From f08212423c24529935d208a39b91609d411516e3 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Fri, 23 Jul 2021 10:48:14 +0800 Subject: [PATCH 1/2] cherry pick #26481 to release-5.0 Signed-off-by: ti-srebot --- .../testdata/stable_result_mode_suite_in.json | 6 ++++ .../stable_result_mode_suite_out.json | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/planner/core/testdata/stable_result_mode_suite_in.json b/planner/core/testdata/stable_result_mode_suite_in.json index 6ec585e9f594d..3844e0dcfad10 100644 --- a/planner/core/testdata/stable_result_mode_suite_in.json +++ b/planner/core/testdata/stable_result_mode_suite_in.json @@ -63,7 +63,13 @@ "select b from t1 where b in (1, 2, 3, 4)", "select * from t1 where a > 10 union all select * from t2 where b > 20", "select * from t1 where a > 10 union distinct select * from t2 where b > 20", +<<<<<<< HEAD:planner/core/testdata/stable_result_mode_suite_in.json "select row_number() over(partition by a) as row_no, sum(b) over(partition by a) as sum_b from t1", +======= + "select * from t1 where a > 10 intersect select * from t2 where b > 20", + "select * from t1 where a > 10 except select * from t2 where b > 20", + "select sum(b) over(partition by a) as sum_b from t1", +>>>>>>> 1c088522c... planner: fix the unstable test TestOrderedResultModeOnOtherOperators (#26481):planner/core/testdata/ordered_result_mode_suite_in.json "select min(a), max(b), sum(c) from t1 group by d", "select min(a), max(b), sum(c) from t1 group by d having max(b) < 20", "select case when a=1 then 'a1' when a=2 then 'a2' else 'ax' end from t1 " diff --git a/planner/core/testdata/stable_result_mode_suite_out.json b/planner/core/testdata/stable_result_mode_suite_out.json index 469f797d5bf77..cf894cf04ba98 100644 --- a/planner/core/testdata/stable_result_mode_suite_out.json +++ b/planner/core/testdata/stable_result_mode_suite_out.json @@ -378,12 +378,42 @@ }, { "Plan": [ +<<<<<<< HEAD:planner/core/testdata/stable_result_mode_suite_out.json "Projection_10 10000.00 root Column#8, Column#7", "└─Sort_11 10000.00 root test.t1.a, Column#7, Column#8", " └─Window_13 10000.00 root row_number()->Column#8 over(partition by test.t1.a)", " └─Window_14 10000.00 root sum(cast(test.t1.b, decimal(32,0) BINARY))->Column#7 over(partition by test.t1.a)", " └─TableReader_17 10000.00 root data:TableFullScan_16", " └─TableFullScan_16 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo" +======= + "Sort_11 2666.67 root test.t1.a, test.t1.b, test.t1.c, test.t1.d", + "└─HashJoin_13 2666.67 root CARTESIAN semi join, other cond:nulleq(test.t1.a, test.t2.a), nulleq(test.t1.b, test.t2.b), nulleq(test.t1.c, test.t2.c), nulleq(test.t1.d, test.t2.d)", + " ├─TableReader_20(Build) 3333.33 root data:Selection_19", + " │ └─Selection_19 3333.33 cop[tikv] gt(test.t2.b, 20)", + " │ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─TableReader_16(Probe) 3333.33 root data:TableRangeScan_15", + " └─TableRangeScan_15 3333.33 cop[tikv] table:t1 range:(10,+inf], keep order:false, stats:pseudo" + ] + }, + { + "Plan": [ + "Sort_11 2666.67 root test.t1.a, test.t1.b, test.t1.c, test.t1.d", + "└─HashJoin_13 2666.67 root anti semi join, equal:[nulleq(test.t1.a, test.t2.a) nulleq(test.t1.b, test.t2.b) nulleq(test.t1.c, test.t2.c) nulleq(test.t1.d, test.t2.d)]", + " ├─TableReader_20(Build) 3333.33 root data:Selection_19", + " │ └─Selection_19 3333.33 cop[tikv] gt(test.t2.b, 20)", + " │ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─TableReader_16(Probe) 3333.33 root data:TableRangeScan_15", + " └─TableRangeScan_15 3333.33 cop[tikv] table:t1 range:(10,+inf], keep order:false, stats:pseudo" + ] + }, + { + "Plan": [ + "Projection_8 10000.00 root Column#6", + "└─Sort_9 10000.00 root test.t1.b, test.t1.a, Column#6", + " └─Window_11 10000.00 root sum(cast(test.t1.b, decimal(32,0) BINARY))->Column#6 over(partition by test.t1.a)", + " └─TableReader_13 10000.00 root data:TableFullScan_12", + " └─TableFullScan_12 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo" +>>>>>>> 1c088522c... planner: fix the unstable test TestOrderedResultModeOnOtherOperators (#26481):planner/core/testdata/ordered_result_mode_suite_out.json ] }, { From 7961c18fb36aa82d62042553017e259eb6320bf4 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Fri, 17 Dec 2021 14:38:55 +0800 Subject: [PATCH 2/2] fixup --- .../testdata/stable_result_mode_suite_in.json | 6 ---- .../stable_result_mode_suite_out.json | 31 ------------------- 2 files changed, 37 deletions(-) diff --git a/planner/core/testdata/stable_result_mode_suite_in.json b/planner/core/testdata/stable_result_mode_suite_in.json index 3844e0dcfad10..9d81da36e4aed 100644 --- a/planner/core/testdata/stable_result_mode_suite_in.json +++ b/planner/core/testdata/stable_result_mode_suite_in.json @@ -63,13 +63,7 @@ "select b from t1 where b in (1, 2, 3, 4)", "select * from t1 where a > 10 union all select * from t2 where b > 20", "select * from t1 where a > 10 union distinct select * from t2 where b > 20", -<<<<<<< HEAD:planner/core/testdata/stable_result_mode_suite_in.json - "select row_number() over(partition by a) as row_no, sum(b) over(partition by a) as sum_b from t1", -======= - "select * from t1 where a > 10 intersect select * from t2 where b > 20", - "select * from t1 where a > 10 except select * from t2 where b > 20", "select sum(b) over(partition by a) as sum_b from t1", ->>>>>>> 1c088522c... planner: fix the unstable test TestOrderedResultModeOnOtherOperators (#26481):planner/core/testdata/ordered_result_mode_suite_in.json "select min(a), max(b), sum(c) from t1 group by d", "select min(a), max(b), sum(c) from t1 group by d having max(b) < 20", "select case when a=1 then 'a1' when a=2 then 'a2' else 'ax' end from t1 " diff --git a/planner/core/testdata/stable_result_mode_suite_out.json b/planner/core/testdata/stable_result_mode_suite_out.json index cf894cf04ba98..4a65f25d8a84b 100644 --- a/planner/core/testdata/stable_result_mode_suite_out.json +++ b/planner/core/testdata/stable_result_mode_suite_out.json @@ -378,42 +378,11 @@ }, { "Plan": [ -<<<<<<< HEAD:planner/core/testdata/stable_result_mode_suite_out.json - "Projection_10 10000.00 root Column#8, Column#7", - "└─Sort_11 10000.00 root test.t1.a, Column#7, Column#8", - " └─Window_13 10000.00 root row_number()->Column#8 over(partition by test.t1.a)", - " └─Window_14 10000.00 root sum(cast(test.t1.b, decimal(32,0) BINARY))->Column#7 over(partition by test.t1.a)", - " └─TableReader_17 10000.00 root data:TableFullScan_16", - " └─TableFullScan_16 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo" -======= - "Sort_11 2666.67 root test.t1.a, test.t1.b, test.t1.c, test.t1.d", - "└─HashJoin_13 2666.67 root CARTESIAN semi join, other cond:nulleq(test.t1.a, test.t2.a), nulleq(test.t1.b, test.t2.b), nulleq(test.t1.c, test.t2.c), nulleq(test.t1.d, test.t2.d)", - " ├─TableReader_20(Build) 3333.33 root data:Selection_19", - " │ └─Selection_19 3333.33 cop[tikv] gt(test.t2.b, 20)", - " │ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader_16(Probe) 3333.33 root data:TableRangeScan_15", - " └─TableRangeScan_15 3333.33 cop[tikv] table:t1 range:(10,+inf], keep order:false, stats:pseudo" - ] - }, - { - "Plan": [ - "Sort_11 2666.67 root test.t1.a, test.t1.b, test.t1.c, test.t1.d", - "└─HashJoin_13 2666.67 root anti semi join, equal:[nulleq(test.t1.a, test.t2.a) nulleq(test.t1.b, test.t2.b) nulleq(test.t1.c, test.t2.c) nulleq(test.t1.d, test.t2.d)]", - " ├─TableReader_20(Build) 3333.33 root data:Selection_19", - " │ └─Selection_19 3333.33 cop[tikv] gt(test.t2.b, 20)", - " │ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader_16(Probe) 3333.33 root data:TableRangeScan_15", - " └─TableRangeScan_15 3333.33 cop[tikv] table:t1 range:(10,+inf], keep order:false, stats:pseudo" - ] - }, - { - "Plan": [ "Projection_8 10000.00 root Column#6", "└─Sort_9 10000.00 root test.t1.b, test.t1.a, Column#6", " └─Window_11 10000.00 root sum(cast(test.t1.b, decimal(32,0) BINARY))->Column#6 over(partition by test.t1.a)", " └─TableReader_13 10000.00 root data:TableFullScan_12", " └─TableFullScan_12 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo" ->>>>>>> 1c088522c... planner: fix the unstable test TestOrderedResultModeOnOtherOperators (#26481):planner/core/testdata/ordered_result_mode_suite_out.json ] }, {