Page 1 of 1

COPY Command does not load data from CSV

Posted: Tue Dec 22, 2015 6:30 pm
by vikramjere
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.

Re: COPY Command does not load data from CSV

Posted: Tue Dec 22, 2015 8:18 pm
by JimKnicely
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