mirror of
https://github.com/hanzo-ds/sqlparser.git
synced 2026-10-30 20:53:50 +00:00
25 lines
583 B
SQL
25 lines
583 B
SQL
-- It's a short link events table
|
|
/**
|
|
* @name Short link events
|
|
* @description It's a short link events table
|
|
*/
|
|
CREATE OR REPLACE TABLE IF NOT EXISTS test.events_local (
|
|
f0 String,
|
|
f1 String CODEC(ZSTD(1)),
|
|
f2 VARCHAR(255),
|
|
) ENGINE = MergeTree
|
|
PRIMARY KEY (f0, f1, f2)
|
|
PARTITION BY toYYYYMMDD(f1)
|
|
TTL f1 + INTERVAL 6 MONTH
|
|
ORDER BY (f1,f2)
|
|
COMMENT 'Comment for table';
|
|
|
|
CREATE OR REPLACE VIEW IF NOT EXISTS my_view(col1 String, col2 String)
|
|
AS
|
|
SELECT
|
|
id,
|
|
name
|
|
FROM
|
|
my_table;
|
|
|
|
CREATE OR REPLACE FUNCTION IF NOT EXISTS my_function AS (x, y) -> x + y; |