Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/25144 )
Change subject: IMPALA-14944: Throw UnsupportedFeatureException for some Calcite planner queries ...................................................................... Patch Set 3: (11 comments) Most of my comments are nits (and some come from Claude) http://gerrit.cloudera.org:8080/#/c/25144/3//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/25144/3//COMMIT_MSG@9 PS3, Line 9: This commit adds code to throw an UnsupportedFeatureException for queries : that cannot be handled by the Calcite planner. The benefit for throwing this : specific exception rather than any other exception is that this will be : used to track queries not supported by Calcite and allow them to pass by : running them through the original planner. In this way, when all queries : are either supported or have this exception thrown, the Jenkins job will : be able to pass when there is no fallback planner specified. This is a very minor nit: For commit messages, we try to keep the line length just a bit shorter than code. When running 'git log', it indents slightly and we'd like to avoid line wraps in a standard terminal (or in Gerrit's scroll box). Targeting a line width of about 70 avoids that. http://gerrit.cloudera.org:8080/#/c/25144/3//COMMIT_MSG@20 PS3, Line 20: A ParseException is thrown and the message is caught an the Unsupported exception Nit: an -> and ("... the message is caught and the Unsupported ...") http://gerrit.cloudera.org:8080/#/c/25144/3/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java File fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java: http://gerrit.cloudera.org:8080/#/c/25144/3/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@a512 PS3, Line 512: This got cut off accidentally http://gerrit.cloudera.org:8080/#/c/25144/3/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@527 PS3, Line 527: triggred Nit: triggered http://gerrit.cloudera.org:8080/#/c/25144/3/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@530 PS3, Line 530: !analysisResult_.shouldFallbackBecauseOfException(analysisException) So, every UnsupportedFeatureException MUST fall back. There is no mode that doesn't run the original planner if we see this. Is that right? http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteMetadataHandler.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteMetadataHandler.java: http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteMetadataHandler.java@107 PS3, Line 107: List<String> notFoundTables = new ArrayList<>(); This is now unused http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteMetadataHandler.java@310 PS3, Line 310: String onlyColumnPart = columnName.split("\\.")[0].toLowerCase(); : if (onlyColumnPart.toLowerCase().equals("_file_row_id")) { Extra toLowerCase() call http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteSingleNodePlanner.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteSingleNodePlanner.java: http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteSingleNodePlanner.java@91 PS3, Line 91: catch (Exception e) { : if (e instanceof ImpalaException) { : throw (ImpalaException) e; : } else if (e instanceof InconsistentMetadataFetchException) { : throw (InconsistentMetadataFetchException) e; : } else { : throw new RuntimeException(e); : } : } Claude says this try/catch isn't doing anything. ImpalaException is the only declared exception thrown, so everything else would be a RuntimeException (including InconsistentMetadataFetchException) and could just pass through as-is. The reason is matters is that RuntimeExceptions other than InconsistentMetadataFetchException get wrapped in a new RuntimeException, which obscures the original exception. Claude could be wrong. Was there a reason we needed this? http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java: http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java@182 PS3, Line 182: "UnsupportedFeatureException Nit: Opening quote with no closing quote http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/UnsupportedChecker.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/UnsupportedChecker.java: http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/UnsupportedChecker.java@63 PS3, Line 63: e.getMessage().equals("Unnest function found" If getMessage() is null, this would produce a null pointer exception. An alternative is "Unnest function found".equals(e.getMessage()) http://gerrit.cloudera.org:8080/#/c/25144/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/UnsupportedChecker.java@109 PS3, Line 109: throw new UnsupportedFeatureException( : "Complex column " + m.group(1) + " not supported."); Nit (from Claude): We now throw UnsupportedFeatureException for things other than complex types (e.g. hidden or virtual columns), so this message may want to handle that. -- To view, visit http://gerrit.cloudera.org:8080/25144 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I037d636064c4c99131598b7424dd99e4ad56d30f Gerrit-Change-Number: 25144 Gerrit-PatchSet: 3 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Comment-Date: Fri, 30 Oct 2026 19:11:32 +0000 Gerrit-HasComments: Yes
