diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java index 0e1fba1fc44920..85367107a2c52a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java @@ -125,6 +125,14 @@ public List normalizeToUseSlotRef(Collection expres NormalizeToSlotTriplet normalizeToSlotTriplet = normalizeToSlotMap.get(child); return normalizeToSlotTriplet == null ? child : normalizeToSlotTriplet.remainExpr; }); + if (rewriteExpr instanceof Alias) { + Alias alias = (Alias) rewriteExpr; + if (alias.child() instanceof SlotReference + && alias.getExprId().equals(((SlotReference) alias.child()).getExprId())) { + // alias k1#1 as k1#1 --> k1#1 + rewriteExpr = alias.child(); + } + } result.add((E) rewriteExpr); } return result.build(); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ExtractAndNormalizeWindowExpressionTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ExtractAndNormalizeWindowExpressionTest.java index 476131e6b068b1..a3527f5d501763 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ExtractAndNormalizeWindowExpressionTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ExtractAndNormalizeWindowExpressionTest.java @@ -90,7 +90,7 @@ public void testSimpleWindowFunction() { ).when(project -> { List projects = project.getProjects(); return projects.get(0).equals(id) - && projects.get(1) instanceof Alias; + && projects.get(1) instanceof SlotReference && projects.get(1).equals(windowAlias.toSlot()); }) ); } @@ -147,7 +147,7 @@ public void testComplexWindowFunction() { ).when(project -> { List projects = project.getProjects(); return projects.get(0) instanceof SlotReference - && projects.get(1) instanceof Alias; + && projects.get(1) instanceof SlotReference && projects.get(1).equals(windowAlias.toSlot()); }) ); } @@ -226,8 +226,7 @@ public void testComplexWindowFunctionTogetherWithAggregateFunction() { List projects = project.getProjects(); return projects.get(0).equals(gender) && projects.get(1) instanceof SlotReference - && projects.get(2) instanceof Alias - && projects.get(2).child(0) instanceof SlotReference; + && projects.get(2) instanceof SlotReference && projects.get(2).equals(windowAlias.toSlot()); }) ); } diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query44.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query44.out index 013c93d6ea7d8c..a2f7a552f10d09 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query44.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query49.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query49.out index 889d5069ff9751..a0a6fe23512f9c 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query49.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query51.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query51.out index ad962e7d114470..1151d99b1ee332 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query51.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query67.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query67.out index cb8a185598c052..17b81ca023bab9 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query67.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_rules_p0/push_down_filter/push_down_filter_through_window.out b/regression-test/data/nereids_rules_p0/push_down_filter/push_down_filter_through_window.out index 9ecb96e1fc0b74..6efd09e5d1deec 100644 --- a/regression-test/data/nereids_rules_p0/push_down_filter/push_down_filter_through_window.out +++ b/regression-test/data/nereids_rules_p0/push_down_filter/push_down_filter_through_window.out @@ -1,7 +1,7 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !multi_column_predicate_push_down_window_shape -- PhysicalResultSink ---filter((num <= 2)) +--filter((t.num <= 2)) ----PhysicalWindow ------PhysicalQuickSort[LOCAL_SORT] --------PhysicalPartitionTopN @@ -15,7 +15,7 @@ PhysicalResultSink -- !multi_column_or_predicate_push_down_window_shape -- PhysicalResultSink ---filter((rc < 2)) +--filter((t.rc < 2)) ----PhysicalWindow ------PhysicalQuickSort[LOCAL_SORT] --------PhysicalPartitionTopN diff --git a/regression-test/data/nereids_syntax_p0/push_filter_through_ptopn.out b/regression-test/data/nereids_syntax_p0/push_filter_through_ptopn.out index dd23fd8ea500f2..49e5abb8c5f35a 100644 --- a/regression-test/data/nereids_syntax_p0/push_filter_through_ptopn.out +++ b/regression-test/data/nereids_syntax_p0/push_filter_through_ptopn.out @@ -6,7 +6,7 @@ -- !shape_1 -- PhysicalResultSink --PhysicalDistribute[DistributionSpecGather] -----filter((rn <= 2)) +----filter((T.rn <= 2)) ------PhysicalWindow --------PhysicalQuickSort[LOCAL_SORT] ----------PhysicalPartitionTopN @@ -22,7 +22,7 @@ PhysicalResultSink PhysicalResultSink --PhysicalDistribute[DistributionSpecGather] ----PhysicalProject -------filter((rn <= 2)) +------filter((T.rn <= 2)) --------PhysicalWindow ----------PhysicalQuickSort[LOCAL_SORT] ------------PhysicalPartitionTopN @@ -32,7 +32,7 @@ PhysicalResultSink -- !3 -- PhysicalResultSink --PhysicalDistribute[DistributionSpecGather] -----filter((T.b = 2) and (rn <= 2)) +----filter((T.b = 2) and (T.rn <= 2)) ------PhysicalWindow --------PhysicalQuickSort[LOCAL_SORT] ----------PhysicalPartitionTopN @@ -42,7 +42,7 @@ PhysicalResultSink PhysicalResultSink --PhysicalDistribute[DistributionSpecGather] ----PhysicalProject -------filter((T.b = 2) and (rn <= 2)) +------filter((T.b = 2) and (T.rn <= 2)) --------PhysicalWindow ----------PhysicalQuickSort[LOCAL_SORT] ------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query44.out index 5c302c265fc9f3..10696d416feed5 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query44.out index 5c302c265fc9f3..10696d416feed5 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out index 889d5069ff9751..a0a6fe23512f9c 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query51.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query51.out index 98b43bfdfc171f..9ffa695b733bf9 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query67.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query67.out index 11f2d128129a53..b5f6486b18a89a 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out index c2cc91b7f43043..fdb632e7aeaa1b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out @@ -15,7 +15,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN broadcast] hashCondition=((asceding.rnk = descending.rnk)) otherCondition=() --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V11.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ------------------------------------------------------filter((store_sales.ss_store_sk = 146) and ss_addr_sk IS NULL) --------------------------------------------------------PhysicalOlapScan[store_sales] --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V21.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query49.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query49.out index dc56d7f9e81411..fbafcdb529a86b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query51.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query67.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query67.out index 2370bce7b8f785..32aca703b091c1 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out index c2cc91b7f43043..fdb632e7aeaa1b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out @@ -15,7 +15,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN broadcast] hashCondition=((asceding.rnk = descending.rnk)) otherCondition=() --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V11.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ------------------------------------------------------filter((store_sales.ss_store_sk = 146) and ss_addr_sk IS NULL) --------------------------------------------------------PhysicalOlapScan[store_sales] --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V21.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query49.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query49.out index dc56d7f9e81411..fbafcdb529a86b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query51.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query67.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query67.out index e4a703c25ac818..b3a41aa353eb81 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out index 86d157354860a4..49a3c764bda9ce 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query49.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query49.out index e34962e0847b0d..4826996e69fcbc 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query51.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query67.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query67.out index d043d5f25b6c7a..ca0256aeea797e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out index 86d157354860a4..49a3c764bda9ce 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out index e34962e0847b0d..4826996e69fcbc 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query67.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query67.out index 09aed607328af2..5d1c063b4cb653 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query44.out index 6549d1401b11a3..2db8bd531f5cf2 100644 --- a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query44.out @@ -13,7 +13,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN broadcast] hashCondition=((asceding.rnk = descending.rnk)) otherCondition=() --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V11.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] @@ -39,7 +39,7 @@ PhysicalResultSink ------------------------------------------------------filter((store_sales.ss_store_sk = 366) and ss_cdemo_sk IS NULL) --------------------------------------------------------PhysicalOlapScan[store_sales] --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V21.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query49.out b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query49.out index 398dcef280ccea..3cca11aedf82d4 100644 --- a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query51.out b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query51.out index 5d049b5a6bb2dc..9f3b3b1b1a3495 100644 --- a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query67.out b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query67.out index 72490b12bb4c6d..c7cf13027a3e80 100644 --- a/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query67.out +++ b/regression-test/data/nereids_tpcds_shape_sf10t_orc/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/hint_tpcds/shape/query67.out b/regression-test/data/new_shapes_p0/hint_tpcds/shape/query67.out index e93c8687236c29..59423fa654c82a 100644 --- a/regression-test/data/new_shapes_p0/hint_tpcds/shape/query67.out +++ b/regression-test/data/new_shapes_p0/hint_tpcds/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query44.out index c2cc91b7f43043..fdb632e7aeaa1b 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query44.out @@ -15,7 +15,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN broadcast] hashCondition=((asceding.rnk = descending.rnk)) otherCondition=() --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V11.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ------------------------------------------------------filter((store_sales.ss_store_sk = 146) and ss_addr_sk IS NULL) --------------------------------------------------------PhysicalOlapScan[store_sales] --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V21.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query49.out b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query49.out index dc56d7f9e81411..fbafcdb529a86b 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query49.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query51.out b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query51.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query67.out b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query67.out index 2370bce7b8f785..32aca703b091c1 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query67.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/noStatsRfPrune/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query44.out index c2cc91b7f43043..fdb632e7aeaa1b 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query44.out @@ -15,7 +15,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN broadcast] hashCondition=((asceding.rnk = descending.rnk)) otherCondition=() --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V11.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ------------------------------------------------------filter((store_sales.ss_store_sk = 146) and ss_addr_sk IS NULL) --------------------------------------------------------PhysicalOlapScan[store_sales] --------------------PhysicalProject -----------------------filter((rnk < 11)) +----------------------filter((V21.rnk < 11)) ------------------------PhysicalWindow --------------------------PhysicalQuickSort[MERGE_SORT] ----------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query49.out b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query49.out index dc56d7f9e81411..fbafcdb529a86b 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query49.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query51.out b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query51.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query67.out b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query67.out index e4a703c25ac818..b3a41aa353eb81 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query67.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/no_stats_shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalQuickSort[LOCAL_SORT] --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query44.out index 86d157354860a4..49a3c764bda9ce 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query49.out b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query49.out index e34962e0847b0d..4826996e69fcbc 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query49.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query51.out b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query51.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query67.out b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query67.out index d043d5f25b6c7a..ca0256aeea797e 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query67.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/rf_prune/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query44.out index 86d157354860a4..49a3c764bda9ce 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query49.out b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query49.out index e34962e0847b0d..4826996e69fcbc 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query49.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query51.out b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query51.out index cec684574edf4b..11fecfc9825a58 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query51.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query67.out b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query67.out index 09aed607328af2..5d1c063b4cb653 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query67.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf100/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf1000/bs_downgrade_shape/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf1000/bs_downgrade_shape/query44.out index 5c302c265fc9f3..10696d416feed5 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf1000/bs_downgrade_shape/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf1000/bs_downgrade_shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query44.out b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query44.out index 5c302c265fc9f3..10696d416feed5 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query44.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query44.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF1 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V11.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] @@ -41,7 +41,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------PhysicalOlapScan[item] apply RFs: RF0 ----------------PhysicalProject -------------------filter((rnk < 11)) +------------------filter((V21.rnk < 11)) --------------------PhysicalWindow ----------------------PhysicalQuickSort[MERGE_SORT] ------------------------PhysicalDistribute[DistributionSpecGather] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query49.out b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query49.out index 889d5069ff9751..a0a6fe23512f9c 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query49.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query49.out @@ -16,7 +16,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((web.return_rank <= 10) OR (web.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -48,7 +48,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((catalog.return_rank <= 10) OR (catalog.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow @@ -80,7 +80,7 @@ PhysicalResultSink --------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------------------filter(((store.return_rank <= 10) OR (store.currency_rank <= 10))) ----------------------------------PhysicalWindow ------------------------------------PhysicalQuickSort[LOCAL_SORT] --------------------------------------PhysicalWindow diff --git a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query51.out b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query51.out index 98b43bfdfc171f..9ffa695b733bf9 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query51.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query51.out @@ -5,7 +5,7 @@ PhysicalResultSink ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] --------PhysicalProject -----------filter((web_cumulative > store_cumulative)) +----------filter((y.web_cumulative > y.store_cumulative)) ------------PhysicalWindow --------------PhysicalQuickSort[LOCAL_SORT] ----------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query67.out b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query67.out index 11f2d128129a53..b5f6486b18a89a 100644 --- a/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query67.out +++ b/regression-test/data/new_shapes_p0/tpcds_sf1000/shape/query67.out @@ -4,7 +4,7 @@ PhysicalResultSink --PhysicalTopN[MERGE_SORT] ----PhysicalDistribute[DistributionSpecGather] ------PhysicalTopN[LOCAL_SORT] ---------filter((rk <= 100)) +--------filter((dw2.rk <= 100)) ----------PhysicalWindow ------------PhysicalPartitionTopN --------------PhysicalDistribute[DistributionSpecHash] diff --git a/regression-test/data/variant_p0/test_sub_path_pruning.out b/regression-test/data/variant_p0/test_sub_path_pruning.out index 16328739167099..13cd70dba08b99 100644 --- a/regression-test/data/variant_p0/test_sub_path_pruning.out +++ b/regression-test/data/variant_p0/test_sub_path_pruning.out @@ -314,3 +314,6 @@ -- !sql -- 1 2 +-- !sql_no_dead_loop -- +{"b":{"c":{"d":{"e":11}}},"c":{"d":{"e":12}},"d":{"e":13},"e":14} + diff --git a/regression-test/suites/variant_p0/test_sub_path_pruning.groovy b/regression-test/suites/variant_p0/test_sub_path_pruning.groovy index f09f4713ad29e5..ab340ab34dd5df 100644 --- a/regression-test/suites/variant_p0/test_sub_path_pruning.groovy +++ b/regression-test/suites/variant_p0/test_sub_path_pruning.groovy @@ -216,4 +216,10 @@ suite("variant_sub_path_pruning", "variant_type"){ order_qt_sql """select c1['a'] as c2, c1['b'] as c3 from (select 1 as id, cast('{"a":1, "b":2}' as variant) as c1 order by id limit 100) tmp;""" order_qt_sql """select c1['a'] from (select 1 as id, cast('{"b":{"a":1}}' as variant)["b"] as c1 order by id limit 100) tmp;""" order_qt_sql """select c1['a'] as c2, c1['b'] as c3 from (select 1 as id, cast('{"b":{"a":1, "b":2}}' as variant)["b"] as c1 order by id limit 100) tmp;""" -} \ No newline at end of file + + order_qt_sql_no_dead_loop """ + select + FIRST_VALUE(dt['a']) over (PARTITION by id) A12708 + FROM pruning_test + """ +}