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

xiong duan commented on CALCITE-7015:
-------------------------------------

MinusToFilterRule has beed deprecated in CALCITE-7002.  You can check 
CoreRules#MINUS_FILTER_TO_FILTER?

> MinusToFilterRule should return empty Values when minus Non-Filter RelNode
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-7015
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7015
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.39.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>             Fix For: 1.40.0
>
>
> sql:
> {code:java}
> final String sql = "SELECT mgr, comm FROM emp WHERE mgr = 12\n"
>     + "EXCEPT\n"
>     + "SELECT mgr, comm FROM emp\n"; 
> sql(sql)
>     .withPreRule(CoreRules.PROJECT_FILTER_TRANSPOSE)
>     .withRule(CoreRules.MINUS_TO_FILTER)
>     .check();{code}
> result:
> {code:java}
> LogicalMinus(all=[false])
>   LogicalFilter(condition=[=($0, 12)])
>     LogicalProject(MGR=[$3], COMM=[$6])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
>   LogicalProject(MGR=[$3], COMM=[$6])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> should better convert to:
> {code:java}
> LogicalValues(tuples=[[]]) {code}



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

Reply via email to