NobiGo commented on code in PR #4308:
URL: https://github.com/apache/calcite/pull/4308#discussion_r2045791580
##########
core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml:
##########
@@ -3768,6 +3796,22 @@ LogicalIntersect(all=[false])
<Resource name="planAfter">
<![CDATA[
LogicalValues(tuples=[[]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testEmptyIntersect2">
Review Comment:
This test case does not have a corresponding one in Java.
##########
core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java:
##########
@@ -406,6 +406,9 @@ public interface UnionEmptyPruneRuleConfig extends
PruneEmptyRule.Config {
+ RelOptUtil.toString(union);
if (nonEmptyInputs == 0) {
relBuilder.push(union).empty();
+ } else if (nonEmptyInputs == 1 && !union.all) {
Review Comment:
> If intersect contains two children, one is values(1) and the other is
values(), then the result will be an empty set. This is another logic, and the
original implementation is as expected.
Do we have test cases covering this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]