If a schema contains two tables with different data retention times, what happens when you run ALTER SCHEMA SET DATA_RETENTION_TIME_IN_DAYS = 20?

Master Snowflake Data Engineer Exam. Study with flashcards and multiple choice questions, each question includes hints and explanations. Prepare for your success!

Multiple Choice

If a schema contains two tables with different data retention times, what happens when you run ALTER SCHEMA SET DATA_RETENTION_TIME_IN_DAYS = 20?

Explanation:
Data retention time is applied at two levels: a schema default and per-table overrides. Setting the schema’s data_retention_time_in_days defines the default for objects in that schema, but it does not override a table that already has an explicit per-table retention value. When you set the schema to 20 days, Snowflake updates the default for future objects and for any existing tables that do not have an explicit retention. If a table already has its own retention configured, that explicit value stays in effect. In this scenario, one table with an explicit retention remains unchanged, while the other table that did not have an explicit setting adopts the new 20-day default. So the table with no explicit setting will be 20 days, and the one with an explicit setting stays as it was.

Data retention time is applied at two levels: a schema default and per-table overrides. Setting the schema’s data_retention_time_in_days defines the default for objects in that schema, but it does not override a table that already has an explicit per-table retention value.

When you set the schema to 20 days, Snowflake updates the default for future objects and for any existing tables that do not have an explicit retention. If a table already has its own retention configured, that explicit value stays in effect. In this scenario, one table with an explicit retention remains unchanged, while the other table that did not have an explicit setting adopts the new 20-day default. So the table with no explicit setting will be 20 days, and the one with an explicit setting stays as it was.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy