
Answer-first summary for fast verification
Answer: SELECT METADATA$FILENAME
The question asks for the command to determine the filename for each row of data loaded from a staged file. In Snowflake, when querying data from staged files using the COPY command or external tables, metadata functions provide information about the source files. METADATA$FILENAME specifically returns the name of the file from which each row was loaded, making it the correct choice. Option A (SHOW FILE FORMATS) lists file formats but does not provide per-row file information. Option B (METADATA$FILE_CONTENT_KEY) is not a valid Snowflake metadata function. Option C (METADATA$FILE_ROW_NUMBER) returns the row number within the file, not the filename. The community discussion shows 100% consensus on D, with a reference to Snowflake documentation confirming METADATA$FILENAME as the correct function for this purpose.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.