SNOWPRO-CORE practice question 2 of 35

While working with unstructured data, which file function generates a Snowflake-hosted file URL to a staged file using the stage name and relative file path as inputs?

Full set: 628 questions

Domain Performance Management

Answer options
A: GET_PRESIGNED_URL
B: GET_ABSOLUTE_PATH
C: BUILD_STAGE_FILE_URL Correct answer
D: BUILD SCOPED FILE URL
Correct Answer:
C. BUILD_STAGE_FILE_URL
Explanation

The BUILDSTAGEFILEURL function is specifically designed to generate a permanent, Snowflake-hosted file URL for a file located in a stage. This function takes the name of the stage and the relative path of the file as its arguments. The resulting URL can be used to access the file, provided the user has the necessary privileges on the stage. This directly addresses the requirement of creating a Snowflake-hosted URL from a stage name and file path for working with unstructured data.

Why Incorrect

A. GETPRESIGNEDURL: This function generates a temporary, pre-signed URL for accessing files directly from external cloud storage (e.g., S3, Azure Blob), not a Snowflake-hosted URL.
B. GETABSOLUTEPATH: This function returns the absolute path of a file within a stage as a string. It does not generate a web-accessible URL.
D. BUILDSCOPEDFILEURL: This function generates a temporary, scoped URL that grants access to a specific user for a limited time. It is for temporary access, unlike the more general-purpose BUILDSTAGEFILEURL.

References

1. Snowflake Documentation: SQL Function Reference > BUILDSTAGEFILEURL. This page explicitly states, "Generates a Snowflake-hosted file URL to a staged file using the stage name and relative file path as inputs."

2. Snowflake Documentation: Unstructured Data Support > Overview of Unstructured Data Support. This section describes the various functions for working with unstructured data, differentiating between file URLs (BUILDSTAGEFILEURL), scoped URLs (BUILDSCOPEDFILEURL), and pre-signed URLs (GETPRESIGNEDURL).

3. Snowflake Documentation: SQL Function Reference > GETPRESIGNEDURL. The documentation clarifies that this function is for generating a URL to access files "in their cloud storage location" for external stages.

4. Snowflake Documentation: SQL Function Reference > GETABSOLUTEPATH. The documentation confirms this function "Retrieves the absolute path of a staged file," not a URL.

Scroll to Top