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

Anton Haidai commented on CALCITE-3939:
---------------------------------------

{quote}

Does RuleX look into the siblings of Project in the RelSet through RelSubset?

{quote}

No, just a couple of application-specific instanceofs on call.rel(0). Even 
more, I was trying to move all logic into RuleX.onMatch() levaing 
RuleX.matches() trivial:
{code:java}
@Override
public boolean matches(RelOptRuleCall call) {
    final Sort sort = call.rel(0);
    final RelNode node = call.rel(1);
    return true;
}{code}
And everything still works according to the description. With the workaround, 
there are numerous calls of RuleX.matches() and RuleX.onMatch() but without it, 
there is only a single call of RuleX.matches() which returns true and zero 
calls of RuleX.onMatch() (as described above).

> Change UnionEliminatorRule and ProjectRemoveRule to auto pruning 
> SubstitutionRule
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-3939
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3939
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Botong Huang
>            Priority: Major
>             Fix For: 1.23.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> UnionEliminatorRule and ProjectRemoveRule are both pruning rules for a 
> RelNode. They can also become SubstitutionRule with autoprune enabled



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

Reply via email to