[
https://issues.apache.org/jira/browse/CALCITE-2582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16622378#comment-16622378
]
Stamatis Zampetakis commented on CALCITE-2582:
----------------------------------------------
Consider the following test from sub-query.iq
{code:java}
# Test project literal IN null non-correlated
select sal,
123 IN (
select cast(null as int)
from "scott".dept)
from "scott".emp;{code}
At some point the FilterProjectTransposeRule is fired:
The condition of the original filter is:
{code:java}
OR(=(123, $0), IS NULL($0)){code}
The condition after pushing the filter past the projection is:
{code:java}
OR(=(123, null), IS NULL(null)){code}
So it seems that it is due to the pushing that the condition can be simplified
further.
> 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)