Skip to content

Core: fix field access display for digit-prefixed identifiers - #2707

Open
princejain756 wants to merge 1 commit into
apache:mainfrom
princejain756:fix-dot-digit-ident
Open

princejain756 wants to merge 1 commit into
apache:mainfrom
princejain756:fix-dot-digit-ident

Conversation

@princejain756

Copy link
Copy Markdown

In Hive, SELECT [dbo]. 1te_sk = 1 parses to a field access on 1te_sk, but displayed as SELECT [dbo].1te_sk = 1, which fails to reparse: .1 is lexed as a number, so [dbo].1te_sk reads as an array expression with alias .1te_sk.

AccessExpr::Dot now writes . before an unquoted identifier starting with a digit, extending the spacing already used for numeric literal access targets (#2463). Quoted identifiers are unchanged since "1x" cannot merge with the dot.

Fixes #2589

AI assistance: this change was implemented with help from an AI coding agent; the behavior and tests were verified manually.

A field access whose target identifier starts with a digit, as in
SELECT [dbo]. 1te_sk in Hive, displayed without the space as
[dbo].1te_sk. On re-lexing, .1 is read as a number, so the output
parsed as a different statement or failed to parse.

AccessExpr::Dot now writes ' . ' before an unquoted identifier
starting with a digit, extending the existing handling for numeric
literals from apache#2463.

Fixes apache#2589
@github-actions github-actions Bot added the Hive label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HIVE: Round trip fails for field access on a numeric-prefix identifier

1 participant