The correct answer is B. GET_PRESIGNED_URL(@ < stage_name > , ' < relative_file_path > ' , [ < expiration_time > ]); .
A pre-signed URL provides temporary access to a staged file. This is useful when users or applications outside Snowflake need access to a file for a limited period of time.
Why B is correct:
GET_PRESIGNED_URL generates a pre-signed URL for a staged file. The URL can be used to access the file without the user needing a Snowflake account, as long as the URL has not expired.
Example:
SELECT GET_PRESIGNED_URL(@my_stage, ' folder/file.csv ' , 3600);
This generates a URL that is valid for a limited time, such as 3600 seconds.
Why the other options are incorrect:
A. BUILD_STAGE_FILE_URL creates a Snowflake file URL, but it does not provide the same temporary external access behavior as a pre-signed URL.
C. GET_RELATIVE_PATH returns the relative path of a staged file, not an access URL.
D. BUILD_SCOPED_FILE_URL creates a scoped URL that is useful within Snowflake-controlled contexts, but for users without Snowflake accounts who need direct temporary access, GET_PRESIGNED_URL is the best answer.
Official Snowflake documentation reference:
Snowflake documentation describes GET_PRESIGNED_URL as a function that returns a pre-signed URL for a staged file, with an optional expiration time.
[Reference: Snowflake Documentation — GET_PRESIGNED_URL; Snowflake Documentation — File functions; SnowPro Core Study Guide — Data Loading and Unloading., ========================]