mirror of
https://github.com/hanzo-ds/sqlparser.git
synced 2026-10-30 20:53:50 +00:00
22 lines
1.2 KiB
SQL
22 lines
1.2 KiB
SQL
-- Origin SQL:
|
|
CREATE MATERIALIZED VIEW IF NOT EXISTS db.table
|
|
ON CLUSTER 'default_cluster' TO db.table_mv
|
|
AS
|
|
SELECT
|
|
event_ts,
|
|
org_id,
|
|
visitParamExtractString(properties, 'x') AS x,
|
|
visitParamExtractString(properties, 'y') AS y,
|
|
visitParamExtractString(properties, 'z') AS z,
|
|
visitParamExtractString(properties, 'a') AS a,
|
|
visitParamExtractString(properties, 'b') AS b,
|
|
visitParamExtractString(properties, 'c') AS c,
|
|
visitParamExtractString(properties, 'd') AS d,
|
|
visitParamExtractInt(properties, 'e') AS e,
|
|
visitParamExtractInt(properties, 'f') AS f
|
|
FROM db.table
|
|
WHERE db.table.event = 'hello';
|
|
|
|
-- Format SQL:
|
|
CREATE MATERIALIZED VIEW IF NOT EXISTS db.table ON CLUSTER 'default_cluster' TO db.table_mv AS SELECT event_ts, org_id, visitParamExtractString(properties, 'x') AS x, visitParamExtractString(properties, 'y') AS y, visitParamExtractString(properties, 'z') AS z, visitParamExtractString(properties, 'a') AS a, visitParamExtractString(properties, 'b') AS b, visitParamExtractString(properties, 'c') AS c, visitParamExtractString(properties, 'd') AS d, visitParamExtractInt(properties, 'e') AS e, visitParamExtractInt(properties, 'f') AS f FROM db.table WHERE db.table.event = 'hello';
|