SnowPro Associate: Platform Question 229
Single answer○ LISTA data engineer is troubleshooting a Snowpipe load from an external stage backed by cloud storage. The engineer wants to verify which files Snowflake can currently see in the stage and narrow the results to only CSV files under the daily_load/ path before running COPY INTO again. Which command should the engineer use?
- A
LIST @ext_stage/daily_load PATTERN='.*\.csv'
- B
SHOW FILES IN @ext_stage LIKE 'daily_load/*.csv'
- C
GET @ext_stage/daily_load file:///tmp/ PATTERN='.*\.csv'
- D
SELECT * FROM @ext_stage/daily_load WHERE METADATA$FILENAME LIKE '%.csv'
Show answer and explanation
Correct answer: A
Explanation
Use LIST to inspect the contents of internal or external stages. In practical troubleshooting, LIST helps confirm that Snowflake can access the expected files and that the stage path is correct. Adding a subpath such as @ext_stage/daily_load limits the search location, and PATTERN applies a regular expression filter to the returned files. This is especially useful before COPY INTO or when diagnosing Snowpipe ingestion issues. By contrast, GET is for downloading from internal stages, and SELECT from a stage is for reading file data rather than enumerating files. Snowflake documentation for staged files and stages identifies LIST as the command for listing staged file names and details.
- A. Correct.
Correct. The LIST command is used to return files that are available in a stage. It can target a stage or subpath such as @ext_stage/daily_load and can filter returned file names with a PATTERN regular expression. This is the appropriate way to inspect which staged files Snowflake can see before loading them.
- B. Incorrect.
Incorrect. SHOW commands are used for Snowflake objects and metadata such as databases, schemas, stages, and pipes, but there is no valid SHOW FILES IN syntax for listing staged files in this way. A common misconception is assuming SHOW can inspect stage contents just like LIST.
- C. Incorrect.
Incorrect. GET is used to download files from an internal stage to a local file system. It is not used to inspect file names in an external stage. Also, GET does not solve the requirement to verify visibility of files in the stage before re-running COPY INTO.
- D. Incorrect.
Incorrect. Querying a stage with SELECT can read file contents from staged data files when the format is supported, but it is not the right command to list available files in a stage. METADATA$FILENAME is useful when querying staged data, not for enumerating stage contents as a replacement for LIST.