Zoltan Borok-Nagy has posted comments on this change. ( https://gerrit.cloudera.org/25234 )
Change subject: IMPALA-15697: Calcite planner: unreserve keywords ...................................................................... Patch Set 3: (5 comments) Thanks for the contribution! https://gerrit.cloudera.org/#/c/25234/3//COMMIT_MSG Commit Message: https://gerrit.cloudera.org/#/c/25234/3//COMMIT_MSG@7 PS3, Line 7: IMPALA-15697: Calcite planner: unreserve keywords This also fixes IMPALA-15535, so please put both IDs in the title ("IMPALA-15697, IMPALA-15535: ...") rather than "Consolidate". https://gerrit.cloudera.org/#/c/25234/3/java/calcite-planner/src/main/codegen/config.fmpp File java/calcite-planner/src/main/codegen/config.fmpp: https://gerrit.cloudera.org/#/c/25234/3/java/calcite-planner/src/main/codegen/config.fmpp@399 PS3, Line 399: "USER" `user` as a qualifier still fails: `select user.a from (select 1 as a) user` -> "Column 'USER' not found" (original planner returns 1; same for `group by user.a` and a CTE named user). ContextVariable() is tried before CompoundIdentifier(), and javacc now warns "common prefix is: USER". Dropping `<USER>` from ContextVariable() in Parser.jj fixes it and keeps user() working. Please add a test. https://gerrit.cloudera.org/#/c/25234/3/java/calcite-planner/src/main/codegen/config.fmpp@400 PS3, Line 400: ] FYI: 22 other words in the original planner's whitelist (sql-scanner.flex:428) are still rejected by Calcite as aliases and as t.<word>: hour, minute, second, begin, call, check, start, system, ... Worth a follow-up Jira? https://gerrit.cloudera.org/#/c/25234/3/java/calcite-planner/src/test/java/org/apache/impala/calcite/service/CalciteKeywordIdentifierTest.java File java/calcite-planner/src/test/java/org/apache/impala/calcite/service/CalciteKeywordIdentifierTest.java: https://gerrit.cloudera.org/#/c/25234/3/java/calcite-planner/src/test/java/org/apache/impala/calcite/service/CalciteKeywordIdentifierTest.java@124 PS3, Line 124: public void testUserColumn() throws ParseException { Passes without the fix: `select USER` already parses via ContextVariable(). Nit: the per-word tests could be one loop, like testQuotedIdentifiers. https://gerrit.cloudera.org/#/c/25234/3/testdata/workloads/functional-query/queries/QueryTest/exprs.test File testdata/workloads/functional-query/queries/QueryTest/exprs.test: https://gerrit.cloudera.org/#/c/25234/3/testdata/workloads/functional-query/queries/QueryTest/exprs.test@3 PS3, Line 3: # IMPALA-15535: TIME is an unquoted identifier in both planners. These pass without the fix: test_exprs uses the default fallback_planner=ORIGINAL, so a Calcite parse error silently falls back. Could they go into QueryTest/calcite.test (TestCalcitePlanner sets fallback_planner=CALCITE)? -- To view, visit https://gerrit.cloudera.org/25234 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81d63e18667939a4e34fba5fd6579a1b33e1b695 Gerrit-Change-Number: 25234 Gerrit-PatchSet: 3 Gerrit-Owner: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Tue, 03 Nov 2026 16:04:07 +0000 Gerrit-HasComments: Yes
