clickhouse-sql-parser icon indicating copy to clipboard operation
clickhouse-sql-parser copied to clipboard

Adding support for comment in table and views

Open sharadgaur opened this issue 1 year ago • 0 comments

The current parser supports comments at the column level, and ClickHouse also enables users to specify comments at the table level, as detailed in the documentation provided at https://clickhouse.com/docs/en/sql-reference/statements/create/table, https://clickhouse.com/docs/en/sql-reference/statements/create/view

Example:

CREATE TABLE IF NOT EXISTS test.events_local (
    f0 String,
    f1 String CODEC(ZSTD(1)),
    f2 VARCHAR(255),
    f3 Datetime,
    f4 Datetime,
    f5 Map(String,String),
    f6 String,
    f8 Datetime DEFAULT now(),
    f9 String MATERIALIZED toString(f7['f70']),
    f10 String ALIAS f11,
) ENGINE = MergeTree
PRIMARY KEY (f0, f1, f2)
PARTITION BY toYYYYMMDD(f3)
TTL f3 + INTERVAL 6 MONTH
ORDER BY (f1,f2,f3)
COMMENT 'Comment for table';

sharadgaur avatar Oct 08 '24 18:10 sharadgaur