forked from AfterShip/clickhouse-sql-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_materialized_view_basic.sql
26 lines (25 loc) · 1.07 KB
/
create_materialized_view_basic.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- Origin SQL:
CREATE
MATERIALIZED VIEW infra_bm.view_name
ON CLUSTER 'default_cluster' TO infra_bm.table_name
(
`f1` DateTime64(3),
`f2` String,
`f3` String,
`f4` String,
`f5` String,
`f6` Int64
) AS
SELECT f1,
f2,
visitParamExtractString(properties, 'f3') AS f3,
visitParamExtractString(properties, 'f4') AS f4,
visitParamExtractString(properties, 'f5') AS f5,
visitParamExtractInt(properties, 'f6') AS f6
FROM
infra_bm.table_name1
WHERE
infra_bm.table_name1.event = 'test-event'
COMMENT 'Comment for table';
-- Format SQL:
CREATE MATERIALIZED VIEW infra_bm.view_name ON CLUSTER 'default_cluster' TO infra_bm.table_name (`f1` DateTime64(3), `f2` String, `f3` String, `f4` String, `f5` String, `f6` Int64) AS SELECT f1, f2, visitParamExtractString(properties, 'f3') AS f3, visitParamExtractString(properties, 'f4') AS f4, visitParamExtractString(properties, 'f5') AS f5, visitParamExtractInt(properties, 'f6') AS f6 FROM infra_bm.table_name1 WHERE infra_bm.table_name1.event = 'test-event' COMMENT 'Comment for table';