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

Jesus Camacho Rodriguez commented on CALCITE-600:
-------------------------------------------------

HiveUnion is created by the Hive planner. {{Logical*}} operators cannot be 
extended, so my understanding is that if you want to have your own operator, 
you may extend to core classes and create e.g. {{HiveUnion}}.

{quote}
UnionMergeRule operates on LogicalUnions. Eventually (I guess) those 
LogicalUnions lower to HiveUnion.
{quote}
{quote}
Using "rule for arbitrary subclass" is a sloppy way.
Consider this: SemiJoin extends Join.
In fact, not all the rules that work for Join will work for SemiJoin (there is 
explicit "if not instanceof SemiJoin" test).
The same might apply for other nodes.
{quote}
I think I get your point, we could give the _class to match_ as a parameter 
too? That makes sense, I have just checked and it is done for other rules in 
Calcite. By default, the rules would operate on LogicalUnion.

> Create UnionFactory and use in rules containing Union operator
> --------------------------------------------------------------
>
>                 Key: CALCITE-600
>                 URL: https://issues.apache.org/jira/browse/CALCITE-600
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>
> Union related rules match on {{LogicalUnion}} and use this implementation to 
> create the new Union operators. As it is done for other rules, a Union 
> factory can be created and used by them, so subclasses that extend Union can 
> use the rules.



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

Reply via email to