
Answer-first summary for fast verification
Answer: select * from directory(@bronzestage);
Option B is correct because the DIRECTORY() function is specifically designed to query directory tables in Snowflake, which contain metadata about files in a stage including the Snowflake-hosted file URL (FILE_URL column). The syntax `SELECT * FROM DIRECTORY(@bronzestage)` directly accesses the directory table for the specified stage. Option A (`list @bronzestage`) is a command, not a query, and does not return results in table format. Option C (`select metadata$filename from @bronzestage`) queries file metadata during data loading but does not access the directory table or return file URLs. Option D queries the stage directory file registration history from INFORMATION_SCHEMA, which contains registration metadata but not the actual file URLs from the directory table. The community discussion unanimously supports B with 100% consensus and references to Snowflake documentation confirming that DIRECTORY() is the proper function for retrieving file URLs from directory tables.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Which query retrieves a Snowflake-hosted file URL from a directory table for a stage named bronzestage?
A
list @bronzestage;
B
select * from directory(@bronzestage);
C
select metadata$filename from @bronzestage;
D
select * from table(information_schema.stage_directory_file_registration_history( stage_name=>'bronzestage'));