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

Caican Cai commented on CALCITE-6439:
-------------------------------------

I'm sorry, I'm not familiar with the RBO module code yet, so the two jiras I 
mentioned have been completed. I'm sorry if it causes any trouble.
 
 

> Add FilterNullTest on RelOptRulesTest
> -------------------------------------
>
>                 Key: CALCITE-6439
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6439
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Caican Cai
>            Priority: Minor
>             Fix For: 1.38.0
>
>
> test example
> {code:java}
> @Test void testFilterNull() {
>   final String sql = "select * from emp where null";
>   sql(sql).withRule(PruneEmptyRules.FILTER_INSTANCE).check();
> } {code}
> logical plan
> {code:java}
>     </Resource>
>   </TestCase>
>   <TestCase name="testFilterNull">
>     <Resource name="sql">
>       <![CDATA[select * from emp where null]]>
>     </Resource>
>     <Resource name="planBefore">
>       <![CDATA[
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
>   LogicalFilter(condition=[null:BOOLEAN])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> ]]>
>     </Resource>
>     <Resource name="planAfter">
>       <![CDATA[
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
>   LogicalFilter(condition=[null:BOOLEAN])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> ]]>{code}
> unchanged.
> The logical plan that should be generated after optimization
> {code:java}
> LogicalValues(tuples=[[]]){code}
> or
> {code:java}
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
>   LogicalValues(tuples=[[]]) {code} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to