How to ignore '\N' in some fields from csv file?

Moderator: NorbertKrupa

Post Reply
Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

How to ignore '\N' in some fields from csv file?

Post by Benjamin_e » Sun Nov 23, 2014 4:30 pm

I got bulk of csvs and when I got them the owner of the files said when he export them mysql set the null values to '\N' and when i try to load them to vertica I getting an error.

What is the best way to over it?

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

Re: How to ignore '\N' in some fields from csv file?

Post by NorbertKrupa » Sun Nov 23, 2014 4:52 pm

Tell the owner to stop exporting nulls as \n.
Checkout vertica.tips for more Vertica resources.

Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

Re: How to ignore '\N' in some fields from csv file?

Post by Benjamin_e » Sun Nov 23, 2014 5:15 pm

Any way to pass it? :// I tried everything!

Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

Re: How to ignore '\N' in some fields from csv file?

Post by Benjamin_e » Mon Nov 24, 2014 9:43 am

Hey norbertk!
Thank you for you great help! ...
Sharing info is awesome .. consider it next time.

Here is the solution:

copy xxx from '/tmp/data.csv' direct delimiter ',' null as '\N' abort on error;

Post Reply

Return to “Vertica Data Load”