[ 
https://issues.apache.org/jira/browse/HIVE-24564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254362#comment-17254362
 ] 

Jesus Camacho Rodriguez commented on HIVE-24564:
------------------------------------------------

[~kkasa], to understand clearly what you are trying to achieve, you would like 
to end up with a predicate {{ws2.ws_on IN RS(key:wr_on)}} on top of 
{{TS(ws2)}}? I guess {{wr.wr_on IN RS(key:ws_on)}} (both from {{TS(ws1)}} and 
{{TS(ws2)}}) are already generated with current logic?

> Extend PPD filter transitivity to be able to discover new opportunities
> -----------------------------------------------------------------------
>
>                 Key: HIVE-24564
>                 URL: https://issues.apache.org/jira/browse/HIVE-24564
>             Project: Hive
>          Issue Type: Improvement
>          Components: Logical Optimizer
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If a predicate references a value column of one of the parent ReduceSink 
> operators of a Join the predicate can not be copied and pushed down to the 
> other side of the join. However if we a parent equijoin exists in the branch 
> of the RS where 
>  1. the referenced value column is a key column of that join
>  2. and the other side of that join expression is the key column of the RS
>  the column in the predicate can be replaced and the new predicate can be 
> pushed down.
> {code:java}
>                                    Join(... = wr_on)
>                                   /                 \
>                                 ...                  RS(key: wr_on)
>                                                           |
>                                               Join(ws1.ws_on = ws2.ws_on)
>                                               (ws1.ws_on, ws2.ws_on, wr_on)
>                                               /                         \
>                                   RS(key:ws_on)                          
> RS(key:ws_on)
>                                     (value: wr_on)
>                                        |                                      
>  |
>                            Join(ws1.ws_on = wr.wr_on)                       
> TS(ws2)
>                            /                        \
>                      RS(key:ws_on)              RS(key:wr_on)
>                            |                        |
>                         TS(ws1)                   TS(wr)
> {code}
> A predicate like
> {code}
> (wr_on in (...))
> {code}
> can not be pushed to TS(ws2) because wr_on is not a key column in 
> Join(ws1.ws_on = ws2.ws_on). But we know that wr_on is equals to ws_on 
> because the join from the left branch. 



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

Reply via email to