This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit db15c811f8459118b9e113e59f44997fc461e7ae
Author: xzj7019 <131111794+xzj7...@users.noreply.github.com>
AuthorDate: Sat May 11 10:46:30 2024 +0800

    [opt](Nereids) enhance properties regulator checking  (#34603)
    
    Enhance properties regulator checking:
    (1) right bucket shuffle restriction takes effective only when either side 
has NATUAL shuffle type.
    (2) enhance bothSideShuffleKeysAreSameOrder checking if taking 
EquivalenceExprIds into consideration.
    
    
    Co-authored-by: zhongjian.xzj 
<zhongjian.xzj@zhongjianxzjdeMacBook-Pro.local>
---
 .../properties/ChildrenPropertiesRegulator.java    | 40 +++++++++++---
 .../shape/query51.out                              | 62 +++++++++++-----------
 .../noStatsRfPrune/query51.out                     | 62 +++++++++++-----------
 .../noStatsRfPrune/query77.out                     | 62 +++++++++++-----------
 .../no_stats_shape/query51.out                     | 62 +++++++++++-----------
 .../no_stats_shape/query77.out                     | 62 +++++++++++-----------
 .../rf_prune/query51.out                           | 62 +++++++++++-----------
 .../nereids_tpcds_shape_sf100_p0/shape/query51.out | 62 +++++++++++-----------
 8 files changed, 244 insertions(+), 230 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
index 8cae2c8775c..31bef9b89d0 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
@@ -216,10 +216,14 @@ public class ChildrenPropertiesRegulator extends 
PlanVisitor<Boolean, Void> {
         }
     }
 
