...
Code Block | ||
---|---|---|
| ||
CREATE DYNAMIC TABLE dwd_orders ( PRIMARY KEY(ds, id) NOT ENFORCED ) PARTITIONED BY (ds) FRESHNESS = INTERVAL '3' MINUTE AS SELECT o.ds o.id, o.order_number, o.user_id, ... FROM orders as o LEFT JOIN products FOR SYSTEM_TIME AS OF proctime() AS prod ON o.product_id = prod.id LEFT JOIN order_pay AS pay ON o.id = pay.order_id and o.ds = pay.ds |
...
Code Block | ||
---|---|---|
| ||
CREATE DYNAMIC TABLE [catalog_name.][db_name.]table_name [ ( [CONSTRAINT constraint_name] PRIMARY KEY (column_name, ...) NOT ENFORCED ) ] [COMMENT table_comment] [PARTITIONED BY (partition_column_name1, partition_column_name2, ...)] [WITH (key1=val1, key2=val2, ...)] FRESHNESS = INTERVAL '<num>' { SECOND | MINUTE | HOUR | DAY | MONTH | YEAR } [REFRESH_MODE = { CONTINUOUS | FULL }] AS <select_statement> |
...