[ https://issues.apache.org/jira/browse/HIVE-24154?focusedWorklogId=483660&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-483660 ]
ASF GitHub Bot logged work on HIVE-24154: ----------------------------------------- Author: ASF GitHub Bot Created on: 13/Sep/20 16:03 Start Date: 13/Sep/20 16:03 Worklog Time Spent: 10m Work Description: jcamachor commented on a change in pull request #1492: URL: https://github.com/apache/hive/pull/1492#discussion_r487546646 ########## File path: ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query74.q.out ########## @@ -147,7 +147,7 @@ HiveSortLimit(sort0=[$2], sort1=[$0], sort2=[$1], dir0=[ASC], dir1=[ASC], dir2=[ HiveProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_net_paid=[$20]) HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) HiveProject(d_date_sk=[$0]) - HiveFilter(condition=[AND(=($1, 1999), IN($1, 1998, 1999))]) + HiveFilter(condition=[=($1, 1999)]) Review comment: What seems to happen is that we close these IN clauses before we call the join propagation rule, which leads to the inference of new predicates. Then the RexSimplify does not deal with the IN+EQUALS clauses and the HivePointLookup cannot deal with the EQUALS. We could possibly change the rules order too but I was not brave enough to do that :) Plus I think supporting the degenerate case of EQUALS in HivePointLookup should be fine. Iirc there is work going on in Calcite to finally have more extensive support for IN in RexSimplify, which you suggested some time ago... I hope that work goes in and we can simplify this whole code path. ---------------------------------------------------------------- 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: 483660) Time Spent: 40m (was: 0.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: 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)