COPY BZ2 Compressed Files?

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

COPY BZ2 Compressed Files?

Post by Julie » Wed Oct 07, 2015 3:16 pm

Hey,

Can we use the copy command with files that are BZ2 compressed? I tried the BZIP option, but am getting an error.

Thank you!
Thanks,
Juliette

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: COPY BZ2 Compressed Files?

Post by NorbertKrupa » Wed Oct 07, 2015 4:28 pm

What is the syntax you're using? What error are you getting?

See the documentation for an example:

Code: Select all

\! bzip2 pf1.dat
\! cat pf1.dat.bz2 > pipe1 &
COPY large_tbl FROM :file ON site01 BZIP delimiter '|'; 
SELECT * FROM large_tbl; 
COMMIT;
bunzip2 pf1.dat.bz2
Checkout vertica.tips for more Vertica resources.

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: COPY BZ2 Compressed Files?

Post by Julie » Wed Oct 07, 2015 11:12 pm

Norbert, thanks for the reply! I looked at your example and realized I had the BZIP keyword in the wrong location of the copy command. It has to be right after the file name; I had it at the end after the DIRECT keyword. After I moved it, I was able to load the data. Duh! :oops:
Thanks,
Juliette

Post Reply

Return to “Vertica Database Administration”