@@ -310,75 +310,6 @@ EnumerableMinus(all=[false])
310310 EnumerableValues(tuples=[[{ 1.0 }, { 4.0 }, { null }]])
311311!plan
312312
313- # Test predicate push down with/without expand disjunction.
314- with t1 (id1, col11, col12) as (values (1, 11, 111), (2, 12, 122), (3, 13, 133), (4, 14, 144), (5, 15, 155)),
315- t2 (id2, col21, col22) as (values (1, 21, 211), (2, 22, 222), (3, 23, 233), (4, 24, 244), (5, 25, 255)),
316- t3 (id3, col31, col32) as (values (1, 31, 311), (2, 32, 322), (3, 33, 333), (4, 34, 344), (5, 35, 355))
317- select * from t1, t2, t3 where id1 = id2 and id1 = id3 and
318- (
319- (col11 > 11 and col31 <= 32)
320- or
321- (col22 < 255 and col32 >= 344)
322- );
323- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
324- | ID1 | COL11 | COL12 | ID2 | COL21 | COL22 | ID3 | COL31 | COL32 |
325- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
326- | 2 | 12 | 122 | 2 | 22 | 222 | 2 | 32 | 322 |
327- | 4 | 14 | 144 | 4 | 24 | 244 | 4 | 34 | 344 |
328- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
329- (2 rows)
330-
331- !ok
332-
333- EnumerableMergeJoin(condition=[AND(=($0, $6), OR(AND(>($1, 11), <=($7, 32)), AND(<($5, 255), >=($8, 344))))], joinType=[inner])
334- EnumerableMergeJoin(condition=[=($0, $3)], joinType=[inner])
335- EnumerableValues(tuples=[[{ 1, 11, 111 }, { 2, 12, 122 }, { 3, 13, 133 }, { 4, 14, 144 }, { 5, 15, 155 }]])
336- EnumerableValues(tuples=[[{ 1, 21, 211 }, { 2, 22, 222 }, { 3, 23, 233 }, { 4, 24, 244 }, { 5, 25, 255 }]])
337- EnumerableValues(tuples=[[{ 1, 31, 311 }, { 2, 32, 322 }, { 3, 33, 333 }, { 4, 34, 344 }, { 5, 35, 355 }]])
338- !plan
339-
340- !set planner-rules "
341- +CoreRules.EXPAND_FILTER_DISJUNCTION_LOCAL"
342-
343- with t1 (id1, col11, col12) as (values (1, 11, 111), (2, 12, 122), (3, 13, 133), (4, 14, 144), (5, 15, 155)),
344- t2 (id2, col21, col22) as (values (1, 21, 211), (2, 22, 222), (3, 23, 233), (4, 24, 244), (5, 25, 255)),
345- t3 (id3, col31, col32) as (values (1, 31, 311), (2, 32, 322), (3, 33, 333), (4, 34, 344), (5, 35, 355))
346- select * from t1, t2, t3 where id1 = id2 and id1 = id3 and
347- (
348- (col11 > 11 and col31 <= 32)
349- or
350- (col22 < 255 and col32 >= 344)
351- );
352- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
353- | ID1 | COL11 | COL12 | ID2 | COL21 | COL22 | ID3 | COL31 | COL32 |
354- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
355- | 2 | 12 | 122 | 2 | 22 | 222 | 2 | 32 | 322 |
356- | 4 | 14 | 144 | 4 | 24 | 244 | 4 | 34 | 344 |
357- +-----+-------+-------+-----+-------+-------+-----+-------+-------+
358- (2 rows)
359-
360- !ok
361-
362- !if (use_old_decorr) {
363- EnumerableHashJoin(condition=[AND(=($0, $6), OR(AND(>($1, 11), <=($7, 32)), AND(<($5, 255), >=($8, 344))))], joinType=[inner])
364- EnumerableMergeJoin(condition=[AND(=($0, $3), OR(>($1, 11), <($5, 255)))], joinType=[inner])
365- EnumerableValues(tuples=[[{ 1, 11, 111 }, { 2, 12, 122 }, { 3, 13, 133 }, { 4, 14, 144 }, { 5, 15, 155 }]])
366- EnumerableValues(tuples=[[{ 1, 21, 211 }, { 2, 22, 222 }, { 3, 23, 233 }, { 4, 24, 244 }, { 5, 25, 255 }]])
367- EnumerableCalc(expr#0..2=[{inputs}], expr#3=[32], expr#4=[<=($t1, $t3)], expr#5=[344], expr#6=[>=($t2, $t5)], expr#7=[OR($t4, $t6)], proj#0..2=[{exprs}], $condition=[$t7])
368- EnumerableValues(tuples=[[{ 1, 31, 311 }, { 2, 32, 322 }, { 3, 33, 333 }, { 4, 34, 344 }, { 5, 35, 355 }]])
369- !plan
370- !}
371-
372- !if (use_new_decorr) {
373- EnumerableMergeJoin(condition=[AND(=($0, $6), OR(AND(>($1, 11), <=($7, 32)), AND(<($5, 255), >=($8, 344))))], joinType=[inner])
374- EnumerableMergeJoin(condition=[=($0, $3)], joinType=[inner])
375- EnumerableValues(tuples=[[{ 1, 11, 111 }, { 2, 12, 122 }, { 3, 13, 133 }, { 4, 14, 144 }, { 5, 15, 155 }]])
376- EnumerableValues(tuples=[[{ 1, 21, 211 }, { 2, 22, 222 }, { 3, 23, 233 }, { 4, 24, 244 }, { 5, 25, 255 }]])
377- EnumerableValues(tuples=[[{ 1, 31, 311 }, { 2, 32, 322 }, { 3, 33, 333 }, { 4, 34, 344 }, { 5, 35, 355 }]])
378- !plan
379- !}
380- !set planner-rules original
381-
382313# [CALCITE-7086] Implement a rule that performs the inverse operation of AggregateCaseToFilterRule
383314# Refer to RelToSqlConverterTest.testAggregateFilterToCase(). The following two SQL
384315# represent the true filtered Aggregate and the case-style Aggregate converted by AggregateFilterToCaseRule.
0 commit comments