LakeShen commented on code in PR #3367:
URL: https://github.com/apache/calcite/pull/3367#discussion_r1313824184
##########
core/src/test/java/org/apache/calcite/test/JdbcTest.java:
##########
@@ -3773,6 +3774,35 @@ public void checkOrderBy(final boolean desc,
"empid=110; name=Theodore");
}
+ @Test void testExceptToDistinct() {
+ final String sql = ""
+ + "select \"empid\", \"name\" from \"hr\".\"emps\" where
\"deptno\"=10\n"
+ + "except\n"
+ + "select \"empid\", \"name\" from \"hr\".\"emps\" where
\"empid\">=150";
+ CalciteAssert.hr()
+ .query(sql)
+ .withHook(Hook.PLANNER, (Consumer<RelOptPlanner>) planner ->
+ planner.removeRule(ENUMERABLE_MINUS_RULE))
Review Comment:
> Can you elaborate on why you need to exclude this rule in the test?
Hi @asolimando ,because in CalcitePrepareImpl#createPlanner method,it uses
the VolcanoPlanner,and the MinusToDistinctRule and EnumerableMinusRule are
added in VolcanoPlanner,the final plan space is as follows:

EnumerableMinus plan cost is less than the plan which is rewrited by
MinusToDistinctRule,so I remove the EnumerableMinusRule,MinusToDistinctRule is
generally used as the RBO rule.
--
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]