Riza Suminto has posted comments on this change. ( http://gerrit.cloudera.org:8080/23566 )
Change subject: IMPALA-14065: Support WHERE clause in SHOW PARTITIONS statement ...................................................................... Patch Set 2: > Patch Set 2: > > I just found an issue in the change and my implementation, > > * Crashes: || operator (e.g., show partitions alltypes where month = 1 || > month = 2) > * Works: OR, AND, &&, comparison operators, IN, BETWEEN, etc. > * The same || operator works fine in SELECT ... WHERE queries > * Code Location: > https://gerrit.cloudera.org/#/c/23566/2/fe/src/main/java/org/apache/impala/analysis/ShowStatsStmt.java > * Current error: Backend crash with message about function name or > serialization failure when using || > * Possible Cause: Analyzed expressions having implicit casts added, which > prevented the HdfsPartitionPruner from evaluating them using partition > metadata, forcing backend evaluation that crashed. > > Approaches Tried (All Failed with ||) > 1. Passing Unanalyzed Expression > Result: IllegalStateException - isBoundBySlotIds() requires analyzed > expressions > 2. Analyze Then Pass(Current behaviour) > Result: Backend crash - implicit casts added during analysis prevent > partition metadata evaluation > 3. Analyze Clone for Validation, Pass Original > Result: IllegalStateException - pruner needs analyzed expressions > 4. Analyze + Extract Conjuncts > Result: Works with OR and AND, crashes with || > 5. Add Constant Folding > Result: Still crashes with || > 6. Add registerConjuncts() (Like SelectStmt) > Result: Still crashes with || > > NOTE: > || vs OR: In standard SQL, || is string concatenation, but Impala apparently > supports it as logical OR in some contexts (SELECT WHERE) > > Should SHOW PARTITIONS WHERE bypass || support and only document OR as > supported? You'll want to override and implement rewriteExprs(ExprRewriter rewriter) for ShowStatsStmt and apply some expression rewrite (i.e., ExtractCompoundVerticalBarExprRule) over the predicate. See also exprRewriter_ inside Analyzer.GlobalState. -- To view, visit http://gerrit.cloudera.org:8080/23566 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2e2a14aabcea3fb17083d4ad6f87b7861113f89e Gerrit-Change-Number: 23566 Gerrit-PatchSet: 2 Gerrit-Owner: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Pranav Lodha <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Reviewer: Surya Hebbar <[email protected]> Gerrit-Comment-Date: Fri, 31 Oct 2025 14:53:07 +0000 Gerrit-HasComments: No
