Skip to content

Commit

Permalink
prepare stmt not infer predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniaofeiafei committed Sep 20, 2024
1 parent 2132eee commit 3ab2b20
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.nereids.rules.rewrite;

import org.apache.doris.mysql.MysqlCommand;
import org.apache.doris.nereids.jobs.JobContext;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
Expand All @@ -30,6 +31,7 @@
import org.apache.doris.nereids.util.ExpressionUtils;
import org.apache.doris.nereids.util.PlanUtils;
import org.apache.doris.nereids.util.PredicateInferUtils;
import org.apache.doris.qe.ConnectContext;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -63,6 +65,10 @@ public class InferPredicates extends DefaultPlanRewriter<JobContext> implements

@Override
public Plan rewriteRoot(Plan plan, JobContext jobContext) {
if (ConnectContext.get().getCommand() == MysqlCommand.COM_STMT_PREPARE
|| ConnectContext.get().getCommand() == MysqlCommand.COM_STMT_EXECUTE) {
return plan;
}
return plan.accept(this, jobContext);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,124 @@ PhysicalResultSink
--filter((test_like1.a = 1) and (test_like1.c = 1))
----PhysicalOlapScan[test_like1]

-- !test_integer_cast_res --

-- !test_simple_compare_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00

-- !test_simple_compare_not_equal_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_simple_compare_datetimev2_res --

-- !test_simple_compare_not_equal_datetimev2_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_not_in_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_in_res --

-- !test_func_not_in_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_like_res --

-- !test_like_not_res --

-- !test_like_to_equal_res --

-- !test_func_not_in_and_func_equal_condition_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_between_and_res --
1 d2 3 5 1 d2 2 2

-- !test_and_res --

-- !test_or1_res --
1 d2 3 5 1 d2 2 2

-- !test_or2_res --
1 d2 3 5 1 d2 2 2

-- !test_sign_predicate_res --
1 d2 3 5 1 d2 2 2

-- !test_if_predicate_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_if_and_in_predicate_res --

-- !test_if_and_in_predicate_not_res --

-- !test_multi_slot_in_predicate1_res --
0 d2 3 5 1 d2 2 2

-- !test_multi_slot_in_predicate2_res --

-- !test_case_when_predicate_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00

-- !test_datetimev2_predicate_res --

-- !test_convert_tz_predicate_res --

-- !test_next_date_predicate_res --
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_random_nest_predicate_res --
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_random_predicate_res --
1 d2 3 5 1 d2 2 2

-- !test_predicate_map_res --
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_int_upcast_res --

-- !test_int_downcast_res --

-- !test_date_upcast_res --

-- !test_date_downcast_res --
1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00 1 01234567890123456789 3 3 0123456789 2020-01-09T10:00:01 2020-01-09 2022-08-09 2022-08-09T10:00
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_date_both_upcast1_res --

-- !test_date_both_upcast2_res --

-- !test_char_different_type1_res --

-- !test_char_different_type2_res --

-- !test_char_different_type3_res --

-- !test_char_different_type4_res --

-- !test_cast_and_func_res --

-- !test_cast_and_func2_res --

-- !test_cast_and_func3_res --

-- !test_cast_and_func4_res --

-- !test_func_equal_and_nest_func_pred1_res --
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !test_func_equal_and_nest_func_pred2_res --
14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02 14 01234567890123456789 33 23 0123456789 2020-01-11T10:00:01 2020-01-11 2022-08-03 2022-08-09T10:00:02

-- !predicate_to_empty_relation_res --

-- !equal_table_predicate_delete_res --

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PhysicalResultSink
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.c < t2.a)
----filter((t1.c < 1))
------PhysicalOlapScan[test_like1] apply RFs: RF0
------PhysicalOlapScan[test_like1]
----filter((t2.a < 1))
------PhysicalOlapScan[test_like2]

Expand All @@ -37,17 +37,17 @@ PhysicalResultSink

