fcsvparser
I'm trying to use copy with fcsvparser to write csv-like data to the database table (regular table, not flex).
COPY <table> (<columns>) FROM STDIN PARSER FCSVParser(type='traditional', escape='\', header='false') ABORT ON ERROR DIRECT
But when the value within the csv file column is greater than the length of the column in the table, the value will be rejected without any warning nor error (record will be loaded but value for column is NULL).
Nothing is written in the rejected table (since no records are rejected).
E.g. value is a 100 char string that I write to a column of varchar(50).
Is it possible to force an error to pop-out in this situation somehow?
Otherwise there's the risk of not noticing that some records are left blank because of max value length has changed over time.
Tagged:
0
This discussion has been closed.
Answers
you need to modify your copy statement as follows so that rejected records will be written to a file in catalog directory on all nodes
https://docs.vertica.com/24.3.x/en/data-load/handling-messy-data/#save-rejected-rows-rejected-data-and-exceptions
COPY
<
table> () FROM STDIN PARSER FCSVParser(type='traditional', escape='\', header='false') DIRECT;