Aleksandr Efimov has posted comments on this change. ( http://gerrit.cloudera.org:8080/25077 )
Change subject: IMPALA-15530: Preserve Calcite expression labels ...................................................................... Patch Set 4: (5 comments) http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteParsedStatement.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteParsedStatement.java: http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteParsedStatement.java@66 PS4, Line 66: ImmutableMap.Builder<SqlParserPos, String> labels = ImmutableMap.builder(); > optional personal nit: Moved the loop into a private static helper in PS5. http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java: http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java@226 PS4, Line 226: static List<SqlNode> getSelectItems(SqlNode node) { > nit: Feels a bit awkward to me to have CalciteParsedStatement call this. I Moved getSelectItems() to CalciteParsedStatement in PS5; the converter now calls it. http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java@241 PS4, Line 241: static String getOriginalColumnLabel(SqlNode item, String sql) { > I don't think this is called from CalciteRelNodeConverter, so we should pro Moved getOriginalColumnLabel() to CalciteParsedStatement in PS5. http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java@243 PS4, Line 243: if (item.getKind() == SqlKind.AS || !alias.startsWith("EXPR$")) return alias; > Can we put a comment here specifying that this is the more normal case, or Split EXPR$ rendering into createImpalaLabel() and added the comment in PS5. http://gerrit.cloudera.org:8080/#/c/25077/4/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java@305 PS4, Line 305: return null; > I didn't run this through, but if we are keeping the original, does this ju PS5 returns the original alias on rendering failure and removes the collector's null check. -- To view, visit http://gerrit.cloudera.org:8080/25077 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0e91b2ff8008513d0a097af806a2437ca725a542 Gerrit-Change-Number: 25077 Gerrit-PatchSet: 4 Gerrit-Owner: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Comment-Date: Wed, 28 Oct 2026 18:17:21 +0000 Gerrit-HasComments: Yes
