[ 
https://issues.apache.org/jira/browse/HIVE-25864?focusedWorklogId=710650&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-710650
 ]

ASF GitHub Bot logged work on HIVE-25864:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jan/22 17:03
            Start Date: 18/Jan/22 17:03
    Worklog Time Spent: 10m 
      Work Description: 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: [email protected]

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 710650)
    Time Spent: 20m  (was: 10m)

> Hive query optimisation creates wrong plan for predicate pushdown with 
> windowing function 
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25864
>                 URL: https://issues.apache.org/jira/browse/HIVE-25864
>             Project: Hive
>          Issue Type: Bug
>            Reporter: mahesh kumar behera
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case of a query with windowing function, the deterministic predicates are 
> pushed down below the window function. Before pushing down, the predicate is 
> converted to refer the project operator values. But the same conversion is 
> done again while creating the project and thus causing wrong plan generation.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to