-- !infer_with_equal --
PhysicalResultSink
--hashJoin[INNER_JOIN] hashCondition=((t1.a = t2.c)) otherCondition=() build RFs:RF0 c->[a];RF1 c->[a]
--hashJoin[INNER_JOIN] hashCondition=((t1.a = t2.c)) otherCondition=()
----filter((t1.a < 1))
------PhysicalOlapScan[test_like1] apply RFs: RF0 RF1
------PhysicalOlapScan[test_like1]
----filter((t2.c < 1))
------PhysicalOlapScan[test_like2]

-- !infer_4_expr --
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.a < t2.a)
----filter((t1.a < 1))
------PhysicalOlapScan[test_like1] apply RFs: RF0
------PhysicalOlapScan[test_like1]
----filter((t2.a < 1) and (t2.c < 1) and (t2.c > t2.a))
------PhysicalOlapScan[test_like2]

Expand All @@ -69,44 +69,44 @@ PhysicalResultSink
-- !remove_useless_predicate --
PhysicalResultSink
--NestedLoopJoin[CROSS_JOIN]
----PhysicalOlapScan[test_like2]
----filter((t1.a = t1.c) and (t1.a > 1))
------PhysicalOlapScan[test_like1]
----PhysicalOlapScan[test_like2]

-- !infer_long_chain_diff_table --
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.a < t2.d)
----filter((t1.a < 10))
------PhysicalOlapScan[test_like1] apply RFs: RF0
------PhysicalOlapScan[test_like1]
----filter((t2.c < 10) and (t2.c > t2.d) and (t2.d < 10))
------PhysicalOlapScan[test_like2]

-- !infer_with_constant_and_columns --
PhysicalResultSink
--hashJoin[INNER_JOIN] hashCondition=((t1.a = t2.c)) otherCondition=() build RFs:RF0 c->[a];RF1 c->[a]
--hashJoin[INNER_JOIN] hashCondition=((t1.a = t2.c)) otherCondition=()
----filter((t1.a > 1))
------PhysicalOlapScan[test_like1] apply RFs: RF0 RF1
------PhysicalOlapScan[test_like1]
----filter((t2.c > 1) and (t2.d > 1) and (t2.d > t2.c))
------PhysicalOlapScan[test_like2]

-- !no_infer --
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.a < t2.d)
----PhysicalOlapScan[test_like1] apply RFs: RF0
----PhysicalOlapScan[test_like1]
----filter((t2.d > t2.c))
------PhysicalOlapScan[test_like2]

-- !no_infer_cyclic_dependency --
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.a < t2.c)(t2.c < t1.a)
----PhysicalOlapScan[test_like1] apply RFs: RF0
----PhysicalOlapScan[test_like1]
----PhysicalOlapScan[test_like2]

