From 5bb79be932aae712abe61be49e3f6616a6b2cfb4 Mon Sep 17 00:00:00 2001 From: morrySnow <101034200+morrySnow@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:52:15 +0800 Subject: [PATCH] [opt](Nereids) forbid gather agg and gather set operation (#21332) gather agg and gather set operation usually not good we cannot compute cost on them nicely, so just forbid them until we could choose realy best plan --- .../ChildrenPropertiesRegulator.java | 1 + .../properties/RequestPropertyDeriver.java | 5 +- .../implementation/AggregateStrategies.java | 9 +- .../shape/query14.out | 54 ++--- .../shape/query33.out | 184 +++++++++--------- .../shape/query49.out | 138 ++++++------- .../shape/query54.out | 26 +-- .../shape/query56.out | 166 ++++++++-------- .../shape/query6.out | 13 +- .../shape/query60.out | 160 +++++++-------- .../shape/query66.out | 109 ++++++----- .../shape/query75.out | 112 ++++++----- .../shape/query76.out | 73 +++---- 13 files changed, 535 insertions(+), 515 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java index 3f811a2362..862dbb5e2b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java @@ -254,6 +254,7 @@ public class ChildrenPropertiesRegulator extends PlanVisitor { for (int i = 0; i < childrenProperties.size(); i++) { if (childrenProperties.get(i).getDistributionSpec() instanceof DistributionSpecStorageAny || childrenProperties.get(i).getDistributionSpec() instanceof DistributionSpecStorageGather + || childrenProperties.get(i).getDistributionSpec() instanceof DistributionSpecGather || (childrenProperties.get(i).getDistributionSpec() instanceof DistributionSpecHash && ((DistributionSpecHash) childrenProperties.get(i).getDistributionSpec()) .getShuffleType() == ShuffleType.NATURAL)) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java index c18fcc7cfb..74324101d3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java @@ -182,6 +182,7 @@ public class RequestPropertyDeriver extends PlanVisitor { @Override public Void visitPhysicalUnion(PhysicalUnion union, PlanContext context) { + // TODO: we do not generate gather union until we could do better cost computation on set operation List requiredPropertyList = Lists.newArrayListWithCapacity(context.arity()); if (union.getConstantExprsList().isEmpty()) { @@ -190,10 +191,6 @@ public class RequestPropertyDeriver extends PlanVisitor { if (distributionRequestFromParent instanceof DistributionSpecHash) { DistributionSpecHash distributionSpecHash = (DistributionSpecHash) distributionRequestFromParent; requiredPropertyList = createHashRequestAccordingToParent(union, distributionSpecHash, context); - } else if (distributionRequestFromParent instanceof DistributionSpecGather) { - for (int i = context.arity(); i > 0; --i) { - requiredPropertyList.add(PhysicalProperties.GATHER); - } } else { for (int i = context.arity(); i > 0; --i) { requiredPropertyList.add(PhysicalProperties.ANY); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java index cf133da31f..551e73532c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java @@ -374,7 +374,8 @@ public class AggregateStrategies implements ImplementationRuleFactory { .withRequire(requireHash) .withPartitionExpressions(logicalAgg.getGroupByExpressions()); return ImmutableList.>builder() - .add(gatherLocalAgg) + // TODO: usually bad, disable it until we could do better cost computation. + //.add(gatherLocalAgg) .add(hashLocalAgg) .build(); } @@ -736,7 +737,8 @@ public class AggregateStrategies implements ImplementationRuleFactory { .withRequire(requireHash) .withPartitionExpressions(logicalAgg.getGroupByExpressions()); return ImmutableList.>builder() - .add(anyLocalGatherGlobalAgg) + // TODO: usually bad, disable it until we could do better cost computation. + // .add(anyLocalGatherGlobalAgg) .add(anyLocalHashGlobalAgg) .build(); } @@ -1074,7 +1076,8 @@ public class AggregateStrategies implements ImplementationRuleFactory { .withRequire(requireHash) .withPartitionExpressions(logicalAgg.getGroupByExpressions()); return ImmutableList.>builder() - .add(gatherLocalAgg) + // TODO: usually bad, disable it until we could do better cost computation. + // .add(gatherLocalAgg) .add(hashLocalAgg) .build(); } 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 d655442bd0..4877f71f8c 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 @@ -49,35 +49,37 @@ CteAnchor[cteId= ( CTEId#8=] ) ------------PhysicalOlapScan[item] --CteAnchor[cteId= ( CTEId#10=] ) ----CteProducer[cteId= ( CTEId#10=] ) -------hashAgg[LOCAL] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +------hashAgg[GLOBAL] +--------PhysicalDistribute +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[store_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((date_dim.d_year <= 2002)(date_dim.d_year >= 2000)) -----------------------PhysicalOlapScan[date_dim] -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +--------------------PhysicalProject +----------------------PhysicalOlapScan[store_sales] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------filter((date_dim.d_year <= 2002)(date_dim.d_year >= 2000)) +--------------------------PhysicalOlapScan[date_dim] +--------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[catalog_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((date_dim.d_year <= 2002)(date_dim.d_year >= 2000)) -----------------------PhysicalOlapScan[date_dim] -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +--------------------PhysicalProject +----------------------PhysicalOlapScan[catalog_sales] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------filter((date_dim.d_year <= 2002)(date_dim.d_year >= 2000)) +--------------------------PhysicalOlapScan[date_dim] +--------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[web_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------filter((date_dim.d_year >= 2000)(date_dim.d_year <= 2002)) -----------------------PhysicalOlapScan[date_dim] +------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +--------------------PhysicalProject +----------------------PhysicalOlapScan[web_sales] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------filter((date_dim.d_year >= 2000)(date_dim.d_year <= 2002)) +--------------------------PhysicalOlapScan[date_dim] ----PhysicalTopN ------PhysicalDistribute --------PhysicalTopN 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 fe5d9b14c0..731dc27082 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 @@ -1,99 +1,99 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_33 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] --------PhysicalDistribute -----------PhysicalProject -------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) ---------------hashAgg[GLOBAL] -----------------PhysicalDistribute -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[store_sales] -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) -------------------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_gmt_offset = -5.00)) -------------------------------------PhysicalOlapScan[customer_address] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------PhysicalDistribute -----------------PhysicalProject -------------------filter((item.i_category = 'Home')) ---------------------PhysicalOlapScan[item] ---------PhysicalDistribute -----------PhysicalProject -------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) ---------------hashAgg[GLOBAL] -----------------PhysicalDistribute -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[catalog_sales] -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) -------------------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_gmt_offset = -5.00)) -------------------------------------PhysicalOlapScan[customer_address] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------PhysicalDistribute -----------------PhysicalProject -------------------filter((item.i_category = 'Home')) ---------------------PhysicalOlapScan[item] ---------PhysicalDistribute -----------PhysicalProject -------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) ---------------hashAgg[GLOBAL] -----------------PhysicalDistribute -------------------hashAgg[LOCAL] ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalProject +----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) +------------------hashAgg[GLOBAL] +--------------------PhysicalDistribute +----------------------hashAgg[LOCAL] ------------------------PhysicalProject ---------------------------PhysicalOlapScan[item] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +--------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) +----------------------------------PhysicalDistribute ------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[web_sales] -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) -------------------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((customer_address.ca_gmt_offset = -5.00)) -------------------------------------PhysicalOlapScan[customer_address] ---------------PhysicalDistribute -----------------PhysicalProject -------------------filter((item.i_category = 'Home')) ---------------------PhysicalOlapScan[item] +--------------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[store_sales] +----------------------------------------PhysicalDistribute +------------------------------------------PhysicalProject +--------------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) +----------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((customer_address.ca_gmt_offset = -5.00)) +----------------------------------------PhysicalOlapScan[customer_address] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[item] +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------filter((item.i_category = 'Home')) +------------------------PhysicalOlapScan[item] +--------------PhysicalProject +----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) +------------------hashAgg[GLOBAL] +--------------------PhysicalDistribute +----------------------hashAgg[LOCAL] +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------------PhysicalDistribute +------------------------------------------PhysicalProject +--------------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) +----------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((customer_address.ca_gmt_offset = -5.00)) +----------------------------------------PhysicalOlapScan[customer_address] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[item] +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------filter((item.i_category = 'Home')) +------------------------PhysicalOlapScan[item] +--------------PhysicalProject +----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id) +------------------hashAgg[GLOBAL] +--------------------PhysicalDistribute +----------------------hashAgg[LOCAL] +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[item] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[web_sales] +----------------------------------------PhysicalDistribute +------------------------------------------PhysicalProject +--------------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002)) +----------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((customer_address.ca_gmt_offset = -5.00)) +----------------------------------------PhysicalOlapScan[customer_address] +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------filter((item.i_category = 'Home')) +------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out index f8d87cba93..c9f23c7fd0 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query49.out @@ -1,82 +1,88 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_49 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion ---------PhysicalProject -----------filter(((return_rank <= 10) OR (currency_rank <= 10))) -------------PhysicalWindow ---------------PhysicalQuickSort -----------------PhysicalWindow -------------------PhysicalQuickSort ---------------------PhysicalDistribute +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] +--------PhysicalDistribute +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalDistribute +----------------PhysicalProject +------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------PhysicalWindow ----------------------PhysicalQuickSort -------------------------PhysicalProject ---------------------------hashAgg[GLOBAL] +------------------------PhysicalWindow +--------------------------PhysicalQuickSort ----------------------------PhysicalDistribute -------------------------------hashAgg[LOCAL] +------------------------------PhysicalQuickSort --------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](ws.ws_order_number = wr.wr_order_number)(item = wr.wr_item_sk) -------------------------------------PhysicalProject ---------------------------------------filter((wr.wr_return_amt > 10000.00)) -----------------------------------------PhysicalOlapScan[web_returns] -------------------------------------hashJoin[INNER_JOIN](ws.ws_sold_date_sk = date_dim.d_date_sk) ---------------------------------------PhysicalProject -----------------------------------------filter((ws.ws_net_paid > 0.00)(ws.ws_quantity > 0)(ws.ws_net_profit > 1.00)) -------------------------------------------PhysicalOlapScan[web_sales] ---------------------------------------PhysicalDistribute +----------------------------------hashAgg[GLOBAL] +------------------------------------PhysicalDistribute +--------------------------------------hashAgg[LOCAL] ----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------PhysicalProject -----------filter(((return_rank <= 10) OR (currency_rank <= 10))) -------------PhysicalWindow ---------------PhysicalQuickSort -----------------PhysicalWindow -------------------PhysicalQuickSort ---------------------PhysicalDistribute +------------------------------------------hashJoin[INNER_JOIN](ws.ws_order_number = wr.wr_order_number)(item = wr.wr_item_sk) +--------------------------------------------PhysicalProject +----------------------------------------------filter((wr.wr_return_amt > 10000.00)) +------------------------------------------------PhysicalOlapScan[web_returns] +--------------------------------------------hashJoin[INNER_JOIN](ws.ws_sold_date_sk = date_dim.d_date_sk) +----------------------------------------------PhysicalProject +------------------------------------------------filter((ws.ws_net_paid > 0.00)(ws.ws_quantity > 0)(ws.ws_net_profit > 1.00)) +--------------------------------------------------PhysicalOlapScan[web_sales] +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalProject +--------------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) +----------------------------------------------------PhysicalOlapScan[date_dim] +--------------PhysicalDistribute +----------------PhysicalProject +------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------PhysicalWindow ----------------------PhysicalQuickSort -------------------------PhysicalProject ---------------------------hashAgg[GLOBAL] +------------------------PhysicalWindow +--------------------------PhysicalQuickSort ----------------------------PhysicalDistribute -------------------------------hashAgg[LOCAL] +------------------------------PhysicalQuickSort --------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](cs.cs_order_number = cr.cr_order_number)(item = cr.cr_item_sk) -------------------------------------PhysicalProject ---------------------------------------filter((cr.cr_return_amount > 10000.00)) -----------------------------------------PhysicalOlapScan[catalog_returns] -------------------------------------hashJoin[INNER_JOIN](cs.cs_sold_date_sk = date_dim.d_date_sk) ---------------------------------------PhysicalProject -----------------------------------------filter((cs.cs_net_paid > 0.00)(cs.cs_quantity > 0)(cs.cs_net_profit > 1.00)) -------------------------------------------PhysicalOlapScan[catalog_sales] ---------------------------------------PhysicalDistribute +----------------------------------hashAgg[GLOBAL] +------------------------------------PhysicalDistribute +--------------------------------------hashAgg[LOCAL] ----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) ---------------------------------------------PhysicalOlapScan[date_dim] ---------PhysicalProject -----------filter(((return_rank <= 10) OR (currency_rank <= 10))) -------------PhysicalWindow ---------------PhysicalQuickSort -----------------PhysicalWindow -------------------PhysicalQuickSort ---------------------PhysicalDistribute +------------------------------------------hashJoin[INNER_JOIN](cs.cs_order_number = cr.cr_order_number)(item = cr.cr_item_sk) +--------------------------------------------PhysicalProject +----------------------------------------------filter((cr.cr_return_amount > 10000.00)) +------------------------------------------------PhysicalOlapScan[catalog_returns] +--------------------------------------------hashJoin[INNER_JOIN](cs.cs_sold_date_sk = date_dim.d_date_sk) +----------------------------------------------PhysicalProject +------------------------------------------------filter((cs.cs_net_paid > 0.00)(cs.cs_quantity > 0)(cs.cs_net_profit > 1.00)) +--------------------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalProject +--------------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) +----------------------------------------------------PhysicalOlapScan[date_dim] +--------------PhysicalDistribute +----------------PhysicalProject +------------------filter(((return_rank <= 10) OR (currency_rank <= 10))) +--------------------PhysicalWindow ----------------------PhysicalQuickSort -------------------------PhysicalProject ---------------------------hashAgg[GLOBAL] +------------------------PhysicalWindow +--------------------------PhysicalQuickSort ----------------------------PhysicalDistribute -------------------------------hashAgg[LOCAL] +------------------------------PhysicalQuickSort --------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN](sts.ss_ticket_number = sr.sr_ticket_number)(item = sr.sr_item_sk) -------------------------------------PhysicalProject ---------------------------------------filter((sr.sr_return_amt > 10000.00)) -----------------------------------------PhysicalOlapScan[store_returns] -------------------------------------hashJoin[INNER_JOIN](sts.ss_sold_date_sk = date_dim.d_date_sk) ---------------------------------------PhysicalProject -----------------------------------------filter((sts.ss_quantity > 0)(sts.ss_net_profit > 1.00)(sts.ss_net_paid > 0.00)) -------------------------------------------PhysicalOlapScan[store_sales] ---------------------------------------PhysicalDistribute +----------------------------------hashAgg[GLOBAL] +------------------------------------PhysicalDistribute +--------------------------------------hashAgg[LOCAL] ----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) ---------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------hashJoin[INNER_JOIN](sts.ss_ticket_number = sr.sr_ticket_number)(item = sr.sr_item_sk) +--------------------------------------------PhysicalProject +----------------------------------------------filter((sr.sr_return_amt > 10000.00)) +------------------------------------------------PhysicalOlapScan[store_returns] +--------------------------------------------hashJoin[INNER_JOIN](sts.ss_sold_date_sk = date_dim.d_date_sk) +----------------------------------------------PhysicalProject +------------------------------------------------filter((sts.ss_quantity > 0)(sts.ss_net_profit > 1.00)(sts.ss_net_paid > 0.00)) +--------------------------------------------------PhysicalOlapScan[store_sales] +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalProject +--------------------------------------------------filter((date_dim.d_moy = 12)(date_dim.d_year = 1999)) +----------------------------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out index a8b0c780eb..72a23fe3e8 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out @@ -60,20 +60,22 @@ PhysicalTopN ----------------------------------------PhysicalOlapScan[date_dim] ----------------------------------PhysicalDistribute ------------------------------------PhysicalAssertNumRows ---------------------------------------hashAgg[GLOBAL] -----------------------------------------PhysicalDistribute -------------------------------------------hashAgg[LOCAL] ---------------------------------------------PhysicalProject -----------------------------------------------filter((date_dim.d_moy = 5)(date_dim.d_year = 1998)) -------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------------PhysicalDistribute +----------------------------------------hashAgg[GLOBAL] +------------------------------------------PhysicalDistribute +--------------------------------------------hashAgg[LOCAL] +----------------------------------------------PhysicalProject +------------------------------------------------filter((date_dim.d_moy = 5)(date_dim.d_year = 1998)) +--------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------PhysicalDistribute --------------------------------PhysicalAssertNumRows -----------------------------------hashAgg[GLOBAL] -------------------------------------PhysicalDistribute ---------------------------------------hashAgg[LOCAL] -----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_year = 1998)(date_dim.d_moy = 5)) ---------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------PhysicalDistribute +------------------------------------hashAgg[GLOBAL] +--------------------------------------PhysicalDistribute +----------------------------------------hashAgg[LOCAL] +------------------------------------------PhysicalProject +--------------------------------------------filter((date_dim.d_year = 1998)(date_dim.d_moy = 5)) +----------------------------------------------PhysicalOlapScan[date_dim] --------------------------PhysicalDistribute ----------------------------PhysicalProject ------------------------------PhysicalOlapScan[store] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query56.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query56.out index 0e6f011f60..a7efe6f1d6 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query56.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query56.out @@ -1,93 +1,93 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_56 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] --------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) -----------------------PhysicalDistribute -------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[store_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) -------------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[item] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(i_color IN ('powder', 'green', 'cyan')) -------------------------------------PhysicalOlapScan[item] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------filter((customer_address.ca_gmt_offset = -6.00)) -----------------------------PhysicalOlapScan[customer_address] ---------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) -----------------------PhysicalDistribute -------------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) -------------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[item] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(i_color IN ('powder', 'green', 'cyan')) -------------------------------------PhysicalOlapScan[item] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------filter((customer_address.ca_gmt_offset = -6.00)) -----------------------------PhysicalOlapScan[customer_address] ---------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------filter((customer_address.ca_gmt_offset = -6.00)) ---------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalDistribute -------------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) -------------------------------------PhysicalOlapScan[date_dim] +------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) --------------------------PhysicalDistribute -----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +----------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[item] +--------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) +----------------------------------------PhysicalOlapScan[date_dim] ------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(i_color IN ('powder', 'green', 'cyan')) +--------------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +----------------------------------PhysicalProject ------------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter(i_color IN ('powder', 'green', 'cyan')) +----------------------------------------PhysicalOlapScan[item] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------filter((customer_address.ca_gmt_offset = -6.00)) +--------------------------------PhysicalOlapScan[customer_address] +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) +--------------------------PhysicalDistribute +----------------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) +----------------------------------------PhysicalOlapScan[date_dim] +------------------------------PhysicalDistribute +--------------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter(i_color IN ('powder', 'green', 'cyan')) +----------------------------------------PhysicalOlapScan[item] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------filter((customer_address.ca_gmt_offset = -6.00)) +--------------------------------PhysicalOlapScan[customer_address] +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) +--------------------------PhysicalProject +----------------------------filter((customer_address.ca_gmt_offset = -6.00)) +------------------------------PhysicalOlapScan[customer_address] +--------------------------PhysicalDistribute +----------------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 2)) +----------------------------------------PhysicalOlapScan[date_dim] +------------------------------PhysicalDistribute +--------------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter(i_color IN ('powder', 'green', 'cyan')) +----------------------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query6.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query6.out index 29b5a1055b..aa6c71623d 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query6.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query6.out @@ -25,12 +25,13 @@ PhysicalTopN ----------------------------------------PhysicalOlapScan[date_dim] --------------------------------------PhysicalDistribute ----------------------------------------PhysicalAssertNumRows -------------------------------------------hashAgg[GLOBAL] ---------------------------------------------PhysicalDistribute -----------------------------------------------hashAgg[LOCAL] -------------------------------------------------PhysicalProject ---------------------------------------------------filter((date_dim.d_year = 2002)(date_dim.d_moy = 3)) -----------------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------PhysicalDistribute +--------------------------------------------hashAgg[GLOBAL] +----------------------------------------------PhysicalDistribute +------------------------------------------------hashAgg[LOCAL] +--------------------------------------------------PhysicalProject +----------------------------------------------------filter((date_dim.d_year = 2002)(date_dim.d_moy = 3)) +------------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject --------------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query60.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query60.out index f428a69ea3..8538ed1f7b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query60.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query60.out @@ -1,94 +1,94 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_60 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] --------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) -----------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) +--------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk) +----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[store_sales] +--------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 8)) +----------------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter((customer_address.ca_gmt_offset = -7.00)) +----------------------------------PhysicalOlapScan[customer_address] +--------------------------PhysicalDistribute +----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[item] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 8)) -------------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((customer_address.ca_gmt_offset = -7.00)) -------------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalDistribute -------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------filter((item.i_category = 'Children')) ---------------------------------PhysicalOlapScan[item] ---------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) -----------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +----------------------------------filter((item.i_category = 'Children')) +------------------------------------PhysicalOlapScan[item] +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) +--------------------------hashJoin[INNER_JOIN](catalog_sales.cs_bill_addr_sk = customer_address.ca_address_sk) +----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] +--------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_moy = 8)(date_dim.d_year = 2000)) +----------------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter((customer_address.ca_gmt_offset = -7.00)) +----------------------------------PhysicalOlapScan[customer_address] +--------------------------PhysicalDistribute +----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[item] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------filter((date_dim.d_moy = 8)(date_dim.d_year = 2000)) -------------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((customer_address.ca_gmt_offset = -7.00)) -------------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalDistribute -------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------filter((item.i_category = 'Children')) ---------------------------------PhysicalOlapScan[item] ---------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) -----------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +----------------------------------filter((item.i_category = 'Children')) +------------------------------------PhysicalOlapScan[item] +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) +--------------------------hashJoin[INNER_JOIN](web_sales.ws_bill_addr_sk = customer_address.ca_address_sk) +----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] +--------------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 8)) +----------------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter((customer_address.ca_gmt_offset = -7.00)) +----------------------------------PhysicalOlapScan[customer_address] +--------------------------PhysicalDistribute +----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[item] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------filter((date_dim.d_year = 2000)(date_dim.d_moy = 8)) -------------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((customer_address.ca_gmt_offset = -7.00)) -------------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalDistribute -------------------------hashJoin[LEFT_SEMI_JOIN](item.i_item_id = item.i_item_id) ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------filter((item.i_category = 'Children')) ---------------------------------PhysicalOlapScan[item] +----------------------------------filter((item.i_category = 'Children')) +------------------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query66.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query66.out index 96c46db256..e80fc9bdd9 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query66.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query66.out @@ -1,63 +1,64 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_66 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] --------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](web_sales.ws_warehouse_sk = warehouse.w_warehouse_sk) -----------------------hashJoin[INNER_JOIN](web_sales.ws_sold_time_sk = time_dim.t_time_sk) -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) -----------------------------hashJoin[INNER_JOIN](web_sales.ws_ship_mode_sk = ship_mode.sm_ship_mode_sk) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[web_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) -------------------------------------PhysicalOlapScan[ship_mode] +----------hashAgg[LOCAL] +------------PhysicalUnion +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](web_sales.ws_warehouse_sk = warehouse.w_warehouse_sk) +--------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_time_sk = time_dim.t_time_sk) +----------------------------PhysicalProject +------------------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +--------------------------------hashJoin[INNER_JOIN](web_sales.ws_ship_mode_sk = ship_mode.sm_ship_mode_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) +----------------------------------------PhysicalOlapScan[ship_mode] +--------------------------------PhysicalDistribute +----------------------------------PhysicalProject +------------------------------------filter((date_dim.d_year = 1998)) +--------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_year = 1998)) -----------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((cast(t_time as BIGINT) <= 77621)(cast(t_time as BIGINT) >= 48821)) -------------------------------PhysicalOlapScan[time_dim] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[warehouse] ---------PhysicalDistribute -----------PhysicalProject -------------hashAgg[GLOBAL] ---------------PhysicalDistribute -----------------hashAgg[LOCAL] -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN](catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk) -----------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_time_sk = time_dim.t_time_sk) -------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) -----------------------------hashJoin[INNER_JOIN](catalog_sales.cs_ship_mode_sk = ship_mode.sm_ship_mode_sk) -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) -------------------------------------PhysicalOlapScan[ship_mode] +--------------------------------filter((cast(t_time as BIGINT) <= 77621)(cast(t_time as BIGINT) >= 48821)) +----------------------------------PhysicalOlapScan[time_dim] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[warehouse] +--------------PhysicalProject +----------------hashAgg[GLOBAL] +------------------PhysicalDistribute +--------------------hashAgg[LOCAL] +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN](catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk) +--------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_time_sk = time_dim.t_time_sk) +----------------------------PhysicalProject +------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +--------------------------------hashJoin[INNER_JOIN](catalog_sales.cs_ship_mode_sk = ship_mode.sm_ship_mode_sk) +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) +----------------------------------------PhysicalOlapScan[ship_mode] +--------------------------------PhysicalDistribute +----------------------------------PhysicalProject +------------------------------------filter((date_dim.d_year = 1998)) +--------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter((date_dim.d_year = 1998)) -----------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((cast(t_time as BIGINT) <= 77621)(cast(t_time as BIGINT) >= 48821)) -------------------------------PhysicalOlapScan[time_dim] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[warehouse] +--------------------------------filter((cast(t_time as BIGINT) <= 77621)(cast(t_time as BIGINT) >= 48821)) +----------------------------------PhysicalOlapScan[time_dim] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[warehouse] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out index 8d41268532..60e083b48a 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out @@ -2,63 +2,67 @@ -- !ds_shape_75 -- CteAnchor[cteId= ( CTEId#3=] ) --CteProducer[cteId= ( CTEId#3=] ) -----hashAgg[LOCAL] -------hashAgg[LOCAL] ---------PhysicalUnion -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[RIGHT_OUTER_JOIN](catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)(catalog_sales.cs_order_number = catalog_returns.cr_order_number) -----------------PhysicalProject -------------------PhysicalOlapScan[catalog_returns] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = catalog_sales.cs_sold_date_sk) ---------------------hashJoin[INNER_JOIN](item.i_item_sk = catalog_sales.cs_item_sk) -----------------------PhysicalProject -------------------------PhysicalOlapScan[catalog_sales] -----------------------PhysicalDistribute +----hashAgg[GLOBAL] +------PhysicalDistribute +--------hashAgg[LOCAL] +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalUnion +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------hashJoin[RIGHT_OUTER_JOIN](catalog_sales.cs_item_sk = catalog_returns.cr_item_sk)(catalog_sales.cs_order_number = catalog_returns.cr_order_number) ------------------------PhysicalProject ---------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) -----------------------------PhysicalOlapScan[item] ---------------------PhysicalDistribute -----------------------PhysicalProject -------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) ---------------------------PhysicalOlapScan[date_dim] -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[RIGHT_OUTER_JOIN](store_sales.ss_item_sk = store_returns.sr_item_sk)(store_sales.ss_ticket_number = store_returns.sr_ticket_number) -----------------PhysicalProject -------------------PhysicalOlapScan[store_returns] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = store_sales.ss_sold_date_sk) ---------------------hashJoin[INNER_JOIN](item.i_item_sk = store_sales.ss_item_sk) -----------------------PhysicalProject -------------------------PhysicalOlapScan[store_sales] -----------------------PhysicalDistribute +--------------------------PhysicalOlapScan[catalog_returns] ------------------------PhysicalProject ---------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) -----------------------------PhysicalOlapScan[item] ---------------------PhysicalDistribute -----------------------PhysicalProject -------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) ---------------------------PhysicalOlapScan[date_dim] -----------PhysicalDistribute -------------PhysicalProject ---------------hashJoin[RIGHT_OUTER_JOIN](web_sales.ws_item_sk = web_returns.wr_item_sk)(web_sales.ws_order_number = web_returns.wr_order_number) -----------------PhysicalProject -------------------PhysicalOlapScan[web_returns] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = web_sales.ws_sold_date_sk) ---------------------hashJoin[INNER_JOIN](item.i_item_sk = web_sales.ws_item_sk) -----------------------PhysicalProject -------------------------PhysicalOlapScan[web_sales] -----------------------PhysicalDistribute +--------------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = catalog_sales.cs_sold_date_sk) +----------------------------hashJoin[INNER_JOIN](item.i_item_sk = catalog_sales.cs_item_sk) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[catalog_sales] +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------------PhysicalOlapScan[item] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) +----------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------hashJoin[RIGHT_OUTER_JOIN](store_sales.ss_item_sk = store_returns.sr_item_sk)(store_sales.ss_ticket_number = store_returns.sr_ticket_number) ------------------------PhysicalProject ---------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) -----------------------------PhysicalOlapScan[item] ---------------------PhysicalDistribute -----------------------PhysicalProject -------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) ---------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalOlapScan[store_returns] +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = store_sales.ss_sold_date_sk) +----------------------------hashJoin[INNER_JOIN](item.i_item_sk = store_sales.ss_item_sk) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[store_sales] +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------------PhysicalOlapScan[item] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) +----------------------------------PhysicalOlapScan[date_dim] +------------------PhysicalDistribute +--------------------PhysicalProject +----------------------hashJoin[RIGHT_OUTER_JOIN](web_sales.ws_item_sk = web_returns.wr_item_sk)(web_sales.ws_order_number = web_returns.wr_order_number) +------------------------PhysicalProject +--------------------------PhysicalOlapScan[web_returns] +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN](date_dim.d_date_sk = web_sales.ws_sold_date_sk) +----------------------------hashJoin[INNER_JOIN](item.i_item_sk = web_sales.ws_item_sk) +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[web_sales] +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------------PhysicalOlapScan[item] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------filter(((date_dim.d_year = 1998) OR (date_dim.d_year = 1999))) +----------------------------------PhysicalOlapScan[date_dim] --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query76.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query76.out index b52788c8f2..809d43e7b6 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query76.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query76.out @@ -1,46 +1,49 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !ds_shape_76 -- PhysicalTopN ---PhysicalTopN -----hashAgg[LOCAL] -------PhysicalUnion +--PhysicalDistribute +----PhysicalTopN +------hashAgg[GLOBAL] --------PhysicalDistribute -----------PhysicalProject -------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) ---------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) -----------------PhysicalProject -------------------filter(ss_hdemo_sk IS NULL) ---------------------PhysicalOlapScan[store_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[item] +----------hashAgg[LOCAL] +------------PhysicalUnion --------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[date_dim] ---------PhysicalDistribute -----------PhysicalProject -------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) ---------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) -----------------PhysicalProject -------------------filter(ws_bill_addr_sk IS NULL) ---------------------PhysicalOlapScan[web_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[item] +------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) +--------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) +----------------------PhysicalProject +------------------------filter(ss_hdemo_sk IS NULL) +--------------------------PhysicalOlapScan[store_sales] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalOlapScan[item] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------PhysicalOlapScan[date_dim] --------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[date_dim] ---------PhysicalDistribute -----------PhysicalProject -------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) ---------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) -----------------PhysicalProject -------------------filter(cs_warehouse_sk IS NULL) ---------------------PhysicalOlapScan[catalog_sales] -----------------PhysicalDistribute -------------------PhysicalProject ---------------------PhysicalOlapScan[item] +------------------hashJoin[INNER_JOIN](web_sales.ws_sold_date_sk = date_dim.d_date_sk) +--------------------hashJoin[INNER_JOIN](web_sales.ws_item_sk = item.i_item_sk) +----------------------PhysicalProject +------------------------filter(ws_bill_addr_sk IS NULL) +--------------------------PhysicalOlapScan[web_sales] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalOlapScan[item] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------PhysicalOlapScan[date_dim] --------------PhysicalDistribute ----------------PhysicalProject -------------------PhysicalOlapScan[date_dim] +------------------hashJoin[INNER_JOIN](catalog_sales.cs_sold_date_sk = date_dim.d_date_sk) +--------------------hashJoin[INNER_JOIN](catalog_sales.cs_item_sk = item.i_item_sk) +----------------------PhysicalProject +------------------------filter(cs_warehouse_sk IS NULL) +--------------------------PhysicalOlapScan[catalog_sales] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalOlapScan[item] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------PhysicalOlapScan[date_dim]