0

i am loading a CSV file with has '|' as delimiter. the CSV file has 22 records in one line and 25 in other line . but my table is only has 18 column . i am facing issue like " Field delimiter '|' found while expecting record delimiter '\n' ".i have used error_on_column_mismatch=false. but its not working.error_on_column_mismatch=false working when the table had more column then file. Do anybody faced this issue and how to solve it.

Mukesh Gupta
  • 101
  • 1
  • 1
  • 6
  • your input needs to be consistent with the amount of columns you are looking to populate. For example if on one row you have more recorded values than another, then you need to standardise the output to pass blank values into the columns where there aren't any values to insert. you should have a set amoiunt of columns to pass values to. If this is not the case then you do not have a structured file – jimmy8ball May 14 '19 at 12:21
  • use CDW_STAGE;copy into CDW_STAGE.public.rawtable from (select $1, $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10,$11,$12,$13,$14,$15,$16,$17,$18 from '@prod_stage_etl/campaing_event_to_tableCAMPAIGN_EVENT_BOUNCE') pattern='.*.txt.*' file_format = (type = 'CSV' FIELD_DELIMITER = '|' RECORD_DELIMITER = '\n' null_if = ('NULL', 'null') EMPTY_FIELD_AS_NULL = FALSE ERROR_ON_COLUMN_COUNT_MISMATCH=FALSE ) ON_ERROR = CONTINUE; – Mukesh Gupta May 14 '19 at 14:01
  • this didnot work – Mukesh Gupta May 14 '19 at 14:01
  • ERROR_ON_COLUMN_COUNT_MISMATCH=FALSE is not working why? – Mukesh Gupta May 14 '19 at 14:03

0 Answers0