From 936428e1efeae608669d1fd771d57ea23e64a0dc Mon Sep 17 00:00:00 2001 From: jackwener Date: Wed, 20 Dec 2023 16:52:08 +0800 Subject: [PATCH] [test](Nereids): remove shape plan project and distribute in eager test --- .../eliminate_join_condition.out | 72 +- .../limit_push_down/limit_push_down.out | 1218 ++++++----------- .../limit_push_down/order_push_down.out | 1028 +++++--------- .../push_down_limit_distinct.out | 26 +- ...push_down_top_n_distinct_through_union.out | 204 +-- .../push_down_top_n_through_union.out | 267 ++-- .../eliminate_join_condition.groovy | 2 + .../limit_push_down/limit_push_down.groovy | 4 +- .../limit_push_down/order_push_down.groovy | 3 +- .../push_down_limit_distinct.groovy | 2 + ...h_down_top_n_distinct_through_union.groovy | 2 + .../push_down_top_n_through_union.groovy | 2 + 12 files changed, 973 insertions(+), 1857 deletions(-) diff --git a/regression-test/data/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.out b/regression-test/data/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.out index fad36fee64f865..4c765dcf37faf5 100644 --- a/regression-test/data/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.out +++ b/regression-test/data/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.out @@ -1,79 +1,47 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !inner_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[CROSS_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalOlapScan[t] +--NestedLoopJoin[CROSS_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !left_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_OUTER_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalOlapScan[t] +--NestedLoopJoin[LEFT_OUTER_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !right_outer_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_OUTER_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalOlapScan[t] +--NestedLoopJoin[RIGHT_OUTER_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !full_outer_join -- PhysicalResultSink ---PhysicalProject -----NestedLoopJoin[FULL_OUTER_JOIN] -------PhysicalDistribute ---------PhysicalOlapScan[t] -------PhysicalDistribute ---------PhysicalOlapScan[t] +--NestedLoopJoin[FULL_OUTER_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !left_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_SEMI_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t] +--PhysicalOlapScan[t] -- !left_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_ANTI_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t] +--PhysicalEmptyRelation -- !right_semi_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_SEMI_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t] +--NestedLoopJoin[RIGHT_SEMI_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !right_anti_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------NestedLoopJoin[LEFT_ANTI_JOIN] ---------PhysicalOlapScan[t] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t] +--NestedLoopJoin[RIGHT_ANTI_JOIN] +----PhysicalOlapScan[t] +----PhysicalOlapScan[t] -- !inner_join -- 1 1 a 1 1 a diff --git a/regression-test/data/nereids_rules_p0/limit_push_down/limit_push_down.out b/regression-test/data/nereids_rules_p0/limit_push_down/limit_push_down.out index 87e1454b65a30d..b0d6a4a0d26328 100644 --- a/regression-test/data/nereids_rules_p0/limit_push_down/limit_push_down.out +++ b/regression-test/data/nereids_rules_p0/limit_push_down/limit_push_down.out @@ -2,279 +2,185 @@ -- !limit_project -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_offset_project -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_semi_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !right_semi_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !left_anti_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !right_anti_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !full_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !left_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !right_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t2] -- !cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t1] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t2] -- !limit_offset_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_offset_agg -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------NestedLoopJoin[CROSS_JOIN] ---------------PhysicalLimit[LOCAL] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------NestedLoopJoin[CROSS_JOIN] +----------PhysicalLimit[LOCAL] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------NestedLoopJoin[CROSS_JOIN] ---------------PhysicalLimit[LOCAL] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------NestedLoopJoin[CROSS_JOIN] +----------PhysicalLimit[LOCAL] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------PhysicalLimit[LOCAL] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalLimit[LOCAL] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------PhysicalLimit[LOCAL] -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalLimit[LOCAL] +------------hashAgg[LOCAL] +--------------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] -- !limit_offset_agg -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_set_operation -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------PhysicalOlapScan[t1] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------PhysicalOlapScan[t2] -- !limit_offset_set_operation -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalIntersect -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------PhysicalIntersect +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_window -- PhysicalResultSink @@ -282,10 +188,9 @@ PhysicalResultSink ----PhysicalLimit[LOCAL] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalPartitionTopN -----------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_offset_window -- PhysicalResultSink @@ -293,82 +198,61 @@ PhysicalResultSink ----PhysicalLimit[LOCAL] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalPartitionTopN -----------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_offset_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_project_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_join_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subquery -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_subquery_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_subquery_window -- PhysicalResultSink @@ -376,744 +260,472 @@ PhysicalResultSink ----PhysicalLimit[LOCAL] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalPartitionTopN -----------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_nested_subquery -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_union_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------filter((t1.id > 100)) ---------------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------filter((t2.id > 100)) ---------------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------filter((t1.id > 100)) +------------------PhysicalOlapScan[t1] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------filter((t2.id > 100)) +------------------PhysicalOlapScan[t2] -- !limit_union_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalLimit[LOCAL] -------------------hashAgg[GLOBAL] ---------------------PhysicalDistribute -----------------------hashAgg[LOCAL] -------------------------PhysicalProject ---------------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[t1] -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[t2] -----------------PhysicalDistribute +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[GLOBAL] +----------------hashAgg[LOCAL] +------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------------PhysicalOlapScan[t1] +--------------------PhysicalOlapScan[t2] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() ------------------PhysicalLimit[LOCAL] --------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() ---------------------------PhysicalLimit[LOCAL] -----------------------------hashAgg[LOCAL] -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[t3] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[t4] +----------------------PhysicalOlapScan[t3] +------------------PhysicalOlapScan[t4] -- !limit_union_window -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------hashAgg[LOCAL] -------------PhysicalUnion ---------------PhysicalLimit[LOCAL] -----------------hashAgg[GLOBAL] -------------------PhysicalDistribute ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalWindow ---------------------------PhysicalQuickSort[MERGE_SORT] -----------------------------PhysicalDistribute -------------------------------PhysicalQuickSort[LOCAL_SORT] ---------------------------------PhysicalOlapScan[t1] ---------------PhysicalLimit[LOCAL] -----------------hashAgg[GLOBAL] -------------------PhysicalDistribute ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalWindow ---------------------------PhysicalQuickSort[MERGE_SORT] -----------------------------PhysicalDistribute -------------------------------PhysicalQuickSort[LOCAL_SORT] ---------------------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[GLOBAL] +----------------hashAgg[LOCAL] +------------------PhysicalWindow +--------------------PhysicalQuickSort[MERGE_SORT] +----------------------PhysicalQuickSort[LOCAL_SORT] +------------------------PhysicalOlapScan[t1] +------------PhysicalLimit[LOCAL] +--------------hashAgg[GLOBAL] +----------------hashAgg[LOCAL] +------------------PhysicalWindow +--------------------PhysicalQuickSort[MERGE_SORT] +----------------------PhysicalQuickSort[LOCAL_SORT] +------------------------PhysicalOlapScan[t2] -- !limit_subquery_join_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subquery_join_window -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalWindow -----------PhysicalQuickSort[LOCAL_SORT] -------------PhysicalPartitionTopN ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------PhysicalWindow +--------PhysicalQuickSort[LOCAL_SORT] +----------PhysicalPartitionTopN +------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] -- !limit_subquery_union_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------filter((t1.id > 100)) ---------------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------filter((t2.id > 100)) ---------------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------filter((t1.id > 100)) +------------------PhysicalOlapScan[t1] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------filter((t2.id > 100)) +------------------PhysicalOlapScan[t2] -- !limit_subquery_union_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t1] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[t2] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() build RFs:RF1 id->[id] ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t3] apply RFs: RF1 ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[t4] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------------PhysicalOlapScan[t1] +------------------PhysicalOlapScan[t2] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------hashJoin[INNER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() build RFs:RF1 id->[id] +------------------PhysicalOlapScan[t3] apply RFs: RF1 +------------------PhysicalOlapScan[t4] -- !limit_subquery_union_window -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalWindow +----PhysicalLimit[LOCAL] +------PhysicalWindow +--------PhysicalPartitionTopN ----------PhysicalPartitionTopN -------------PhysicalDistribute ---------------PhysicalPartitionTopN -----------------hashAgg[GLOBAL] -------------------PhysicalDistribute ---------------------hashAgg[LOCAL] -----------------------PhysicalUnion -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] +------------hashAgg[GLOBAL] +--------------hashAgg[LOCAL] +----------------PhysicalUnion +------------------PhysicalOlapScan[t1] +------------------PhysicalOlapScan[t2] -- !limit_correlated_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() ---------PhysicalProject -----------PhysicalOlapScan[t1] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t2] +--hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() +----PhysicalOlapScan[t1] +----PhysicalOlapScan[t2] -- !limit_correlated_subquery_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t3.id = t1.id)) otherCondition=() ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t3] +--hashJoin[LEFT_SEMI_JOIN] hashCondition=((t3.id = t1.id)) otherCondition=() +----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------PhysicalOlapScan[t1] +------PhysicalOlapScan[t2] +----PhysicalOlapScan[t3] -- !limit_correlated_subquery_window -- PhysicalResultSink ---PhysicalDistribute -----PhysicalWindow -------PhysicalQuickSort[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() -------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +--PhysicalWindow +----PhysicalQuickSort[LOCAL_SORT] +------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_cte_query -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalResultSink ----PhysicalLimit[GLOBAL] -------PhysicalDistribute ---------PhysicalLimit[LOCAL] -----------PhysicalDistribute -------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------PhysicalLimit[LOCAL] +--------PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_cte_query_join -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalCteAnchor ( cteId=CTEId#1 ) ----PhysicalCteProducer ( cteId=CTEId#1 ) -------PhysicalProject ---------filter((t2.id < 10)) -----------PhysicalOlapScan[t2] +------filter((t2.id < 10)) +--------PhysicalOlapScan[t2] ----PhysicalResultSink ------PhysicalLimit[GLOBAL] ---------PhysicalDistribute -----------PhysicalLimit[LOCAL] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((cte1.id = cte2.id)) otherCondition=() -----------------PhysicalDistribute -------------------PhysicalCteConsumer ( cteId=CTEId#0 ) -----------------PhysicalDistribute -------------------PhysicalCteConsumer ( cteId=CTEId#1 ) +--------PhysicalLimit[LOCAL] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((cte1.id = cte2.id)) otherCondition=() +------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------PhysicalCteConsumer ( cteId=CTEId#1 ) -- !limit_cte_query_window -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalResultSink ----PhysicalLimit[GLOBAL] ------PhysicalLimit[LOCAL] --------PhysicalWindow ----------PhysicalQuickSort[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalQuickSort[LOCAL_SORT] -----------------PhysicalPartitionTopN -------------------PhysicalDistribute ---------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------PhysicalQuickSort[LOCAL_SORT] +--------------PhysicalPartitionTopN +----------------PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_project_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_join_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subquery -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_filter -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_subquery_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_subquery_window -- PhysicalResultSink --PhysicalLimit[GLOBAL] ----PhysicalLimit[LOCAL] -------PhysicalProject ---------PhysicalWindow -----------PhysicalQuickSort[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalQuickSort[LOCAL_SORT] -----------------PhysicalPartitionTopN -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] +------PhysicalWindow +--------PhysicalQuickSort[MERGE_SORT] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_nested_subquery -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_order_by -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_order_by_offset -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_distinct -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t2] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t1] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t2] -- !limit_multiple_left_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +----PhysicalLimit[LOCAL] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------PhysicalLimit[LOCAL] +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalLimit[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +--------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_multiple_right_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF1 id->[id] -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] apply RFs: RF1 -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF1 id->[id] +--------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] apply RFs: RF1 +----------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_multiple_full_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_multiple_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] ----------NestedLoopJoin[CROSS_JOIN] ------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------NestedLoopJoin[CROSS_JOIN] -------------------PhysicalLimit[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalLimit[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +--------------PhysicalOlapScan[t1] +------------PhysicalLimit[LOCAL] +--------------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_left_outer_join_right_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] apply RFs: RF0 -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF0 id->[id] +--------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] apply RFs: RF0 +----------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_left_outer_join_full_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_left_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalLimit[LOCAL] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +--------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_right_outer_join_full_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_right_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +------------PhysicalOlapScan[t1] apply RFs: RF0 ------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] apply RFs: RF0 -------------------PhysicalDistribute ---------------------PhysicalLimit[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +--------------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_full_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t3] -- !limit_left_outer_join_right_outer_join_full_outer_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t4.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t3] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t4] +----PhysicalLimit[LOCAL] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t4.id)) otherCondition=() +--------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] +----------PhysicalOlapScan[t3] +--------PhysicalOlapScan[t4] -- !limit_left_outer_join_right_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF0 id->[id] +------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] apply RFs: RF0 +--------------PhysicalOlapScan[t2] ------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() build RFs:RF0 id->[id] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t1] apply RFs: RF0 -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] -------------------PhysicalDistribute ---------------------PhysicalLimit[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t3] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t4] +--------------PhysicalOlapScan[t3] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t4] -- !limit_left_outer_join_full_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t3] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t4] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] +------------PhysicalOlapScan[t3] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t4] -- !limit_right_outer_join_full_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------PhysicalProject -----------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t3] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalProject -------------------PhysicalOlapScan[t4] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] +------------PhysicalOlapScan[t3] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t4] -- !limit_left_outer_join_right_outer_join_full_outer_join_cross_join -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------NestedLoopJoin[CROSS_JOIN] -------------PhysicalLimit[LOCAL] ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t4.id)) otherCondition=() -----------------PhysicalDistribute -------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() ---------------------PhysicalDistribute -----------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalOlapScan[t2] ---------------------PhysicalDistribute -----------------------PhysicalOlapScan[t3] -----------------PhysicalDistribute -------------------PhysicalOlapScan[t4] -------------PhysicalDistribute ---------------PhysicalLimit[LOCAL] -----------------PhysicalOlapScan[t4] +----PhysicalLimit[LOCAL] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalLimit[LOCAL] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t4.id)) otherCondition=() +------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------------PhysicalOlapScan[t1] +----------------PhysicalOlapScan[t2] +--------------PhysicalOlapScan[t3] +------------PhysicalOlapScan[t4] +--------PhysicalLimit[LOCAL] +----------PhysicalOlapScan[t4] diff --git a/regression-test/data/nereids_rules_p0/limit_push_down/order_push_down.out b/regression-test/data/nereids_rules_p0/limit_push_down/order_push_down.out index 786441121025ac..f157b03fc82217 100644 --- a/regression-test/data/nereids_rules_p0/limit_push_down/order_push_down.out +++ b/regression-test/data/nereids_rules_p0/limit_push_down/order_push_down.out @@ -2,243 +2,155 @@ -- !limit_offset_sort_project -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalOlapScan[t1] -- !limit_sort_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalOlapScan[t2] -- !limit_sort_semi_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalOlapScan[t2] -- !right_semi_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !left_anti_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !right_anti_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !full_outer_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !left_outer_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalTopN[MERGE_SORT] -----------------PhysicalDistribute -------------------PhysicalTopN[LOCAL_SORT] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !right_outer_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalTopN[MERGE_SORT] -----------------PhysicalDistribute -------------------PhysicalTopN[LOCAL_SORT] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t2] -- !cross_join_order -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalTopN[LOCAL_SORT] -------PhysicalProject ---------NestedLoopJoin[CROSS_JOIN] -----------PhysicalTopN[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalTopN[LOCAL_SORT] -----------------PhysicalProject -------------------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t2] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_offset_sort_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalOlapScan[t2] -- !limit_sort_agg_having -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_offset_agg_having -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_offset_sort_agg_having -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------NestedLoopJoin[CROSS_JOIN] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------NestedLoopJoin[CROSS_JOIN] +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------NestedLoopJoin[CROSS_JOIN] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------NestedLoopJoin[CROSS_JOIN] +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_window -- PhysicalResultSink @@ -246,10 +158,9 @@ PhysicalResultSink ----PhysicalLimit[LOCAL] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalPartitionTopN -----------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_sort_window -- PhysicalResultSink @@ -257,9 +168,8 @@ PhysicalResultSink ----PhysicalTopN[LOCAL_SORT] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_offset_window -- PhysicalResultSink @@ -267,10 +177,9 @@ PhysicalResultSink ----PhysicalLimit[LOCAL] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalPartitionTopN -----------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalPartitionTopN +--------------PhysicalOlapScan[t1] -- !limit_offset_sort_window -- PhysicalResultSink @@ -278,109 +187,76 @@ PhysicalResultSink ----PhysicalTopN[LOCAL_SORT] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_sort_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_offset_sort_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_subquery_order_by_inside_limit_outside -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_all_inside -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalOlapScan[t1] -- !limit_set_operation -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_outside_order_inside_set_operation -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t2] - --- !limit_inside_set_operation -- -PhysicalResultSink ---PhysicalDistribute -----hashAgg[GLOBAL] -------PhysicalDistribute +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] --------hashAgg[LOCAL] ----------PhysicalUnion -------------PhysicalDistribute ---------------PhysicalProject +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] ----------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalTopN[MERGE_SORT] -----------------PhysicalDistribute -------------------PhysicalTopN[LOCAL_SORT] ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------PhysicalOlapScan[t2] + +-- !limit_inside_set_operation -- +PhysicalResultSink +--hashAgg[GLOBAL] +----hashAgg[LOCAL] +------PhysicalUnion +--------PhysicalOlapScan[t1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t2] -- !limit_offset_set_operation -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalIntersect -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------PhysicalIntersect +--------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_window -- PhysicalResultSink @@ -388,9 +264,8 @@ PhysicalResultSink ----PhysicalTopN[LOCAL_SORT] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_offset_window -- PhysicalResultSink @@ -398,81 +273,60 @@ PhysicalResultSink ----PhysicalTopN[LOCAL_SORT] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_offset_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id = 1)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id = 1)) +--------PhysicalOlapScan[t1] -- !limit_project_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_join_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subquery -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalOlapScan[t1] -- !limit_subquery_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_subquery_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalOlapScan[t2] -- !limit_subquery_window -- PhysicalResultSink @@ -480,525 +334,341 @@ PhysicalResultSink ----PhysicalTopN[LOCAL_SORT] ------PhysicalWindow --------PhysicalQuickSort[MERGE_SORT] -----------PhysicalDistribute -------------PhysicalQuickSort[LOCAL_SORT] ---------------PhysicalOlapScan[t1] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_nested_subquery -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalOlapScan[t1] -- !limit_union_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t1.id > 100)) -----------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t2.id > 100)) -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------filter((t1.id > 100)) +--------------PhysicalOlapScan[t1] +------------filter((t2.id > 100)) +--------------PhysicalOlapScan[t2] -- !limit_union_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalProject -------------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() ---------------------PhysicalDistribute -----------------------PhysicalProject -------------------------PhysicalOlapScan[t1] ---------------------PhysicalDistribute -----------------------PhysicalProject -------------------------PhysicalOlapScan[t2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[t3] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t4] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] +------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() +--------------PhysicalOlapScan[t3] +--------------PhysicalOlapScan[t4] -- !limit_union_window -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalWindow -----------------------PhysicalQuickSort[MERGE_SORT] -------------------------PhysicalDistribute ---------------------------PhysicalQuickSort[LOCAL_SORT] -----------------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalWindow -----------------------PhysicalQuickSort[MERGE_SORT] -------------------------PhysicalDistribute ---------------------------PhysicalQuickSort[LOCAL_SORT] -----------------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalWindow +--------------PhysicalQuickSort[MERGE_SORT] +----------------PhysicalQuickSort[LOCAL_SORT] +------------------PhysicalOlapScan[t1] +------------PhysicalWindow +--------------PhysicalQuickSort[MERGE_SORT] +----------------PhysicalQuickSort[LOCAL_SORT] +------------------PhysicalOlapScan[t2] -- !limit_subquery_join_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subqueryjoin_window -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalWindow -----------PhysicalQuickSort[LOCAL_SORT] -------------PhysicalProject ---------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------PhysicalWindow +--------PhysicalQuickSort[LOCAL_SORT] +----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_subquery_union_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t1.id > 100)) -----------------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t2.id > 100)) -----------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------filter((t1.id > 100)) +--------------PhysicalOlapScan[t1] +------------filter((t2.id > 100)) +--------------PhysicalOlapScan[t2] -- !limit_subquery_union_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[t1] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() build RFs:RF1 id->[id] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t3] apply RFs: RF1 -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t4] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] +------------hashJoin[INNER_JOIN] hashCondition=((t3.id = t4.id)) otherCondition=() build RFs:RF1 id->[id] +--------------PhysicalOlapScan[t3] apply RFs: RF1 +--------------PhysicalOlapScan[t4] -- !limit_subquery_union_window -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalWindow -----------PhysicalQuickSort[LOCAL_SORT] -------------PhysicalDistribute ---------------hashAgg[GLOBAL] -----------------PhysicalDistribute -------------------hashAgg[LOCAL] ---------------------PhysicalUnion -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t1] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------PhysicalWindow +--------PhysicalQuickSort[LOCAL_SORT] +----------hashAgg[GLOBAL] +------------hashAgg[LOCAL] +--------------PhysicalUnion +----------------PhysicalOlapScan[t1] +----------------PhysicalOlapScan[t2] -- !limit_correlated_subquery -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() ---------PhysicalProject -----------PhysicalOlapScan[t1] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t2] +--hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() +----PhysicalOlapScan[t1] +----PhysicalOlapScan[t2] -- !limit_correlated_subquery_join -- PhysicalResultSink ---PhysicalDistribute -----PhysicalProject -------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t3.id = t1.id)) otherCondition=() ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] ---------PhysicalDistribute -----------PhysicalProject -------------PhysicalOlapScan[t3] +--hashJoin[LEFT_SEMI_JOIN] hashCondition=((t3.id = t1.id)) otherCondition=() +----hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +------PhysicalOlapScan[t1] +------PhysicalOlapScan[t2] +----PhysicalOlapScan[t3] -- !limit_correlated_subquery_window -- PhysicalResultSink --PhysicalQuickSort[MERGE_SORT] -----PhysicalDistribute -------PhysicalQuickSort[LOCAL_SORT] ---------PhysicalWindow -----------PhysicalQuickSort[LOCAL_SORT] -------------PhysicalProject ---------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() -----------------PhysicalOlapScan[t1] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[t2] +----PhysicalQuickSort[LOCAL_SORT] +------PhysicalWindow +--------PhysicalQuickSort[LOCAL_SORT] +----------hashJoin[LEFT_SEMI_JOIN] hashCondition=((t2.id = t1.id)) otherCondition=() +------------PhysicalOlapScan[t1] +------------PhysicalOlapScan[t2] -- !limit_cte_query -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalResultSink ----PhysicalTopN[MERGE_SORT] -------PhysicalDistribute ---------PhysicalTopN[LOCAL_SORT] -----------PhysicalDistribute -------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------PhysicalTopN[LOCAL_SORT] +--------PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_cte_outside_query -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalResultSink ----PhysicalLimit[GLOBAL] -------PhysicalDistribute ---------PhysicalLimit[LOCAL] -----------PhysicalDistribute -------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------PhysicalLimit[LOCAL] +--------PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_cte_outside_query -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) ----PhysicalTopN[MERGE_SORT] -------PhysicalDistribute ---------PhysicalTopN[LOCAL_SORT] -----------PhysicalProject -------------filter((t1.id < 10)) ---------------PhysicalOlapScan[t1] +------PhysicalTopN[LOCAL_SORT] +--------filter((t1.id < 10)) +----------PhysicalOlapScan[t1] --PhysicalResultSink -----PhysicalDistribute -------PhysicalCteConsumer ( cteId=CTEId#0 ) +----PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_cte_query_join -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalCteAnchor ( cteId=CTEId#1 ) ----PhysicalCteProducer ( cteId=CTEId#1 ) -------PhysicalProject ---------filter((t2.id < 10)) -----------PhysicalOlapScan[t2] +------filter((t2.id < 10)) +--------PhysicalOlapScan[t2] ----PhysicalResultSink ------PhysicalTopN[MERGE_SORT] ---------PhysicalDistribute -----------PhysicalTopN[LOCAL_SORT] -------------PhysicalProject ---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((cte1.id = cte2.id)) otherCondition=() -----------------PhysicalDistribute -------------------PhysicalCteConsumer ( cteId=CTEId#0 ) -----------------PhysicalDistribute -------------------PhysicalCteConsumer ( cteId=CTEId#1 ) +--------PhysicalTopN[LOCAL_SORT] +----------hashJoin[FULL_OUTER_JOIN] hashCondition=((cte1.id = cte2.id)) otherCondition=() +------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------PhysicalCteConsumer ( cteId=CTEId#1 ) -- !limit_cte_query_window -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----PhysicalProject -------filter((t1.id < 10)) ---------PhysicalOlapScan[t1] +----filter((t1.id < 10)) +------PhysicalOlapScan[t1] --PhysicalResultSink ----PhysicalTopN[MERGE_SORT] ------PhysicalTopN[LOCAL_SORT] --------PhysicalWindow ----------PhysicalQuickSort[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalQuickSort[LOCAL_SORT] -----------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------PhysicalQuickSort[LOCAL_SORT] +--------------PhysicalCteConsumer ( cteId=CTEId#0 ) -- !limit_project_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------filter((t1.id > 100)) -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------filter((t1.id > 100)) +--------PhysicalOlapScan[t1] -- !limit_join_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------PhysicalProject ---------------filter((t1.id > 100)) -----------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------filter((t2.id > 100)) -------------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +--------filter((t1.id > 100)) +----------PhysicalOlapScan[t1] apply RFs: RF0 +--------filter((t2.id > 100)) +----------PhysicalOlapScan[t2] -- !limit_subquery_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------PhysicalProject ---------------PhysicalOlapScan[t1] apply RFs: RF0 -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t2] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------PhysicalOlapScan[t1] apply RFs: RF0 +--------PhysicalOlapScan[t2] -- !limit_subquery_window -- PhysicalResultSink ---PhysicalProject -----PhysicalTopN[MERGE_SORT] -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------PhysicalWindow -------------PhysicalQuickSort[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalQuickSort[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] +--PhysicalTopN[MERGE_SORT] +----PhysicalTopN[LOCAL_SORT] +------PhysicalWindow +--------PhysicalQuickSort[MERGE_SORT] +----------PhysicalQuickSort[LOCAL_SORT] +------------PhysicalOlapScan[t1] -- !limit_nested_subquery -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------PhysicalProject -----------PhysicalOlapScan[t1] +----PhysicalLimit[LOCAL] +------PhysicalOlapScan[t1] -- !limit_subquery_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------PhysicalOlapScan[t1] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------PhysicalOlapScan[t1] -- !limit_cross_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalTopN[LOCAL_SORT] -------PhysicalProject ---------NestedLoopJoin[CROSS_JOIN] -----------PhysicalTopN[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalTopN[LOCAL_SORT] -----------------PhysicalProject -------------------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------PhysicalProject ---------------PhysicalOlapScan[t2] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_multiple_left_outer_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute +----PhysicalTopN[LOCAL_SORT] +------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() --------------PhysicalTopN[MERGE_SORT] -----------------PhysicalDistribute -------------------PhysicalTopN[LOCAL_SORT] ---------------------PhysicalProject -----------------------hashJoin[LEFT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------------PhysicalDistribute ---------------------------PhysicalTopN[MERGE_SORT] -----------------------------PhysicalDistribute -------------------------------PhysicalTopN[LOCAL_SORT] ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[t1] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----------------PhysicalTopN[LOCAL_SORT] +------------------PhysicalOlapScan[t1] +--------------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_multiple_right_outer_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------hashJoin[RIGHT_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] apply RFs: RF0 RF1 +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_multiple_full_outerjoin -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() -------------PhysicalDistribute ---------------PhysicalProject -----------------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t1] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalProject -----------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t3.id)) otherCondition=() +--------hashJoin[FULL_OUTER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_subquery_cross_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalTopN[LOCAL_SORT] -------PhysicalProject ---------NestedLoopJoin[CROSS_JOIN] -----------PhysicalTopN[MERGE_SORT] -------------PhysicalDistribute ---------------PhysicalTopN[LOCAL_SORT] -----------------PhysicalProject -------------------PhysicalOlapScan[t1] -----------PhysicalDistribute -------------PhysicalOlapScan[t2] +------NestedLoopJoin[CROSS_JOIN] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[t1] +--------PhysicalOlapScan[t2] -- !limit_subquery_multiple_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((subq.id = t3.id)) otherCondition=() -------------hashJoin[INNER_JOIN] hashCondition=((subq.id = t2.id)) otherCondition=() ---------------PhysicalProject -----------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 ---------------PhysicalDistribute -----------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((subq.id = t3.id)) otherCondition=() +--------hashJoin[INNER_JOIN] hashCondition=((subq.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] apply RFs: RF0 RF1 +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_subquery_multiple_join_nested_subquery -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalProject -----------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() -------------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() ---------------PhysicalProject -----------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 ---------------PhysicalDistribute -----------------PhysicalOlapScan[t2] -------------PhysicalDistribute ---------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() +--------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() +----------PhysicalOlapScan[t1] apply RFs: RF0 RF1 +----------PhysicalOlapScan[t2] +--------PhysicalOlapScan[t3] -- !limit_subquery_multiple_join_nested_subquery_distinct -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() -------------------PhysicalProject ---------------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[t2] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() +----------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() +------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 +------------PhysicalOlapScan[t2] +----------PhysicalOlapScan[t3] -- !limit_subquery_multiple_join_nested_subquery_distinct_filter -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() build RFs:RF1 id->[id] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] -------------------PhysicalProject ---------------------filter((t1.id > 100)) -----------------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------filter((t2.id > 100)) -------------------------PhysicalOlapScan[t2] ---------------PhysicalDistribute -----------------PhysicalProject -------------------filter((t3.id > 100)) ---------------------PhysicalOlapScan[t3] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[LOCAL] +--------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t3.id)) otherCondition=() build RFs:RF1 id->[id] +----------hashJoin[INNER_JOIN] hashCondition=((subq2.id = t2.id)) otherCondition=() build RFs:RF0 id->[id] +------------filter((t1.id > 100)) +--------------PhysicalOlapScan[t1] apply RFs: RF0 RF1 +------------filter((t2.id > 100)) +--------------PhysicalOlapScan[t2] +----------filter((t3.id > 100)) +------------PhysicalOlapScan[t3] diff --git a/regression-test/data/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.out b/regression-test/data/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.out index 1cb6435483e4a7..9ffe9520387501 100644 --- a/regression-test/data/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.out +++ b/regression-test/data/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.out @@ -2,20 +2,14 @@ -- !basic -- PhysicalResultSink --PhysicalLimit[GLOBAL] -----PhysicalDistribute -------PhysicalLimit[LOCAL] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t] -----------------PhysicalDistribute -------------------PhysicalLimit[LOCAL] ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------PhysicalOlapScan[t] +----PhysicalLimit[LOCAL] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------PhysicalOlapScan[t] +------------PhysicalLimit[LOCAL] +--------------hashAgg[LOCAL] +----------------PhysicalOlapScan[t] diff --git a/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.out b/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.out index cd1c60b17d376b..58dfe43639ab14 100644 --- a/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.out +++ b/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.out @@ -2,170 +2,106 @@ -- !push_down_topn_through_union -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_union_with_conditions -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t1.score > 10)) -----------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t2.name = 'Test')) -----------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t3.id < 5)) -----------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------filter((t1.score > 10)) +--------------PhysicalOlapScan[table2] +------------filter((t2.name = 'Test')) +--------------PhysicalOlapScan[table2] +------------filter((t3.id < 5)) +--------------PhysicalOlapScan[table2] -- !push_down_topn_union_with_order_by -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_nested_union -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_union_after_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[table2] -----------------------PhysicalProject -------------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[table2] +--------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_union_different_projections -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_union_with_subquery -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((table2.score > 20)) -----------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------filter((table2.score > 20)) +--------------PhysicalOlapScan[table2] +------------PhysicalOlapScan[table2] -- !push_down_topn_union_with_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalLimit[GLOBAL] ---------------------PhysicalDistribute -----------------------PhysicalLimit[LOCAL] -------------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalLimit[GLOBAL] ---------------------PhysicalDistribute -----------------------PhysicalLimit[LOCAL] -------------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------PhysicalLimit[GLOBAL] +--------------PhysicalLimit[LOCAL] +----------------PhysicalOlapScan[table2] +------------PhysicalLimit[GLOBAL] +--------------PhysicalLimit[LOCAL] +----------------PhysicalOlapScan[table2] -- !push_down_topn_union_complex_conditions -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalUnion -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t1.name = 'Test') and (t1.score > 10)) -----------------------PhysicalOlapScan[table2] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((t2.id < 5) and (t2.score < 20)) -----------------------PhysicalOlapScan[table2] +----PhysicalTopN[LOCAL_SORT] +------hashAgg[GLOBAL] +--------hashAgg[LOCAL] +----------PhysicalUnion +------------filter((t1.name = 'Test') and (t1.score > 10)) +--------------PhysicalOlapScan[table2] +------------filter((t2.id < 5) and (t2.score < 20)) +--------------PhysicalOlapScan[table2] diff --git a/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.out b/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.out index 8120b0d38e71fb..72db4b9b31e472 100644 --- a/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.out +++ b/regression-test/data/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.out @@ -2,207 +2,132 @@ -- !push_down_topn_through_union -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_union_with_conditions -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((t1.score > 10)) -----------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((t2.name = 'Test')) -----------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((t3.id < 5)) -----------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((t1.score > 10)) +--------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((t2.name = 'Test')) +--------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((t3.id < 5)) +--------------PhysicalOlapScan[table1] -- !push_down_topn_union_with_order_by -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_nested_union -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_union_after_join -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[table1] apply RFs: RF0 -----------------------PhysicalProject -------------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) otherCondition=() +--------------PhysicalOlapScan[table1] apply RFs: RF0 +--------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_union_different_projections -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_union_with_subquery -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((table1.score > 20)) -----------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((table1.score > 20)) +--------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalOlapScan[table1] -- !push_down_topn_union_with_limit -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalTopN[LOCAL_SORT] -----------------PhysicalLimit[GLOBAL] -------------------PhysicalDistribute ---------------------PhysicalLimit[LOCAL] -----------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalTopN[LOCAL_SORT] -----------------PhysicalLimit[GLOBAL] -------------------PhysicalDistribute ---------------------PhysicalLimit[LOCAL] -----------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalLimit[GLOBAL] +--------------PhysicalLimit[LOCAL] +----------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------PhysicalLimit[GLOBAL] +--------------PhysicalLimit[LOCAL] +----------------PhysicalOlapScan[table1] -- !push_down_topn_union_complex_conditions -- PhysicalResultSink --PhysicalTopN[MERGE_SORT] -----PhysicalDistribute -------PhysicalTopN[LOCAL_SORT] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((t1.name = 'Test') and (t1.score > 10)) -----------------------PhysicalOlapScan[table1] -----------PhysicalDistribute -------------PhysicalTopN[MERGE_SORT] ---------------PhysicalDistribute -----------------PhysicalTopN[LOCAL_SORT] -------------------PhysicalProject ---------------------filter((t2.id < 5) and (t2.score < 20)) -----------------------PhysicalOlapScan[table1] +----PhysicalTopN[LOCAL_SORT] +------PhysicalUnion +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((t1.name = 'Test') and (t1.score > 10)) +--------------PhysicalOlapScan[table1] +--------PhysicalTopN[MERGE_SORT] +----------PhysicalTopN[LOCAL_SORT] +------------filter((t2.id < 5) and (t2.score < 20)) +--------------PhysicalOlapScan[table1] diff --git a/regression-test/suites/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.groovy b/regression-test/suites/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.groovy index 09f2c9a2d32db8..f6833de6bd573e 100644 --- a/regression-test/suites/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.groovy +++ b/regression-test/suites/nereids_rules_p0/eliminate_join_condition/eliminate_join_condition.groovy @@ -18,6 +18,8 @@ suite("eliminate_join_condition") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" sql """ DROP TABLE IF EXISTS t; diff --git a/regression-test/suites/nereids_rules_p0/limit_push_down/limit_push_down.groovy b/regression-test/suites/nereids_rules_p0/limit_push_down/limit_push_down.groovy index a97ca16fe974cd..39aa020ee6ac70 100644 --- a/regression-test/suites/nereids_rules_p0/limit_push_down/limit_push_down.groovy +++ b/regression-test/suites/nereids_rules_p0/limit_push_down/limit_push_down.groovy @@ -20,7 +20,9 @@ suite("limit_push_down") { sql "SET enable_fallback_to_original_planner=false" sql "use regression_test_nereids_rules_p0" sql """ SET inline_cte_referenced_threshold=0 """ - sql "set disable_join_reorder=true" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" + sql 'set be_number_for_test=3' //`limit 1, project`: qt_limit_project """ explain shape plan SELECT t1.id as c FROM t1 LIMIT 1; """ diff --git a/regression-test/suites/nereids_rules_p0/limit_push_down/order_push_down.groovy b/regression-test/suites/nereids_rules_p0/limit_push_down/order_push_down.groovy index a6b35a661ac88f..f6caf529a38750 100644 --- a/regression-test/suites/nereids_rules_p0/limit_push_down/order_push_down.groovy +++ b/regression-test/suites/nereids_rules_p0/limit_push_down/order_push_down.groovy @@ -20,7 +20,8 @@ suite("order_push_down") { sql "SET enable_fallback_to_original_planner=false" sql "use regression_test_nereids_rules_p0" sql """ SET inline_cte_referenced_threshold=0 """ - sql "set disable_join_reorder=true" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" sql 'set be_number_for_test=3' //`limit 1 offset 1 + sort, project`: diff --git a/regression-test/suites/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.groovy b/regression-test/suites/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.groovy index cbb509db32b031..d63fed50878526 100644 --- a/regression-test/suites/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.groovy +++ b/regression-test/suites/nereids_rules_p0/push_down_limit_distinct/push_down_limit_distinct.groovy @@ -18,6 +18,8 @@ suite("push_down_limit_distinct_through_join") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" sql """ DROP TABLE IF EXISTS t; diff --git a/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.groovy b/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.groovy index 0ed932c81d389d..c7a56da147f642 100644 --- a/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.groovy +++ b/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_distinct_through_union.groovy @@ -18,6 +18,8 @@ suite("push_down_top_n_distinct_through_union") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" sql """ DROP TABLE IF EXISTS table2; diff --git a/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.groovy b/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.groovy index 9f19d7ac5dbfc5..974c9ab3ba1923 100644 --- a/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.groovy +++ b/regression-test/suites/nereids_rules_p0/push_down_top_n/push_down_top_n_through_union.groovy @@ -18,6 +18,8 @@ suite("push_down_top_n_through_union") { sql "SET enable_nereids_planner=true" sql "SET enable_fallback_to_original_planner=false" + sql "SET ignore_shape_nodes='PhysicalDistribute,PhysicalProject'" + sql "SET disable_join_reorder=true" sql """ DROP TABLE IF EXISTS table1;