[
https://issues.apache.org/jira/browse/CALCITE-6948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17943312#comment-17943312
]
Julian Hyde commented on CALCITE-6948:
--------------------------------------
In your description and summary, can you describe in one sentence what the rule
does.
The relational algebra example is clear - thank you! - but could you also show
the SQL for the before and after?
Does your rule handle {{{}EXCEPT ALL{}}}? (Ok if it doesn't... but just say so.)
Does it handle n-way minus for n > 2? (Ok if it doesn't... but just say so.)
Can {{IS NOT DISTINCT FROM}} be converted to {{=}} when the types are not
nullable? (Maybe {{RelBuilder}} should be doing this.)
> Implement MinusToAntiJoinRule
> -----------------------------
>
> Key: CALCITE-6948
> URL: https://issues.apache.org/jira/browse/CALCITE-6948
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.39.0
> Reporter: Zhen Chen
> Assignee: Zhen Chen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.40.0
>
>
> Similar to IntersectToSemiJoinRule, we can implement MinusToAntiJoinRule.
> Like this:
> from:
> {code:java}
> LogicalMinus(all=[false])
> LogicalProject(ENAME=[$1])
> LogicalFilter(condition=[=($7, 10)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> LogicalProject(ENAME=[$1])
> LogicalFilter(condition=[=($7, 20)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> to:
> {code:java}
> LogicalAggregate(group=[{0}])
> LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[anti])
> LogicalProject(ENAME=[$1])
> LogicalFilter(condition=[=($7, 10)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> LogicalProject(ENAME=[$1])
> LogicalFilter(condition=[=($7, 20)])
> LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)