-- !infer_multiple_conditions --
PhysicalResultSink
--NestedLoopJoin[INNER_JOIN](t1.a < t2.a)
----filter((t1.a < 10))
------PhysicalOlapScan[test_like1] apply RFs: RF0
------PhysicalOlapScan[test_like1]
----filter((t2.a < 10) and (t2.c > t2.a) and (t2.d < 10) and (t2.d > t2.c))
------PhysicalOlapScan[test_like2]

Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,74 @@ suite("extend_infer_equal_predicate") {
qt_equal_table_predicate_delete """
explain shape plan select * from test_like1 where a=1 and c=1;
"""

qt_test_integer_cast_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_tinyint where t1.d_tinyint<10 order by t1.d_int;;"""
qt_test_simple_compare_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int where t2.d_int<10 order by t1.d_int;"""
qt_test_simple_compare_not_equal_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int where t2.d_int!=10 order by t1.d_int;"""
qt_test_simple_compare_datetimev2_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_datetimev2=t2.d_datetimev2 where t2.d_datetimev2='2024-01-01' order by t1.d_int;;"""
qt_test_simple_compare_not_equal_datetimev2_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_datetimev2=t2.d_datetimev2 where t2.d_datetimev2!='2024-01-01' order by t1.d_int;;"""
qt_test_not_in_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int where t2.d_int not in (10,20) order by t1.d_int;"""
qt_test_in_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int where t2.d_int in (10,20) order by t1.d_int ;"""
qt_test_func_not_in_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int where abs(t2.d_int) not in (10,20) order by t1.d_int;"""
qt_test_like_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_char100=t2.d_char100 where t2.d_char100 like '012% order by t1.d_int;'"""
qt_test_like_not_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_char100=t2.d_char100 where t2.d_char100 not like '012%' order by t1.d_int;"""
qt_test_like_to_equal_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_char100=t2.d_char100 where t2.d_char100 like '012' order by t1.d_int;"""
qt_test_func_not_in_and_func_equal_condition_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on abs(t1.d_int)=abs(t2.d_int) where abs(t2.d_int) not in (10,20) order by t1.d_int;"""

qt_test_between_and_res """select * from test_like1 t1 ,test_like2 t2 where t1.a=t2.a and t1.a between 1 and 10 order by 1,2,3,4,5,6,7,8;"""
qt_test_and_res """select * from test_like1 t1 ,test_like2 t2 where t1.a=t2.a and (t1.a >=2 and t1.a<=10) order by 1,2,3,4,5,6,7,8;"""
qt_test_or1_res """select * from test_like1 t1 ,test_like2 t2 where t1.a=t2.a and not t1.a between 2 and 10 order by 1,2,3,4,5,6,7,8;"""
qt_test_or2_res """select * from test_like1 t1 ,test_like2 t2 where t1.a=t2.a and not (t1.a >=2 and t1.a<=10) order by 1,2,3,4,5,6,7,8;"""
qt_test_sign_predicate_res """select * from test_like1 t1 ,test_like2 t2 where t1.a=t2.a and sign(t1.a)>=1 order by 1,2,3,4,5,6,7,8"""
qt_test_if_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int
where case when t2.d_int not in (10,20) then true else false end order by 1,2,3,4,5,6,7,8"""
qt_test_if_and_in_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int
where if(t2.d_int =5,true, false) not in (FALSE) order by 1,2,3,4,5,6,7,8"""
qt_test_if_and_in_predicate_not_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int
where if(t2.d_int =5,true, false) !=FALSE order by 1,2,3,4,5,6,7,8"""
qt_test_multi_slot_in_predicate1_res """select * from test_like1 t1 inner join test_like2 t2 on t1.a+t1.c=t2.a+t2.c and t1.a+t1.c<10 order by 1,2,3,4,5,6,7,8"""
qt_test_multi_slot_in_predicate2_res """select * from test_like1 t1 inner join test_like2 t2 on t1.a=t2.a and t1.b=t2.b and t1.a+t1.b<10 order by 1,2,3,4,5,6,7,8"""
qt_test_case_when_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_int
where case when t2.d_int=1 then true when t2.d_int=2 then false else false end order by t1.d_int"""
qt_test_datetimev2_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_datetimev2=t2.d_datetimev2 where convert_tz(date_trunc(t2.d_datetimev2, 'month'),'Asia/Shanghai','Europe/Paris')='2024-01-01' order by t1.d_int;"""

// function predicate
qt_test_convert_tz_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on t1.d_datetimev2 =t2.d_datetimev2 and convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris')>'2022-01-01' order by t1.d_int;"""
qt_test_next_date_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on t1.d_datetimev2 =t2.d_datetimev2 and day(hours_add(convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris'),10))>10 order by t1.d_int;"""
qt_test_random_nest_predicate_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on t1.d_datetimev2 =t2.d_datetimev2 and day(hours_add(convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris'),random(1,10)))>10 order by t1.d_int;"""
qt_test_random_predicate_res """select * from test_like1 t1 inner join test_like2 t2 on t1.a=t2.a and t1.a>random(10) order by 1,2,3,4,5,6,7,8;"""
qt_test_predicate_map_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on t1.d_datetimev2 =t2.d_datetimev2 and day(hours_add(convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris'),10))>10
and convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris') < '2022-01-01' order by t1.d_int;"""

// test cast
qt_test_int_upcast_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int=t2.d_tinyint where t2.d_tinyint<10 order by t1.d_int;"""
qt_test_int_downcast_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(t1.d_int as tinyint)=t2.d_tinyint where t2.d_tinyint<10 order by t1.d_int;"""
qt_test_date_upcast_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2 on t1.d_datev2 =t2.d_datetimev2 and t1.d_datev2<'2022-01-03' order by t1.d_int;"""
qt_test_date_downcast_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2 on t1.d_datev2 =cast(t2.d_datetimev2 as datev2) and t1.d_datev2<'2022-01-03' order by t1.d_int;"""
qt_test_date_both_upcast1_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2 on cast(t1.d_datev2 as datetimev2)=cast(t2.d_date as datetimev2)
and t1.d_datev2<'2022-01-03' order by t1.d_int;"""
qt_test_date_both_upcast2_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2 on cast(t1.d_datetime as datetimev2)=cast(t2.d_date as datetimev2)
and t1.d_datetime<'2022-01-03' order by t1.d_int;"""
// cast char behave differently because of substring
qt_test_char_different_type1_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_char100=t2.d_char10 and t2.d_char10>'abc' order by t1.d_int;"""
qt_test_char_different_type2_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(t1.d_char100 as char(50))=t2.d_char10 and t2.d_char10>'abc' order by t1.d_int;"""
qt_test_char_different_type3_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(t1.d_char100 as char(50))=cast(t2.d_char10 as char(50)) and t2.d_char10>'abc' order by t1.d_int;"""
qt_test_char_different_type4_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(t1.d_char100 as char(200))=cast(t2.d_char10 as char(200)) and t2.d_char10>'abc' order by t1.d_int;"""

qt_test_cast_and_func_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on abs(t1.d_int)=t2.d_tinyint where t2.d_tinyint<10 order by t1.d_int;"""
qt_test_cast_and_func2_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(abs(t1.d_int) as tinyint)=t2.d_tinyint where t2.d_tinyint<10 order by t1.d_int;"""
qt_test_cast_and_func3_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on cast(t1.d_int as tinyint)=abs(t2.d_tinyint) where abs(t2.d_tinyint)<10 order by t1.d_int;"""
qt_test_cast_and_func4_res """select * from test_cast_infer9 t1 inner join test_cast_infer9 t2 on t1.d_int =abs(t2.d_tinyint) where abs(t2.d_tinyint)<10 order by t1.d_int;"""
qt_test_func_equal_and_nest_func_pred1_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris') =convert_tz(t2.d_datetimev2,'Asia/Shanghai','Europe/Paris')
and day(hours_add(convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris'),10))>10 order by t1.d_int;"""
qt_test_func_equal_and_nest_func_pred2_res """select * from test_cast_infer9 t1 inner join test_cast_infer8 t2
on convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris') =convert_tz(t2.d_datetimev2,'Asia/Shanghai','Europe/Paris')
and day(convert_tz(t1.d_datetimev2,'Asia/Shanghai','Europe/Paris'))>10 order by t1.d_int;"""
qt_predicate_to_empty_relation_res """select * from test_like1 t1 left join test_like2 t2 on t1.a=t2.a and t2.a=1 left join test_like2 t3 on t1.a=t3.a where t1.a=2"""
qt_equal_table_predicate_delete_res """select * from test_like1 where a=1 and c=1 order by 1,2,3,4;"""
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

suite("infer_unequal_predicates") {
sql """SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'"""
sql "set runtime_filter_mode = OFF"
sql "set disable_join_reorder=true "
sql "drop table if exists test_like1"
sql """
CREATE TABLE `test_like1` (
Expand Down

0 comments on commit 3ab2b20

Please sign in to comment.