[
https://issues.apache.org/jira/browse/CALCITE-7373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18052328#comment-18052328
]
xiong duan commented on CALCITE-7373:
-------------------------------------
[~jensen] In this PR, any inclusion of non-deterministic functions will don't
pushdown.
> FILTER_INTO_JOIN should not push Filter into a join when the Filter contains
> non-deterministic function
> -------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-7373
> URL: https://issues.apache.org/jira/browse/CALCITE-7373
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> The test in RelOptRulesTest:
> {code:java}
> <TestCase name="testPushFilterThroughSemiJoin5">
> <Resource name="sql">
> <![CDATA[select * from (
> select * from dept where dept.deptno in (
> select emp.deptno from emp))R
> where 0.9 <= RANDOM()]]>
> </Resource>
> <Resource name="planBefore">
> <![CDATA[
> LogicalProject(DEPTNO=[$0], NAME=[$1])
> LogicalFilter(condition=[<=(CAST(0.9:DECIMAL(2, 1)):DOUBLE NOT NULL,
> RANDOM())])
> LogicalJoin(condition=[=($0, $2)], joinType=[semi])
> LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
> LogicalProject(DEPTNO=[$7])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> ]]>
> </Resource>
> <Resource name="planAfter">
> <![CDATA[
> LogicalProject(DEPTNO=[$0], NAME=[$1])
> LogicalJoin(condition=[=($0, $2)], joinType=[semi])
> LogicalFilter(condition=[<=(0.9E0, RANDOM())])
> LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
> LogicalProject(DEPTNO=[$7])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> ]]>
> </Resource>
> </TestCase> {code}
> The Filter constains RANDOM() should not be push down.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)