SOL-C01 practice question 23 of 30

How do you enable a Directory Table for an external stage in Snowflake?

Full set: 214 questions
Answer options
A: By default, Directory Tables are enabled
B: Using the command CREATE DIRECTORY TABLE ...
C: By setting the ENABLE_DIRECTORY_TABLE property to TRUE on the external stage using ALTER STAGE ... SET ENABLE_DIRECTORY_TABLE = TRUE Correct answer
D: By creating a view on the external stage
Correct Answer:
C. By setting the ENABLE_DIRECTORY_TABLE property to TRUE on the external stage using ALTER STAGE ... SET ENABLE_DIRECTORY_TABLE = TRUE
Explanation

Directory tables are not enabled by default on external stages. To enable this feature, which allows you to query a catalog of staged files, you must explicitly set a parameter on the stage. The correct method is to use the ALTER STAGE command to modify an existing stage or include the parameter during the CREATE STAGE command. The parameter ENABLEDIRECTORYTABLE (or the newer DIRECTORY = (ENABLE = TRUE)) must be set to TRUE.

Why Incorrect

A. By default, Directory Tables are enabled: This is incorrect. The feature must be explicitly enabled to avoid the overhead of file cataloging if not needed.
B. Using the command CREATE DIRECTORY TABLE ...: This is not a valid Snowflake SQL command. Directory tables are a property of a stage, not a standalone object.
D. By creating a view on the external stage: A view is a logical representation of a query and cannot be used to configure the underlying properties of a stage.

References

Snowflake Documentation, "CREATE STAGE". The documentation lists ENABLEDIRECTORYTABLE = TRUE | FALSE as one of the optional stageparams for creating a stage.

Snowflake Documentation, "ALTER STAGE". This page documents the syntax for modifying a stage, including ALTER STAGE ... SET ENABLEDIRECTORYTABLE = TRUE.

Snowflake Documentation, "Directory Tables". The section "Enabling Directory Tables" explicitly states that the feature must be enabled on a stage.

Scroll to Top