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

jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new cedd492dec4 [refactor](Nereids): unify all `replaceNamedExpressions` 
(#28228)
cedd492dec4 is described below

commit cedd492dec4c3e29edf694233d671511d2d6d3ca
Author: jakevin <[email protected]>
AuthorDate: Tue Jan 9 13:32:55 2024 +0800

    [refactor](Nereids): unify all `replaceNamedExpressions` (#28228)
    
    Use a unified function `replaceNamedExpressions ` instead of implementing 
it yourself repeatedly.
---
 .../nereids/rules/rewrite/EliminateFilter.java     | 10 +--
 .../rewrite/PushProjectIntoOneRowRelation.java     | 36 ++-------
 .../doris/nereids/trees/plans/algebra/Project.java | 13 +---
 .../apache/doris/nereids/util/ExpressionUtils.java | 33 +++++++++
 .../doris/nereids/util/ImmutableEqualSet.java      | 11 +--
 .../org/apache/doris/nereids/util/PlanUtils.java   | 23 +-----
 .../shape/query51.out                              | 85 +++++++++++-----------
 .../shape/query53.out                              | 61 ++++++++--------
 .../noStatsRfPrune/query51.out                     | 85 +++++++++++-----------
 .../noStatsRfPrune/query53.out                     | 57 +++++++--------
 .../no_stats_shape/query51.out                     | 85 +++++++++++-----------
 .../no_stats_shape/query53.out                     | 57 +++++++--------
 .../rf_prune/query51.out                           | 85 +++++++++++-----------
 .../rf_prune/query53.out                           | 61 ++++++++--------
 .../nereids_tpcds_shape_sf100_p0/shape/query51.out | 85 +++++++++++-----------
 .../nereids_tpcds_shape_sf100_p0/shape/query53.out | 61 ++++++++--------
 16 files changed, 405 insertions(+), 443 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateFilter.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateFilter.java
index 2f46c43ecff..a3de71a770e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateFilter.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateFilter.java
@@ -21,9 +21,8 @@ import org.apache.doris.nereids.rules.Rule;
 import org.apache.doris.nereids.rules.RuleType;
 import org.apache.doris.nereids.rules.expression.ExpressionRewriteContext;
 import org.apache.doris.nereids.rules.expression.rules.FoldConstantRule;
-import org.apache.doris.nereids.trees.expressions.Alias;
 import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.NamedExpression;
+import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.expressions.literal.BooleanLiteral;
 import org.apache.doris.nereids.trees.plans.Plan;
 import org.apache.doris.nereids.trees.plans.logical.LogicalEmptyRelation;
@@ -36,7 +35,6 @@ import com.google.common.collect.ImmutableSet;
 
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * Eliminate filter which is FALSE or TRUE.
@@ -68,11 +66,9 @@ public class EliminateFilter implements RewriteRuleFactory {
                 .toRule(RuleType.ELIMINATE_FILTER),
                 logicalFilter(logicalOneRowRelation()).thenApply(ctx -> {
                     LogicalFilter<LogicalOneRowRelation> filter = ctx.root;
-                    Map<Expression, Expression> replaceMap =
-                            filter.child().getOutputs().stream().filter(e -> e 
instanceof Alias)
-                                    
.collect(Collectors.toMap(NamedExpression::toSlot, e -> ((Alias) e).child()));
+                    Map<Slot, Expression> replaceMap = 
ExpressionUtils.generateReplaceMap(filter.child().getOutputs());
 
-                    ImmutableSet.Builder newConjuncts = ImmutableSet.builder();
+                    ImmutableSet.Builder<Expression> newConjuncts = 
ImmutableSet.builder();
                     ExpressionRewriteContext context =
                             new ExpressionRewriteContext(ctx.cascadesContext);
                     for (Expression expression : filter.getConjuncts()) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushProjectIntoOneRowRelation.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushProjectIntoOneRowRelation.java
index 04faffd9afc..21fad1904c1 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushProjectIntoOneRowRelation.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushProjectIntoOneRowRelation.java
@@ -19,16 +19,11 @@ package org.apache.doris.nereids.rules.rewrite;
 
 import org.apache.doris.nereids.rules.Rule;
 import org.apache.doris.nereids.rules.RuleType;
-import org.apache.doris.nereids.trees.expressions.Alias;
-import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.NamedExpression;
-import org.apache.doris.nereids.trees.expressions.SlotReference;
-import org.apache.doris.nereids.util.ExpressionUtils;
+import org.apache.doris.nereids.trees.plans.logical.LogicalOneRowRelation;
+import org.apache.doris.nereids.util.PlanUtils;
 
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Maps;
-
-import java.util.Map;
+import java.util.List;
 
 /**
  * Project(OneRowRelation) -> OneRowRelation
@@ -36,26 +31,11 @@ import java.util.Map;
 public class PushProjectIntoOneRowRelation extends OneRewriteRuleFactory {
     @Override
     public Rule build() {
-        return logicalProject(logicalOneRowRelation()).then(p -> {
-            Map<Expression, Expression> replaceMap = Maps.newHashMap();
-            Map<Expression, NamedExpression> replaceRootMap = 
Maps.newHashMap();
-            p.child().getProjects().forEach(ne -> {
-                if (ne instanceof Alias) {
-                    replaceMap.put(ne.toSlot(), ((Alias) ne).child());
-                } else {
-                    replaceMap.put(ne, ne);
-                }
-                replaceRootMap.put(ne.toSlot(), ne);
-            });
-            ImmutableList.Builder<NamedExpression> newProjections = 
ImmutableList.builder();
-            for (NamedExpression old : p.getProjects()) {
-                if (old instanceof SlotReference) {
-                    newProjections.add(replaceRootMap.get(old));
-                } else {
-                    newProjections.add((NamedExpression) 
ExpressionUtils.replace(old, replaceMap));
-                }
-            }
-            return p.child().withProjects(newProjections.build());
+        return logicalProject(logicalOneRowRelation()).then(project -> {
+            LogicalOneRowRelation oneRowRelation = project.child();
+            List<NamedExpression> namedExpressions = 
PlanUtils.mergeProjections(oneRowRelation.getProjects(),
+                    project.getProjects());
+            return oneRowRelation.withProjects(namedExpressions);
 
         }).toRule(RuleType.PUSH_PROJECT_INTO_ONE_ROW_RELATION);
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java
index 1f1573fd65b..9238f869545 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.plans.algebra;
 
 import org.apache.doris.nereids.exceptions.AnalysisException;
-import org.apache.doris.nereids.trees.expressions.Alias;
 import org.apache.doris.nereids.trees.expressions.ExprId;
 import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.NamedExpression;
@@ -31,7 +30,6 @@ import com.google.common.collect.ImmutableMap;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * Common interface for logical/physical project.
@@ -51,16 +49,7 @@ public interface Project {
      * </pre>
      */
     default Map<Slot, Expression> getAliasToProducer() {
-        return getProjects()
-                .stream()
-                .filter(Alias.class::isInstance)
-                .collect(
-                        Collectors.toMap(
-                                NamedExpression::toSlot,
-                                // Avoid cast to alias, retrieving the first 
child expression.
-                                alias -> alias.child(0)
-                        )
-                );
+        return ExpressionUtils.generateReplaceMap(getProjects());
     }
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
index b9c240df415..7a2d9fc27d5 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
@@ -304,6 +304,22 @@ public class ExpressionUtils {
         }
     }
 
+    /**
+     * Generate replaceMap Slot -> Expression from NamedExpression[Expression 
as name]
+     */
+    public static Map<Slot, Expression> 
generateReplaceMap(List<NamedExpression> namedExpressions) {
+        return namedExpressions
+                .stream()
+                .filter(Alias.class::isInstance)
+                .collect(
+                        Collectors.toMap(
+                                NamedExpression::toSlot,
+                                // Avoid cast to alias, retrieving the first 
child expression.
+                                alias -> alias.child(0)
+                        )
+                );
+    }
+
     /**
      * Replace expression node in the expression tree by `replaceMap` in 
top-down manner.
      * For example.
@@ -346,6 +362,23 @@ public class ExpressionUtils {
                 .collect(ImmutableSet.toImmutableSet());
     }
 
+    /**
+     * Replace expression node in the expression tree by `replaceMap` in 
top-down manner.
+     */
+    public static List<NamedExpression> 
replaceNamedExpressions(List<NamedExpression> namedExpressions,
+            Map<? extends Expression, ? extends Expression> replaceMap) {
+        return namedExpressions.stream()
+                .map(namedExpression -> {
+                    NamedExpression newExpr = replace(namedExpression, 
replaceMap);
+                    if 
(newExpr.getExprId().equals(namedExpression.getExprId())) {
+                        return newExpr;
+                    } else {
+                        return new Alias(namedExpression.getExprId(), newExpr, 
namedExpression.getName());
+                    }
+                })
+                .collect(ImmutableList.toImmutableList());
+    }
+
     public static <E extends Expression> List<E> rewriteDownShortCircuit(
             Collection<E> exprs, Function<Expression, Expression> 
rewriteFunction) {
         return exprs.stream()
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ImmutableEqualSet.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ImmutableEqualSet.java
index 724414e2e19..e8dcbe084d6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ImmutableEqualSet.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ImmutableEqualSet.java
@@ -53,16 +53,9 @@ public class ImmutableEqualSet<T> {
         public void addEqualPair(T a, T b) {
             T root1 = findRoot(a);
             T root2 = findRoot(b);
-
             if (root1 != root2) {
-                // merge by size
-                if (size.get(root1) < size.get(root2)) {
-                    parent.put(root1, root2);
-                    size.put(root2, size.get(root2) + size.get(root1));
-                } else {
-                    parent.put(root2, root1);
-                    size.put(root1, size.get(root1) + size.get(root2));
-                }
+                parent.put(b, root1);
+                findRoot(b);
             }
         }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/PlanUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/PlanUtils.java
index 48eb452a74c..0dbd6044cae 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/PlanUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/PlanUtils.java
@@ -17,7 +17,6 @@
 
 package org.apache.doris.nereids.util;
 
-import org.apache.doris.nereids.trees.expressions.Alias;
 import org.apache.doris.nereids.trees.expressions.ComparisonPredicate;
 import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.NamedExpression;
@@ -27,14 +26,12 @@ import 
org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
 import org.apache.doris.nereids.trees.plans.logical.LogicalLimit;
 import org.apache.doris.nereids.trees.plans.logical.LogicalProject;
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Sets;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 /**
  * Util for plan
@@ -78,24 +75,8 @@ public class PlanUtils {
      */
     public static List<NamedExpression> mergeProjections(List<NamedExpression> 
childProjects,
             List<NamedExpression> parentProjects) {
-        Map<Expression, Alias> replaceMap =
-                childProjects.stream().filter(e -> e instanceof Alias).collect(
-                        Collectors.toMap(NamedExpression::toSlot, e -> (Alias) 
e, (v1, v2) -> v1));
-        return parentProjects.stream().map(expr -> {
-            if (expr instanceof Alias) {
-                Alias alias = (Alias) expr;
-                Expression insideExpr = alias.child();
-                Expression newInsideExpr = insideExpr.rewriteUp(e -> {
-                    Alias getAlias = replaceMap.get(e);
-                    return getAlias == null ? e : getAlias.child();
-                });
-                return newInsideExpr == insideExpr ? expr
-                        : alias.withChildren(ImmutableList.of(newInsideExpr));
-            } else {
-                Alias getAlias = replaceMap.get(expr);
-                return getAlias == null ? expr : getAlias;
-            }
-        }).collect(ImmutableList.toImmutableList());
+        Map<Slot, Expression> replaceMap = 
ExpressionUtils.generateReplaceMap(childProjects);
+        return ExpressionUtils.replaceNamedExpressions(parentProjects, 
replaceMap);
     }
 
     public static Plan skipProjectFilterLimit(Plan plan) {
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 7824ec86b7b..a2b1574bf0e 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
@@ -1,49 +1,48 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_51 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((web_cumulative > store_cumulative))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------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]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((web_cumulative > store_cumulative))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------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
+----------------------------------------------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]
+----------------------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]
+--------------------------------------------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_sf1000_p0/shape/query53.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query53.out
index ad1f58a01a3..1932fa62f3b 100644
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query53.out
+++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query53.out
@@ -1,36 +1,35 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_53 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
---------------------------------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
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
-----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1 RF2
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
-----------------------------------------------PhysicalOlapScan[item]
-------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------PhysicalProject
-----------------------------------------filter(d_month_seq IN (1186, 1187, 
1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197))
-------------------------------------------PhysicalOlapScan[date_dim]
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------PhysicalProject
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
+------------------------------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]
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1 RF2
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------------------PhysicalProject
+------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
+--------------------------------------------PhysicalOlapScan[item]
+----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------PhysicalProject
+--------------------------------------filter(d_month_seq IN (1186, 1187, 1188, 
1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197))
+----------------------------------------PhysicalOlapScan[date_dim]
+------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[store]
 
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 19f1ce2f7bf..648db486099 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
@@ -1,49 +1,48 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_51 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((web_cumulative > store_cumulative))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------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]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((web_cumulative > store_cumulative))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------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
+----------------------------------------------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]
+----------------------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]
+--------------------------------------------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/query53.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query53.out
index 4bd2e6d21f0..c8024da9168 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query53.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query53.out
@@ -1,35 +1,34 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_53 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
---------------------------------PhysicalProject
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF1 i_item_sk->[ss_item_sk]
-------------------------------------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 RF1
---------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------PhysicalProject
-------------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
---------------------------------------------PhysicalOlapScan[date_dim]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------PhysicalProject
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
+------------------------------PhysicalProject
+--------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF1 i_item_sk->[ss_item_sk]
+----------------------------------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 RF1
 
