[ https://issues.apache.org/jira/browse/HIVE-13803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15351376#comment-15351376 ]
Jesus Camacho Rodriguez commented on HIVE-13803: ------------------------------------------------ I just did. I pointed out the changes that I made in the code that I brought from Calcite so it is easier for you to review it. > More aggressive inference of transitive predicates for inner joins > ------------------------------------------------------------------ > > Key: HIVE-13803 > URL: https://issues.apache.org/jira/browse/HIVE-13803 > Project: Hive > Issue Type: Sub-task > Components: CBO > Affects Versions: 2.1.0 > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Attachments: HIVE-13803.01.patch, HIVE-13803.02.patch, > HIVE-13803.patch > > > Follow-up of HIVE-13068. > Currently for inner joins, we do not infer transitive predicates that do not > reference any of the columns of the input. These predicates can be evaluated > statically and can be useful to quickly discard intermediary results. > Ex. ql/src/test/results/clientpositive/constprog3.q.out > {noformat} > explain > select table1.id, table1.val, table1.val1 > from table1 inner join table3 > on table1.dimid = table3.id and table3.id = 1 where table1.dimid <> 1 > {noformat} > Current plan: > {noformat} > STAGE DEPENDENCIES: > Stage-1 is a root stage > Stage-0 depends on stages: Stage-1 > STAGE PLANS: > Stage: Stage-1 > Map Reduce > Map Operator Tree: > TableScan > alias: table1 > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column > stats: NONE > Filter Operator > predicate: false (type: boolean) > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > Select Operator > expressions: id (type: int), val (type: int), val1 (type: int) > outputColumnNames: _col0, _col1, _col2 > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > Reduce Output Operator > sort order: > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > value expressions: _col0 (type: int), _col1 (type: int), > _col2 (type: int) > TableScan > alias: table3 > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column > stats: NONE > Filter Operator > predicate: (id = 1) (type: boolean) > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > Select Operator > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > Reduce Output Operator > sort order: > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL > Column stats: NONE > Reduce Operator Tree: > Join Operator > condition map: > Inner Join 0 to 1 > keys: > 0 > 1 > outputColumnNames: _col0, _col1, _col2 > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column > stats: NONE > File Output Operator > compressed: false > Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column > stats: NONE > table: > input format: org.apache.hadoop.mapred.SequenceFileInputFormat > output format: > org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat > serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe > Stage: Stage-0 > Fetch Operator > limit: -1 > Processor Tree: > ListSink > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)