-    private boolean couldNotRightBucketShuffleJoin(JoinType joinType) {
-        return joinType == JoinType.RIGHT_ANTI_JOIN
+    private boolean couldNotRightBucketShuffleJoin(JoinType joinType, 
DistributionSpecHash leftHashSpec,
+            DistributionSpecHash rightHashSpec) {
+        boolean isJoinTypeInScope = (joinType == JoinType.RIGHT_ANTI_JOIN
                 || joinType == JoinType.RIGHT_OUTER_JOIN
-                || joinType == JoinType.FULL_OUTER_JOIN;
+                || joinType == JoinType.FULL_OUTER_JOIN);
+        boolean isSpecInScope = (leftHashSpec.getShuffleType() == 
ShuffleType.NATURAL
+                || rightHashSpec.getShuffleType() == ShuffleType.NATURAL);
+        return isJoinTypeInScope && isSpecInScope;
     }
 
     @Override
@@ -254,7 +258,7 @@ public class ChildrenPropertiesRegulator extends 
PlanVisitor<Boolean, Void> {
         if (JoinUtils.couldColocateJoin(leftHashSpec, rightHashSpec)) {
             // check colocate join with scan
             return true;
-        } else if (couldNotRightBucketShuffleJoin(hashJoin.getJoinType())) {
+        } else if (couldNotRightBucketShuffleJoin(hashJoin.getJoinType(), 
leftHashSpec, rightHashSpec)) {
             // right anti, right outer, full outer join could not do bucket 
shuffle join
             // TODO remove this after we refactor coordinator
             updatedForLeft = Optional.of(calAnotherSideRequired(
@@ -482,8 +486,32 @@ public class ChildrenPropertiesRegulator extends 
PlanVisitor<Boolean, Void> {
     private boolean bothSideShuffleKeysAreSameOrder(
             DistributionSpecHash notShuffleSideOutput, DistributionSpecHash 
shuffleSideOutput,
             DistributionSpecHash notShuffleSideRequired, DistributionSpecHash 
shuffleSideRequired) {
-        return shuffleSideOutput.getOrderedShuffledColumns().equals(
-                calAnotherSideRequiredShuffleIds(notShuffleSideOutput, 
notShuffleSideRequired, shuffleSideRequired));
+        List<ExprId> shuffleSideOutputList = 
shuffleSideOutput.getOrderedShuffledColumns();
+        List<ExprId> notShuffleSideOutputList = 
calAnotherSideRequiredShuffleIds(notShuffleSideOutput,
+                notShuffleSideRequired, shuffleSideRequired);
+        if (shuffleSideOutputList.size() != notShuffleSideOutputList.size()) {
+            return false;
+        } else if (shuffleSideOutputList.equals(notShuffleSideOutputList)) {
+            return true;
+        } else {
+            boolean isSatisfy = true;
+            for (int i = 0; i < shuffleSideOutputList.size() && isSatisfy; 
i++) {
+                ExprId shuffleSideExprId = shuffleSideOutputList.get(i);
+                boolean found = false;
+                for (int j = 0; j < notShuffleSideOutputList.size() && !found; 
j++) {
+                    ExprId notShuffleSideExprId = 
notShuffleSideOutputList.get(j);
+                    if (shuffleSideExprId.equals(notShuffleSideExprId)
+                            || 
shuffleSideOutput.getEquivalenceExprIdsOf(shuffleSideExprId)
+                            .contains(notShuffleSideExprId)) {
+                        found = true;
+                    }
+                }
+                if (!found) {
+                    isSatisfy = false;
+                }
+            }
+            return isSatisfy;
+        }
     }
 
     /**
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 0483d72c793..06a6c3d034e 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
@@ -10,38 +10,36 @@ PhysicalResultSink
 --------------PhysicalDistribute[DistributionSpecHash]
 ----------------PhysicalProject
 ------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = 
store.d_date) and (web.item_sk = store.item_sk)) otherCondition=()
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF1
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF1
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1223) and (date_dim.d_month_seq >= 1212))
-------------------------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1223) and (date_dim.d_month_seq >= 1212))
+----------------------------------------------PhysicalOlapScan[date_dim]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF0
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1223) and (date_dim.d_month_seq >= 1212))
-------------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1223) and (date_dim.d_month_seq >= 1212))
+----------------------------------------------PhysicalOlapScan[date_dim]
 
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 0c8124f96ed..e78afd78236 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
@@ -10,38 +10,36 @@ PhysicalResultSink
 --------------PhysicalDistribute[DistributionSpecHash]
 ----------------PhysicalProject
 ------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = 
store.d_date) and (web.item_sk = store.item_sk)) otherCondition=()
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF1
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF1
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query77.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query77.out
index 4c425894c8d..83e9bd6a4e2 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query77.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query77.out
@@ -28,23 +28,22 @@ PhysicalResultSink
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[store]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashAgg[LOCAL]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_store_sk = store.s_store_sk)) otherCondition=()
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[sr_returned_date_sk]
+------------------------PhysicalProject
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_store_sk = store.s_store_sk)) otherCondition=()
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[sr_returned_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[store_returns] apply 
RFs: RF0
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[store_returns] 
apply RFs: RF0
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
-----------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[store]
+------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
+--------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[store]
 --------------------PhysicalProject
 ----------------------NestedLoopJoin[CROSS_JOIN]
 ------------------------PhysicalProject
@@ -90,21 +89,20 @@ PhysicalResultSink
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[web_page]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashAgg[LOCAL]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_web_page_sk = web_page.wp_web_page_sk)) 
otherCondition=()
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[wr_returned_date_sk]
+------------------------PhysicalProject
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_web_page_sk = web_page.wp_web_page_sk)) 
otherCondition=()
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[wr_returned_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[web_returns] apply 
RFs: RF6
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[web_returns] apply 
RFs: RF6
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
-----------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[web_page]
+------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
+--------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[web_page]
 
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 0c8124f96ed..e78afd78236 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
@@ -10,38 +10,36 @@ PhysicalResultSink
 --------------PhysicalDistribute[DistributionSpecHash]
 ----------------PhysicalProject
 ------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = 
store.d_date) and (web.item_sk = store.item_sk)) otherCondition=()
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF1
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF1
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query77.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query77.out
index 59df7cd5a6e..2ca65387bbf 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query77.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query77.out
@@ -28,23 +28,22 @@ PhysicalResultSink
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[store]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashAgg[LOCAL]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_store_sk = store.s_store_sk)) 
otherCondition=() build RFs:RF1 s_store_sk->[sr_store_sk]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[sr_returned_date_sk]
+------------------------PhysicalProject
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_store_sk = store.s_store_sk)) 
otherCondition=() build RFs:RF1 s_store_sk->[sr_store_sk]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[sr_returned_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[store_returns] apply 
RFs: RF0 RF1
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[store_returns] 
apply RFs: RF0 RF1
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
-----------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[store]
+------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
+--------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[store]
 --------------------PhysicalProject
 ----------------------NestedLoopJoin[CROSS_JOIN]
 ------------------------PhysicalProject
@@ -90,21 +89,20 @@ PhysicalResultSink
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[web_page]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashAgg[LOCAL]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_web_page_sk = web_page.wp_web_page_sk)) 
otherCondition=() build RFs:RF7 wp_web_page_sk->[wr_web_page_sk]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[wr_returned_date_sk]
+------------------------PhysicalProject
+--------------------------hashAgg[LOCAL]
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_web_page_sk = web_page.wp_web_page_sk)) 
otherCondition=() build RFs:RF7 wp_web_page_sk->[wr_web_page_sk]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[wr_returned_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[web_returns] apply 
RFs: RF6 RF7
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[web_returns] apply 
RFs: RF6 RF7
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
-----------------------------------------------PhysicalOlapScan[date_dim]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[web_page]
+------------------------------------------filter((date_dim.d_date <= 
'1998-09-04') and (date_dim.d_date >= '1998-08-05'))
+--------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[web_page]
 
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 0c8124f96ed..e78afd78236 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
@@ -10,38 +10,36 @@ PhysicalResultSink
 --------------PhysicalDistribute[DistributionSpecHash]
 ----------------PhysicalProject
 ------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = 
store.d_date) and (web.item_sk = store.item_sk)) otherCondition=()
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF1
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF1
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
 
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 0c8124f96ed..e78afd78236 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
@@ -10,38 +10,36 @@ PhysicalResultSink
 --------------PhysicalDistribute[DistributionSpecHash]
 ----------------PhysicalProject
 ------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = 
store.d_date) and (web.item_sk = store.item_sk)) otherCondition=()
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF1
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF1
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute[DistributionSpecHash]
-----------------------PhysicalProject
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashAgg[GLOBAL]
-----------------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------------hashAgg[LOCAL]
---------------------------------------PhysicalProject
-----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
+--------------------PhysicalProject
+----------------------PhysicalWindow
+------------------------PhysicalQuickSort[LOCAL_SORT]
+--------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------PhysicalProject
+------------------------------hashAgg[GLOBAL]
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------hashAgg[LOCAL]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[ws_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------------------PhysicalProject
---------------------------------------------PhysicalOlapScan[web_sales] apply 
RFs: RF0
-------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------------PhysicalProject
-----------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
-------------------------------------------------PhysicalOlapScan[date_dim]
+--------------------------------------------filter((date_dim.d_month_seq <= 
1227) and (date_dim.d_month_seq >= 1216))
+----------------------------------------------PhysicalOlapScan[date_dim]
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org


Reply via email to