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

Adding support for comment in table/view

Open sharadgaur opened this issue 1 year ago • 2 comments

Adding Table/View Comment Support as per document https://clickhouse.com/docs/en/sql-reference/statements/create/table https://github.com/AfterShip/clickhouse-sql-parser/issues/105 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

Pull Request Test Coverage Report for Build 11253730392

Details

  • 19 of 23 (82.61%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 59.682%

Changes Missing Coverage Covered Lines Changed/Added Lines %
parser/parser_table.go 3 5 60.0%
parser/parser_view.go 3 5 60.0%
<!-- Total: 19 23
Totals Coverage Status
Change from base Build 11227639957: 0.05%
Covered Lines: 6260
Relevant Lines: 10489

💛 - Coveralls

coveralls avatar Oct 08 '24 18:10 coveralls

Generally looks good, just one comment inline. Thank you!

git-hulk avatar Oct 09 '24 02:10 git-hulk