Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Parser improvements:

  • DROP TABLE with multiple tables: now captures all table names in Tables slice
  • ORDER BY (): now stores empty tuple literal instead of discarding it
  • PRIMARY KEY (): same fix as ORDER BY for empty tuples
  • Multiple table parsing handles qualified names (db.table)

Explain layer improvements:

  • Negative integer/float literals output as Literal Int64_-N instead of Function negate
  • Empty tuple in ORDER BY/PRIMARY KEY renders as Function tuple with empty ExpressionList
  • DROP TABLE with multiple tables renders ExpressionList with TableIdentifiers
  • Added FormatFloat helper function for consistent float formatting

Test results: 6,000 passing (87.9%) vs previous 5,933 (86.9%)
67 additional tests now pass, skipped reduced from 891 to 824

…empty tuple ORDER BY

Parser improvements:
- DROP TABLE with multiple tables: now captures all table names in Tables slice
- ORDER BY (): now stores empty tuple literal instead of discarding it
- PRIMARY KEY (): same fix as ORDER BY for empty tuples
- Multiple table parsing handles qualified names (db.table)

Explain layer improvements:
- Negative integer/float literals output as Literal Int64_-N instead of Function negate
- Empty tuple in ORDER BY/PRIMARY KEY renders as Function tuple with empty ExpressionList
- DROP TABLE with multiple tables renders ExpressionList with TableIdentifiers
- Added FormatFloat helper function for consistent float formatting

Test results: 6,000 passing (87.9%) vs previous 5,933 (86.9%)
67 additional tests now pass, skipped reduced from 891 to 824
The lexer now properly unescapes string literals:
- \' → single quote
- \\ → backslash
- \n → newline
- \t → tab
- \r → carriage return
- \0 → null byte
- \b → backspace
- \f → form feed
- \xNN → hex byte value
- '' → single quote (SQL-style escape)

The explain layer re-escapes these characters for display in EXPLAIN AST
output, using ClickHouse's double-escaping format (e.g., null becomes \\0).

Test results improved from 6,000 to 6,006 passing tests.
@kyleconroy kyleconroy merged commit 8a5092d into main Dec 14, 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