Skip to content

Fix STORAGE LIFECYCLE POLICY for snowflake queries#2264

Open
romanoff wants to merge 2 commits intoapache:mainfrom
romanoff:fix_storage_lifecycle_policy_for_snowflake
Open

Fix STORAGE LIFECYCLE POLICY for snowflake queries#2264
romanoff wants to merge 2 commits intoapache:mainfrom
romanoff:fix_storage_lifecycle_policy_for_snowflake

Conversation

@romanoff
Copy link
Contributor

@romanoff romanoff commented Mar 4, 2026

Sample query:

CREATE TABLE IF NOT EXISTS RAW_KAFKA_NRT_KSQL.RAW_BIE_NRT_BRAZE_ATTRIBUTES_PROD
(
    RAW_ID NUMBER(38,0) IDENTITY START 1 INCREMENT 1,
    RECORD_METADATA VARIANT
) WITH STORAGE LIFECYCLE POLICY dba.global_settings.raw_kafka_storage_policy_cold_by_date ON (UPDATE_DATETIME);

Spec: https://docs.snowflake.com/en/sql-reference/sql/create-table

src/ast/ddl.rs Outdated
/// Snowflake "WITH ROW ACCESS POLICY" clause
/// <https://docs.snowflake.com/en/sql-reference/sql/create-table>
pub with_row_access_policy: Option<RowAccessPolicy>,
/// Snowflake "WITH STORAGE LIFECYCLE POLICY" clause
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Snowflake "WITH STORAGE LIFECYCLE POLICY" clause
/// Snowflake `WITH STORAGE LIFECYCLE POLICY` clause

Comment on lines +310 to +312
.parse_sql_statements(
"CREATE TABLE my_table (a NUMBER(38,0)) STORAGE LIFECYCLE POLICY my_policy ON (a, b)",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use one_statement_parses_to to assert what this statement is displayed as?

@romanoff
Copy link
Contributor Author

@iffyio Updated. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants