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

Yu Xu edited comment on CALCITE-7015 at 5/15/25 2:48 AM:
---------------------------------------------------------

[~nobigo] OK, mainly considering that there may be existing users who use 
MinusToFilterRule rule, so I did the following maintenance for it,maybe it's 
necessary? And I would also check it in MINUS_FILTER_TO_FILTER.


was (Author: JIRAUSER307770):
[~nobigo] OK, mainly considering that there may be existing users who use 
MinusToFilterRule rule, so I did the following maintenance for it,maybe it's 
necessary. And I would also check it in 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