xiong duan created CALCITE-7373:
-----------------------------------
Summary: 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
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)