xiedeyantu commented on code in PR #4715:
URL: https://github.com/apache/calcite/pull/4715#discussion_r2655139009


##########
core/src/test/resources/sql/planner.iq:
##########
@@ -310,75 +310,6 @@ EnumerableMinus(all=[false])
     EnumerableValues(tuples=[[{ 1.0 }, { 4.0 }, { null }]])
 !plan
 
-# Test predicate push down with/without expand disjunction.
-with t1 (id1, col11, col12) as (values (1, 11, 111), (2, 12, 122), (3, 13, 
133), (4, 14, 144), (5, 15, 155)),
-t2 (id2, col21, col22) as (values (1, 21, 211), (2, 22, 222), (3, 23, 233), 
(4, 24, 244), (5, 25, 255)),
-t3 (id3, col31, col32) as (values (1, 31, 311), (2, 32, 322), (3, 33, 333), 
(4, 34, 344), (5, 35, 355))
-select * from t1, t2, t3 where id1 = id2 and id1 = id3 and
-(
-(col11 > 11 and col31 <= 32)
-or
-(col22 < 255 and col32 >= 344)
-);
-+-----+-------+-------+-----+-------+-------+-----+-------+-------+
-| ID1 | COL11 | COL12 | ID2 | COL21 | COL22 | ID3 | COL31 | COL32 |
-+-----+-------+-------+-----+-------+-------+-----+-------+-------+
-|   2 |    12 |   122 |   2 |    22 |   222 |   2 |    32 |   322 |
-|   4 |    14 |   144 |   4 |    24 |   244 |   4 |    34 |   344 |
-+-----+-------+-------+-----+-------+-------+-----+-------+-------+
-(2 rows)
-
-!ok
-
-EnumerableMergeJoin(condition=[AND(=($0, $6), OR(AND(>($1, 11), <=($7, 32)), 
AND(<($5, 255), >=($8, 344))))], joinType=[inner])
-  EnumerableMergeJoin(condition=[=($0, $3)], joinType=[inner])
-    EnumerableValues(tuples=[[{ 1, 11, 111 }, { 2, 12, 122 }, { 3, 13, 133 }, 
{ 4, 14, 144 }, { 5, 15, 155 }]])
-    EnumerableValues(tuples=[[{ 1, 21, 211 }, { 2, 22, 222 }, { 3, 23, 233 }, 
{ 4, 24, 244 }, { 5, 25, 255 }]])
-  EnumerableValues(tuples=[[{ 1, 31, 311 }, { 2, 32, 322 }, { 3, 33, 333 }, { 
4, 34, 344 }, { 5, 35, 355 }]])
-!plan
-
-!set planner-rules "
-+CoreRules.EXPAND_FILTER_DISJUNCTION_LOCAL"

Review Comment:
   Because the new disjoint algorithm performs 
[FILTER_INTO_JOIN](https://github.com/apache/calcite/blob/6ba1b536a6a17de776386681b45a9d4c0d7cf2a7/core/src/main/java/org/apache/calcite/sql2rel/TopDownGeneralDecorrelator.java#L221)
 before and after execution, the `EXPAND_FILTER_DISJUNCTION_LOCAL` rule fails 
to take effect, leading to plan inconsistencies. Furthermore, 
`EXPAND_JOIN_DISJUNCTION_LOCAL` creates an infinite loop in the Volcano 
planner, making it unsuitable for `planner.iq`. Therefore, I moved it to 
`hep.iq`, allowing the Hep planner to perform the validation, which then 
executes the SQL correctly.



-- 
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]

Reply via email to