• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AfterShip / clickhouse-sql-parser / 25881992239

14 May 2026 07:50PM UTC coverage: 51.662% (+0.04%) from 51.621%
25881992239

Pull #270

github

sharadgaur
fix: support column list before ENGINE and fix DEPENDS ON multi-table in CREATE MATERIALIZED VIEW

1. Column list before ENGINE (new):
   ClickHouse SHOW CREATE TABLE for refreshable materialized views with
   ENGINE (e.g. Memory) outputs the column list between REFRESH and ENGINE:

     CREATE MATERIALIZED VIEW db1.mv_name
     REFRESH EVERY 1 SECOND
     (col1 String, col2 Int8)
     ENGINE = Memory
     AS SELECT ...

   The parser previously expected TO or ENGINE immediately after REFRESH
   clauses. Added support for (columns) before ENGINE by parsing a
   TableSchemaClause when a left paren is encountered.

2. DEPENDS ON multi-table (bug fix):
   The comma in 'DEPENDS ON db1.mv_a, db1.mv_b' was not consumed before
   parsing the next table identifier. Added missing consumeToken() call
   in the comma loop, matching the pattern used in parser_query.go.

Changes:
- parser/parser_view.go: handle (columns) before ENGINE; consume comma in DEPENDS ON loop
- parser/ast.go: add TableSchema field to CreateMaterializedView
- parser/format.go: emit TableSchema before ENGINE in FormatSQL
- parser/walk.go: traverse TableSchema in Walk

Tests:
- create_materialized_view_rmv_engine_with_columns.sql (column list + ENGINE)
- create_materialized_view_rmv_depends_on_multi.sql (multi-table DEPENDS ON)
- All 21 MV syntax variants tested, all existing tests pass
Pull Request #270: fix: support column list before ENGINE in CREATE MATERIALIZED VIEW

16 of 28 new or added lines in 4 files covered. (57.14%)

8268 of 16004 relevant lines covered (51.66%)

3015.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.78
/parser/parser_view.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc