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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new cd456857c60 [fix](Nereids) exists should not return null (#29435) 
(#29836)
cd456857c60 is described below

commit cd456857c608287f9eaf29caee221bdf7d480b63
Author: morrySnow <[email protected]>
AuthorDate: Thu Jan 11 14:03:05 2024 +0800

    [fix](Nereids) exists should not return null (#29435) (#29836)
    
    PR #29435
    commit 2b3e75bb2725ee49291ebf1b4ac0cb2796aef190
---
 .../nereids/rules/analysis/SubqueryToApply.java    |  3 +-
 .../nereids/rules/rewrite/ExistsApplyToJoin.java   | 37 +++++----
 .../nereids/trees/plans/logical/LogicalApply.java  |  9 ++-
 .../nereids_tpcds_shape_sf1000_p0/shape/query1.out | 43 -----------
 .../shape/query49.out                              | 89 ----------------------
 .../shape/query75.out                              | 81 --------------------
 .../shape/query76.out                              | 52 -------------
 .../shape/query95.out                              | 53 -------------
 .../shape/query97.out                              | 37 ---------
 .../noStatsRfPrune/query95.out                     | 53 -------------
 .../no_stats_shape/query95.out                     | 53 -------------
 .../rf_prune/query44.out                           | 71 -----------------
 .../rf_prune/query76.out                           | 50 ------------
 .../rf_prune/query95.out                           | 53 -------------
 .../nereids_tpcds_shape_sf100_p0/shape/query10.out |  2 +-
 .../nereids_tpcds_shape_sf100_p0/shape/query35.out |  2 +-
 16 files changed, 26 insertions(+), 662 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java
index 675575ad298..12eed92b402 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java
@@ -37,6 +37,7 @@ import 
org.apache.doris.nereids.trees.expressions.ScalarSubquery;
 import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.expressions.SlotReference;
 import org.apache.doris.nereids.trees.expressions.SubqueryExpr;
+import org.apache.doris.nereids.trees.expressions.functions.scalar.Nvl;
 import org.apache.doris.nereids.trees.expressions.literal.BooleanLiteral;
 import 
org.apache.doris.nereids.trees.expressions.visitor.DefaultExpressionRewriter;
 import org.apache.doris.nereids.trees.plans.Plan;
@@ -442,7 +443,7 @@ public class SubqueryToApply implements AnalysisRuleFactory 
{
                     MarkJoinSlotReference markJoinSlotReference =
                             new 
MarkJoinSlotReference(statementContext.generateColumnName());
                     context.setSubqueryToMarkJoinSlot(exists, 
Optional.of(markJoinSlotReference));
-                    return markJoinSlotReference;
+                    return new Nvl(markJoinSlotReference, 
BooleanLiteral.FALSE);
                 } else {
                     return BooleanLiteral.TRUE;
                 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ExistsApplyToJoin.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ExistsApplyToJoin.java
index f4b2cbc9a19..3e3efb070f9 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ExistsApplyToJoin.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ExistsApplyToJoin.java
@@ -44,27 +44,27 @@ import java.util.ArrayList;
 import java.util.Optional;
 
 /**
- * Convert Existsapply to LogicalJoin.
+ * Convert ExistsApply to LogicalJoin.
  * <p>
  * Exists
  *    Correlated -> LEFT_SEMI_JOIN
  *         apply                  LEFT_SEMI_JOIN(Correlated Predicate)
  *      /       \         -->       /           \
  *    input    queryPlan          input        queryPlan
- *
+ * <p>
  *    UnCorrelated -> CROSS_JOIN(limit(1))
  *          apply                       CROSS_JOIN
  *      /           \          -->      /       \
  *    input        queryPlan          input    limit(1)
  *                                               |
  *                                             queryPlan
- *
+ * <p>
  * Not Exists
  *    Correlated -> LEFT_ANTI_JOIN
  *          apply                  LEFT_ANTI_JOIN(Correlated Predicate)
  *       /       \         -->       /           \
  *     input    queryPlan          input        queryPlan
- *
+ * <p>
  *    UnCorrelated -> CROSS_JOIN(Count(*))
  *                                    Filter(count(*) = 0)
  *                                          |
@@ -88,29 +88,24 @@ public class ExistsApplyToJoin extends 
OneRewriteRuleFactory {
         }).toRule(RuleType.EXISTS_APPLY_TO_JOIN);
     }
 
-    private Plan correlatedToJoin(LogicalApply apply) {
+    private Plan correlatedToJoin(LogicalApply<?, ?> apply) {
         Optional<Expression> correlationFilter = apply.getCorrelationFilter();
-        Expression predicate = correlationFilter.get();
         if (((Exists) apply.getSubqueryExpr()).isNot()) {
             return new LogicalJoin<>(JoinType.LEFT_ANTI_JOIN, 
ExpressionUtils.EMPTY_CONDITION,
-                    predicate != null
-                        ? ExpressionUtils.extractConjunction(predicate)
-                        : ExpressionUtils.EMPTY_CONDITION,
+                    
correlationFilter.map(ExpressionUtils::extractConjunction).orElse(ExpressionUtils.EMPTY_CONDITION),
                     JoinHint.NONE,
                     apply.getMarkJoinSlotReference(),
                     apply.children());
         } else {
             return new LogicalJoin<>(JoinType.LEFT_SEMI_JOIN, 
ExpressionUtils.EMPTY_CONDITION,
-                    predicate != null
-                        ? ExpressionUtils.extractConjunction(predicate)
-                        : ExpressionUtils.EMPTY_CONDITION,
+                    
correlationFilter.map(ExpressionUtils::extractConjunction).orElse(ExpressionUtils.EMPTY_CONDITION),
                     JoinHint.NONE,
                     apply.getMarkJoinSlotReference(),
                     apply.children());
         }
     }
 
-    private Plan unCorrelatedToJoin(LogicalApply unapply) {
+    private Plan unCorrelatedToJoin(LogicalApply<?, ?> unapply) {
         if (((Exists) unapply.getSubqueryExpr()).isNot()) {
             return unCorrelatedNotExist(unapply);
         } else {
@@ -118,20 +113,22 @@ public class ExistsApplyToJoin extends 
OneRewriteRuleFactory {
         }
     }
 
-    private Plan unCorrelatedNotExist(LogicalApply unapply) {
-        LogicalLimit newLimit = new LogicalLimit<>(1, 0, LimitPhase.ORIGIN, 
(LogicalPlan) unapply.right());
+    private Plan unCorrelatedNotExist(LogicalApply<?, ?> unapply) {
+        LogicalLimit<?> newLimit = new LogicalLimit<>(1, 0, LimitPhase.ORIGIN, 
(LogicalPlan) unapply.right());
         Alias alias = new Alias(new Count(), "count(*)");
-        LogicalAggregate newAgg = new LogicalAggregate<>(new ArrayList<>(),
+        LogicalAggregate<?> newAgg = new LogicalAggregate<>(new ArrayList<>(),
                 ImmutableList.of(alias), newLimit);
-        LogicalJoin newJoin = new LogicalJoin<>(JoinType.CROSS_JOIN, 
ExpressionUtils.EMPTY_CONDITION,
-                ExpressionUtils.EMPTY_CONDITION, JoinHint.NONE, 
unapply.getMarkJoinSlotReference(),
+        LogicalJoin<?, ?> newJoin = new LogicalJoin<>(JoinType.CROSS_JOIN, 
ExpressionUtils.EMPTY_CONDITION,
+                ExpressionUtils.EMPTY_CONDITION,
+                JoinHint.NONE,
+                unapply.getMarkJoinSlotReference(),
                 (LogicalPlan) unapply.left(), newAgg);
         return new LogicalFilter<>(ImmutableSet.of(new 
EqualTo(newAgg.getOutput().get(0),
                 new IntegerLiteral(0))), newJoin);
     }
 
-    private Plan unCorrelatedExist(LogicalApply unapply) {
-        LogicalLimit newLimit = new LogicalLimit<>(1, 0, LimitPhase.ORIGIN, 
(LogicalPlan) unapply.right());
+    private Plan unCorrelatedExist(LogicalApply<?, ?> unapply) {
+        LogicalLimit<?> newLimit = new LogicalLimit<>(1, 0, LimitPhase.ORIGIN, 
(LogicalPlan) unapply.right());
         return new LogicalJoin<>(JoinType.CROSS_JOIN, 
ExpressionUtils.EMPTY_CONDITION,
             ExpressionUtils.EMPTY_CONDITION,
             JoinHint.NONE, unapply.getMarkJoinSlotReference(), (LogicalPlan) 
unapply.left(), newLimit);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalApply.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalApply.java
index 70f8db04f15..885a597eec3 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalApply.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalApply.java
@@ -163,7 +163,7 @@ public class LogicalApply<LEFT_CHILD_TYPE extends Plan, 
RIGHT_CHILD_TYPE extends
         if (o == null || getClass() != o.getClass()) {
             return false;
         }
-        LogicalApply that = (LogicalApply) o;
+        LogicalApply<?, ?> that = (LogicalApply<?, ?>) o;
         return Objects.equals(correlationSlot, that.getCorrelationSlot())
                 && Objects.equals(subqueryExpr, that.getSubqueryExpr())
                 && Objects.equals(correlationFilter, 
that.getCorrelationFilter())
@@ -191,10 +191,11 @@ public class LogicalApply<LEFT_CHILD_TYPE extends Plan, 
RIGHT_CHILD_TYPE extends
                     .addAll(correlationSlot)
                     .add(correlationFilter.get())
                     .build();
+        } else {
+            return new ImmutableList.Builder<Expression>()
+                    .addAll(correlationSlot)
+                    .build();
         }
-        return new ImmutableList.Builder<Expression>()
-                .addAll(correlationSlot)
-                .build();
     }
 
     public LogicalApply<Plan, Plan> withSubqueryExprAndChildren(SubqueryExpr 
subqueryExpr, List<Plan> children) {
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query1.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query1.out
deleted file mode 100644
index 50d0c4bce67..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query1.out
+++ /dev/null
@@ -1,43 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_1 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----PhysicalProject
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN] 
hashCondition=((store_returns.sr_returned_date_sk = 
date_dim.d_date_sk))otherCondition=()
-----------------PhysicalProject
-------------------PhysicalOlapScan[store_returns]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------filter((date_dim.d_year = 2000))
-----------------------PhysicalOlapScan[date_dim]
---PhysicalResultSink
-----PhysicalTopN
-------PhysicalDistribute
---------PhysicalTopN
-----------PhysicalProject
-------------hashJoin[INNER_JOIN] hashCondition=((ctr1.ctr_customer_sk = 
customer.c_customer_sk))otherCondition=()
---------------PhysicalDistribute
-----------------PhysicalProject
-------------------PhysicalOlapScan[customer]
---------------PhysicalDistribute
-----------------hashJoin[INNER_JOIN] hashCondition=((ctr1.ctr_store_sk = 
ctr2.ctr_store_sk))otherCondition=((cast(ctr_total_return as DOUBLE) > 
cast((avg(cast(ctr_total_return as DECIMALV3(38, 4))) * 1.2) as DOUBLE)))
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = 
ctr1.ctr_store_sk))otherCondition=()
-----------------------PhysicalDistribute
-------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-----------------------PhysicalDistribute
-------------------------PhysicalProject
---------------------------filter((store.s_state = 'TN'))
-----------------------------PhysicalOlapScan[store]
-------------------PhysicalDistribute
---------------------hashAgg[GLOBAL]
-----------------------PhysicalDistribute
-------------------------hashAgg[LOCAL]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out
deleted file mode 100644
index a8ab13bb0f8..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query49.out
+++ /dev/null
@@ -1,89 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_49 --
-PhysicalResultSink
---PhysicalTopN
-----PhysicalDistribute
-------PhysicalTopN
---------hashAgg[GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[LOCAL]
---------------PhysicalUnion
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------filter(((return_rank <= 10) OR (currency_rank <= 10)))
-----------------------PhysicalWindow
-------------------------PhysicalQuickSort
---------------------------PhysicalWindow
-----------------------------PhysicalQuickSort
-------------------------------PhysicalDistribute
---------------------------------PhysicalQuickSort
-----------------------------------PhysicalProject
-------------------------------------hashAgg[GLOBAL]
---------------------------------------PhysicalDistribute
-----------------------------------------hashAgg[LOCAL]
-------------------------------------------PhysicalProject
---------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws.ws_item_sk = wr.wr_item_sk) and (ws.ws_order_number = 
wr.wr_order_number))otherCondition=()
-----------------------------------------------PhysicalProject
-------------------------------------------------filter((wr.wr_return_amt > 
10000.00))
---------------------------------------------------PhysicalOlapScan[web_returns]
-----------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=()
-------------------------------------------------PhysicalProject
---------------------------------------------------filter((ws.ws_net_paid > 
0.00) and (ws.ws_net_profit > 1.00) and (ws.ws_quantity > 0))
-----------------------------------------------------PhysicalOlapScan[web_sales]
-------------------------------------------------PhysicalDistribute
---------------------------------------------------PhysicalProject
-----------------------------------------------------filter((date_dim.d_moy = 
11) and (date_dim.d_year = 1998))
-------------------------------------------------------PhysicalOlapScan[date_dim]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------filter(((return_rank <= 10) OR (currency_rank <= 10)))
-----------------------PhysicalWindow
-------------------------PhysicalQuickSort
---------------------------PhysicalWindow
-----------------------------PhysicalQuickSort
-------------------------------PhysicalDistribute
---------------------------------PhysicalQuickSort
-----------------------------------PhysicalProject
-------------------------------------hashAgg[GLOBAL]
---------------------------------------PhysicalDistribute
-----------------------------------------hashAgg[LOCAL]
-------------------------------------------PhysicalProject
---------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((cs.cs_item_sk = cr.cr_item_sk) and (cs.cs_order_number = 
cr.cr_order_number))otherCondition=()
-----------------------------------------------PhysicalProject
-------------------------------------------------filter((cr.cr_return_amount > 
10000.00))
---------------------------------------------------PhysicalOlapScan[catalog_returns]
-----------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((cs.cs_sold_date_sk = date_dim.d_date_sk))otherCondition=()
-------------------------------------------------PhysicalProject
---------------------------------------------------filter((cs.cs_net_paid > 
0.00) and (cs.cs_net_profit > 1.00) and (cs.cs_quantity > 0))
-----------------------------------------------------PhysicalOlapScan[catalog_sales]
-------------------------------------------------PhysicalDistribute
---------------------------------------------------PhysicalProject
-----------------------------------------------------filter((date_dim.d_moy = 
11) and (date_dim.d_year = 1998))
-------------------------------------------------------PhysicalOlapScan[date_dim]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------filter(((return_rank <= 10) OR (currency_rank <= 10)))
-----------------------PhysicalWindow
-------------------------PhysicalQuickSort
---------------------------PhysicalWindow
-----------------------------PhysicalQuickSort
-------------------------------PhysicalDistribute
---------------------------------PhysicalQuickSort
-----------------------------------PhysicalProject
-------------------------------------hashAgg[GLOBAL]
---------------------------------------PhysicalDistribute
-----------------------------------------hashAgg[LOCAL]
-------------------------------------------PhysicalProject
---------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((sts.ss_item_sk = sr.sr_item_sk) and (sts.ss_ticket_number = 
sr.sr_ticket_number))otherCondition=()
-----------------------------------------------PhysicalProject
-------------------------------------------------filter((sr.sr_return_amt > 
10000.00))
---------------------------------------------------PhysicalOlapScan[store_returns]
-----------------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((sts.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=()
-------------------------------------------------PhysicalProject
---------------------------------------------------filter((sts.ss_net_paid > 
0.00) and (sts.ss_net_profit > 1.00) and (sts.ss_quantity > 0))
-----------------------------------------------------PhysicalOlapScan[store_sales]
-------------------------------------------------PhysicalDistribute
---------------------------------------------------PhysicalProject
-----------------------------------------------------filter((date_dim.d_moy = 
11) and (date_dim.d_year = 1998))
-------------------------------------------------------PhysicalOlapScan[date_dim]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query75.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query75.out
deleted file mode 100644
index fb9d10e30ff..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query75.out
+++ /dev/null
@@ -1,81 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_75 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----hashAgg[GLOBAL]
-------PhysicalDistribute
---------hashAgg[LOCAL]
-----------hashAgg[GLOBAL]
-------------PhysicalDistribute
---------------hashAgg[LOCAL]
-----------------PhysicalUnion
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------hashJoin[RIGHT_OUTER_JOIN] 
hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and 
(catalog_sales.cs_order_number = 
catalog_returns.cr_order_number))otherCondition=()
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[catalog_returns]
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((date_dim.d_date_sk = 
catalog_sales.cs_sold_date_sk))otherCondition=()
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((item.i_item_sk = catalog_sales.cs_item_sk))otherCondition=()
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[catalog_sales]
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((item.i_category = 'Sports'))
---------------------------------------PhysicalOlapScan[item]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter(d_year IN (2001, 2002))
-----------------------------------PhysicalOlapScan[date_dim]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------hashJoin[RIGHT_OUTER_JOIN] 
hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and 
(store_sales.ss_ticket_number = 
store_returns.sr_ticket_number))otherCondition=()
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[store_returns]
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((date_dim.d_date_sk = 
store_sales.ss_sold_date_sk))otherCondition=()
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((item.i_item_sk = store_sales.ss_item_sk))otherCondition=()
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[store_sales]
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((item.i_category = 'Sports'))
---------------------------------------PhysicalOlapScan[item]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter(d_year IN (2001, 2002))
-----------------------------------PhysicalOlapScan[date_dim]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------hashJoin[RIGHT_OUTER_JOIN] 
hashCondition=((web_sales.ws_item_sk = web_returns.wr_item_sk) and 
(web_sales.ws_order_number = web_returns.wr_order_number))otherCondition=()
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[web_returns]
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((date_dim.d_date_sk = 
web_sales.ws_sold_date_sk))otherCondition=()
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((item.i_item_sk = web_sales.ws_item_sk))otherCondition=()
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales]
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((item.i_category = 'Sports'))
---------------------------------------PhysicalOlapScan[item]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter(d_year IN (2001, 2002))
-----------------------------------PhysicalOlapScan[date_dim]
---PhysicalResultSink
-----PhysicalTopN
-------PhysicalDistribute
---------PhysicalTopN
-----------PhysicalProject
-------------hashJoin[INNER_JOIN] hashCondition=((curr_yr.i_brand_id = 
prev_yr.i_brand_id) and (curr_yr.i_category_id = prev_yr.i_category_id) and 
(curr_yr.i_class_id = prev_yr.i_class_id) and (curr_yr.i_manufact_id = 
prev_yr.i_manufact_id))otherCondition=(((cast(cast(sales_cnt as DECIMALV3(17, 
2)) as DECIMALV3(23, 8)) / cast(sales_cnt as DECIMALV3(17, 2))) < 0.900000))
---------------PhysicalDistribute
-----------------filter((curr_yr.d_year = 2002))
-------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------PhysicalDistribute
-----------------filter((prev_yr.d_year = 2001))
-------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query76.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query76.out
deleted file mode 100644
index 3f46749fc61..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query76.out
+++ /dev/null
@@ -1,52 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_76 --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalDistribute
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[LOCAL]
---------------PhysicalUnion
-----------------PhysicalDistribute
-------------------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
---------------------------filter(ss_customer_sk IS NULL)
-----------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[date_dim]
-----------------------PhysicalDistribute
-------------------------PhysicalProject
---------------------------PhysicalOlapScan[item]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk 
= item.i_item_sk)) otherCondition=() build RFs:RF3 ws_item_sk->[i_item_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[item] apply RFs: RF3
-----------------------PhysicalDistribute
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------filter(ws_promo_sk IS NULL)
---------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[date_dim]
-----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF5 i_item_sk->[cs_item_sk]
---------------------PhysicalDistribute
-----------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[cs_sold_date_sk]
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------filter(cs_bill_customer_sk IS NULL)
-------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 
RF5
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalDistribute
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[item]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query95.out
deleted file mode 100644
index 6720aab10b8..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query95.out
+++ /dev/null
@@ -1,53 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_95 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----PhysicalProject
-------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
---PhysicalResultSink
-----PhysicalTopN[MERGE_SORT]
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[DISTINCT_GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[DISTINCT_LOCAL]
---------------hashAgg[GLOBAL]
-----------------hashAgg[LOCAL]
-------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF7 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF2 d_date_sk->[ws_ship_date_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF1 ca_address_sk->[ws_ship_addr_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((customer_address.ca_state = 'VA'))
---------------------------------------PhysicalOlapScan[customer_address]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((date_dim.d_date <= '2001-05-31') and 
(date_dim.d_date >= '2001-04-01'))
-------------------------------------PhysicalOlapScan[date_dim]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query97.out 
b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query97.out
deleted file mode 100644
index bb1f3c8efc6..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query97.out
+++ /dev/null
@@ -1,37 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_97 --
-PhysicalResultSink
---PhysicalLimit[GLOBAL]
-----PhysicalLimit[LOCAL]
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[FULL_OUTER_JOIN] hashCondition=((ssci.customer_sk = 
csci.customer_sk) and (ssci.item_sk = csci.item_sk)) otherCondition=()
-----------------PhysicalProject
-------------------hashAgg[GLOBAL]
---------------------PhysicalDistribute
-----------------------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
-------------------------------filter(( not ss_sold_date_sk IS NULL))
---------------------------------PhysicalOlapScan[store_sales] apply RFs: RF1
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((date_dim.d_month_seq <= 1210) and 
(date_dim.d_month_seq >= 1199))
-----------------------------------PhysicalOlapScan[date_dim]
-----------------PhysicalProject
-------------------hashAgg[GLOBAL]
---------------------PhysicalDistribute
-----------------------hashAgg[LOCAL]
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[cs_sold_date_sk]
-----------------------------PhysicalProject
-------------------------------filter(( not cs_sold_date_sk IS NULL))
---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((date_dim.d_month_seq <= 1210) and 
(date_dim.d_month_seq >= 1199))
-----------------------------------PhysicalOlapScan[date_dim]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out
deleted file mode 100644
index d2ecc4813b5..00000000000
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out
+++ /dev/null
@@ -1,53 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_95 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----PhysicalProject
-------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
---PhysicalResultSink
-----PhysicalTopN[MERGE_SORT]
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[DISTINCT_GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[DISTINCT_LOCAL]
---------------hashAgg[GLOBAL]
-----------------hashAgg[LOCAL]
-------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF7 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF2 ca_address_sk->[ws_ship_addr_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF1 d_date_sk->[ws_ship_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_date <= '1999-04-02') 
and (date_dim.d_date >= '1999-02-01'))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_state = 'NC'))
-------------------------------------PhysicalOlapScan[customer_address]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out
deleted file mode 100644
index d2ecc4813b5..00000000000
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out
+++ /dev/null
@@ -1,53 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_95 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----PhysicalProject
-------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
---PhysicalResultSink
-----PhysicalTopN[MERGE_SORT]
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[DISTINCT_GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[DISTINCT_LOCAL]
---------------hashAgg[GLOBAL]
-----------------hashAgg[LOCAL]
-------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF7 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF2 ca_address_sk->[ws_ship_addr_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF1 d_date_sk->[ws_ship_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_date <= '1999-04-02') 
and (date_dim.d_date >= '1999-02-01'))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_state = 'NC'))
-------------------------------------PhysicalOlapScan[customer_address]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out
deleted file mode 100644
index 35ca3b8e453..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query44.out
+++ /dev/null
@@ -1,71 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_44 --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalDistribute
-------PhysicalTopN[LOCAL_SORT]
---------PhysicalProject
-----------hashJoin[INNER_JOIN] hashCondition=((i2.i_item_sk = 
descending.item_sk)) otherCondition=() build RFs:RF1 item_sk->[i_item_sk]
-------------PhysicalProject
---------------PhysicalOlapScan[item] apply RFs: RF1
-------------PhysicalDistribute
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN] hashCondition=((asceding.rnk = 
descending.rnk)) otherCondition=()
-------------------hashJoin[INNER_JOIN] hashCondition=((i1.i_item_sk = 
asceding.item_sk)) otherCondition=() build RFs:RF0 item_sk->[i_item_sk]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[item] apply RFs: RF0
---------------------PhysicalDistribute
-----------------------PhysicalProject
-------------------------filter((rnk < 11))
---------------------------PhysicalWindow
-----------------------------PhysicalQuickSort[MERGE_SORT]
-------------------------------PhysicalDistribute
---------------------------------PhysicalQuickSort[LOCAL_SORT]
-----------------------------------PhysicalPartitionTopN
-------------------------------------PhysicalProject
---------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col 
as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
-----------------------------------------PhysicalProject
-------------------------------------------hashAgg[GLOBAL]
---------------------------------------------PhysicalDistribute
-----------------------------------------------hashAgg[LOCAL]
-------------------------------------------------PhysicalProject
---------------------------------------------------filter((ss1.ss_store_sk = 
146))
-----------------------------------------------------PhysicalOlapScan[store_sales]
-----------------------------------------PhysicalDistribute
-------------------------------------------PhysicalAssertNumRows
---------------------------------------------PhysicalDistribute
-----------------------------------------------PhysicalProject
-------------------------------------------------hashAgg[GLOBAL]
---------------------------------------------------PhysicalDistribute
-----------------------------------------------------hashAgg[LOCAL]
-------------------------------------------------------PhysicalProject
---------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
-----------------------------------------------------------PhysicalOlapScan[store_sales]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------filter((rnk < 11))
-------------------------PhysicalWindow
---------------------------PhysicalQuickSort[MERGE_SORT]
-----------------------------PhysicalDistribute
-------------------------------PhysicalQuickSort[LOCAL_SORT]
---------------------------------PhysicalPartitionTopN
-----------------------------------PhysicalProject
-------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col 
as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
---------------------------------------PhysicalProject
-----------------------------------------hashAgg[GLOBAL]
-------------------------------------------PhysicalDistribute
---------------------------------------------hashAgg[LOCAL]
-----------------------------------------------PhysicalProject
-------------------------------------------------filter((ss1.ss_store_sk = 146))
---------------------------------------------------PhysicalOlapScan[store_sales]
---------------------------------------PhysicalDistribute
-----------------------------------------PhysicalAssertNumRows
-------------------------------------------PhysicalDistribute
---------------------------------------------PhysicalProject
-----------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------PhysicalDistribute
---------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
---------------------------------------------------------PhysicalOlapScan[store_sales]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query76.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query76.out
deleted file mode 100644
index 00c4bba1df6..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query76.out
+++ /dev/null
@@ -1,50 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_76 --
-PhysicalResultSink
---PhysicalTopN[MERGE_SORT]
-----PhysicalDistribute
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[LOCAL]
---------------PhysicalUnion
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF1 ss_item_sk->[i_item_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[item] apply RFs: RF1
-----------------------PhysicalDistribute
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 ss_sold_date_sk->[d_date_sk]
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[date_dim] apply RFs: RF0
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------filter(ss_hdemo_sk IS NULL)
---------------------------------PhysicalOlapScan[store_sales]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk 
= item.i_item_sk)) otherCondition=() build RFs:RF3 ws_item_sk->[i_item_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[item] apply RFs: RF3
-----------------------PhysicalDistribute
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 ws_sold_date_sk->[d_date_sk]
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[date_dim] apply RFs: RF2
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------filter(ws_bill_addr_sk IS NULL)
---------------------------------PhysicalOlapScan[web_sales]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() 
build RFs:RF5 cs_item_sk->[i_item_sk]
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[item] apply RFs: RF5
-----------------------PhysicalDistribute
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 cs_sold_date_sk->[d_date_sk]
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[date_dim] apply RFs: RF4
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------filter(cs_warehouse_sk IS NULL)
---------------------------------PhysicalOlapScan[catalog_sales]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query95.out
deleted file mode 100644
index bde9dbef392..00000000000
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query95.out
+++ /dev/null
@@ -1,53 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !ds_shape_95 --
-PhysicalCteAnchor ( cteId=CTEId#0 )
---PhysicalCteProducer ( cteId=CTEId#0 )
-----PhysicalProject
-------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
---------PhysicalDistribute
-----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
---PhysicalResultSink
-----PhysicalTopN[MERGE_SORT]
-------PhysicalTopN[LOCAL_SORT]
---------hashAgg[DISTINCT_GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[DISTINCT_LOCAL]
---------------hashAgg[GLOBAL]
-----------------hashAgg[LOCAL]
-------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF6 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF7 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF2 d_date_sk->[ws_ship_date_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF1 ca_address_sk->[ws_ship_addr_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------filter((customer_address.ca_state = 'NC'))
---------------------------------------PhysicalOlapScan[customer_address]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((date_dim.d_date <= '1999-04-02') and 
(date_dim.d_date >= '1999-02-01'))
-------------------------------------PhysicalOlapScan[date_dim]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
-
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query10.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query10.out
index b80b526bc89..96d2bd3f76b 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query10.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query10.out
@@ -7,7 +7,7 @@ PhysicalResultSink
 --------PhysicalProject
 ----------hashAgg[LOCAL]
 ------------PhysicalProject
---------------filter(($c$1 OR $c$2))
+--------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE)))
 ----------------hashJoin[LEFT_SEMI_JOIN](c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)
 ------------------hashJoin[LEFT_SEMI_JOIN](c.c_customer_sk = 
web_sales.ws_bill_customer_sk)
 --------------------PhysicalProject
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query35.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query35.out
index b8294ca5c37..026bcb23ea1 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query35.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query35.out
@@ -9,7 +9,7 @@ PhysicalResultSink
 ------------PhysicalDistribute
 --------------hashAgg[LOCAL]
 ----------------PhysicalProject
-------------------filter(($c$1 OR $c$2))
+------------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE)))
 --------------------hashJoin[LEFT_SEMI_JOIN](c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)
 ----------------------hashJoin[LEFT_SEMI_JOIN](c.c_customer_sk = 
web_sales.ws_bill_customer_sk)
 ------------------------PhysicalProject


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

Reply via email to