[
https://issues.apache.org/jira/browse/CALCITE-7015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952529#comment-17952529
]
Yu Xu commented on CALCITE-7015:
--------------------------------
OK, I close this issue, thanks for your suggestion. [~nobigo]
> 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
> Labels: pull-request-available
>
> 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)