Skip to content

Commit 242667a

Browse files
kyleconroyclaude
andcommitted
Handle implicit aliases in projection SELECT column parsing
Projection column lists like `SELECT name, max(frequency) max_frequency` need to handle implicit aliases where an identifier follows an expression without the AS keyword. This adds parseImplicitAlias call after parsing each column expression in projections. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5ec3094 commit 242667a

File tree

5 files changed

+6
-20
lines changed

5 files changed

+6
-20
lines changed

parser/parser.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8006,6 +8006,8 @@ func (p *Parser) parseProjection() *ast.Projection {
80068006

80078007
col := p.parseExpression(LOWEST)
80088008
if col != nil {
8009+
// Handle implicit alias (identifier without AS)
8010+
col = p.parseImplicitAlias(col)
80098011
proj.Select.Columns = append(proj.Select.Columns, col)
80108012
}
80118013

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+
{}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt3": true
4-
}
5-
}
1+
{}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt4": true
4-
}
5-
}
1+
{}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt4": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)