deniskuzZ commented on code in PR #7000:
URL: https://github.com/apache/hive/pull/7000#discussion_r4792151371


##########
ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDescUtils.java:
##########
@@ -1229,7 +1229,7 @@ private static void conjunctiveDecomposition(ExprNodeDesc 
expr, List<ExprNodeDes
 
   }
 
-  private static boolean isTrue(ExprNodeDesc expr) {
+  public static boolean isTrue(ExprNodeDesc expr) {

Review Comment:
   Nit: instead of making this public and special-casing TRUE in 
`SessionStateUtil#disjunction`, `ExprNodeDescUtils#disjunction(ExprNodeDesc, 
ExprNodeDesc)` could return TRUE when either operand is TRUE (`x OR TRUE` is 
TRUE, also when `x` is NULL). That mirrors `conjunctiveDecomposition`, which 
already drops TRUE from a conjunction, and `isTrue` could stay private. Its 
other caller, `SharedWorkOptimizer`, casts the result to 
`ExprNodeGenericFuncDesc`, so it's worth checking that none of its operands can 
be a constant TRUE.



##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveStoragePredicateHandler.java:
##########
@@ -65,6 +66,15 @@ public DecomposedPredicate decomposePredicate(
     Deserializer deserializer,
     ExprNodeDesc predicate);
 
+  /**
+   * Tells the storage handler that a scan of the table pushes no predicate 
down: either no predicate reaches the
+   * scan, or the storage handler pushes none of it. The scan reads the entire 
table.
+   *
+   * @param tableDesc the scanned table
+   */
+  default void noPredicatePushed(TableDesc tableDesc) {

Review Comment:
   This works, but it splits one concept across two paths: a pushed filter is 
registered as a side effect inside 
`HiveIcebergStorageHandler#decomposePredicate`, and "nothing pushed" arrives 
through this method, called from `TableScanPPD`. It also adds a concern of one 
storage handler (conflict detection at commit) to a generic pushdown interface, 
under a name that only describes pushdown.
   
   What about a single callback from `TableScanPPD` after pushdown that passes 
the scan's final pushed predicate, or null when nothing was pushed? For example 
`default void onScanPushdown(TableDesc tableDesc, ExprNodeGenericFuncDesc 
pushedPredicate) {}`. The Iceberg handler would then register the predicate, or 
TRUE for null, in one place, and `decomposePredicate` would go back to only 
decomposing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to