Skip to content

Commit 4d3104b

Browse files
committed
Add parser tests with ClickHouse EXPLAIN AST verification
- 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
1 parent f70ddda commit 4d3104b

File tree

2 files changed

+561
-0
lines changed

2 files changed

+561
-0
lines changed

parser/expression.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
// Operator precedence levels
1212
const (
1313
LOWEST = iota
14+
ALIAS_PREC // AS
1415
OR_PREC // OR
1516
AND_PREC // AND
1617
NOT_PREC // NOT
@@ -25,6 +26,8 @@ const (
2526

2627
func (p *Parser) precedence(tok token.Token) int {
2728
switch tok {
29+
case token.AS:
30+
return ALIAS_PREC
2831
case token.OR:
2932
return OR_PREC
3033
case token.AND:

0 commit comments

Comments
 (0)