SOL-C01 · Question #168
SOL-C01 Question #168: Real Exam Question with Answer & Explanation
The correct answer is A: Use along with 'ON_ERROR = CONTINUE in the COPY INTO statement. Define a file format. Ensures that columns are matched by name regardless of case, handling inconsistent column order. ERROR = CONTINUE' allows loading to proceed even if some rows have errors, and SKIP HEADER = in file format skips the headers. Using a view adds an unnecessary step and overhead. 'ORD
Question
You are tasked with loading data from a set of CSV files located in an Amazon S3 bucket into a Snowflake table named 'CUSTOMER DATA'. The files have headers, but some files might have inconsistent column order compared to the table schema. The table 'CUSTOMER DATA' is already created with the correct schema. Which of the following COPY INTO command options is BEST suited to handle this situation efficiently, minimizing manual intervention and ensuring all relevant data is loaded?
Options
- AUse along with 'ON_ERROR = CONTINUE in the COPY INTO statement. Define a file format
- BUse a simple 'COPY INTO' statement without any specific options and rely on Snowflake's
- CCreate a view on top of the staged data using 'SELECT statements that explicitly map columns by
- DUse 'ORDER BY clause in the 'COPY INTO' statement to explicitly define the order of columns
- EDefine a file format object with `SKIP_HEADER = 1' and -- (if applicable). Use 'MATCH BY
Explanation
Ensures that columns are matched by name regardless of case, handling inconsistent column order. ERROR = CONTINUE' allows loading to proceed even if some rows have errors, and SKIP HEADER = in file format skips the headers. Using a view adds an unnecessary step and overhead. 'ORDER_BY is not relevant for controlling the order of columns being loaded. While VALIDATE' is useful for pre-loading checks, can lead to data loss if a single row error exists in the whole file. 'ON ERROR=CONTINUE along with monitoring the error logs offers a more controlled loading process.
Topics
Community Discussion
No community discussion yet for this question.