Exam SnowPro Advanced Data Engineer All QuestionsBrowse all questions from this exam
Question 37

A Data Engineer is trying to load the following rows from a CSV file into a table in Snowflake with the following structure:

The engineer is using the following COPY INTO statement:

However, the following error is received:

Number of columns in file (6) does not match that of the corresponding table (3), use file format option error_on_column_count_mismatch=false to ignore this error File 'address.csv.gz', line 3, character 1 Row 1 starts at line 2, column "STGCUSTOMER"[6] If you would like to continue loading when an error is encountered, use other values such as 'SKIP_FILE' or 'CONTINUE' for the ON_ERROR option.

Which file format option should be used to resolve the error and successfully load all the data into the table?

    Correct Answer: B

    The error states that the number of columns in the file (6) does not match that of the table (3). This indicates that Snowflake is reading the data incorrectly due to the presence of special characters such as additional commas in the 'ADDRESS' field, which causes it to misinterpret the number of columns. To instruct Snowflake to ignore this discrepancy and proceed with loading only the columns that match the table's structure, you should use the option 'ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE'. This tells Snowflake to load the data without throwing an error due to the column count mismatches.

Discussion
ecvdataOption: B

https://docs.snowflake.com/en/user-guide/data-unload-considerations FIELD_OPTIONALLY_ENCLOSED_BY = 'character' | NONE Use this option to enclose strings in the specified character: single quote ('), double quote ("), or NONE.

stopthisnowOption: D

D makes sense. Due to commas in the column value, the column needs to be enclosed by " to be treated as a single column.