An existing clustering key is not supported when a table is created using CREATE TABLE ... AS SELECT; however, you can define a clustering key after the table is created.

Master the SnowPro Advanced Architect Test with flashcards, multiple-choice questions, and detailed explanations. Prepare thoroughly for your certification!

Multiple Choice

An existing clustering key is not supported when a table is created using CREATE TABLE ... AS SELECT; however, you can define a clustering key after the table is created.

Explanation:
Clustering keys affect how Snowflake organizes data into micro-partitions for efficient pruning. When you create a new table with CREATE TABLE ... AS SELECT, Snowflake builds the table from the query’s result set but does not automatically carry over any existing clustering configuration from the source table. That means an existing clustering key from the source isn’t applied to the new table at creation time. You can, however, define a clustering key after the table exists by altering the table (for example, using CLUSTER BY or the clustering-key syntax) and Snowflake will start clustering the data accordingly. This is why the statement is true: the clustering key isn’t preserved during CTAS, but you can add one after the table is created.

Clustering keys affect how Snowflake organizes data into micro-partitions for efficient pruning. When you create a new table with CREATE TABLE ... AS SELECT, Snowflake builds the table from the query’s result set but does not automatically carry over any existing clustering configuration from the source table. That means an existing clustering key from the source isn’t applied to the new table at creation time.

You can, however, define a clustering key after the table exists by altering the table (for example, using CLUSTER BY or the clustering-key syntax) and Snowflake will start clustering the data accordingly. This is why the statement is true: the clustering key isn’t preserved during CTAS, but you can add one after the table is created.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy