SOL-C01 · Question #192
SOL-C01 Question #192: Real Exam Question with Answer & Explanation
The correct answer is B: The error is related to an integrity constraint violation (e.g., a unique key violation), and =. Options B, C and D are correct. ERROR = 'CONTINUE' primarily handles file-level errors (like a corrupted file that can't be opened) and certain row-level errors (like incorrect number of columns). It does not handle integrity constraint violations; these will always cause the COP
Question
Consider the following Snowflake SQL code snippet that attempts to load data from a CSV file into a table. Assume the file format 'MY CSV FORMAT' is correctly defined with appropriate delimiters and skip header settings. Despite setting 'ON ERROR = 'CONTINUE", the COPY INTO operation fails and throws an error. Which of the following scenarios could explain this behavior?
Options
- AThe error is a parsing error related to data type mismatch, and 'ON ERROR = 'CONTINUE" only
- BThe error is related to an integrity constraint violation (e.g., a unique key violation), and =
- CThe file 'data.csv' is not present in the stage @MY_STAGE, and Snowflake cannot find the file to
- DThe user executing the COPY INTO command does not have the 'USAGE' privilege on the stage
- E`ON_ERROR = 'CONTINUE" will always ensure a full load of the file and its impossible to find out
Explanation
Options B, C and D are correct. ERROR = 'CONTINUE'primarily handles file-level errors (like a corrupted file that can't be opened) and certain row-level errors (like incorrect number of columns). It does not handle integrity constraint violations; these will always cause the COPY INTO to fail, even withON ERROR = 'CONTINUE". If the file is not present (Option C) or the user lacks the USAGE privilege (Option D), the COPY INTO will fail before it even attempts to parse the data, and 'ON_ERROR will not apply because Snowflake cannot even access the file. Option A is incorrect as its not just parse level error, it may happen due to data validation contraints also. Option E is incorrect because 'ON_ERROR = 'CONTINUE'` will not ensure that the file is loaded no matter what, some issues will occur causing the COPY INTO to fail.
Topics
Community Discussion
No community discussion yet for this question.