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

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

                Author: ASF GitHub Bot
            Created on: 28/Sep/20 17:19
            Start Date: 28/Sep/20 17:19
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on a change in pull request #1492:
URL: https://github.com/apache/hive/pull/1492#discussion_r496112152



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java
##########
@@ -757,10 +752,15 @@ private static RexNode handleAND(RexBuilder rexBuilder, 
RexCall call) {
         }
       }
       // Create IN clauses
-      final List<RexNode> newOperands = createInClauses(rexBuilder, 
inLHSExprToRHSExprs);
+      final List<RexNode> newOperands = createInClauses(rexBuilder,
+          visitedRefs, inLHSExprToRHSExprs, inLHSExprToRHSNullableExprs);
       newOperands.addAll(operands);
       // Return node
-      return RexUtil.composeConjunction(rexBuilder, newOperands, false);
+      RexNode result = RexUtil.composeConjunction(rexBuilder, newOperands, 
false);
+      if (!result.getType().equals(call.getType())) {

Review comment:
       Once again, good catch. This compensation was coming from a previous 
version of the patch :(




----------------------------------------------------------------
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.

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


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

    Worklog Id:     (was: 492079)
    Time Spent: 2h 40m  (was: 2.5h)

> Missing simplification opportunity with IN and EQUALS clauses
> -------------------------------------------------------------
>
>                 Key: HIVE-24154
>                 URL: https://issues.apache.org/jira/browse/HIVE-24154
>             Project: Hive
>          Issue Type: Improvement
>          Components: CBO
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> For instance, in perf driver CBO query 74, there are several filters that 
> could be simplified further:
> {code}
> HiveFilter(condition=[AND(=($1, 1999), IN($1, 1998, 1999))])
> {code}
> This may lead to incorrect estimates and leads to unnecessary execution time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to