Rejected Reason: Too Many Columns Found
BWCempl237
Community Edition User
When I try to copy a file from my local drive the majority of records are not copying with the rejected reason: too many columns found. I am trying to copy the exact same columns from the file, though, into the table. Has anyone encountered this error before or know what it means?
0
Best Answer
-
LenoyJ - Select Field - Employee
Check the delimiter in your
COPY
command - if you are loading strings that may have the delimiter character within it, it may break the format and that would be perceived as too many columns. You could use theENCLOSED BY
option if your strings are quoted. See the section "Delimiting Characters (ENCLOSED BY)" at this link: https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/AdministratorsGuide/BulkLoadCOPY/LoadingUTF-8FormatData.htm5
Answers
please share sample rows, table definition and your COPY statement.
In addition, try to use unprintable character as a delimiter, to eliminate the risk that your data include a delimiter character.
The following examples use \001 (CTRL-A) as field separator and \002 (CTRL-B) as record separator.
Export 2000 rows from a table to a file:
vsql -F $'\001' -R $'\002' -P null='REALNULL' -AXtnqc "select * from schema_name.table_name limit 2000" > file_name.tbl
Load the file data back to a table:
copy schema_name.table_name from 'file_name.tbl' delimiter E'\001' record terminator E'\002' null 'REALNULL' abort on error;
Enclosed by ' " ' command was what I was missing LenoyJ, thanks!