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

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

[~ashutoshc], patch makes sense, and by doing transformation at the end, there 
should not be any interaction with other rules that might prevent some 
optimizations from triggering. As a side note, it might be worth extending the 
original Calcite rule, since we have a native HiveSemiJoin operator in Hive 
that we might want to use instead of the Logical instance.

In addition, there was a flag in HiveJoin that was used to know whether a Join 
was a Semijoin or not; if I remember from previous discussions, this was done 
this way because 1) many rules only apply to Join (and not to Semijoin), thus 
we would not like to prevent some optimizations in Calcite from triggering, but 
2) we still want to calculate stats differently for these cases. However, I am 
not sure if we take into account this flag when we translate back to Hive? 
Should we either take into account or extend the rule to transform HiveJoin + 
isSemijoin=true to HiveSemiJoin?

> Optimize join + gby into semijoin
> ---------------------------------
>
>                 Key: HIVE-15227
>                 URL: https://issues.apache.org/jira/browse/HIVE-15227
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer
>            Reporter: Ashutosh Chauhan
>            Assignee: Ashutosh Chauhan
>         Attachments: HIVE-15227.patch
>
>
> Calcite has a rule which can do this transformation. Lets take advantage of 
> this since Hive has native Left semi join operator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to