COPY Command does not load data from CSV

Moderator: NorbertKrupa

Post Reply
vikramjere
Newbie
Newbie
Posts: 1
Joined: Tue Dec 22, 2015 6:24 pm

COPY Command does not load data from CSV

Post by vikramjere » Tue Dec 22, 2015 6:30 pm

I have the below command and on execution, the takes a while (approx 3 to 6 mins) and then says 0 Rows Loaded with out any error. I am executing this command on the bash directly. Not sure if any timeout is occuring, but it is expected to load few thousands of rows.

pvsql -e -c "COPY dml_infrastructure__node FROM '/new_fs/upload/node.csv' WITH DELIMITER ',' DIRECT"

COPY dml_infrastructure__node FROM '/new_fs/upload/node.csv' WITH DELIMITER ',' DIRECT
Rows Loaded
-------------
0
(1 row)

Appreciate any help on this.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: COPY Command does not load data from CSV

Post by JimKnicely » Tue Dec 22, 2015 8:18 pm

Hi,

Zero records loaded usually indicates that all records in your data file failed to load.

Check the directory <catalog_path>/CopyErrorLogs for files that have a name like ' dml_infrastructure__node*rejected*' and ' dml_infrastructure__node*exceptions*'. These files will show you the records that were not loaded and why...

You can specify where to create the rejected data and exceptions files using the EXCEPTIONS and REJECTED DATA options on the COPY command:

pvsql -e -c "COPY dml_infrastructure__node FROM '/new_fs/upload/node.csv' WITH DELIMITER ',' DIRECT EXCEPTIONS '~/dml_infrastructure__node.exp' REJECTED DATA '~/dml_infrastructure__node.rej"

You can also populate a table with the rejected data. That's probably the easiest method. Check out this link to find out more:

http://my.vertica.com/docs/7.2.x/HTML/i ... ctions.htm
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica SQL”