From 6b3564e72cdda03182d1e7d9d50f2314c13e0ab2 Mon Sep 17 00:00:00 2001 From: xiongzhongjian Date: Tue, 20 Aug 2024 17:51:35 +0800 Subject: [PATCH 1/2] [opt](nereids) refine left semi/anti cost under short-cut opt --- .../doris/nereids/cost/CostModelV1.java | 18 ++++- .../org/apache/doris/qe/SessionVariable.java | 12 +++ .../shape/query16.out | 40 +++++----- .../shape/query23.out | 16 ++-- .../shape/query33.out | 28 +++---- .../shape/query35.out | 52 ++++++------- .../shape/query69.out | 44 +++++------ .../shape/query78.out | 57 +++++++------- .../shape/query94.out | 40 +++++----- .../rf_prune/query14.out | 44 +++++------ .../rf_prune/query23.out | 16 ++-- .../rf_prune/query33.out | 36 ++++----- .../rf_prune/query35.out | 76 +++++++++---------- .../rf_prune/query69.out | 50 ++++++------ .../rf_prune/query78.out | 57 +++++++------- .../rf_prune/query94.out | 32 ++++---- .../shape/query14.out | 44 +++++------ .../shape/query23.out | 16 ++-- .../shape/query33.out | 28 +++---- .../shape/query35.out | 76 +++++++++---------- .../shape/query69.out | 50 ++++++------ .../shape/query78.out | 57 +++++++------- .../shape/query94.out | 32 ++++---- .../rf_prune/q16.out | 17 ++--- .../shape/q16.out | 17 ++--- 25 files changed, 490 insertions(+), 465 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 d840b44c1fa2a5..562c742a692b8f 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 @@ -396,6 +396,15 @@ public Cost visitPhysicalHashJoin( ); } + double probeShortcutFactor = 1.0; + if (ConnectContext.get() != null && ConnectContext.get().getStatementContext() != null + && !ConnectContext.get().getStatementContext().isHasUnknownColStats() + && physicalHashJoin.getJoinType().isLeftSemiOrAntiJoin() + && physicalHashJoin.getOtherJoinConjuncts().isEmpty() + && physicalHashJoin.getMarkJoinConjuncts().isEmpty()) { + // left semi/anti has short-cut opt, add probe side factor for distinguishing from the right ones + probeShortcutFactor = context.getSessionVariable().getLeftSemiOrAntiProbeFactor(); + } if (context.isBroadcastJoin()) { // compared with shuffle join, bc join will be taken a penalty for both build and probe side; // currently we use the following factor as the penalty factor: @@ -417,14 +426,15 @@ public Cost visitPhysicalHashJoin( } } return CostV1.of(context.getSessionVariable(), - leftRowCount + rightRowCount * buildSideFactor + outputRowCount * probeSideFactor, + leftRowCount * probeShortcutFactor + rightRowCount * probeShortcutFactor * buildSideFactor + + outputRowCount * probeSideFactor, rightRowCount, 0 ); } - return CostV1.of(context.getSessionVariable(), leftRowCount + rightRowCount + outputRowCount, - rightRowCount, - 0 + return CostV1.of(context.getSessionVariable(), + leftRowCount * probeShortcutFactor + rightRowCount * probeShortcutFactor + outputRowCount, + rightRowCount, 0 ); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index 5ca5bf1d36c765..fe2c0f019bba68 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -300,6 +300,7 @@ public class SessionVariable implements Serializable, Writable { public static final String FORBID_UNKNOWN_COLUMN_STATS = "forbid_unknown_col_stats"; public static final String BROADCAST_RIGHT_TABLE_SCALE_FACTOR = "broadcast_right_table_scale_factor"; + public static final String LEFT_SEMI_OR_ANTI_PROBE_FACTOR = "left_semi_or_anti_probe_factor"; public static final String BROADCAST_ROW_COUNT_LIMIT = "broadcast_row_count_limit"; // percentage of EXEC_MEM_LIMIT @@ -1253,6 +1254,9 @@ public void setEnableLeftZigZag(boolean enableLeftZigZag) { @VariableMgr.VarAttr(name = BROADCAST_RIGHT_TABLE_SCALE_FACTOR) private double broadcastRightTableScaleFactor = 0.0; + @VariableMgr.VarAttr(name = LEFT_SEMI_OR_ANTI_PROBE_FACTOR) + private double leftSemiOrAntiProbeFactor = 0.05; + @VariableMgr.VarAttr(name = BROADCAST_ROW_COUNT_LIMIT, needForward = true) private double broadcastRowCountLimit = 30000000; @@ -2705,6 +2709,14 @@ public void setBroadcastRightTableScaleFactor(double broadcastRightTableScaleFac this.broadcastRightTableScaleFactor = broadcastRightTableScaleFactor; } + public double getLeftSemiOrAntiProbeFactor() { + return leftSemiOrAntiProbeFactor; + } + + public void setLeftSemiOrAntiProbeFactor(double leftSemiOrAntiProbeFactor) { + this.leftSemiOrAntiProbeFactor = leftSemiOrAntiProbeFactor; + } + public double getBroadcastRowCountLimit() { return broadcastRowCountLimit; } diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query16.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query16.out index 2a7c2892977007..574303e12bab9e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query16.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query16.out @@ -8,31 +8,31 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((cs1.cs_order_number = cs2.cs_order_number)) otherCondition=(( not (cs_warehouse_sk = cs_warehouse_sk))) build RFs:RF4 cs_order_number->[cs_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 +----------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF3 cc_call_center_sk->[cs_call_center_sk] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((cs1.cs_order_number = cr1.cr_order_number)) otherCondition=() build RFs:RF3 cs_order_number->[cr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((cs1.cs_order_number = cs2.cs_order_number)) otherCondition=(( not (cs_warehouse_sk = cs_warehouse_sk))) build RFs:RF2 cs_order_number->[cs_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF3 -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF2 cc_call_center_sk->[cs_call_center_sk] ---------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[cs_ship_date_sk] -----------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[cs_ship_addr_sk] +--------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF2 +----------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[cs_ship_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[cs_ship_addr_sk] +--------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((cs1.cs_order_number = cr1.cr_order_number)) otherCondition=() +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF2 -------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'PA')) -------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF3 +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2002-05-31') and (date_dim.d_date >= '2002-04-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalOlapScan[catalog_returns] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((call_center.cc_county = 'Williamson County')) ---------------------------------PhysicalOlapScan[call_center] +------------------------------filter((customer_address.ca_state = 'PA')) +--------------------------------PhysicalOlapScan[customer_address] +------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------PhysicalProject +----------------------------filter((date_dim.d_date <= '2002-05-31') and (date_dim.d_date >= '2002-04-01')) +------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((call_center.cc_county = 'Williamson County')) +------------------------PhysicalOlapScan[call_center] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query23.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query23.out index 0475cae9f9522a..3517d384222065 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query23.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query23.out @@ -57,9 +57,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------hashAgg[LOCAL] ----------------PhysicalUnion ------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4 +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() @@ -73,21 +71,23 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) -------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk] ----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6 +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------------PhysicalProject +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ws_sold_date_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF4 d_date_sk->[ws_sold_date_sk] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF5 +----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4 --------------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------------PhysicalProject ------------------------------------filter((date_dim.d_moy = 7) and (date_dim.d_year = 2000)) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) +----------------------PhysicalDistribute[DistributionSpecHash] +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query33.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query33.out index 7202a2b63da237..4fd0db7610a788 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query33.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query33.out @@ -9,11 +9,7 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalUnion ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] ---------------------PhysicalDistribute[DistributionSpecHash] -----------------------PhysicalProject -------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF3 +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -37,13 +33,13 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF3 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF7 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -67,13 +63,13 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF7 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -97,5 +93,9 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------PhysicalDistribute[DistributionSpecHash] +----------------------PhysicalProject +------------------------filter((item.i_category = 'Books')) +--------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query35.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query35.out index 666bab9f30a563..268155aeba6586 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query35.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query35.out @@ -10,50 +10,50 @@ PhysicalResultSink --------------hashAgg[LOCAL] ----------------PhysicalProject ------------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE))) ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[cs_sold_date_sk] -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF5 -----------------------------PhysicalDistribute[DistributionSpecReplicated] -------------------------------PhysicalProject ---------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) -----------------------------------PhysicalOlapScan[date_dim] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF5 cd_demo_sk->[c_current_cdemo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[c_current_addr_sk] +--------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF4 ca_address_sk->[c_current_addr_sk] ----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ss_customer_sk] ---------------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------------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 RF2 ---------------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------------PhysicalProject -------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) ---------------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +--------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk] ----------------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------------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] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 +------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) ----------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------------PhysicalProject ---------------------------------------------PhysicalOlapScan[customer] apply RFs: RF3 RF4 +--------------------------------------------PhysicalOlapScan[customer] apply RFs: RF4 RF5 +--------------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------------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 +------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) +--------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------PhysicalProject --------------------------------------PhysicalOlapScan[customer_address] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject --------------------------------PhysicalOlapScan[customer_demographics] +----------------------PhysicalDistribute[DistributionSpecHash] +------------------------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 +------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 +----------------------------PhysicalDistribute[DistributionSpecReplicated] +------------------------------PhysicalProject +--------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) +----------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query69.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query69.out index 1181fb7a15ac0d..82e8e9ee38859d 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query69.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query69.out @@ -9,50 +9,50 @@ PhysicalResultSink ------------PhysicalDistribute[DistributionSpecHash] --------------hashAgg[LOCAL] ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 c_customer_sk->[ss_customer_sk] +------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF6 c_customer_sk->[ss_customer_sk] --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk] --------------------------PhysicalProject -----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7 +----------------------------PhysicalOlapScan[store_sales] apply RFs: RF5 RF6 --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) --------------------------------PhysicalOlapScan[date_dim] --------------------PhysicalProject -----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk] +----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[cs_ship_customer_sk] ------------------------PhysicalDistribute[DistributionSpecHash] --------------------------PhysicalProject -----------------------------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] +----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[cs_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3 RF4 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject ----------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) ------------------------------------PhysicalOlapScan[date_dim] ------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF3 c_current_cdemo_sk->[cd_demo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF2 c_current_cdemo_sk->[cd_demo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF3 +--------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF2 ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ws_bill_customer_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[c_current_addr_sk] --------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------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 RF2 ---------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[c_current_addr_sk] +----------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() ------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------PhysicalProject -----------------------------------------PhysicalOlapScan[customer] apply RFs: RF0 +----------------------------------------PhysicalOlapScan[customer] apply RFs: RF1 ------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------PhysicalProject -----------------------------------------filter(ca_state IN ('IL', 'ME', 'TX')) -------------------------------------------PhysicalOlapScan[customer_address] +----------------------------------------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 +----------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) +------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------PhysicalProject +------------------------------------filter(ca_state IN ('IL', 'ME', 'TX')) +--------------------------------------PhysicalOlapScan[customer_address] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query78.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query78.out index f646302500c348..31d7a5f02c100f 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query78.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query78.out @@ -14,44 +14,47 @@ PhysicalResultSink ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 ---------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[store_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 1998)) +------------------------------------PhysicalOlapScan[date_dim] ------------------PhysicalProject --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() -------------------------------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 -------------------------------------filter((date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------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_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 1998)) +------------------------------------PhysicalOlapScan[date_dim] --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute[DistributionSpecHash] --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() ---------------------------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 -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 -----------------------------PhysicalDistribute[DistributionSpecReplicated] -------------------------------PhysicalProject ---------------------------------filter((date_dim.d_year = 1998)) -----------------------------------PhysicalOlapScan[date_dim] +------------------------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 -----------------------------PhysicalOlapScan[catalog_returns] +----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_returns] +--------------------------PhysicalDistribute[DistributionSpecReplicated] +----------------------------PhysicalProject +------------------------------filter((date_dim.d_year = 1998)) +--------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query94.out b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query94.out index f9bd1b64a4a034..5353cfa76d167e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query94.out +++ b/regression-test/data/nereids_tpcds_shape_sf1000_p0/shape/query94.out @@ -8,31 +8,31 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF4 ws_order_number->[ws_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[web_sales] apply RFs: RF4 +----------------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] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() build RFs:RF3 ws_order_number->[wr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF2 ws_order_number->[ws_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[web_returns] apply RFs: RF3 -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF2 web_site_sk->[ws_web_site_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] -----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 +----------------------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] +------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +--------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF2 -------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'OK')) -------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF3 +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2002-06-30') and (date_dim.d_date >= '2002-05-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalOlapScan[web_returns] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((web_site.web_company_name = 'pri')) ---------------------------------PhysicalOlapScan[web_site] +------------------------------filter((customer_address.ca_state = 'OK')) +--------------------------------PhysicalOlapScan[customer_address] +------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------PhysicalProject +----------------------------filter((date_dim.d_date <= '2002-06-30') and (date_dim.d_date >= '2002-05-01')) +------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((web_site.web_company_name = 'pri')) +------------------------PhysicalOlapScan[web_site] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query14.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query14.out index dd8fd10a09abe4..7a23da9346a561 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query14.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query14.out @@ -104,10 +104,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF14 ss_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF14 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF12 d_date_sk->[ss_sold_date_sk] ----------------------------------------------PhysicalProject @@ -117,8 +115,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows @@ -131,21 +131,21 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF17 cs_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF17 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF15 d_date_sk->[cs_sold_date_sk] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[cs_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF15 +------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF14 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows @@ -158,21 +158,21 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF20 ws_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF20 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF18 d_date_sk->[ws_sold_date_sk] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF16 d_date_sk->[ws_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF18 +------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query23.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query23.out index 4d4463732f09c3..cf2b6f503c9033 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query23.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query23.out @@ -57,9 +57,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------hashAgg[LOCAL] ----------------PhysicalUnion ------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4 +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() @@ -73,21 +71,23 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) -------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk] ----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6 +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------------PhysicalProject +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ws_sold_date_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF4 d_date_sk->[ws_sold_date_sk] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF5 +----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4 --------------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------------PhysicalProject ------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000)) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) +----------------------PhysicalDistribute[DistributionSpecHash] +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query33.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query33.out index b84e41f1c4a37e..328c9681f0b96c 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query33.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query33.out @@ -9,16 +9,12 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalUnion ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] ---------------------PhysicalDistribute[DistributionSpecHash] -----------------------PhysicalProject -------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF3 +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF2 i_item_sk->[ss_item_sk] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject ----------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk] @@ -26,7 +22,7 @@ PhysicalResultSink --------------------------------------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 RF1 +--------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1 RF2 ------------------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------------------PhysicalProject ----------------------------------------------filter((date_dim.d_moy = 1) and (date_dim.d_year = 2002)) @@ -37,18 +33,18 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF3 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF7 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() +----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF6 i_item_sk->[cs_item_sk] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject ----------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF5 ca_address_sk->[cs_bill_addr_sk] @@ -56,7 +52,7 @@ PhysicalResultSink --------------------------------------PhysicalProject ----------------------------------------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] ------------------------------------------PhysicalProject ---------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 +--------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 RF6 ------------------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------------------PhysicalProject ----------------------------------------------filter((date_dim.d_moy = 1) and (date_dim.d_year = 2002)) @@ -67,20 +63,20 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF7 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject ----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF10 ws_item_sk->[i_item_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[item] apply RFs: RF10 +--------------------------------PhysicalOlapScan[item] apply RFs: RF10 RF11 ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject ----------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF9 ca_address_sk->[ws_bill_addr_sk] @@ -97,4 +93,8 @@ PhysicalResultSink --------------------------------------PhysicalProject ----------------------------------------filter((customer_address.ca_gmt_offset = -5.00)) ------------------------------------------PhysicalOlapScan[customer_address] +--------------------PhysicalDistribute[DistributionSpecHash] +----------------------PhysicalProject +------------------------filter((item.i_category = 'Home')) +--------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query35.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query35.out index 8cdd21c2e1e24c..44d1c3e733419b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query35.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query35.out @@ -10,50 +10,48 @@ PhysicalResultSink --------------hashAgg[LOCAL] ----------------PhysicalProject ------------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE))) ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +----------------------PhysicalProject +------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF5 ss_customer_sk->[c_customer_sk] +----------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() +------------------------------------PhysicalDistribute[DistributionSpecHash] +--------------------------------------PhysicalProject +----------------------------------------PhysicalOlapScan[customer] apply RFs: RF5 +------------------------------------PhysicalDistribute[DistributionSpecHash] +--------------------------------------PhysicalProject +----------------------------------------PhysicalOlapScan[customer_address] +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[customer_demographics] +----------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 +----------------------------------PhysicalDistribute[DistributionSpecReplicated] +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) +----------------------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------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 +------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) +--------------------------------------PhysicalOlapScan[date_dim] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[cs_sold_date_sk] +--------------------------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 -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF5 +------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) ----------------------------------PhysicalOlapScan[date_dim] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() -----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() -----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ss_customer_sk] ---------------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------------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 RF2 ---------------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------------PhysicalProject -------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) ---------------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------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 ---------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) -----------------------------------------------------PhysicalOlapScan[date_dim] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalProject ---------------------------------------------PhysicalOlapScan[customer] -----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query69.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query69.out index 400e9be378499f..016b682684dd0e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query69.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query69.out @@ -9,49 +9,49 @@ PhysicalResultSink ------------PhysicalDistribute[DistributionSpecHash] --------------hashAgg[LOCAL] ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 c_customer_sk->[ss_customer_sk] +------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF6 c_customer_sk->[ss_customer_sk] --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk] --------------------------PhysicalProject -----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7 +----------------------------PhysicalOlapScan[store_sales] apply RFs: RF5 RF6 --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) --------------------------------PhysicalOlapScan[date_dim] --------------------PhysicalProject -----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk] +----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[cs_ship_customer_sk] ------------------------PhysicalDistribute[DistributionSpecHash] --------------------------PhysicalProject -----------------------------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] +----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[cs_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3 RF4 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject ----------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) ------------------------------------PhysicalOlapScan[date_dim] ------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF3 c_current_cdemo_sk->[cd_demo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF2 c_current_cdemo_sk->[cd_demo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF3 +--------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF2 ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ws_bill_customer_sk] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------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 RF2 ---------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[c_current_addr_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[c_current_addr_sk] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +----------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------PhysicalProject +--------------------------------------PhysicalOlapScan[customer] apply RFs: RF1 +----------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[customer] apply RFs: RF0 -------------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------------PhysicalProject -----------------------------------------filter(ca_state IN ('MI', 'TX', 'VA')) -------------------------------------------PhysicalOlapScan[customer_address] +--------------------------------------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 +--------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) +----------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalDistribute[DistributionSpecReplicated] +----------------------------------PhysicalProject +------------------------------------filter(ca_state IN ('MI', 'TX', 'VA')) +--------------------------------------PhysicalOlapScan[customer_address] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query78.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query78.out index a12f6215a0b486..b513e5ab178733 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query78.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query78.out @@ -14,44 +14,47 @@ PhysicalResultSink ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 ---------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 2000)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[store_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 2000)) +------------------------------------PhysicalOlapScan[date_dim] ------------------PhysicalProject --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() -------------------------------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 -------------------------------------filter((date_dim.d_year = 2000)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------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_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 2000)) +------------------------------------PhysicalOlapScan[date_dim] --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute[DistributionSpecHash] --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() ---------------------------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 -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 -----------------------------PhysicalDistribute[DistributionSpecReplicated] -------------------------------PhysicalProject ---------------------------------filter((date_dim.d_year = 2000)) -----------------------------------PhysicalOlapScan[date_dim] +------------------------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 -----------------------------PhysicalOlapScan[catalog_returns] +----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_returns] +--------------------------PhysicalDistribute[DistributionSpecReplicated] +----------------------------PhysicalProject +------------------------------filter((date_dim.d_year = 2000)) +--------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query94.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query94.out index 57ddcdd5d7516e..20d2f507df9dfb 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query94.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/rf_prune/query94.out @@ -8,31 +8,31 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF4 ws_order_number->[ws_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[web_sales] apply RFs: RF4 +----------------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] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() build RFs:RF3 ws_order_number->[wr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF2 ws_order_number->[ws_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[web_returns] apply RFs: RF3 +--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 ----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF2 web_site_sk->[ws_web_site_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] -----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 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] +--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF2 +--------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF3 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'OK')) -------------------------------------PhysicalOlapScan[customer_address] +----------------------------------PhysicalOlapScan[web_returns] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2000-04-01') and (date_dim.d_date >= '2000-02-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------filter((customer_address.ca_state = 'OK')) +----------------------------------PhysicalOlapScan[customer_address] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((web_site.web_company_name = 'pri')) ---------------------------------PhysicalOlapScan[web_site] +------------------------------filter((date_dim.d_date <= '2000-04-01') and (date_dim.d_date >= '2000-02-01')) +--------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((web_site.web_company_name = 'pri')) +------------------------PhysicalOlapScan[web_site] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query14.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query14.out index 7c33c7de1a4cf6..ea523e727adacb 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query14.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query14.out @@ -104,10 +104,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF14 ss_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF14 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF13 i_item_sk->[ss_item_sk] +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF13 i_item_sk->[ss_item_sk,ss_item_sk] +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((store_sales.ss_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF12 d_date_sk->[ss_sold_date_sk] ----------------------------------------------PhysicalProject @@ -117,8 +115,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF13 +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows @@ -131,21 +131,21 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF17 cs_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF17 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF16 i_item_sk->[cs_item_sk] +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF15 i_item_sk->[cs_item_sk,ss_item_sk] +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF15 d_date_sk->[cs_sold_date_sk] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[cs_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF15 RF16 +------------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF14 RF15 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF15 +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows @@ -158,21 +158,21 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalDistribute[DistributionSpecHash] ----------------------------------hashAgg[LOCAL] ------------------------------------PhysicalProject ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() build RFs:RF20 ws_item_sk->[ss_item_sk] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF20 -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF19 i_item_sk->[ws_item_sk] +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF17 i_item_sk->[ss_item_sk,ws_item_sk] +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = cross_items.ss_item_sk)) otherCondition=() ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF18 d_date_sk->[ws_sold_date_sk] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF16 d_date_sk->[ws_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF18 RF19 +------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF16 RF17 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2002)) ----------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[item] +--------------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF17 +----------------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------PhysicalAssertNumRows diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query23.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query23.out index edd849ea421d13..749f00976648f9 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query23.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query23.out @@ -57,9 +57,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------hashAgg[LOCAL] ----------------PhysicalUnion ------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4 +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() @@ -73,21 +71,23 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) -------------------PhysicalProject ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk] ----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6 +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) +------------------PhysicalProject +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject --------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=() ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ws_sold_date_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF4 d_date_sk->[ws_sold_date_sk] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF5 +----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4 --------------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------------PhysicalProject ------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000)) --------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalCteConsumer ( cteId=CTEId#2 ) +----------------------PhysicalDistribute[DistributionSpecHash] +------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out index ef9997b0f58746..328c9681f0b96c 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out @@ -9,11 +9,7 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalUnion ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] ---------------------PhysicalDistribute[DistributionSpecHash] -----------------------PhysicalProject -------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF3 +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -37,13 +33,13 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF3 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF7 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -67,20 +63,20 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF7 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Home')) ---------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject ----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF10 ws_item_sk->[i_item_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[item] apply RFs: RF10 +--------------------------------PhysicalOlapScan[item] apply RFs: RF10 RF11 ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject ----------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF9 ca_address_sk->[ws_bill_addr_sk] @@ -97,4 +93,8 @@ PhysicalResultSink --------------------------------------PhysicalProject ----------------------------------------filter((customer_address.ca_gmt_offset = -5.00)) ------------------------------------------PhysicalOlapScan[customer_address] +--------------------PhysicalDistribute[DistributionSpecHash] +----------------------PhysicalProject +------------------------filter((item.i_category = 'Home')) +--------------------------PhysicalOlapScan[item] 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 f5a56cf3ec21ce..308c7b6e5b86a9 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 @@ -10,50 +10,48 @@ PhysicalResultSink --------------hashAgg[LOCAL] ----------------PhysicalProject ------------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE))) ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +----------------------PhysicalProject +------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF5 ss_customer_sk->[c_customer_sk] +----------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk] +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[c_current_addr_sk] +------------------------------------PhysicalDistribute[DistributionSpecHash] +--------------------------------------PhysicalProject +----------------------------------------PhysicalOlapScan[customer] apply RFs: RF3 RF4 RF5 +------------------------------------PhysicalDistribute[DistributionSpecHash] +--------------------------------------PhysicalProject +----------------------------------------PhysicalOlapScan[customer_address] +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[customer_demographics] +----------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 +----------------------------------PhysicalDistribute[DistributionSpecReplicated] +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) +----------------------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------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 +------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) +--------------------------------------PhysicalOlapScan[date_dim] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[cs_sold_date_sk] +--------------------------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 -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF5 +------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject --------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) ----------------------------------PhysicalOlapScan[date_dim] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk] -----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[c_current_addr_sk] -----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ss_customer_sk] ---------------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------------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 RF2 ---------------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------------PhysicalProject -------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) ---------------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------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 ---------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 2001)) -----------------------------------------------------PhysicalOlapScan[date_dim] -----------------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------------PhysicalProject ---------------------------------------------PhysicalOlapScan[customer] apply RFs: RF3 RF4 -----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query69.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query69.out index 400e9be378499f..016b682684dd0e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query69.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query69.out @@ -9,49 +9,49 @@ PhysicalResultSink ------------PhysicalDistribute[DistributionSpecHash] --------------hashAgg[LOCAL] ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 c_customer_sk->[ss_customer_sk] +------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF6 c_customer_sk->[ss_customer_sk] --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk] --------------------------PhysicalProject -----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7 +----------------------------PhysicalOlapScan[store_sales] apply RFs: RF5 RF6 --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) --------------------------------PhysicalOlapScan[date_dim] --------------------PhysicalProject -----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk] +----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[cs_ship_customer_sk] ------------------------PhysicalDistribute[DistributionSpecHash] --------------------------PhysicalProject -----------------------------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] +----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[cs_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3 RF4 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject ----------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) ------------------------------------PhysicalOlapScan[date_dim] ------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF3 c_current_cdemo_sk->[cd_demo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF2 c_current_cdemo_sk->[cd_demo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF3 +--------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF2 ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ws_bill_customer_sk] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------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 RF2 ---------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[c_current_addr_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[c_current_addr_sk] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +----------------------------------PhysicalDistribute[DistributionSpecHash] +------------------------------------PhysicalProject +--------------------------------------PhysicalOlapScan[customer] apply RFs: RF1 +----------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[customer] apply RFs: RF0 -------------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------------PhysicalProject -----------------------------------------filter(ca_state IN ('MI', 'TX', 'VA')) -------------------------------------------PhysicalOlapScan[customer_address] +--------------------------------------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 +--------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2000)) +----------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalDistribute[DistributionSpecReplicated] +----------------------------------PhysicalProject +------------------------------------filter(ca_state IN ('MI', 'TX', 'VA')) +--------------------------------------PhysicalOlapScan[customer_address] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query78.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query78.out index a12f6215a0b486..b513e5ab178733 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query78.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query78.out @@ -14,44 +14,47 @@ PhysicalResultSink ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 ---------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 2000)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[store_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((store_returns.sr_ticket_number = store_sales.ss_ticket_number) and (store_sales.ss_item_sk = store_returns.sr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 2000)) +------------------------------------PhysicalOlapScan[date_dim] ------------------PhysicalProject --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] --------------------------PhysicalProject -----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() -------------------------------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 -------------------------------------filter((date_dim.d_year = 2000)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------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_returns] +--------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((web_returns.wr_order_number = web_sales.ws_order_number) and (web_sales.ws_item_sk = web_returns.wr_item_sk)) otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_returns] +------------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 2000)) +------------------------------------PhysicalOlapScan[date_dim] --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute[DistributionSpecHash] --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() ---------------------------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 -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 -----------------------------PhysicalDistribute[DistributionSpecReplicated] -------------------------------PhysicalProject ---------------------------------filter((date_dim.d_year = 2000)) -----------------------------------PhysicalOlapScan[date_dim] +------------------------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 -----------------------------PhysicalOlapScan[catalog_returns] +----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((catalog_returns.cr_order_number = catalog_sales.cs_order_number) and (catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)) otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_returns] +--------------------------PhysicalDistribute[DistributionSpecReplicated] +----------------------------PhysicalProject +------------------------------filter((date_dim.d_year = 2000)) +--------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out index 57ddcdd5d7516e..20d2f507df9dfb 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out @@ -8,31 +8,31 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF4 ws_order_number->[ws_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[web_sales] apply RFs: RF4 +----------------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] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() build RFs:RF3 ws_order_number->[wr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF2 ws_order_number->[ws_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[web_returns] apply RFs: RF3 +--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 ----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF2 web_site_sk->[ws_web_site_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] -----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 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] +--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +----------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF2 +--------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF3 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'OK')) -------------------------------------PhysicalOlapScan[customer_address] +----------------------------------PhysicalOlapScan[web_returns] ----------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2000-04-01') and (date_dim.d_date >= '2000-02-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------filter((customer_address.ca_state = 'OK')) +----------------------------------PhysicalOlapScan[customer_address] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((web_site.web_company_name = 'pri')) ---------------------------------PhysicalOlapScan[web_site] +------------------------------filter((date_dim.d_date <= '2000-04-01') and (date_dim.d_date >= '2000-02-01')) +--------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((web_site.web_company_name = 'pri')) +------------------------PhysicalOlapScan[web_site] diff --git a/regression-test/data/nereids_tpch_shape_sf1000_p0/rf_prune/q16.out b/regression-test/data/nereids_tpch_shape_sf1000_p0/rf_prune/q16.out index e26fad635f7687..eb94cc0f521104 100644 --- a/regression-test/data/nereids_tpch_shape_sf1000_p0/rf_prune/q16.out +++ b/regression-test/data/nereids_tpch_shape_sf1000_p0/rf_prune/q16.out @@ -9,15 +9,14 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalProject ----------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((partsupp.ps_suppkey = supplier.s_suppkey)) otherCondition=() -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN] hashCondition=((part.p_partkey = partsupp.ps_partkey)) otherCondition=() build RFs:RF0 p_partkey->[ps_partkey] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[partsupp] apply RFs: RF0 -------------------------PhysicalProject ---------------------------filter(( not (p_brand = 'Brand#45')) and ( not (p_type like 'MEDIUM POLISHED%')) and p_size IN (14, 19, 23, 3, 36, 45, 49, 9)) -----------------------------PhysicalOlapScan[part] -------------------PhysicalDistribute[DistributionSpecHash] +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((part.p_partkey = partsupp.ps_partkey)) otherCondition=() build RFs:RF0 p_partkey->[ps_partkey] +----------------------PhysicalProject +------------------------PhysicalOlapScan[partsupp] apply RFs: RF0 +----------------------PhysicalProject +------------------------filter(( not (p_brand = 'Brand#45')) and ( not (p_type like 'MEDIUM POLISHED%')) and p_size IN (14, 19, 23, 3, 36, 45, 49, 9)) +--------------------------PhysicalOlapScan[part] +------------------PhysicalDistribute[DistributionSpecReplicated] --------------------PhysicalProject ----------------------filter((s_comment like '%Customer%Complaints%')) ------------------------PhysicalOlapScan[supplier] diff --git a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q16.out b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q16.out index e26fad635f7687..eb94cc0f521104 100644 --- a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q16.out +++ b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q16.out @@ -9,15 +9,14 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalProject ----------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((partsupp.ps_suppkey = supplier.s_suppkey)) otherCondition=() -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN] hashCondition=((part.p_partkey = partsupp.ps_partkey)) otherCondition=() build RFs:RF0 p_partkey->[ps_partkey] -------------------------PhysicalProject ---------------------------PhysicalOlapScan[partsupp] apply RFs: RF0 -------------------------PhysicalProject ---------------------------filter(( not (p_brand = 'Brand#45')) and ( not (p_type like 'MEDIUM POLISHED%')) and p_size IN (14, 19, 23, 3, 36, 45, 49, 9)) -----------------------------PhysicalOlapScan[part] -------------------PhysicalDistribute[DistributionSpecHash] +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((part.p_partkey = partsupp.ps_partkey)) otherCondition=() build RFs:RF0 p_partkey->[ps_partkey] +----------------------PhysicalProject +------------------------PhysicalOlapScan[partsupp] apply RFs: RF0 +----------------------PhysicalProject +------------------------filter(( not (p_brand = 'Brand#45')) and ( not (p_type like 'MEDIUM POLISHED%')) and p_size IN (14, 19, 23, 3, 36, 45, 49, 9)) +--------------------------PhysicalOlapScan[part] +------------------PhysicalDistribute[DistributionSpecReplicated] --------------------PhysicalProject ----------------------filter((s_comment like '%Customer%Complaints%')) ------------------------PhysicalOlapScan[supplier] From c021f12b2b6a873b67ec4a5163087b53fa7d5573 Mon Sep 17 00:00:00 2001 From: xiongzhongjian Date: Wed, 21 Aug 2024 13:14:47 +0800 Subject: [PATCH 2/2] [opt](nereids) refine left semi/anti cost under short-cut opt --- .../nereids_hint_tpcds_p0/shape/query16.out | 40 ++++++------- .../nereids_hint_tpcds_p0/shape/query33.out | 28 ++++----- .../nereids_hint_tpcds_p0/shape/query35.out | 52 ++++++++-------- .../nereids_hint_tpcds_p0/shape/query64.out | 60 +++++++++---------- .../nereids_hint_tpcds_p0/shape/query69.out | 44 +++++++------- .../nereids_hint_tpcds_p0/shape/query94.out | 40 ++++++------- 6 files changed, 132 insertions(+), 132 deletions(-) diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query16.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query16.out index f7aa89f2433e20..53839bda2f2eba 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query16.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query16.out @@ -8,33 +8,33 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((cs1.cs_order_number = cs2.cs_order_number)) otherCondition=(( not (cs_warehouse_sk = cs_warehouse_sk))) build RFs:RF4 cs_order_number->[cs_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 +----------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF3 cc_call_center_sk->[cs_call_center_sk] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((cs1.cs_order_number = cr1.cr_order_number)) otherCondition=() build RFs:RF3 cs_order_number->[cr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((cs1.cs_order_number = cs2.cs_order_number)) otherCondition=(( not (cs_warehouse_sk = cs_warehouse_sk))) build RFs:RF2 cs_order_number->[cs_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF3 -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_call_center_sk = call_center.cc_call_center_sk)) otherCondition=() build RFs:RF2 cc_call_center_sk->[cs_call_center_sk] ---------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[cs_ship_date_sk] -----------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[cs_ship_addr_sk] +--------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF2 +----------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[cs_ship_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((cs1.cs_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[cs_ship_addr_sk] +--------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((cs1.cs_order_number = cr1.cr_order_number)) otherCondition=() +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF2 -------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'PA')) -------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 RF1 RF3 +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2002-05-31') and (date_dim.d_date >= '2002-04-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalOlapScan[catalog_returns] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((call_center.cc_county = 'Williamson County')) ---------------------------------PhysicalOlapScan[call_center] +------------------------------filter((customer_address.ca_state = 'PA')) +--------------------------------PhysicalOlapScan[customer_address] +------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------PhysicalProject +----------------------------filter((date_dim.d_date <= '2002-05-31') and (date_dim.d_date >= '2002-04-01')) +------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((call_center.cc_county = 'Williamson County')) +------------------------PhysicalOlapScan[call_center] Hint log: Used: leading(catalog_sales { cs1 customer_address date_dim call_center } ) diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query33.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query33.out index 68d1f6064f3230..96180c0cb39d78 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query33.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query33.out @@ -9,11 +9,7 @@ PhysicalResultSink ------------hashAgg[LOCAL] --------------PhysicalUnion ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] ---------------------PhysicalDistribute[DistributionSpecHash] -----------------------PhysicalProject -------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF3 +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF3 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -37,13 +33,13 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF3 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF7 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF7 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -67,13 +63,13 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] -----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] +----------------------------------PhysicalOlapScan[item] apply RFs: RF7 --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject ------------------------filter((item.i_category = 'Books')) ---------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------------PhysicalOlapScan[item] +----------------PhysicalProject +------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((item.i_manufact_id = item.i_manufact_id)) otherCondition=() build RFs:RF11 i_manufact_id->[i_manufact_id] --------------------hashAgg[GLOBAL] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------hashAgg[LOCAL] @@ -97,7 +93,11 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalOlapScan[item] apply RFs: RF11 +--------------------PhysicalDistribute[DistributionSpecHash] +----------------------PhysicalProject +------------------------filter((item.i_category = 'Books')) +--------------------------PhysicalOlapScan[item] Hint log: Used: leading(store_sales date_dim customer_address item ) leading(catalog_sales date_dim customer_address item ) leading(web_sales date_dim customer_address item ) diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query35.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query35.out index 666bab9f30a563..268155aeba6586 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query35.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query35.out @@ -10,50 +10,50 @@ PhysicalResultSink --------------hashAgg[LOCAL] ----------------PhysicalProject ------------------filter((ifnull($c$1, FALSE) OR ifnull($c$2, FALSE))) ---------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() +--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[cs_sold_date_sk] -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF5 -----------------------------PhysicalDistribute[DistributionSpecReplicated] -------------------------------PhysicalProject ---------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) -----------------------------------PhysicalOlapScan[date_dim] -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF5 cd_demo_sk->[c_current_cdemo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[c_current_addr_sk] +--------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF4 ca_address_sk->[c_current_addr_sk] ----------------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ss_customer_sk] ---------------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------------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 RF2 ---------------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------------PhysicalProject -------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) ---------------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() +--------------------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk] ----------------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------------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] +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk] ----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 +------------------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF2 RF3 ----------------------------------------------PhysicalDistribute[DistributionSpecReplicated] ------------------------------------------------PhysicalProject --------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) ----------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------------PhysicalProject ---------------------------------------------PhysicalOlapScan[customer] apply RFs: RF3 RF4 +--------------------------------------------PhysicalOlapScan[customer] apply RFs: RF4 RF5 +--------------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------------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 +------------------------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) +--------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------------PhysicalProject --------------------------------------PhysicalOlapScan[customer_address] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject --------------------------------PhysicalOlapScan[customer_demographics] +----------------------PhysicalDistribute[DistributionSpecHash] +------------------------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 +------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0 +----------------------------PhysicalDistribute[DistributionSpecReplicated] +------------------------------PhysicalProject +--------------------------------filter((date_dim.d_qoy < 4) and (date_dim.d_year = 1999)) +----------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query64.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query64.out index 35ccd9ccad09d1..96deef5e605ad6 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query64.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query64.out @@ -4,48 +4,48 @@ PhysicalCteAnchor ( cteId=CTEId#1 ) --PhysicalCteProducer ( cteId=CTEId#1 ) ----hashAgg[GLOBAL] ------hashAgg[LOCAL] ---------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=() build RFs:RF18 sr_item_sk->[ss_item_sk];RF19 sr_item_sk->[cr_item_sk,cs_item_sk,i_item_sk];RF20 sr_ticket_number->[ss_ticket_number] -----------hashJoin[INNER_JOIN] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=() build RFs:RF17 d_date_sk->[c_first_shipto_date_sk] -------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=() build RFs:RF16 hd_demo_sk->[ss_hdemo_sk] ---------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() build RFs:RF15 s_store_sk->[ss_store_sk] -----------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=() build RFs:RF14 p_promo_sk->[ss_promo_sk] -------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=() build RFs:RF13 d_date_sk->[c_first_sales_date_sk] ---------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=() build RFs:RF12 ca_address_sk->[c_current_addr_sk] -----------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=() build RFs:RF11 ca_address_sk->[ss_addr_sk] -------------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_hdemo_sk = hd2.hd_demo_sk)) otherCondition=() build RFs:RF10 hd_demo_sk->[c_current_hdemo_sk] ---------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF9 d_date_sk->[ss_sold_date_sk] -----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF8 i_item_sk->[cr_item_sk,cs_item_sk,ss_item_sk] +--------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_promo_sk = promotion.p_promo_sk)) otherCondition=() build RFs:RF20 p_promo_sk->[ss_promo_sk] +----------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_addr_sk = ad2.ca_address_sk)) otherCondition=() build RFs:RF19 ca_address_sk->[c_current_addr_sk] +------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk)) otherCondition=() build RFs:RF18 s_store_sk->[ss_store_sk] +--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = store_returns.sr_item_sk) and (store_sales.ss_ticket_number = store_returns.sr_ticket_number)) otherCondition=() build RFs:RF15 sr_item_sk->[ss_item_sk];RF16 sr_item_sk->[cr_item_sk,cs_item_sk,i_item_sk];RF17 sr_ticket_number->[ss_ticket_number] +----------------hashJoin[INNER_JOIN] hashCondition=((customer.c_first_shipto_date_sk = d3.d_date_sk)) otherCondition=() build RFs:RF14 d_date_sk->[c_first_shipto_date_sk] +------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = ad1.ca_address_sk)) otherCondition=() build RFs:RF13 ca_address_sk->[ss_addr_sk] +--------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_hdemo_sk = hd2.hd_demo_sk)) otherCondition=() build RFs:RF12 hd_demo_sk->[c_current_hdemo_sk] +----------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_first_sales_date_sk = d2.d_date_sk)) otherCondition=() build RFs:RF11 d_date_sk->[c_first_sales_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_hdemo_sk = hd1.hd_demo_sk)) otherCondition=() build RFs:RF10 hd_demo_sk->[ss_hdemo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk)) otherCondition=() build RFs:RF9 i_item_sk->[cr_item_sk,cs_item_sk,ss_item_sk] +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = d1.d_date_sk)) otherCondition=() build RFs:RF8 d_date_sk->[ss_sold_date_sk] ------------------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_cdemo_sk = cd2.cd_demo_sk)) otherCondition=(( not (cd_marital_status = cd_marital_status))) build RFs:RF7 cd_demo_sk->[c_current_cdemo_sk] --------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = cs_ui.cs_item_sk)) otherCondition=() build RFs:RF6 cs_item_sk->[ss_item_sk] ----------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_cdemo_sk = cd1.cd_demo_sk)) otherCondition=() build RFs:RF5 cd_demo_sk->[ss_cdemo_sk] ------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[ss_customer_sk] ---------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF4 RF5 RF6 RF8 RF9 RF11 RF14 RF15 RF16 RF18 RF20 ---------------------------------------PhysicalOlapScan[customer] apply RFs: RF7 RF10 RF12 RF13 RF17 +--------------------------------------PhysicalOlapScan[store_sales] apply RFs: RF4 RF5 RF6 RF8 RF9 RF10 RF13 RF15 RF17 RF18 RF20 +--------------------------------------PhysicalOlapScan[customer] apply RFs: RF7 RF11 RF12 RF14 RF19 ------------------------------------PhysicalOlapScan[customer_demographics] ----------------------------------filter((sale > (2 * refund))) ------------------------------------hashAgg[GLOBAL] --------------------------------------hashAgg[LOCAL] ----------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) and (catalog_sales.cs_order_number = catalog_returns.cr_order_number)) otherCondition=() build RFs:RF2 cr_item_sk->[cs_item_sk];RF3 cr_order_number->[cs_order_number] -------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF2 RF3 RF8 RF19 -------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF8 RF19 +------------------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF2 RF3 RF9 RF16 +------------------------------------------PhysicalOlapScan[catalog_returns] apply RFs: RF9 RF16 --------------------------------PhysicalOlapScan[customer_demographics] -------------------------------filter((item.i_current_price <= 58.00) and (item.i_current_price >= 49.00) and i_color IN ('blush', 'lace', 'lawn', 'misty', 'orange', 'pink')) ---------------------------------PhysicalOlapScan[item] apply RFs: RF19 -----------------------------filter(d_year IN (1999, 2000)) -------------------------------PhysicalOlapScan[date_dim] ---------------------------hashJoin[INNER_JOIN] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=() build RFs:RF1 ib_income_band_sk->[hd_income_band_sk] +------------------------------filter(d_year IN (1999, 2000)) +--------------------------------PhysicalOlapScan[date_dim] +----------------------------filter((item.i_current_price <= 58.00) and (item.i_current_price >= 49.00) and i_color IN ('blush', 'lace', 'lawn', 'misty', 'orange', 'pink')) +------------------------------PhysicalOlapScan[item] apply RFs: RF16 +--------------------------hashJoin[INNER_JOIN] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=() build RFs:RF1 ib_income_band_sk->[hd_income_band_sk] ----------------------------PhysicalOlapScan[household_demographics] apply RFs: RF1 ----------------------------PhysicalOlapScan[income_band] -------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalOlapScan[customer_address] ---------------------PhysicalOlapScan[date_dim] -------------------PhysicalOlapScan[promotion] -----------------PhysicalOlapScan[store] ---------------hashJoin[INNER_JOIN] hashCondition=((hd1.hd_income_band_sk = ib1.ib_income_band_sk)) otherCondition=() build RFs:RF0 ib_income_band_sk->[hd_income_band_sk] -----------------PhysicalOlapScan[household_demographics] apply RFs: RF0 -----------------PhysicalOlapScan[income_band] -------------PhysicalOlapScan[date_dim] -----------PhysicalOlapScan[store_returns] +------------------------PhysicalOlapScan[date_dim] +----------------------hashJoin[INNER_JOIN] hashCondition=((hd2.hd_income_band_sk = ib2.ib_income_band_sk)) otherCondition=() build RFs:RF0 ib_income_band_sk->[hd_income_band_sk] +------------------------PhysicalOlapScan[household_demographics] apply RFs: RF0 +------------------------PhysicalOlapScan[income_band] +--------------------PhysicalOlapScan[customer_address] +------------------PhysicalOlapScan[date_dim] +----------------PhysicalOlapScan[store_returns] +--------------PhysicalOlapScan[store] +------------PhysicalOlapScan[customer_address] +----------PhysicalOlapScan[promotion] --PhysicalResultSink ----PhysicalQuickSort[MERGE_SORT] ------PhysicalQuickSort[LOCAL_SORT] diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query69.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query69.out index 1181fb7a15ac0d..82e8e9ee38859d 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query69.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query69.out @@ -9,50 +9,50 @@ PhysicalResultSink ------------PhysicalDistribute[DistributionSpecHash] --------------hashAgg[LOCAL] ----------------PhysicalProject -------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 c_customer_sk->[ss_customer_sk] +------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=() build RFs:RF6 c_customer_sk->[ss_customer_sk] --------------------PhysicalDistribute[DistributionSpecHash] ----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF5 d_date_sk->[ss_sold_date_sk] --------------------------PhysicalProject -----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7 +----------------------------PhysicalOlapScan[store_sales] apply RFs: RF5 RF6 --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) --------------------------------PhysicalOlapScan[date_dim] --------------------PhysicalProject -----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk] +----------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) otherCondition=() build RFs:RF4 c_customer_sk->[cs_ship_customer_sk] ------------------------PhysicalDistribute[DistributionSpecHash] --------------------------PhysicalProject -----------------------------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] +----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[cs_sold_date_sk] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 RF5 +--------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3 RF4 ------------------------------PhysicalDistribute[DistributionSpecReplicated] --------------------------------PhysicalProject ----------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) ------------------------------------PhysicalOlapScan[date_dim] ------------------------PhysicalDistribute[DistributionSpecHash] ---------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF3 c_current_cdemo_sk->[cd_demo_sk] +--------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) otherCondition=() build RFs:RF2 c_current_cdemo_sk->[cd_demo_sk] ----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF3 +--------------------------------PhysicalOlapScan[customer_demographics] apply RFs: RF2 ----------------------------PhysicalDistribute[DistributionSpecHash] -------------------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() build RFs:RF2 c_customer_sk->[ws_bill_customer_sk] +------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[c_current_addr_sk] --------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------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 RF2 ---------------------------------------PhysicalDistribute[DistributionSpecReplicated] -----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute[DistributionSpecHash] -----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[c_current_addr_sk] +----------------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) otherCondition=() ------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------PhysicalProject -----------------------------------------PhysicalOlapScan[customer] apply RFs: RF0 +----------------------------------------PhysicalOlapScan[customer] apply RFs: RF1 ------------------------------------PhysicalDistribute[DistributionSpecHash] --------------------------------------PhysicalProject -----------------------------------------filter(ca_state IN ('IL', 'ME', 'TX')) -------------------------------------------PhysicalOlapScan[customer_address] +----------------------------------------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 +----------------------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy >= 1) and (date_dim.d_year = 2002)) +------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalDistribute[DistributionSpecHash] +----------------------------------PhysicalProject +------------------------------------filter(ca_state IN ('IL', 'ME', 'TX')) +--------------------------------------PhysicalOlapScan[customer_address] diff --git a/regression-test/data/nereids_hint_tpcds_p0/shape/query94.out b/regression-test/data/nereids_hint_tpcds_p0/shape/query94.out index f9bd1b64a4a034..5353cfa76d167e 100644 --- a/regression-test/data/nereids_hint_tpcds_p0/shape/query94.out +++ b/regression-test/data/nereids_hint_tpcds_p0/shape/query94.out @@ -8,31 +8,31 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF4 ws_order_number->[ws_order_number] -------------------PhysicalDistribute[DistributionSpecHash] ---------------------PhysicalProject -----------------------PhysicalOlapScan[web_sales] apply RFs: RF4 +----------------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] ------------------PhysicalProject ---------------------hashJoin[RIGHT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() build RFs:RF3 ws_order_number->[wr_order_number] +--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = ws_warehouse_sk))) build RFs:RF2 ws_order_number->[ws_order_number] ----------------------PhysicalDistribute[DistributionSpecHash] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[web_returns] apply RFs: RF3 -----------------------PhysicalDistribute[DistributionSpecHash] -------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF2 web_site_sk->[ws_web_site_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] -----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 +----------------------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] +------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ws_ship_addr_sk] +--------------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((ws1.ws_order_number = wr1.wr_order_number)) otherCondition=() +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF2 -------------------------------PhysicalDistribute[DistributionSpecReplicated] ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_state = 'OK')) -------------------------------------PhysicalOlapScan[customer_address] -----------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF1 RF3 +----------------------------PhysicalDistribute[DistributionSpecHash] ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_date <= '2002-06-30') and (date_dim.d_date >= '2002-05-01')) -----------------------------------PhysicalOlapScan[date_dim] +--------------------------------PhysicalOlapScan[web_returns] --------------------------PhysicalDistribute[DistributionSpecReplicated] ----------------------------PhysicalProject -------------------------------filter((web_site.web_company_name = 'pri')) ---------------------------------PhysicalOlapScan[web_site] +------------------------------filter((customer_address.ca_state = 'OK')) +--------------------------------PhysicalOlapScan[customer_address] +------------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------------PhysicalProject +----------------------------filter((date_dim.d_date <= '2002-06-30') and (date_dim.d_date >= '2002-05-01')) +------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute[DistributionSpecReplicated] +--------------------PhysicalProject +----------------------filter((web_site.web_company_name = 'pri')) +------------------------PhysicalOlapScan[web_site]