nerdexam
Snowflake

SOL-C01 · Question #163

You are using a named file format called to load data from CSV files into a Snowflake table named PRODUCTS'. However, you are encountering errors during the data loading process because some CSV files

The correct answer is B. Modify the file format object to include the ` = FALSE parameter.. Setting ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE in the named file format object is the correct approach - it instructs Snowflake to suppress errors when a CSV row contains more columns than the target table defines, loading only the columns that map to the table and silently ignor

Data Loading and Unloading

Question

You are using a named file format called to load data from CSV files into a Snowflake table named PRODUCTS'. However, you are encountering errors during the data loading process because some CSV files contain rows with more columns than defined in the PRODUCTS table. You want Snowflake to ignore these extra columns and load the data without errors. Which of the following approaches can achieve this goal?

Options

  • AModify the file format object to include the MISMATCH = TRUE' parameter.
  • BModify the file format object to include the ` = FALSE parameter.
  • CIn the 'COPY INTO statement, specify the 'MATCH BY COLUMN_NAME' parameter to explicitly
  • DIn the 'COPY INTO' statement, specify the 'TRUNCATECOLUMNS = TRUE parameter. This
  • EThis cannot be achieved directly. Columns number and data types should match exactly

How the community answered

(53 responses)
  • A
    6% (3)
  • B
    74% (39)
  • C
    15% (8)
  • D
    2% (1)
  • E
    4% (2)

Explanation

Setting ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE in the named file format object is the correct approach - it instructs Snowflake to suppress errors when a CSV row contains more columns than the target table defines, loading only the columns that map to the table and silently ignoring the extras.

Why the distractors are wrong:

  • A - MISMATCH = TRUE is not a valid Snowflake file format parameter; this option is fabricated.
  • C - MATCH_BY_COLUMN_NAME maps CSV columns to table columns by name (useful for reordering), but does not suppress errors caused by extra columns.
  • D - TRUNCATECOLUMNS = TRUE truncates string values that exceed a column's defined character length - it has nothing to do with extra column counts.
  • E - Snowflake does not require exact column counts when ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE is set.

Memory tip: Read the parameter name literally - ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE means "do not error when column counts mismatch." Any time you want Snowflake to be lenient about column count, flip this flag to FALSE in your file format, not in the COPY INTO statement itself.

Topics

#File Format#COPY INTO#CSV Loading#Column Mismatch

Community Discussion

No community discussion yet for this question.

Full SOL-C01 Practice