From 2a81d238f5b7791341ffc3873eac08d4ca6f8c00 Mon Sep 17 00:00:00 2001 From: jakevin Date: Wed, 20 Dec 2023 14:41:49 +0800 Subject: [PATCH] [test](Nereids): remove shape plan project and distribute in eager test (#28701) --- .../push_down_count_through_join.out | 883 +++++++----------- .../push_down_count_through_join_one_side.out | 797 ++++++---------- .../push_down_max_through_join.out | 439 +++------ .../push_down_min_through_join.out | 439 +++------ .../push_down_sum_through_join.out | 467 ++++----- .../push_down_sum_through_join_one_side.out | 439 +++------ .../push_down_count_through_join.groovy | 1 + ...sh_down_count_through_join_one_side.groovy | 1 + .../push_down_max_through_join.groovy | 1 + .../push_down_min_through_join.groovy | 1 + .../push_down_sum_through_join.groovy | 1 + ...push_down_sum_through_join_one_side.groovy | 1 + 12 files changed, 1225 insertions(+), 2245 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 bde67d5c1657f5..7cdf0f16d0fd5b 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 @@ -1,716 +1,461 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((count_t.score > 10)) ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((count_t.score > 10)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((count_t.score > 10)) ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((count_t.score > 10)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((count(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[count_t] -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t] +--filter((count(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[count_t] +----------hashAgg[LOCAL] +------------PhysicalOlapScan[count_t] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[count_t] -----------------------hashAgg[LOCAL] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[count_t] -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[count_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t] ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t] ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[count_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[count_t] -----------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------hashAgg[LOCAL] -------------------filter((count_t.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[count_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((count_t.id < 100)) -----------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------hashAgg[LOCAL] +----------filter((count_t.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[count_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((count_t.id < 100)) +------------PhysicalOlapScan[count_t] -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((count_t.score > 10)) -----------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((count_t.score > 10)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((count_t.score > 10)) -----------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((count_t.score > 10)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((count(*) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t] -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t] +--filter((count(*) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[count_t] +----------hashAgg[LOCAL] +------------PhysicalOlapScan[count_t] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[count_t] -----------------------hashAgg[LOCAL] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[count_t] -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((t1.score > 50)) -----------------------PhysicalOlapScan[count_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[count_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[count_t] -----------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[count_t] +--------PhysicalOlapScan[count_t] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((count_t.score > 20) and (t1.id < 100)) -----------------------PhysicalOlapScan[count_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((count_t.id < 100)) -----------------------PhysicalOlapScan[count_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------hashAgg[LOCAL] +----------filter((count_t.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[count_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((count_t.id < 100)) +------------PhysicalOlapScan[count_t] diff --git a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out index 487763d55dbab4..c28f225c99ef84 100644 --- a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out +++ b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.out @@ -1,672 +1,417 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((count_t_one_side.score > 10)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((count_t_one_side.score > 10)) +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((count_t_one_side.score > 10)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((count_t_one_side.score > 10)) +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((count(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[count_t_one_side] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t_one_side] +--filter((count(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[count_t_one_side] +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[count_t_one_side] -----------------------PhysicalProject -------------------------PhysicalOlapScan[count_t_one_side] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t_one_side] +------------PhysicalOlapScan[count_t_one_side] +------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[count_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t_one_side] +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t_one_side] ---------------PhysicalProject -----------------PhysicalOlapScan[count_t_one_side] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t_one_side] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t_one_side] ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[count_t_one_side] +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[count_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[count_t_one_side] +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------filter((count_t_one_side.id < 100)) ---------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((count_t_one_side.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((count_t_one_side.id < 100)) +----------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((count_t_one_side.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------PhysicalProject -------------------filter((count_t_one_side.score > 10)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------filter((count_t_one_side.score > 10)) +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------PhysicalProject -------------------filter((count_t_one_side.score > 10)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------filter((count_t_one_side.score > 10)) +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((count(*) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t_one_side] -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t_one_side] +--filter((count(*) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[count_t_one_side] +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[count_t_one_side] +--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_one_side] +----------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[count_t_one_side] +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------PhysicalProject -----------------PhysicalOlapScan[count_t_one_side] ---------------PhysicalProject -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------PhysicalProject -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------filter((t1.score > 50)) +----------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[count_t_one_side] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[count_t_one_side] +------------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[count_t_one_side] -----------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[count_t_one_side] +--------PhysicalOlapScan[count_t_one_side] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------filter((count_t_one_side.id < 100)) ---------------------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 -----------------PhysicalProject -------------------filter((count_t_one_side.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[count_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((count_t_one_side.id < 100)) +----------PhysicalOlapScan[count_t_one_side] apply RFs: RF0 +--------filter((count_t_one_side.score > 20) and (t1.id < 100)) +----------PhysicalOlapScan[count_t_one_side] 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 3bc9c52d47e869..c0bf3d4108dea3 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 @@ -1,366 +1,237 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] -----------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((max_t.score > 10)) ---------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[max_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((max_t.score > 10)) +------------PhysicalOlapScan[max_t] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((max_t.score > 10)) ---------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[max_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((max_t.score > 10)) +------------PhysicalOlapScan[max_t] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((max(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[max_t] -------------------PhysicalProject ---------------------PhysicalOlapScan[max_t] +--filter((max(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[max_t] +----------PhysicalOlapScan[max_t] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[max_t] -----------------------PhysicalProject -------------------------PhysicalOlapScan[max_t] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[max_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[max_t] +------------PhysicalOlapScan[max_t] +------PhysicalOlapScan[max_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[max_t] ---------------------PhysicalProject -----------------------PhysicalOlapScan[max_t] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[max_t] +------------PhysicalOlapScan[max_t] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[max_t] ---------------PhysicalProject -----------------PhysicalOlapScan[max_t] +----------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[max_t] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[max_t] ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[max_t] +----------PhysicalOlapScan[max_t] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[max_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[max_t] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[max_t] ---------------------PhysicalProject -----------------------PhysicalOlapScan[max_t] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[max_t] +------------PhysicalOlapScan[max_t] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[max_t] -----------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] -----------------PhysicalProject -------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[max_t] +--------PhysicalOlapScan[max_t] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------filter((max_t.id < 100)) ---------------------PhysicalOlapScan[max_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((max_t.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[max_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((max_t.id < 100)) +----------PhysicalOlapScan[max_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((max_t.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[max_t] 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 891466033e15c1..46126279efab52 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 @@ -1,366 +1,237 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] -----------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((min_t.score > 10)) ---------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[min_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((min_t.score > 10)) +------------PhysicalOlapScan[min_t] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((min_t.score > 10)) ---------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[min_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((min_t.score > 10)) +------------PhysicalOlapScan[min_t] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((min(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[min_t] -------------------PhysicalProject ---------------------PhysicalOlapScan[min_t] +--filter((min(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[min_t] +----------PhysicalOlapScan[min_t] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[min_t] -----------------------PhysicalProject -------------------------PhysicalOlapScan[min_t] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[min_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[min_t] +------------PhysicalOlapScan[min_t] +------PhysicalOlapScan[min_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[min_t] ---------------------PhysicalProject -----------------------PhysicalOlapScan[min_t] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[min_t] +------------PhysicalOlapScan[min_t] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[min_t] ---------------PhysicalProject -----------------PhysicalOlapScan[min_t] +----------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[min_t] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[min_t] ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[min_t] +----------PhysicalOlapScan[min_t] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[min_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[min_t] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[min_t] ---------------------PhysicalProject -----------------------PhysicalOlapScan[min_t] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[min_t] +------------PhysicalOlapScan[min_t] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[min_t] -----------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] -----------------PhysicalProject -------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[min_t] +--------PhysicalOlapScan[min_t] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------filter((min_t.id < 100)) ---------------------PhysicalOlapScan[min_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((min_t.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[min_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((min_t.id < 100)) +----------PhysicalOlapScan[min_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((min_t.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[min_t] 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 6dca4f076c8240..8415bcaf99d642 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 @@ -1,379 +1,250 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] -----------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((sum_t.score > 10)) ---------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((sum_t.score > 10)) +------------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((sum_t.score > 10)) ---------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((sum_t.score > 10)) +------------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((sum(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[sum_t] -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[sum_t] +--filter((sum(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[sum_t] +----------hashAgg[LOCAL] +------------PhysicalOlapScan[sum_t] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[sum_t] -----------------------hashAgg[LOCAL] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[sum_t] -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[sum_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[sum_t] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[sum_t] ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------PhysicalOlapScan[sum_t] ---------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[sum_t] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[sum_t] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[sum_t] -----------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t] +--------PhysicalOlapScan[sum_t] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------hashAgg[LOCAL] -------------------filter((sum_t.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[sum_t] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------filter((sum_t.id < 100)) -----------------------PhysicalOlapScan[sum_t] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------hashAgg[LOCAL] +----------filter((sum_t.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[sum_t] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((sum_t.id < 100)) +------------PhysicalOlapScan[sum_t] 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 873f67fabb4352..b11f8ba92c3e79 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 @@ -1,366 +1,237 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !groupby_pushdown_basic -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_left_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_right_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_full_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_complex_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=((t1.name < t2.name)) +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((sum_t_one_side.score > 10)) ---------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((sum_t_one_side.score > 10)) +------------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_deep_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((sum_t_one_side.score > 10)) ---------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((sum_t_one_side.score > 10)) +------------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_having -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------filter((sum(score) > 100)) ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------hashAgg[LOCAL] ---------------------PhysicalOlapScan[sum_t_one_side] -------------------PhysicalProject ---------------------PhysicalOlapScan[sum_t_one_side] +--filter((sum(score) > 100)) +----hashAgg[GLOBAL] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------hashAgg[LOCAL] +------------PhysicalOlapScan[sum_t_one_side] +----------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_mixed_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_multi_table_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------hashAgg[LOCAL] -------------------------PhysicalOlapScan[sum_t_one_side] -----------------------PhysicalProject -------------------------PhysicalOlapScan[sum_t_one_side] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[LOCAL] +----hashJoin[INNER_JOIN] hashCondition=((t1.name = t3.name)) otherCondition=() +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t_one_side] +------------PhysicalOlapScan[sum_t_one_side] +------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_with_order_by -- PhysicalResultSink ---PhysicalProject -----PhysicalQuickSort[MERGE_SORT] -------PhysicalDistribute ---------PhysicalQuickSort[LOCAL_SORT] -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[sum_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[sum_t_one_side] +--PhysicalQuickSort[MERGE_SORT] +----PhysicalQuickSort[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t_one_side] +------------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_equal_conditions_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_equal_conditions_non_aggregate_selection -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[sum_t_one_side] ---------------PhysicalProject -----------------PhysicalOlapScan[sum_t_one_side] +----------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_equal_conditions_non_aggregate_selection_with_aggregate -- PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t_one_side] --------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.name = t2.name)) otherCondition=() ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[sum_t_one_side] ---------------hashAgg[LOCAL] -----------------PhysicalOlapScan[sum_t_one_side] +----------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_with_where_clause -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((t1.score > 50)) ---------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((t1.score > 50)) +------------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_varied_aggregates -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_with_order_by_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------hashAgg[LOCAL] -----------------------PhysicalOlapScan[sum_t_one_side] ---------------------PhysicalProject -----------------------PhysicalOlapScan[sum_t_one_side] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[sum_t_one_side] +------------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_alias_multiple_equal_conditions -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() -----------------hashAgg[LOCAL] -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1_alias.id = t2_alias.id) and (t1_alias.name = t2_alias.name)) otherCondition=() +--------hashAgg[LOCAL] +----------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_complex_join_condition -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) -----------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id) and (t1.score = t2.score)) otherCondition=(( not (name = name))) +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_function_processed_columns -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] -----------------PhysicalProject -------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[sum_t_one_side] +--------PhysicalOlapScan[sum_t_one_side] -- !groupby_pushdown_nested_queries -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashAgg[GLOBAL] ---------PhysicalDistribute -----------hashAgg[LOCAL] -------------PhysicalProject ---------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -----------------PhysicalProject -------------------filter((sum_t_one_side.id < 100)) ---------------------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 -----------------hashAgg[LOCAL] -------------------filter((sum_t_one_side.score > 20) and (t1.id < 100)) ---------------------PhysicalOlapScan[sum_t_one_side] +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((sum_t_one_side.id < 100)) +----------PhysicalOlapScan[sum_t_one_side] apply RFs: RF0 +--------hashAgg[LOCAL] +----------filter((sum_t_one_side.score > 20) and (t1.id < 100)) +------------PhysicalOlapScan[sum_t_one_side] 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 8ffb44d3682be1..1414110374d84d 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 @@ -18,6 +18,7 @@ suite("push_down_count_through_join") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS count_t; diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy index d8f3e84485f0fd..3bf9febfe93e8e 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_count_through_join_one_side.groovy @@ -18,6 +18,7 @@ suite("push_down_count_through_join_one_side") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS count_t_one_side; diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy index 91079ba9de349b..40cdca48aaa80a 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_max_through_join.groovy @@ -18,6 +18,7 @@ suite("push_down_max_through_join") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS max_t; diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy index a9c8480415c8f2..906c35e19a772a 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_min_through_join.groovy @@ -18,6 +18,7 @@ suite("push_down_min_through_join") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS min_t; diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy index 4dc9917c56a0bf..4e2a13d644480d 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.groovy @@ -18,6 +18,7 @@ suite("push_down_sum_through_join") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS sum_t; diff --git a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy index 29c5376b78443c..866c755d5b0472 100644 --- a/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy +++ b/regression-test/suites/nereids_rules_p0/eager_aggregate/push_down_sum_through_join_one_side.groovy @@ -18,6 +18,7 @@ suite("push_down_sum_through_join_one_side") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" sql """ DROP TABLE IF EXISTS sum_t_one_side;