------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------------------PhysicalProject
-----------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
-------------------------------------------PhysicalOlapScan[item]
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store]
+----------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
+------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------PhysicalProject
+--------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
+----------------------------------------PhysicalOlapScan[item]
+------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[store]
 
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 19f1ce2f7bf..648db486099 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
@@ -1,49 +1,48 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_51 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((web_cumulative > store_cumulative))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------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]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((web_cumulative > store_cumulative))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------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
+----------------------------------------------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]
+----------------------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]
+--------------------------------------------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/query53.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query53.out
index 72eb97c8be7..7d5ebf71070 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query53.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query53.out
@@ -1,35 +1,34 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_53 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
---------------------------------PhysicalProject
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF1 i_item_sk->[ss_item_sk]
-------------------------------------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 RF1 RF2
---------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------PhysicalProject
-------------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
---------------------------------------------PhysicalOlapScan[date_dim]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------PhysicalProject
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
+------------------------------PhysicalProject
+--------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF1 i_item_sk->[ss_item_sk]
+----------------------------------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 RF1 RF2
 
------------------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------------------PhysicalProject
-----------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
-------------------------------------------PhysicalOlapScan[item]
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store]
+----------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
+------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------PhysicalProject
+--------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
+----------------------------------------PhysicalOlapScan[item]
+------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[store]
 
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 19f1ce2f7bf..648db486099 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
@@ -1,49 +1,48 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_51 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((web_cumulative > store_cumulative))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------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]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((web_cumulative > store_cumulative))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------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
+----------------------------------------------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]
+----------------------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]
+--------------------------------------------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/rf_prune/query53.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query53.out
index 822cb5b88a7..05565e6c372 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query53.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query53.out
@@ -1,36 +1,35 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_53 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
---------------------------------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
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
-----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
-----------------------------------------------PhysicalOlapScan[item]
-------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------PhysicalProject
-----------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
-------------------------------------------PhysicalOlapScan[date_dim]
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------PhysicalProject
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=()
+------------------------------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]
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------------------PhysicalProject
+------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
+--------------------------------------------PhysicalOlapScan[item]
+----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------PhysicalProject
+--------------------------------------filter(d_month_seq IN (1200, 1201, 1202, 
1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
+----------------------------------------PhysicalOlapScan[date_dim]
+------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[store]
 
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 19f1ce2f7bf..648db486099 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
@@ -1,49 +1,48 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_51 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((web_cumulative > store_cumulative))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------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]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((web_cumulative > store_cumulative))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------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
+----------------------------------------------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]
+----------------------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]
+--------------------------------------------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/query53.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query53.out
index c2836ccea5f..53b753ee604 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query53.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query53.out
@@ -1,36 +1,35 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !ds_shape_53 --
 PhysicalResultSink
