From 4fa0e304056bcd4ef1f824e8b7e1de85451e80d1 Mon Sep 17 00:00:00 2001 From: minghong Date: Mon, 29 Jul 2024 14:05:55 +0800 Subject: [PATCH] update regression case for eager-agg --- .../push_down_count_through_join.out | 52 +++++++++---------- .../push_down_max_through_join.out | 22 ++++---- .../push_down_min_through_join.out | 22 ++++---- .../push_down_sum_through_join.out | 22 ++++---- .../push_down_sum_through_join_one_side.out | 22 ++++---- .../push_down_count_through_join.groovy | 8 +-- 6 files changed, 68 insertions(+), 80 deletions(-) diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out index 4a12c8d638a4e74..66649e2c54d88a9 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out @@ -106,15 +106,14 @@ PhysicalResultSink --------PhysicalOlapScan[count_t] --------PhysicalOlapScan[count_t] --- !groupby_pushdown_multi_table_join -- +-- !groupby_pushdown_multi_table_join_1 -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[count_t] -----------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] --------PhysicalOlapScan[count_t] +------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -318,15 +317,14 @@ PhysicalResultSink ----------PhysicalOlapScan[count_t] ----------PhysicalOlapScan[count_t] --- !groupby_pushdown_multi_table_join -- +-- !groupby_pushdown_multi_table_join_2 -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[count_t] -----------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] --------PhysicalOlapScan[count_t] +------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -571,15 +569,14 @@ Used: UnUsed: use_push_down_agg_through_join SyntaxError: --- !with_hint_groupby_pushdown_multi_table_join -- +-- !with_hint_groupby_pushdown_multi_table_join_1 -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[count_t] -----------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] --------PhysicalOlapScan[count_t] +------PhysicalOlapScan[count_t] Hint log: Used: @@ -908,15 +905,14 @@ Used: UnUsed: use_push_down_agg_through_join SyntaxError: --- !with_hint_groupby_pushdown_multi_table_join -- +-- !with_hint_groupby_pushdown_multi_table_join_2 -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[count_t] -----------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] --------PhysicalOlapScan[count_t] +------PhysicalOlapScan[count_t] Hint log: Used: diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out index 281de8ea61b88e6..d68e38240616883 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_max_through_join.out @@ -108,13 +108,12 @@ PhysicalResultSink -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[max_t] -----------PhysicalOlapScan[max_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] --------PhysicalOlapScan[max_t] +------PhysicalOlapScan[max_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -393,13 +392,12 @@ SyntaxError: -- !with_hint_groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[max_t] -----------PhysicalOlapScan[max_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] --------PhysicalOlapScan[max_t] +------PhysicalOlapScan[max_t] Hint log: Used: diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out index d4efe7df0935039..ff979df292c8c97 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_min_through_join.out @@ -108,13 +108,12 @@ PhysicalResultSink -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[min_t] -----------PhysicalOlapScan[min_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] --------PhysicalOlapScan[min_t] +------PhysicalOlapScan[min_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -393,13 +392,12 @@ SyntaxError: -- !with_hint_groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[min_t] -----------PhysicalOlapScan[min_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] --------PhysicalOlapScan[min_t] +------PhysicalOlapScan[min_t] Hint log: Used: diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out index 9d20fb8b02dd52b..4c31da33494dbe8 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out @@ -108,13 +108,12 @@ PhysicalResultSink -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[sum_t] -----------PhysicalOlapScan[sum_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] --------PhysicalOlapScan[sum_t] +------PhysicalOlapScan[sum_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -393,13 +392,12 @@ SyntaxError: -- !with_hint_groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[sum_t] -----------PhysicalOlapScan[sum_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] --------PhysicalOlapScan[sum_t] +------PhysicalOlapScan[sum_t] Hint log: Used: diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out index 5013dc7dbdfb93d..3a9f9a42edfd2d9 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.out @@ -108,13 +108,12 @@ PhysicalResultSink -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[sum_t_one_side] -----------PhysicalOlapScan[sum_t_one_side] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] --------PhysicalOlapScan[sum_t_one_side] +------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_with_order_by -- PhysicalResultSink @@ -393,13 +392,12 @@ SyntaxError: -- !with_hint_groupby_pushdown_multi_table_join -- PhysicalResultSink ---hashAgg[GLOBAL] -----hashAgg[LOCAL] -------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() ---------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------PhysicalOlapScan[sum_t_one_side] -----------PhysicalOlapScan[sum_t_one_side] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] --------PhysicalOlapScan[sum_t_one_side] +------PhysicalOlapScan[sum_t_one_side] Hint log: Used: diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy index 33b2f888f155f74..d6ee21b213d0795 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join.groovy @@ -100,7 +100,7 @@ suite("push_down_count_through_join") { explain shape plan select count(t1.score), count(*), max(t1.score) from count_t t1 join count_t t2 on t1.id = t2.id group by t1.name; """ - qt_groupby_pushdown_multi_table_join """ + qt_groupby_pushdown_multi_table_join_1 """ explain shape plan select count(t1.score) from count_t t1 join count_t t2 on t1.id = t2.id join count_t t3 on t1.name = t3.name group by t1.name; """ @@ -201,7 +201,7 @@ suite("push_down_count_through_join") { explain shape plan select count(*) from count_t t1, count_t t2 where t1.id = t2.id group by t1.name having count(*) > 100; """ - qt_groupby_pushdown_multi_table_join """ + qt_groupby_pushdown_multi_table_join_2 """ explain shape plan select count(*) from count_t t1 join count_t t2 on t1.id = t2.id join count_t t3 on t1.name = t3.name group by t1.name; """ @@ -289,7 +289,7 @@ suite("push_down_count_through_join") { explain shape plan select /*+ USE_CBO_RULE(push_down_agg_through_join) */ count(t1.score), count(*), max(t1.score) from count_t t1 join count_t t2 on t1.id = t2.id group by t1.name; """ - qt_with_hint_groupby_pushdown_multi_table_join """ + qt_with_hint_groupby_pushdown_multi_table_join_1 """ explain shape plan select /*+ USE_CBO_RULE(push_down_agg_through_join) */ count(t1.score) from count_t t1 join count_t t2 on t1.id = t2.id join count_t t3 on t1.name = t3.name group by t1.name; """ @@ -390,7 +390,7 @@ suite("push_down_count_through_join") { explain shape plan select /*+ USE_CBO_RULE(push_down_agg_through_join) */ count(*) from count_t t1, count_t t2 where t1.id = t2.id group by t1.name having count(*) > 100; """ - qt_with_hint_groupby_pushdown_multi_table_join """ + qt_with_hint_groupby_pushdown_multi_table_join_2 """ explain shape plan select /*+ USE_CBO_RULE(push_down_agg_through_join) */ count(*) from count_t t1 join count_t t2 on t1.id = t2.id join count_t t3 on t1.name = t3.name group by t1.name; """