Skip to content

ClickHouse SQL Parsing Test Results #11

@alexey-milovidov

Description

@alexey-milovidov

Tested polyglot-sql v0.1.4 ClickHouse dialect against 7,425 .sql files from ClickHouse/tests/queries/0_stateless/.

Summary

Metric Total OK Errors Success Rate
Files 7,425 5,100 2,325 68.7%
Statements 141,952 ~82,788 ~59,164 58.3%

Note: The statement count is approximate — when a file fails to parse, all its statements are counted as errors because the parser stops at the first error.

Common Error Categories

ClickHouse-Specific Syntax Not Supported

  • Ternary operator ? : (e.g., x > 0 ? 1 : 0)
  • IGNORE() function — treated as a keyword instead of a function
  • Tuple element access via dot on literals: ('a', 'b').2
  • ARRAY JOIN with AS inside array literals: [0 as x]
  • DROP TEMPORARY TABLETEMPORARY not recognized after DROP
  • system keyword treated as reserved: system.one, system.numbers
  • Nested column access via dot in column lists: INSERT INTO t (n.a, n.b)
  • Lambda expressions: x -> -x in function arguments
  • Parametric aggregate functions: groupArrayInsertAt('-')(...) (two argument lists)
  • WITH TOTALS after GROUP BY inside subqueries
  • CREATE TABLE ... AS SELECT ... (table from subquery)
  • CREATE TABLE ... AS db.table (table cloning)
  • DEFAULT column values in CREATE TABLE: b DEFAULT 0
  • SET as table name (reserved word conflict)
  • FORMAT clause: ... FORMAT JSONEachRow {...}
  • INSERT ... FORMAT with inline data
  • Enum8/Enum16 types with negative values

DDL and Other Constructs

  • ALTER TABLE ... CLEAR COLUMN IN PARTITION
  • MergeTree(date, id, 1) — old-style engine parameters
  • Nested(...) column type
  • set allow_deprecated_syntax_for_merge_tree=1 — parsed but affects subsequent DDL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions