You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/01/18 17:03:05 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #2943: HIVE-25864 : Hive query optimisation creates wrong plan for predicate pushdown with windowing function

kgyrtkirk commented on a change in pull request #2943:
URL: https://github.com/apache/hive/pull/2943#discussion_r786971885



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
##########
@@ -170,6 +171,7 @@ public void onMatch(RelOptRuleCall call) {
             if (HiveCalciteUtil.isDeterministicFuncWithSingleInputRef(newCondition,
                 commonPartitionKeys)) {
               newPartKeyFilConds.add(newCondition);
+              isConversionDone = true;

Review comment:
       * above line adds 1 element to `newPartKeyFilConds`
   * then the if at line180 will only fire in that case the collection is not empty
   * we will also have `isConversionDone` set to true (it will be set iff collection not empty|)
   * `getNewProject` has only one callsite => which will have `isConversionDone=true` all the time
   
   I think we could:
   * simply add `ce` to the `newPartKeyFilConds` and let the existing code push it...the non-over related codepath have been using external rex-es but now we add a pushed one...
   * I was thinking a different approach in with a rename of `filterCondToPushBelowProj` would happened to `filterCondPushedBelowProj`; but it seemed more complicated; 
   
   I think it would be better to add `ce` to that array in line#173.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org