Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Add 18 new test functions covering:

  • Basic expressions (arithmetic, WHERE, ORDER BY, LIMIT, CASE, etc.)
  • Window functions (OVER, PARTITION BY, ROWS/RANGE frames, named windows)
  • Join types (CROSS, INNER, LEFT, RIGHT, FULL, ANY, ALL, SEMI, ANTI, GLOBAL)
  • Subqueries (scalar, IN/NOT IN, EXISTS/NOT EXISTS)
  • Array functions (constructors, manipulation, lambda expressions)
  • Date/time functions (conversion, extraction, arithmetic)
  • String functions (manipulation, formatting, searching)
  • Type conversions (numeric, string, casting)
  • DDL statements (CREATE TABLE/VIEW/DATABASE, DROP, TRUNCATE, RENAME)
  • ALTER statements (columns, indexes, constraints, partitions, TTL)
  • INSERT statements (VALUES, SELECT, FORMAT)
  • OPTIMIZE, SHOW, DESCRIBE, USE, SET statements
  • SYSTEM commands (cache, merges, replicas)
  • EXPLAIN variants (AST, SYNTAX, PLAN, PIPELINE, ESTIMATE)
  • ClickHouse-specific features (ARRAY JOIN, PREWHERE, SAMPLE, FINAL,
    FORMAT, parametric aggregates, combinators, dictionaries, maps, JSON,
    regex, UUID, IP, URL, hash, encoding, bit functions)

All queries validated against ClickHouse server (v25.12.1).
Tests are designed as TODO items - they skip if parser doesn't support
the feature yet, allowing incremental parser development.

Add 18 new test functions covering:
- Basic expressions (arithmetic, WHERE, ORDER BY, LIMIT, CASE, etc.)
- Window functions (OVER, PARTITION BY, ROWS/RANGE frames, named windows)
- Join types (CROSS, INNER, LEFT, RIGHT, FULL, ANY, ALL, SEMI, ANTI, GLOBAL)
- Subqueries (scalar, IN/NOT IN, EXISTS/NOT EXISTS)
- Array functions (constructors, manipulation, lambda expressions)
- Date/time functions (conversion, extraction, arithmetic)
- String functions (manipulation, formatting, searching)
- Type conversions (numeric, string, casting)
- DDL statements (CREATE TABLE/VIEW/DATABASE, DROP, TRUNCATE, RENAME)
- ALTER statements (columns, indexes, constraints, partitions, TTL)
- INSERT statements (VALUES, SELECT, FORMAT)
- OPTIMIZE, SHOW, DESCRIBE, USE, SET statements
- SYSTEM commands (cache, merges, replicas)
- EXPLAIN variants (AST, SYNTAX, PLAN, PIPELINE, ESTIMATE)
- ClickHouse-specific features (ARRAY JOIN, PREWHERE, SAMPLE, FINAL,
  FORMAT, parametric aggregates, combinators, dictionaries, maps, JSON,
  regex, UUID, IP, URL, hash, encoding, bit functions)

All queries validated against ClickHouse server (v25.12.1).
Tests are designed as TODO items - they skip if parser doesn't support
the feature yet, allowing incremental parser development.
- Move each test case to its own folder inside testdata/
- Each folder contains query.sql with the SQL query
- Add metadata.yaml with todo: true for unsupported features
- Add source key with URL for queries from ClickHouse repo
- Create single TestParser function using subtests
- Add TestParserWithClickHouse for server validation
- Remove old individual test functions (reduced from 1594 to 257 lines)
- Add yaml.v3 dependency for metadata parsing
- Convert metadata.yaml files to metadata.json
- Update parser_test.go to use encoding/json instead of yaml.v3
- Remove gopkg.in/yaml.v3 dependency from go.mod
- Simplifies dependencies by using only stdlib
- Fix parser hanging on queries like quantile(0.9)(number)
- Return error instead of looping when LPAREN follows non-identifier
- Remove ClickHouse integration test (TestParserWithClickHouse)
- Add todo metadata for 10 failing test cases
- Tests now complete in ~0.2s (well under 10s timeout)
@kyleconroy kyleconroy merged commit f849263 into main Dec 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants