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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new af986c370b7 [feat](Nereids): Put the Child with Least Row Count in the 
First Position of Intersect (#34290) (#35339)
af986c370b7 is described below

commit af986c370b7669e3033fc3ae0b06a769a7021cc4
Author: 谢健 <[email protected]>
AuthorDate: Mon May 27 11:52:35 2024 +0800

    [feat](Nereids): Put the Child with Least Row Count in the First Position 
of Intersect (#34290) (#35339)
    
    In this pull request, we optimize the ordering of children in the Intersect 
operator to improve query performance. The proposed change is to place the 
child with the least row count in the first position of the Intersect operator.
    
    The rationale behind this optimization is that the Intersect operator works 
by first evaluating the leftmost child and then iterating through the results 
of the other children to find matching rows. By placing the child with the 
least row count first, we can minimize the number of iterations required to 
find the matching rows, thereby reducing the overall execution time of the 
query.
---
 .../org/apache/doris/nereids/cost/CostModelV1.java | 11 ++++
 .../org/apache/doris/nereids/rules/RuleSet.java    |  2 +
 .../org/apache/doris/nereids/rules/RuleType.java   |  1 +
 .../rules/exploration/IntersectReorder.java        | 69 ++++++++++++++++++++++
 .../rules/exploration/IntersectReorderTest.java    | 69 ++++++++++++++++++++++
 .../doris/nereids/util/LogicalPlanBuilder.java     |  6 ++
 .../bs_downgrade_shape/query8.out                  |  8 +--
 .../nereids_tpcds_shape_sf1000_p0/shape/query8.out |  8 +--
 .../noStatsRfPrune/query14.out                     | 16 ++---
 .../noStatsRfPrune/query8.out                      |  8 +--
 .../no_stats_shape/query14.out                     | 16 ++---
 .../no_stats_shape/query8.out                      |  8 +--
 .../rf_prune/query8.out                            |  8 +--
 .../nereids_tpcds_shape_sf100_p0/shape/query8.out  |  8 +--
 14 files changed, 198 insertions(+), 40 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
index 87e0f8ab9fa..483ccfbcc7c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
@@ -35,6 +35,7 @@ import 
org.apache.doris.nereids.trees.plans.physical.PhysicalFileScan;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalGenerate;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalHashAggregate;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalHashJoin;
+import org.apache.doris.nereids.trees.plans.physical.PhysicalIntersect;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalJdbcScan;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalNestedLoopJoin;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalOdbcScan;
@@ -384,6 +385,16 @@ class CostModelV1 extends PlanVisitor<Cost, PlanContext> {
         );
     }
 
+    @Override
+    public Cost visitPhysicalIntersect(PhysicalIntersect physicalIntersect, 
PlanContext context) {
+        double cpuCost = 0.0;
+        for (int i = 0; i < physicalIntersect.children().size(); i++) {
+            cpuCost += context.getChildStatistics(i).getRowCount();
+        }
+        double memoryCost = context.getChildStatistics(0).computeSize();
+        return CostV1.of(context.getSessionVariable(), cpuCost, memoryCost, 0);
+    }
+
     @Override
     public Cost visitPhysicalGenerate(PhysicalGenerate<? extends Plan> 
generate, PlanContext context) {
         Statistics statistics = context.getStatisticsWithCheck();
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleSet.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleSet.java
index e6a3b6cb2f6..cafdb953200 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleSet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleSet.java
@@ -17,6 +17,7 @@
 
 package org.apache.doris.nereids.rules;
 
+import org.apache.doris.nereids.rules.exploration.IntersectReorder;
 import org.apache.doris.nereids.rules.exploration.MergeProjectsCBO;
 import org.apache.doris.nereids.rules.exploration.TransposeAggSemiJoin;
 import org.apache.doris.nereids.rules.exploration.TransposeAggSemiJoinProject;
@@ -123,6 +124,7 @@ public class RuleSet {
 
     public static final List<Rule> EXPLORATION_RULES = planRuleFactories()
             .add(new MergeProjectsCBO())
+            .add(IntersectReorder.INSTANCE)
             .build();
 
     public static final List<Rule> OTHER_REORDER_RULES = planRuleFactories()
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java
index d3dac32355c..71218bd2e8d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java
@@ -334,6 +334,7 @@ public enum RuleType {
     BUILD_AGG_FOR_RANDOM_DISTRIBUTED_TABLE_FILTER_SCAN(RuleTypeClass.REWRITE),
     BUILD_AGG_FOR_RANDOM_DISTRIBUTED_TABLE_AGG_SCAN(RuleTypeClass.REWRITE),
     // exploration rules
+    REORDER_INTERSECT(RuleTypeClass.EXPLORATION),
     TEST_EXPLORATION(RuleTypeClass.EXPLORATION),
     OR_EXPANSION(RuleTypeClass.EXPLORATION),
     LOGICAL_JOIN_COMMUTE(RuleTypeClass.EXPLORATION),
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/IntersectReorder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/IntersectReorder.java
new file mode 100644
index 00000000000..25eada7561f
--- /dev/null
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/IntersectReorder.java
@@ -0,0 +1,69 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.exploration;
+
+import org.apache.doris.nereids.rules.Rule;
+import org.apache.doris.nereids.rules.RuleType;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.plans.GroupPlan;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.algebra.SetOperation.Qualifier;
+
+import com.google.common.collect.Lists;
+
+import java.util.List;
+
+/**
+ * this rule put the child with least row count to the first child of 
intersect op
+ */
+public class IntersectReorder extends OneExplorationRuleFactory {
+
+    public static final IntersectReorder INSTANCE = new IntersectReorder();
+
+    @Override
+    public Rule build() {
+        return logicalIntersect()
+                .when(logicalIntersect -> 
logicalIntersect.getQualifier().equals(Qualifier.DISTINCT))
+                .then(logicalIntersect -> {
+                    int minChildIdx = 0;
+                    double minRowCount = Double.MAX_VALUE;
+                    for (int i = 0; i < logicalIntersect.children().size(); 
i++) {
+                        GroupPlan child = (GroupPlan) 
logicalIntersect.child(i);
+                        if (child.getGroup().getStatistics().getRowCount() < 
minRowCount) {
+                            minChildIdx = i;
+                            minRowCount = 
child.getGroup().getStatistics().getRowCount();
+                        }
+                    }
+                    if (minChildIdx == 0) {
+                        return null;
+                    }
+                    List<Plan> children = 
Lists.newArrayList(logicalIntersect.children());
+                    List<List<SlotReference>> regularOutput =
+                            
Lists.newArrayList(logicalIntersect.getRegularChildrenOutputs());
+                    children.set(0, logicalIntersect.child(minChildIdx));
+                    children.set(minChildIdx, logicalIntersect.child(0));
+                    if (regularOutput.isEmpty()) {
+                        return logicalIntersect.withChildren(children);
+                    }
+                    regularOutput.set(0, 
logicalIntersect.getRegularChildOutput(minChildIdx));
+                    regularOutput.set(minChildIdx, 
logicalIntersect.getRegularChildOutput(0));
+                    return 
logicalIntersect.withChildrenAndTheirOutputs(children, regularOutput);
+                })
+                .toRule(RuleType.REORDER_INTERSECT);
+    }
+}
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/IntersectReorderTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/IntersectReorderTest.java
new file mode 100644
index 00000000000..74f066c4cc2
--- /dev/null
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/IntersectReorderTest.java
@@ -0,0 +1,69 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.exploration;
+
+import org.apache.doris.nereids.CascadesContext;
+import org.apache.doris.nereids.memo.Group;
+import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan;
+import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
+import org.apache.doris.nereids.util.LogicalPlanBuilder;
+import org.apache.doris.nereids.util.MemoPatternMatchSupported;
+import org.apache.doris.nereids.util.MemoTestUtils;
+import org.apache.doris.nereids.util.PlanChecker;
+import org.apache.doris.nereids.util.PlanConstructor;
+import org.apache.doris.statistics.Statistics;
+
+import com.google.common.collect.ImmutableList;
+import org.junit.jupiter.api.Test;
+
+import java.util.HashMap;
+
+class IntersectReorderTest implements MemoPatternMatchSupported {
+
+    private final LogicalOlapScan scan1 = 
PlanConstructor.newLogicalOlapScan(0, "t1", 0);
+    private final LogicalOlapScan scan2 = 
PlanConstructor.newLogicalOlapScan(1, "t2", 0);
+
+    @Test
+    void test() {
+        LogicalPlan plan = new LogicalPlanBuilder(scan1)
+                .intersect(ImmutableList.of(scan2, scan1))
+                .build();
+
+        CascadesContext ctx = MemoTestUtils.createCascadesContext(plan);
+        for (Group group : ctx.getMemo().getGroups()) {
+            if (group.getLogicalExpression().getPlan() instanceof 
LogicalOlapScan) {
+                LogicalOlapScan scan = (LogicalOlapScan) 
group.getLogicalExpression().getPlan();
+                if (scan.equals(scan1)) {
+                    group.setStatistics(new Statistics(1, new HashMap<>()));
+                }
+                if (scan.equals(scan2)) {
+                    group.setStatistics(new Statistics(2, new HashMap<>()));
+                }
+            }
+        }
+        PlanChecker.from(ctx)
+                .applyExploration(IntersectReorder.INSTANCE.build())
+                .printlnExploration()
+                .matchesExploration(
+                        logicalIntersect(
+                                logicalOlapScan().when(scan -> 
scan.equals(scan1)),
+                                logicalOlapScan().when(scan -> 
scan.equals(scan2))
+                        )
+                );
+    }
+}
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/LogicalPlanBuilder.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/LogicalPlanBuilder.java
index 053f0e2d80b..f7101e4bb04 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/LogicalPlanBuilder.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/LogicalPlanBuilder.java
@@ -31,9 +31,11 @@ import org.apache.doris.nereids.trees.plans.DistributeType;
 import org.apache.doris.nereids.trees.plans.JoinType;
 import org.apache.doris.nereids.trees.plans.LimitPhase;
 import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.algebra.SetOperation.Qualifier;
 import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
 import org.apache.doris.nereids.trees.plans.logical.LogicalAssertNumRows;
 import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
+import org.apache.doris.nereids.trees.plans.logical.LogicalIntersect;
 import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
 import org.apache.doris.nereids.trees.plans.logical.LogicalLimit;
 import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan;
@@ -231,4 +233,8 @@ public class LogicalPlanBuilder {
                 new AssertNumRowsElement(numRows, "", assertion), this.plan);
         return from(assertNumRows);
     }
+
+    public LogicalPlanBuilder intersect(List<Plan> children) {
+        return from(new LogicalIntersect(Qualifier.DISTINCT, children));
+    }
 }
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query8.out
 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query8.out
index aa750d86818..c7b568a824f 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query8.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/bs_downgrade_shape/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -44,4 +40,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query8.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query8.out
index 28aa0fc2442..8368b9deff6 100644
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query8.out
+++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -43,4 +39,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query14.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query14.out
index b4b3526d38b..8dd1172b32e 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query14.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query14.out
@@ -7,17 +7,17 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------PhysicalIntersect
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk 
= d1.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = 
d3.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk 
= iss.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = 
iws.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ws_item_sk]
 --------------------PhysicalProject
-----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
 ------------------------PhysicalOlapScan[item]
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------filter((d1.d_year <= 2002) and (d1.d_year >= 2000))
+--------------------filter((d3.d_year <= 2002) and (d3.d_year >= 2000))
 ----------------------PhysicalOlapScan[date_dim]
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
@@ -35,17 +35,17 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 ----------------------PhysicalOlapScan[date_dim]
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = 
d3.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ws_sold_date_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk 
= d1.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = 
iws.i_item_sk)) otherCondition=()
+------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk 
= iss.i_item_sk)) otherCondition=()
 --------------------PhysicalProject
-----------------------PhysicalOlapScan[web_sales] apply RFs: RF5
+----------------------PhysicalOlapScan[store_sales] apply RFs: RF5
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
 ------------------------PhysicalOlapScan[item]
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------filter((d3.d_year <= 2002) and (d3.d_year >= 2000))
+--------------------filter((d1.d_year <= 2002) and (d1.d_year >= 2000))
 ----------------------PhysicalOlapScan[date_dim]
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query8.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query8.out
index 8cc8346be1f..03428cce88a 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query8.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -43,4 +39,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query14.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query14.out
index b6a98320d1f..76221a53aca 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query14.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query14.out
@@ -7,17 +7,17 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------PhysicalIntersect
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk 
= d1.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = 
d3.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk 
= iss.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ss_item_sk]
+------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = 
iws.i_item_sk)) otherCondition=() build RFs:RF0 i_item_sk->[ws_item_sk]
 --------------------PhysicalProject
-----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
+----------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
 ------------------------PhysicalOlapScan[item] apply RFs: RF6 RF7 RF8
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------filter((d1.d_year <= 2002) and (d1.d_year >= 2000))
+--------------------filter((d3.d_year <= 2002) and (d3.d_year >= 2000))
 ----------------------PhysicalOlapScan[date_dim]
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
@@ -35,17 +35,17 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 ----------------------PhysicalOlapScan[date_dim]
 ----------PhysicalDistribute[DistributionSpecHash]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = 
d3.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ws_sold_date_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk 
= d1.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = 
iws.i_item_sk)) otherCondition=() build RFs:RF4 i_item_sk->[ws_item_sk]
+------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk 
= iss.i_item_sk)) otherCondition=() build RFs:RF4 i_item_sk->[ss_item_sk]
 --------------------PhysicalProject
-----------------------PhysicalOlapScan[web_sales] apply RFs: RF4 RF5
+----------------------PhysicalOlapScan[store_sales] apply RFs: RF4 RF5
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
 ------------------------PhysicalOlapScan[item] apply RFs: RF6 RF7 RF8
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------filter((d3.d_year <= 2002) and (d3.d_year >= 2000))
+--------------------filter((d1.d_year <= 2002) and (d1.d_year >= 2000))
 ----------------------PhysicalOlapScan[date_dim]
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query8.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query8.out
index 28aa0fc2442..8368b9deff6 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query8.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -43,4 +39,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query8.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query8.out
index 8cc8346be1f..03428cce88a 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query8.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -43,4 +39,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 
diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out
index 28aa0fc2442..8368b9deff6 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out
@@ -27,10 +27,6 @@ PhysicalResultSink
 ----------------------PhysicalIntersect
 ------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------PhysicalProject
-----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
-------------------------------PhysicalOlapScan[customer_address]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
 ----------------------------filter((cnt > 10))
 ------------------------------hashAgg[GLOBAL]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
@@ -43,4 +39,8 @@ PhysicalResultSink
 ------------------------------------------PhysicalProject
 
--------------------------------------------filter((customer.c_preferred_cust_flag
 = 'Y'))
 ----------------------------------------------PhysicalOlapScan[customer]
+------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------PhysicalProject
+----------------------------filter(substring(ca_zip, 1, 5) IN ('10298', 
'10374', '10425', '11340', '11489', '11618', '11652', '11686', '11855', 
'11912', '12197', '12318', '12320', '12350', '13086', '13123', '13261', 
'13338', '13376', '13378', '13443', '13844', '13869', '13918', '14073', 
'14155', '14196', '14242', '14312', '14440', '14530', '14851', '15371', 
'15475', '15543', '15734', '15751', '15782', '15794', '16005', '16226', 
'16364', '16515', '16704', '16791', '16891', '17167', '17193 [...]
+------------------------------PhysicalOlapScan[customer_address]
 


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


Reply via email to