I need some sample DDL to create a snowflake table with primary keys and partition columns.
1 Answer
The documentation can sometimes be a little overwhelming, I get it, so here is an example.
CREATE OR REPLACE TABLE stack_overflow (
post_id INTEGER,
post_str VARCHAR(20),
post_timestamp TIMESTAMP_LTZ,
PRIMARY KEY (post_id, post_str))
CLUSTER BY (to_date(post_timestamp));
https://docs.snowflake.com/en/sql-reference/sql/create-table.html