ARA-C01 · Question #154
When using the copy into <table> command with the CSV file format, how does the match_by_column_name parameter behave?
The correct answer is B. The parameter will be ignored. The MATCH_BY_COLUMN_NAME parameter in the COPY INTO command is designed for semi-structured file formats - specifically JSON, Avro, ORC, Parquet, and XML - where the file inherently contains named fields that can be matched to table columns by name. For CSV files, the format is…
Question
When using the copy into <table> command with the CSV file format, how does the match_by_column_name parameter behave?
Options
- AIt expects a header to be present in the CSV file, which is matched to a case-sensitive table
- BThe parameter will be ignored.
- CThe command will return an error.
- DThe command will return a warning stating that the file has unmatched columns.
How the community answered
(23 responses)- A4% (1)
- B91% (21)
- D4% (1)
Explanation
The MATCH_BY_COLUMN_NAME parameter in the COPY INTO command is designed for semi-structured file formats - specifically JSON, Avro, ORC, Parquet, and XML - where the file inherently contains named fields that can be matched to table columns by name. For CSV files, the format is purely positional: data is loaded column by column based on order, not by header name matching. Snowflake does not interpret a CSV header row as column names for MATCH_BY_COLUMN_NAME purposes. As a result, when MATCH_BY_COLUMN_NAME is specified alongside FILE FORMAT = CSV, the parameter is silently ignored and the load proceeds using positional column mapping as normal. Option A is incorrect because case-sensitive header matching is the behavior for supported semi-structured formats, not CSV. Option C is incorrect because Snowflake does not raise an error - it simply ignores the unsupported parameter combination. Option D is incorrect because no warning is generated either.
Topics
Community Discussion
No community discussion yet for this question.