Table of Contents
Question
How can a Snowflake user load duplicate files with a COPY INTO command?
A. The COPY INTO options should be set to PURGE = FALSE
B. The COPY INTO options should be set to FORCE = TRUE
C. The COPY INTO options should be set to RETURN_FAILED_ONLY = FALSE
D. The COPY INTO options should be set to ON_ERROR = CONTINUE
Answer
B. The COPY INTO options should be set to FORCE = TRUE
Explanation
The correct answer is B. The COPY INTO options should be set to FORCE = TRUE.
The COPY INTO command is a SQL statement that can be used to load data from files into tables or stages in Snowflake. The COPY INTO command supports various options that can modify its behavior and performance.
One of the options is FORCE, which controls whether the COPY INTO command should load duplicate files or skip them. By default, the FORCE option is set to FALSE, which means that the COPY INTO command will skip any files that have already been loaded into the table or stage. This can prevent loading duplicate data and improve performance by avoiding unnecessary work.
However, if a Snowflake user wants to load duplicate files with the COPY INTO command, they can set the FORCE option to TRUE, which means that the COPY INTO command will load all files regardless of whether they have already been loaded or not. This can be useful for scenarios where the user wants to overwrite existing data or append new data from the same files.
The other options are incorrect because:
- A. The COPY INTO options should be set to PURGE = FALSE. This is false because this option does not affect whether the COPY INTO command should load duplicate files or not. The PURGE option controls whether the COPY INTO command should delete the source files after loading them or not. By default, the PURGE option is set to TRUE, which means that the COPY INTO command will delete the source files after loading them. Setting the PURGE option to FALSE will prevent the COPY INTO command from deleting the source files, but it will not make it load duplicate files.
- C. The COPY INTO options should be set to RETURN_FAILED_ONLY = FALSE. This is false because this option does not affect whether the COPY INTO command should load duplicate files or not. The RETURN_FAILED_ONLY option controls whether the COPY INTO command should return information about all files or only failed files in its output. By default, the RETURN_FAILED_ONLY option is set to TRUE, which means that the COPY INTO command will only return information about failed files in its output. Setting the RETURN_FAILED_ONLY option to FALSE will make the COPY INTO command return information about all files in its output, but it will not make it load duplicate files.
- D. The COPY INTO options should be set to ON_ERROR = CONTINUE. This is false because this option does not affect whether the COPY INTO command should load duplicate files or not. The ON_ERROR option controls how the COPY INTO command should handle errors during loading. By default, the ON_ERROR option is set to ABORT_STATEMENT, which means that the COPY INTO command will abort and roll back if any error occurs during loading. Setting the ON_ERROR option to CONTINUE will make the COPY INTO command continue and commit if any error occurs during loading, but it will not make it load duplicate files.
Reference
Snowflake SnowPro Core certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Snowflake SnowPro Core exam and earn Snowflake SnowPro Core certification.