---PhysicalProject
-----PhysicalTopN[MERGE_SORT]
-------PhysicalDistribute[DistributionSpecGather]
---------PhysicalTopN[LOCAL_SORT]
-----------PhysicalProject
-------------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
---------------PhysicalWindow
-----------------PhysicalQuickSort[LOCAL_SORT]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
---------------------------------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
---------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
-----------------------------------------PhysicalProject
-------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1 RF2
-----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------------PhysicalProject
---------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
-----------------------------------------------PhysicalOlapScan[item]
-------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------PhysicalProject
-----------------------------------------filter(d_month_seq IN (1200, 1201, 
1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
-------------------------------------------PhysicalOlapScan[date_dim]
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--PhysicalTopN[MERGE_SORT]
+----PhysicalDistribute[DistributionSpecGather]
+------PhysicalTopN[LOCAL_SORT]
+--------PhysicalProject
+----------filter((if((avg_quarterly_sales > 0.0000), (cast(abs((sum_sales - 
cast(avg_quarterly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / 
avg_quarterly_sales), NULL) > 0.100000))
+------------PhysicalWindow
+--------------PhysicalQuickSort[LOCAL_SORT]
+----------------PhysicalDistribute[DistributionSpecHash]
+------------------PhysicalProject
+--------------------hashAgg[GLOBAL]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------hashAgg[LOCAL]
+--------------------------PhysicalProject
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() 
build RFs:RF2 s_store_sk->[ss_store_sk]
+------------------------------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]
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF0 i_item_sk->[ss_item_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF0 RF1 RF2
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------------------PhysicalProject
+------------------------------------------filter((((i_category IN ('Books', 
'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 
'self-help')) AND i_brand IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 
'scholaramalgamalg #7', 'scholaramalgamalg #9')) OR ((i_category IN ('Men', 
'Music', 'Women') AND i_class IN ('accessories', 'classical', 'fragrances', 
'pants')) AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 
'exportiimporto #1', 'importoamalg #1'))))
+--------------------------------------------PhysicalOlapScan[item]
+----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------PhysicalProject
+--------------------------------------filter(d_month_seq IN (1200, 1201, 1202, 
1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211))
+----------------------------------------PhysicalOlapScan[date_dim]
+------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------PhysicalProject
+----------------------------------PhysicalOlapScan[store]
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to