Skip to content

Commit 9a96fab

Browse files
kyleconroyclaude
andcommitted
Allow SYNC keyword as implicit alias in expressions
In ClickHouse, keywords like SYNC can be used as column aliases without AS keyword. Add SYNC to the list of allowed implicit alias keywords. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3da9497 commit 9a96fab

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

parser/expression.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func (p *Parser) parseImplicitAlias(expr ast.Expression) ast.Expression {
332332
if !canBeAlias {
333333
// Some keywords can be used as implicit aliases in ClickHouse
334334
switch p.current.Token {
335-
case token.KEY, token.INDEX, token.VIEW, token.DATABASE, token.TABLE:
335+
case token.KEY, token.INDEX, token.VIEW, token.DATABASE, token.TABLE, token.SYNC:
336336
canBeAlias = true
337337
}
338338
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt8": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)