Skip to content

Commit 5121d5c

Browse files
kyleconroyclaude
andcommitted
Fix EPHEMERAL column parsing to not consume COMMENT keyword
When parsing EPHEMERAL columns, don't treat COMMENT, TTL, PRIMARY, or SETTINGS as part of the default expression. These are column modifiers that should be parsed separately. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 613e3e5 commit 5121d5c

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

parser/parser.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,8 +4340,10 @@ func (p *Parser) parseColumnDeclaration() *ast.ColumnDeclaration {
43404340
if p.currentIs(token.IDENT) && strings.ToUpper(p.current.Value) == "EPHEMERAL" {
43414341
col.DefaultKind = "EPHEMERAL"
43424342
p.nextToken()
4343-
// Optional default value
4344-
if !p.currentIs(token.COMMA) && !p.currentIs(token.RPAREN) && !p.currentIs(token.IDENT) {
4343+
// Optional default value - but don't parse column keywords (CODEC, COMMENT, TTL, etc.) as expressions
4344+
if !p.currentIs(token.COMMA) && !p.currentIs(token.RPAREN) && !p.currentIs(token.IDENT) &&
4345+
!p.currentIs(token.COMMENT) && !p.currentIs(token.TTL) && !p.currentIs(token.PRIMARY) &&
4346+
!p.currentIs(token.SETTINGS) {
43454347
col.Default = p.parseExpression(LOWEST)
43464348
}
43474349
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt2": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)