Load file using Copy Command Vertica

Here is how you can load the file to Vertica using Copy Command Vertica .

1) STDIN input format

cat /tmp/test.csv | vsql -c "copy customer from stdin direct delimiter ','"

2) From a source file

COPY  public.Users
(
USERID,USERNAME,USERGENDER
)
FROM  '/home/notroot/lab/data/USER.csv'
SKIP 1 NULL AS 'null'
ENCLOSED BY U&'\0027' DELIMITER '|'
rejected data '/home/notroot/lab/data/reject.csv'
exceptions '/home/notroot/lab/data/exception.csv' ;

Copy Command Vertica is powerful option to do a bulk loading to Vertica, its load the data directly to WOS if you use DIRECT command in the copy statement

Leave a Reply