Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

  • token: Define lexical tokens and keywords for ClickHouse SQL
  • ast: Define AST node types for statements and expressions
  • lexer: Implement tokenizer for ClickHouse SQL syntax

- token: Define lexical tokens and keywords for ClickHouse SQL
- ast: Define AST node types for statements and expressions
- lexer: Implement tokenizer for ClickHouse SQL syntax
- Implement Parse function taking context and io.Reader
- Support SELECT, INSERT, CREATE, DROP, ALTER, TRUNCATE statements
- Support USE, DESCRIBE, SHOW, EXPLAIN, SET, OPTIMIZE, SYSTEM
- Parse expressions with proper operator precedence
- Handle JOINs, subqueries, CTEs, window functions
- Support CASE, CAST, EXTRACT, INTERVAL expressions
- Parse lambdas, arrays, tuples, and parameters
- Add comprehensive parser tests for SELECT, DDL, and expressions
- Test against ClickHouse EXPLAIN AST to verify compatibility
- All 39 ClickHouse comparison tests pass
- Fix AS alias precedence to properly parse column aliases
- Add JSON serialization tests
@kyleconroy kyleconroy merged commit ec361e6 into main Dec 12, 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