SnowPro Core Certification — Question 1136
An external stage, my_stage contains many directories, including one, app_files that contains CSV files.
How can all the CSV files from this directory be moved into table my_table without scanning files that are not needed?
Answer options
- A. COPY INTO my_table FROM @my_stage PATTERN='.*[.]csv';
- B. COPY INTO my_table FROM @my_stage/app_files PATTERN='.*[.]csv';
- C. COPY INTO my_table FROM @my_stage/app_files PATTERN='.*[.]txt';
- D. COPY INTO my_table FROM @my_stage PATTERN='.*[.]txt';
Correct answer: B
Explanation
The correct option B specifies the exact directory containing the CSV files, ensuring only those files are scanned during the copy operation. Option A does not limit the source to the app_files directory, potentially scanning unnecessary files. Options C and D incorrectly look for .txt files instead of .csv files, which does not meet the requirement of transferring CSV files.