[
https://issues.apache.org/jira/browse/CALCITE-2582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16624227#comment-16624227
]
Stamatis Zampetakis commented on CALCITE-2582:
----------------------------------------------
In my opinion the discussion about the refactoring of the RelBuilder and the
copying of RelNode's should be a separate Jira and not block this or other
issues that have an easy solution. Like that the commit history is much more
cleaner and easier to follow.
As a general comment regarding this rule, I don't see clearly the benefit of
having a copy option (copyFilter and copyProject parameters). If somebody wants
to create specific subclasses of Filter and Project when applying the rule it
suffices to provide an appropriate RelBuilderFactory.
Now regarding the proposed solution from Vladimir
(https://issues.apache.org/jira/browse/CALCITE-2582?focusedCommentId=16623397&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16623397)
I think there may be a few edge cases that should be handled. One that comes
to my mind is the case where the newCondition is simplified to always false
where the RelBuilder will not return a Filter but an empty LogicalValues
operator. I will have a better look when we decide more or less what we are
going to do with this issue.
> FilterProjectTransposeRule does not always simplify the new filter condition
> ----------------------------------------------------------------------------
>
> Key: CALCITE-2582
> URL: https://issues.apache.org/jira/browse/CALCITE-2582
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.17.0
> Reporter: Stamatis Zampetakis
> Assignee: Julian Hyde
> Priority: Minor
> Fix For: 1.18.0
>
>
> After pushing the filter below the project a new condition is going to be
> generated along with a new Filter operator. The new condition is not going to
> be simplified if the filter operator is copied and not created using the
> RelBuilder.
> Thus the resulting plan may contain redundant conditions which can have a
> slight impact on performance. Apart, from that tests verifying the resulting
> (logical/physical) plan may produce indeterministic results if the rule is
> applied with (a different order and in combination with other rules).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)