Skip to content

Conversation

@bombsimon
Copy link
Contributor

Since v0.55.0, qualified column names using SQL keywords failed to parse. For example, T.interval in PARTITION BY T.key, T.interval ORDER BY ... was incorrectly interpreted as an INTERVAL expression instead of a column.

In 3e90a18 changed parse_compound_expr to use parse_subexpr() for tokens after ., causing keywords like INTERVAL, CASE, CAST, etc. to be treated as expression starters.

Explicitly handle Token::Word in parse_compound_expr by treating it as an identifier. If followed by ( (excluding the (+) outer join operator), parse as a method call. This restores the original behavior where words after . were always converted to identifiers.

Since v0.55.0, qualified column names using SQL keywords failed to
parse. For example, `T.interval` in `PARTITION BY T.key, T.interval
ORDER BY ...` was incorrectly interpreted as an INTERVAL expression
instead of a column.

In `3e90a18` changed `parse_compound_expr` to use `parse_subexpr()` for
tokens after `.`, causing keywords like INTERVAL, CASE, CAST, etc. to be
treated as expression starters.

Explicitly handle `Token::Word` in `parse_compound_expr` by treating it
as an identifier. If followed by `(` (excluding the `(+)` outer join
operator), parse as a method call. This restores the original behavior
where words after `.` were always converted to identifiers.
@bombsimon bombsimon requested a review from iffyio January 22, 2026 12:41
@bombsimon bombsimon force-pushed the interval-column-name branch from 438bb58 to 4ea8e36 Compare January 22, 2026 12:42
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @bombsimon!

@iffyio iffyio added this pull request to the merge queue Jan 22, 2026
Merged via the queue into apache:main with commit 845e213 Jan 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants