diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java index 725b279568..41f384ac77 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlot.java @@ -21,6 +21,7 @@ import org.apache.doris.nereids.trees.expressions.Alias; import org.apache.doris.nereids.trees.expressions.Expression; import org.apache.doris.nereids.trees.expressions.NamedExpression; import org.apache.doris.nereids.trees.expressions.Slot; +import org.apache.doris.nereids.trees.expressions.SlotReference; import org.apache.doris.nereids.trees.expressions.WindowExpression; import org.apache.doris.nereids.trees.expressions.visitor.DefaultExpressionRewriter; @@ -69,8 +70,14 @@ public interface NormalizeToSlot { if (normalizeToSlotMap.containsKey(expression)) { continue; } - NormalizeToSlotTriplet normalizeToSlotTriplet = - NormalizeToSlotTriplet.toTriplet(expression, existsAliasMap.get(expression)); + Alias alias = null; + // consider projects: c1, c1 as a1. we should push down both of them, + // so we could not replace c1 with c1 as a1. + // use null as alias for SlotReference to avoid replace it by another alias of it. + if (!(expression instanceof SlotReference)) { + alias = existsAliasMap.get(expression); + } + NormalizeToSlotTriplet normalizeToSlotTriplet = NormalizeToSlotTriplet.toTriplet(expression, alias); normalizeToSlotMap.put(expression, normalizeToSlotTriplet); } return new NormalizeToSlotContext(normalizeToSlotMap); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/FillUpMissingSlotsTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/FillUpMissingSlotsTest.java index 394c7ea3b7..2e479c0595 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/FillUpMissingSlotsTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/FillUpMissingSlotsTest.java @@ -102,7 +102,8 @@ public class FillUpMissingSlotsTest extends AnalyzeCheckTestBase implements Memo logicalProject( logicalAggregate( logicalProject(logicalOlapScan()) - ).when(FieldChecker.check("outputExpressions", Lists.newArrayList(value)))) + ).when(FieldChecker.check("outputExpressions", Lists.newArrayList(a1))) + ).when(FieldChecker.check("projects", ImmutableList.of(new Alias(new ExprId(3), a1, value.toSql())))) ).when(FieldChecker.check("conjuncts", ImmutableSet.of(new GreaterThan(value.toSlot(), new TinyIntLiteral((byte) 0))))))); sql = "SELECT a1 as value FROM t1 GROUP BY a1 HAVING value > 0"; @@ -113,7 +114,8 @@ public class FillUpMissingSlotsTest extends AnalyzeCheckTestBase implements Memo logicalProject( logicalAggregate( logicalProject(logicalOlapScan()) - ).when(FieldChecker.check("outputExpressions", Lists.newArrayList(value)))) + ).when(FieldChecker.check("outputExpressions", Lists.newArrayList(a1))) + ).when(FieldChecker.check("projects", ImmutableList.of(new Alias(new ExprId(3), a1, value.toSql())))) ).when(FieldChecker.check("conjuncts", ImmutableSet.of(new GreaterThan(value.toSlot(), new TinyIntLiteral((byte) 0)))))); sql = "SELECT sum(a2) FROM t1 GROUP BY a1 HAVING a1 > 0"; diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/InferPredicatesTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/InferPredicatesTest.java index b7b235d2b4..6eb8f89c8a 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/InferPredicatesTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/InferPredicatesTest.java @@ -340,12 +340,15 @@ public class InferPredicatesTest extends TestWithFeService implements MemoPatter logicalFilter( logicalOlapScan() ).when(filer -> filer.getPredicate().toSql().contains("id > 1")), - logicalAggregate( - logicalProject( + logicalProject( + logicalAggregate( + logicalProject( logicalFilter( - logicalOlapScan() - ).when(filer -> filer.getPredicate().toSql().contains("sid > 1")) - )) + logicalOlapScan() + ).when(filer -> filer.getPredicate().toSql().contains("sid > 1")) + ) + ) + ) ) ) ); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlotTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlotTest.java new file mode 100644 index 0000000000..1133201e1e --- /dev/null +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/NormalizeToSlotTest.java @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.rules.rewrite; + +import org.apache.doris.nereids.rules.rewrite.NormalizeToSlot.NormalizeToSlotContext; +import org.apache.doris.nereids.trees.expressions.Alias; +import org.apache.doris.nereids.trees.expressions.Expression; +import org.apache.doris.nereids.trees.expressions.SlotReference; +import org.apache.doris.nereids.types.StringType; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Set; + +public class NormalizeToSlotTest { + + @Test + void testSlotReferenceWithItsAlias() { + SlotReference slotReference = new SlotReference("c1", StringType.INSTANCE); + Alias alias = new Alias(slotReference, "a1"); + Set existsAliases = ImmutableSet.of(alias); + List sourceExpressions = ImmutableList.of(slotReference, alias); + + NormalizeToSlotContext context = NormalizeToSlotContext.buildContext(existsAliases, sourceExpressions); + Assertions.assertEquals(slotReference, context.normalizeToUseSlotRef(slotReference)); + Assertions.assertEquals(alias.toSlot(), context.normalizeToUseSlotRef(alias)); + Assertions.assertEquals(Sets.newHashSet(sourceExpressions), + context.pushDownToNamedExpression(sourceExpressions)); + } +} diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out index 9d78edab8f..67d53678b4 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out @@ -2,17 +2,18 @@ -- !ds_shape_1 -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----hashAgg[GLOBAL] -------PhysicalDistribute ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ---------------PhysicalProject -----------------PhysicalOlapScan[store_returns] ---------------PhysicalDistribute +----PhysicalProject +------hashAgg[GLOBAL] +--------PhysicalDistribute +----------hashAgg[LOCAL] +------------PhysicalProject +--------------hashJoin[INNER_JOIN] hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ----------------PhysicalProject -------------------filter((date_dim.d_year = 2000)) ---------------------PhysicalOlapScan[date_dim] +------------------PhysicalOlapScan[store_returns] +----------------PhysicalDistribute +------------------PhysicalProject +--------------------filter((date_dim.d_year = 2000)) +----------------------PhysicalOlapScan[date_dim] --PhysicalResultSink ----PhysicalTopN ------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query19.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query19.out index 1dc78a027b..156e41249b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query19.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query19.out @@ -4,36 +4,37 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk))otherCondition=(( not (substring(ca_zip, 1, 5) = substring(s_zip, 1, 5)))) -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_addr_sk = customer_address.ca_address_sk))otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[customer_address] -----------------------PhysicalDistribute +--------PhysicalProject +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalProject +------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk))otherCondition=(( not (substring(ca_zip, 1, 5) = substring(s_zip, 1, 5)))) +--------------------PhysicalProject +----------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_current_addr_sk = customer_address.ca_address_sk))otherCondition=() ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk))otherCondition=() -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[customer] -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() -----------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[store_sales] +--------------------------PhysicalOlapScan[customer_address] +------------------------PhysicalDistribute +--------------------------PhysicalProject +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_customer_sk = customer.c_customer_sk))otherCondition=() +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------PhysicalOlapScan[customer] +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() +--------------------------------------PhysicalProject +----------------------------------------PhysicalOlapScan[store_sales] +--------------------------------------PhysicalDistribute +----------------------------------------PhysicalProject +------------------------------------------filter((item.i_manager_id = 2)) +--------------------------------------------PhysicalOlapScan[item] ------------------------------------PhysicalDistribute --------------------------------------PhysicalProject -----------------------------------------filter((item.i_manager_id = 2)) -------------------------------------------PhysicalOlapScan[item] -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1999)) -----------------------------------------PhysicalOlapScan[date_dim] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[store] +----------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1999)) +------------------------------------------PhysicalOlapScan[date_dim] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------PhysicalOlapScan[store] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out index 4ef76ce80d..8f295b0cd5 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out @@ -8,30 +8,29 @@ PhysicalResultSink ----------hashAgg[GLOBAL] ------------PhysicalDistribute --------------hashAgg[LOCAL] -----------------PhysicalProject -------------------PhysicalRepeat ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk))otherCondition=() -------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() ---------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_cdemo_sk = customer_demographics.cd_demo_sk))otherCondition=() -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[store_sales] -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------filter((customer_demographics.cd_education_status = 'Secondary') and (customer_demographics.cd_gender = 'F') and (customer_demographics.cd_marital_status = 'D')) -----------------------------------------PhysicalOlapScan[customer_demographics] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 1999)) ---------------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[item] +----------------PhysicalRepeat +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_store_sk = store.s_store_sk))otherCondition=() +----------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ------------------------PhysicalDistribute --------------------------PhysicalProject -----------------------------filter(s_state IN ('AL', 'LA', 'MI', 'MO', 'SC', 'TN')) -------------------------------PhysicalOlapScan[store] +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_cdemo_sk = customer_demographics.cd_demo_sk))otherCondition=() +--------------------------------PhysicalProject +----------------------------------PhysicalOlapScan[store_sales] +--------------------------------PhysicalDistribute +----------------------------------PhysicalProject +------------------------------------filter((customer_demographics.cd_education_status = 'Secondary') and (customer_demographics.cd_gender = 'F') and (customer_demographics.cd_marital_status = 'D')) +--------------------------------------PhysicalOlapScan[customer_demographics] +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------filter((date_dim.d_year = 1999)) +------------------------------------PhysicalOlapScan[date_dim] +------------------------PhysicalDistribute +--------------------------PhysicalProject +----------------------------PhysicalOlapScan[item] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------filter(s_state IN ('AL', 'LA', 'MI', 'MO', 'SC', 'TN')) +----------------------------PhysicalOlapScan[store] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query3.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query3.out index 7590a50077..a505a9ff33 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query3.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query3.out @@ -4,21 +4,22 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() -------------------PhysicalDistribute ---------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() -----------------------PhysicalProject -------------------------PhysicalOlapScan[store_sales] -----------------------PhysicalDistribute +--------PhysicalProject +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalProject +------------------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +--------------------PhysicalDistribute +----------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ------------------------PhysicalProject ---------------------------filter((item.i_manufact_id = 816)) -----------------------------PhysicalOlapScan[item] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------filter((dt.d_moy = 11)) -------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalOlapScan[store_sales] +------------------------PhysicalDistribute +--------------------------PhysicalProject +----------------------------filter((item.i_manufact_id = 816)) +------------------------------PhysicalOlapScan[item] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------filter((dt.d_moy = 11)) +--------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out index 7995bfe619..edac382179 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out @@ -2,23 +2,24 @@ -- !ds_shape_30 -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----hashAgg[GLOBAL] -------PhysicalDistribute ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returning_addr_sk = customer_address.ca_address_sk))otherCondition=() ---------------PhysicalDistribute -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[web_returns] ---------------------PhysicalDistribute +----PhysicalProject +------hashAgg[GLOBAL] +--------PhysicalDistribute +----------hashAgg[LOCAL] +------------PhysicalProject +--------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returning_addr_sk = customer_address.ca_address_sk))otherCondition=() +----------------PhysicalDistribute +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ----------------------PhysicalProject -------------------------filter((date_dim.d_year = 2002)) ---------------------------PhysicalOlapScan[date_dim] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[customer_address] +------------------------PhysicalOlapScan[web_returns] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------filter((date_dim.d_year = 2002)) +----------------------------PhysicalOlapScan[date_dim] +----------------PhysicalDistribute +------------------PhysicalProject +--------------------PhysicalOlapScan[customer_address] --PhysicalResultSink ----PhysicalTopN ------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out index 63f3bf1642..95d9e38065 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out @@ -8,55 +8,52 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ----------PhysicalDistribute ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = store_sales.ss_customer_sk))otherCondition=() +----------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = store_sales.ss_customer_sk))otherCondition=() +------------------PhysicalDistribute +--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() +----------------------PhysicalProject +------------------------PhysicalOlapScan[store_sales] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------PhysicalOlapScan[store_sales] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[customer] +--------------------------filter(d_year IN (1999, 2000)) +----------------------------PhysicalOlapScan[date_dim] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------filter(d_year IN (1999, 2000)) -------------------------PhysicalOlapScan[date_dim] +----------------------PhysicalOlapScan[customer] ------PhysicalProject --------hashAgg[GLOBAL] ----------PhysicalDistribute ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk))otherCondition=() -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = catalog_sales.cs_bill_customer_sk))otherCondition=() +----------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = catalog_sales.cs_bill_customer_sk))otherCondition=() +------------------PhysicalDistribute +--------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk))otherCondition=() +----------------------PhysicalProject +------------------------PhysicalOlapScan[catalog_sales] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------PhysicalOlapScan[catalog_sales] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[customer] +--------------------------filter(d_year IN (1999, 2000)) +----------------------------PhysicalOlapScan[date_dim] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------filter(d_year IN (1999, 2000)) -------------------------PhysicalOlapScan[date_dim] +----------------------PhysicalOlapScan[customer] ------PhysicalProject --------hashAgg[GLOBAL] ----------PhysicalDistribute ------------hashAgg[LOCAL] --------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() -------------------PhysicalProject ---------------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = web_sales.ws_bill_customer_sk))otherCondition=() +----------------hashJoin[INNER_JOIN] hashCondition=((customer.c_customer_sk = web_sales.ws_bill_customer_sk))otherCondition=() +------------------PhysicalDistribute +--------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() +----------------------PhysicalProject +------------------------PhysicalOlapScan[web_sales] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------PhysicalOlapScan[web_sales] -----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------PhysicalOlapScan[customer] +--------------------------filter(d_year IN (1999, 2000)) +----------------------------PhysicalOlapScan[date_dim] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------filter(d_year IN (1999, 2000)) -------------------------PhysicalOlapScan[date_dim] +----------------------PhysicalOlapScan[customer] --PhysicalResultSink ----PhysicalTopN ------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out index 9c3796dc03..7b4e8c0686 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query44.out @@ -20,12 +20,13 @@ PhysicalResultSink ------------------------------PhysicalPartitionTopN --------------------------------PhysicalProject ----------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col as DOUBLE) > cast((0.9 * rank_col) as DOUBLE)) -------------------------------------hashAgg[GLOBAL] ---------------------------------------PhysicalDistribute -----------------------------------------hashAgg[LOCAL] -------------------------------------------PhysicalProject ---------------------------------------------filter((ss1.ss_store_sk = 146)) -----------------------------------------------PhysicalOlapScan[store_sales] +------------------------------------PhysicalProject +--------------------------------------hashAgg[GLOBAL] +----------------------------------------PhysicalDistribute +------------------------------------------hashAgg[LOCAL] +--------------------------------------------PhysicalProject +----------------------------------------------filter((ss1.ss_store_sk = 146)) +------------------------------------------------PhysicalOlapScan[store_sales] ------------------------------------PhysicalDistribute --------------------------------------PhysicalAssertNumRows ----------------------------------------PhysicalDistribute @@ -50,12 +51,13 @@ PhysicalResultSink ------------------------------PhysicalPartitionTopN --------------------------------PhysicalProject ----------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col as DOUBLE) > cast((0.9 * rank_col) as DOUBLE)) -------------------------------------hashAgg[GLOBAL] ---------------------------------------PhysicalDistribute -----------------------------------------hashAgg[LOCAL] -------------------------------------------PhysicalProject ---------------------------------------------filter((ss1.ss_store_sk = 146)) -----------------------------------------------PhysicalOlapScan[store_sales] +------------------------------------PhysicalProject +--------------------------------------hashAgg[GLOBAL] +----------------------------------------PhysicalDistribute +------------------------------------------hashAgg[LOCAL] +--------------------------------------------PhysicalProject +----------------------------------------------filter((ss1.ss_store_sk = 146)) +------------------------------------------------PhysicalOlapScan[store_sales] ------------------------------------PhysicalDistribute --------------------------------------PhysicalAssertNumRows ----------------------------------------PhysicalDistribute 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 80fae98da4..673bc53892 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 @@ -20,7 +20,7 @@ PhysicalResultSink ----------------------------------PhysicalDistribute ------------------------------------hashAgg[LOCAL] --------------------------------------PhysicalProject -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((item = wr.wr_item_sk) and (ws.ws_order_number = wr.wr_order_number))otherCondition=() +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((ws.ws_item_sk = wr.wr_item_sk) and (ws.ws_order_number = wr.wr_order_number))otherCondition=() ------------------------------------------PhysicalProject --------------------------------------------filter((wr.wr_return_amt > 10000.00)) ----------------------------------------------PhysicalOlapScan[web_returns] @@ -46,7 +46,7 @@ PhysicalResultSink ----------------------------------PhysicalDistribute ------------------------------------hashAgg[LOCAL] --------------------------------------PhysicalProject -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((cs.cs_order_number = cr.cr_order_number) and (item = cr.cr_item_sk))otherCondition=() +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((cs.cs_item_sk = cr.cr_item_sk) and (cs.cs_order_number = cr.cr_order_number))otherCondition=() ------------------------------------------PhysicalProject --------------------------------------------filter((cr.cr_return_amount > 10000.00)) ----------------------------------------------PhysicalOlapScan[catalog_returns] @@ -72,7 +72,7 @@ PhysicalResultSink ----------------------------------PhysicalDistribute ------------------------------------hashAgg[LOCAL] --------------------------------------PhysicalProject -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((item = sr.sr_item_sk) and (sts.ss_ticket_number = sr.sr_ticket_number))otherCondition=() +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((sts.ss_item_sk = sr.sr_item_sk) and (sts.ss_ticket_number = sr.sr_ticket_number))otherCondition=() ------------------------------------------PhysicalProject --------------------------------------------filter((sr.sr_return_amt > 10000.00)) ----------------------------------------------PhysicalOlapScan[store_returns] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out index 50eb1c4bf3..cfa64c7daa 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query51.out @@ -4,42 +4,45 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------filter((web_cumulative > store_cumulative)) -----------PhysicalWindow -------------PhysicalQuickSort ---------------PhysicalDistribute -----------------PhysicalProject -------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = store.d_date) and (web.item_sk = store.item_sk))otherCondition=() ---------------------PhysicalProject -----------------------PhysicalWindow -------------------------PhysicalQuickSort ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashAgg[GLOBAL] ---------------------------------PhysicalDistribute -----------------------------------hashAgg[LOCAL] -------------------------------------PhysicalProject ---------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() +--------PhysicalProject +----------filter((web_cumulative > store_cumulative)) +------------PhysicalWindow +--------------PhysicalQuickSort +----------------PhysicalDistribute +------------------PhysicalProject +--------------------hashJoin[FULL_OUTER_JOIN] hashCondition=((web.d_date = store.d_date) and (web.item_sk = store.item_sk))otherCondition=() +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalWindow +----------------------------PhysicalQuickSort +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------hashAgg[GLOBAL] +------------------------------------PhysicalDistribute +--------------------------------------hashAgg[LOCAL] ----------------------------------------PhysicalProject -------------------------------------------PhysicalOlapScan[store_sales] -----------------------------------------PhysicalDistribute -------------------------------------------PhysicalProject ---------------------------------------------filter((date_dim.d_month_seq <= 1227) and (date_dim.d_month_seq >= 1216)) -----------------------------------------------PhysicalOlapScan[date_dim] ---------------------PhysicalProject -----------------------PhysicalWindow -------------------------PhysicalQuickSort ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashAgg[GLOBAL] ---------------------------------PhysicalDistribute -----------------------------------hashAgg[LOCAL] -------------------------------------PhysicalProject ---------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() +--------------------------------------------PhysicalProject +----------------------------------------------PhysicalOlapScan[store_sales] +--------------------------------------------PhysicalDistribute +----------------------------------------------PhysicalProject +------------------------------------------------filter((date_dim.d_month_seq <= 1227) and (date_dim.d_month_seq >= 1216)) +--------------------------------------------------PhysicalOlapScan[date_dim] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalWindow +----------------------------PhysicalQuickSort +------------------------------PhysicalDistribute +--------------------------------PhysicalProject +----------------------------------hashAgg[GLOBAL] +------------------------------------PhysicalDistribute +--------------------------------------hashAgg[LOCAL] ----------------------------------------PhysicalProject -------------------------------------------PhysicalOlapScan[web_sales] -----------------------------------------PhysicalDistribute -------------------------------------------PhysicalProject ---------------------------------------------filter((date_dim.d_month_seq <= 1227) and (date_dim.d_month_seq >= 1216)) -----------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() +--------------------------------------------PhysicalProject +----------------------------------------------PhysicalOlapScan[web_sales] +--------------------------------------------PhysicalDistribute +----------------------------------------------PhysicalProject +------------------------------------------------filter((date_dim.d_month_seq <= 1227) and (date_dim.d_month_seq >= 1216)) +--------------------------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query52.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query52.out index 053175f95a..523764e3ae 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query52.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query52.out @@ -4,20 +4,21 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() -------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[store_sales] +--------PhysicalProject +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalProject +------------------hashJoin[INNER_JOIN] hashCondition=((dt.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() +----------------------PhysicalProject +------------------------PhysicalOlapScan[store_sales] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------filter((item.i_manager_id = 1)) +----------------------------PhysicalOlapScan[item] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------filter((item.i_manager_id = 1)) ---------------------------PhysicalOlapScan[item] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------filter((dt.d_moy = 12) and (dt.d_year = 2002)) -------------------------PhysicalOlapScan[date_dim] +------------------------filter((dt.d_moy = 12) and (dt.d_year = 2002)) +--------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query55.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query55.out index c0dbead767..7e1ae9a83e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query55.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query55.out @@ -4,20 +4,21 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() -------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[store_sales] +--------PhysicalProject +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalProject +------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() +----------------------PhysicalProject +------------------------PhysicalOlapScan[store_sales] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------filter((item.i_manager_id = 100)) +----------------------------PhysicalOlapScan[item] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------filter((item.i_manager_id = 100)) ---------------------------PhysicalOlapScan[item] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 2000)) -------------------------PhysicalOlapScan[date_dim] +------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 2000)) +--------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query58.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query58.out index 36bcd02e22..03ce5bd855 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query58.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query58.out @@ -11,85 +11,87 @@ PhysicalResultSink ----------------PhysicalDistribute ------------------hashAgg[LOCAL] --------------------PhysicalProject -----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() -------------------------PhysicalProject +----------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk))otherCondition=() +------------------------PhysicalDistribute --------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk))otherCondition=() -----------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_sales.cs_item_sk = item.i_item_sk))otherCondition=() -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[catalog_sales] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[item] +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[catalog_sales] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalAssertNumRows +--------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[date_dim] ----------------------------------PhysicalDistribute ------------------------------------PhysicalProject ---------------------------------------filter((date_dim.d_date = 2001-03-24)) -----------------------------------------PhysicalOlapScan[date_dim] +--------------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------------PhysicalDistribute +------------------------------------------PhysicalAssertNumRows +--------------------------------------------PhysicalDistribute +----------------------------------------------PhysicalProject +------------------------------------------------filter((date_dim.d_date = 2001-03-24)) +--------------------------------------------------PhysicalOlapScan[date_dim] +------------------------PhysicalDistribute +--------------------------PhysicalProject +----------------------------PhysicalOlapScan[item] ------------hashJoin[INNER_JOIN] hashCondition=((ss_items.item_id = ws_items.item_id))otherCondition=((cast(ss_item_rev as DOUBLE) <= cast((1.1 * ws_item_rev) as DOUBLE)) and (cast(ss_item_rev as DOUBLE) >= cast((0.9 * ws_item_rev) as DOUBLE)) and (cast(ws_item_rev as DOUBLE) <= cast((1.1 * ss_item_rev) as DOUBLE)) and (cast(ws_item_rev as DOUBLE) >= cast((0.9 * ss_item_rev) as DOUBLE))) --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[store_sales] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[item] +------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk))otherCondition=() +--------------------------PhysicalDistribute +----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[web_sales] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute -----------------------------------PhysicalAssertNumRows +----------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +------------------------------------PhysicalProject +--------------------------------------PhysicalOlapScan[date_dim] ------------------------------------PhysicalDistribute --------------------------------------PhysicalProject -----------------------------------------filter((date_dim.d_date = 2001-03-24)) -------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------PhysicalDistribute +--------------------------------------------PhysicalAssertNumRows +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalProject +--------------------------------------------------filter((date_dim.d_date = 2001-03-24)) +----------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[item] --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() ---------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_item_sk = item.i_item_sk))otherCondition=() ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[web_sales] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[item] +------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_item_sk = item.i_item_sk))otherCondition=() +--------------------------PhysicalDistribute +----------------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[store_sales] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute -----------------------------------PhysicalAssertNumRows +----------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +------------------------------------PhysicalProject +--------------------------------------PhysicalOlapScan[date_dim] ------------------------------------PhysicalDistribute --------------------------------------PhysicalProject -----------------------------------------filter((date_dim.d_date = 2001-03-24)) -------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------PhysicalDistribute +--------------------------------------------PhysicalAssertNumRows +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalProject +--------------------------------------------------filter((date_dim.d_date = 2001-03-24)) +----------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalDistribute +----------------------------PhysicalProject +------------------------------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 9d1fd50125..80cf4daa14 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 @@ -4,51 +4,51 @@ PhysicalResultSink --PhysicalTopN ----PhysicalDistribute ------PhysicalTopN ---------filter((cnt >= 10)) -----------hashAgg[GLOBAL] -------------PhysicalDistribute ---------------hashAgg[LOCAL] -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((j.i_category = i.i_category))otherCondition=((cast(i_current_price as DECIMALV3(38, 5)) > (1.2 * avg(cast(i_current_price as DECIMALV3(9, 4)))))) ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN] hashCondition=((s.ss_item_sk = i.i_item_sk))otherCondition=() -------------------------PhysicalDistribute ---------------------------hashJoin[INNER_JOIN] hashCondition=((d.d_month_seq = date_dim.d_month_seq))otherCondition=() -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((s.ss_sold_date_sk = d.d_date_sk))otherCondition=() ---------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_customer_sk = s.ss_customer_sk))otherCondition=() -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------PhysicalOlapScan[store_sales] -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------hashJoin[INNER_JOIN] hashCondition=((a.ca_address_sk = c.c_current_addr_sk))otherCondition=() -------------------------------------------PhysicalDistribute ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[customer] -------------------------------------------PhysicalDistribute ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[customer_address] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[date_dim] +--------PhysicalProject +----------filter((cnt >= 10)) +------------hashAgg[GLOBAL] +--------------PhysicalDistribute +----------------hashAgg[LOCAL] +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((a.ca_address_sk = c.c_current_addr_sk))otherCondition=() +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN] hashCondition=((c.c_customer_sk = s.ss_customer_sk))otherCondition=() ----------------------------PhysicalDistribute -------------------------------PhysicalAssertNumRows ---------------------------------PhysicalDistribute -----------------------------------hashAgg[GLOBAL] -------------------------------------PhysicalDistribute ---------------------------------------hashAgg[LOCAL] +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[customer] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((j.i_category = i.i_category))otherCondition=((cast(i_current_price as DECIMALV3(38, 5)) > (1.2 * avg(cast(i_current_price as DECIMALV3(9, 4)))))) +----------------------------------PhysicalProject +------------------------------------hashJoin[INNER_JOIN] hashCondition=((s.ss_item_sk = i.i_item_sk))otherCondition=() +--------------------------------------PhysicalDistribute +----------------------------------------hashJoin[INNER_JOIN] hashCondition=((s.ss_sold_date_sk = d.d_date_sk))otherCondition=() +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[store_sales] +------------------------------------------PhysicalDistribute +--------------------------------------------hashJoin[INNER_JOIN] hashCondition=((d.d_month_seq = date_dim.d_month_seq))otherCondition=() +----------------------------------------------PhysicalProject +------------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalAssertNumRows +--------------------------------------------------PhysicalDistribute +----------------------------------------------------hashAgg[GLOBAL] +------------------------------------------------------PhysicalDistribute +--------------------------------------------------------hashAgg[LOCAL] +----------------------------------------------------------PhysicalProject +------------------------------------------------------------filter((date_dim.d_moy = 3) and (date_dim.d_year = 2002)) +--------------------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------------PhysicalDistribute ----------------------------------------PhysicalProject -------------------------------------------filter((date_dim.d_moy = 3) and (date_dim.d_year = 2002)) ---------------------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------PhysicalOlapScan[item] ---------------------PhysicalDistribute -----------------------hashAgg[GLOBAL] -------------------------PhysicalDistribute ---------------------------hashAgg[LOCAL] -----------------------------PhysicalProject -------------------------------PhysicalOlapScan[item] +------------------------------------------PhysicalOlapScan[item] +----------------------------------PhysicalDistribute +------------------------------------hashAgg[GLOBAL] +--------------------------------------PhysicalDistribute +----------------------------------------hashAgg[LOCAL] +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[item] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------PhysicalOlapScan[customer_address] 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 d1d08ca46b..d04ce6a4e1 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 @@ -22,9 +22,8 @@ PhysicalResultSink ------------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) --------------------------------------PhysicalOlapScan[ship_mode] --------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------------filter((date_dim.d_year = 1998)) +------------------------------------PhysicalOlapScan[date_dim] ------------------------------PhysicalDistribute --------------------------------filter((cast(t_time as BIGINT) <= 77621) and (time_dim.t_time >= 48821)) ----------------------------------PhysicalOlapScan[time_dim] @@ -44,9 +43,8 @@ PhysicalResultSink ------------------------------------filter(sm_carrier IN ('GREAT EASTERN', 'LATVIAN')) --------------------------------------PhysicalOlapScan[ship_mode] --------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] +----------------------------------filter((date_dim.d_year = 1998)) +------------------------------------PhysicalOlapScan[date_dim] ------------------------------PhysicalDistribute --------------------------------filter((cast(t_time as BIGINT) <= 77621) and (time_dim.t_time >= 48821)) ----------------------------------PhysicalOlapScan[time_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query70.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query70.out index ee6b506337..21bf7714e4 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query70.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query70.out @@ -28,24 +28,27 @@ PhysicalResultSink ------------------------------------PhysicalDistribute --------------------------------------PhysicalProject ----------------------------------------PhysicalOlapScan[store] -------------------------------------PhysicalProject ---------------------------------------filter((ranking <= 5)) -----------------------------------------PhysicalWindow -------------------------------------------PhysicalQuickSort +------------------------------------PhysicalDistribute +--------------------------------------PhysicalProject +----------------------------------------filter((ranking <= 5)) +------------------------------------------PhysicalWindow --------------------------------------------PhysicalPartitionTopN -----------------------------------------------hashAgg[GLOBAL] -------------------------------------------------PhysicalDistribute ---------------------------------------------------hashAgg[LOCAL] -----------------------------------------------------PhysicalProject -------------------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = store_sales.ss_store_sk))otherCondition=() ---------------------------------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +----------------------------------------------PhysicalDistribute +------------------------------------------------PhysicalPartitionTopN +--------------------------------------------------PhysicalProject +----------------------------------------------------hashAgg[GLOBAL] +------------------------------------------------------PhysicalDistribute +--------------------------------------------------------hashAgg[LOCAL] ----------------------------------------------------------PhysicalProject -------------------------------------------------------------PhysicalOlapScan[store_sales] -----------------------------------------------------------PhysicalDistribute -------------------------------------------------------------PhysicalProject ---------------------------------------------------------------filter((date_dim.d_month_seq <= 1224) and (date_dim.d_month_seq >= 1213)) -----------------------------------------------------------------PhysicalOlapScan[date_dim] ---------------------------------------------------------PhysicalDistribute -----------------------------------------------------------PhysicalProject -------------------------------------------------------------PhysicalOlapScan[store] +------------------------------------------------------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = store_sales.ss_store_sk))otherCondition=() +--------------------------------------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +----------------------------------------------------------------PhysicalProject +------------------------------------------------------------------PhysicalOlapScan[store_sales] +----------------------------------------------------------------PhysicalDistribute +------------------------------------------------------------------PhysicalProject +--------------------------------------------------------------------filter((date_dim.d_month_seq <= 1224) and (date_dim.d_month_seq >= 1213)) +----------------------------------------------------------------------PhysicalOlapScan[date_dim] +--------------------------------------------------------------PhysicalDistribute +----------------------------------------------------------------PhysicalProject +------------------------------------------------------------------PhysicalOlapScan[store] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out index 4a6de147b9..98860bd352 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out @@ -4,48 +4,49 @@ PhysicalResultSink --PhysicalQuickSort ----PhysicalDistribute ------PhysicalQuickSort ---------hashAgg[GLOBAL] -----------PhysicalDistribute -------------hashAgg[LOCAL] ---------------PhysicalProject -----------------hashJoin[INNER_JOIN] hashCondition=((tmp.time_sk = time_dim.t_time_sk))otherCondition=() -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------hashJoin[INNER_JOIN] hashCondition=((tmp.sold_item_sk = item.i_item_sk))otherCondition=() -------------------------PhysicalUnion +--------PhysicalProject +----------hashAgg[GLOBAL] +------------PhysicalDistribute +--------------hashAgg[LOCAL] +----------------PhysicalProject +------------------hashJoin[INNER_JOIN] hashCondition=((tmp.time_sk = time_dim.t_time_sk))otherCondition=() +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------hashJoin[INNER_JOIN] hashCondition=((tmp.sold_item_sk = item.i_item_sk))otherCondition=() +--------------------------PhysicalUnion +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = web_sales.ws_sold_date_sk))otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[web_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) +----------------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = catalog_sales.cs_sold_date_sk))otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[catalog_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) +----------------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalDistribute +------------------------------PhysicalProject +--------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() +----------------------------------PhysicalProject +------------------------------------PhysicalOlapScan[store_sales] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) +----------------------------------------PhysicalOlapScan[date_dim] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = web_sales.ws_sold_date_sk))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[web_sales] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = catalog_sales.cs_sold_date_sk))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[catalog_sales] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[store_sales] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter((date_dim.d_moy = 12) and (date_dim.d_year = 1998)) ---------------------------------------PhysicalOlapScan[date_dim] -------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------filter((item.i_manager_id = 1)) -------------------------------PhysicalOlapScan[item] -------------------PhysicalDistribute ---------------------PhysicalProject -----------------------filter(t_meal_time IN ('breakfast', 'dinner')) -------------------------PhysicalOlapScan[time_dim] +------------------------------filter((item.i_manager_id = 1)) +--------------------------------PhysicalOlapScan[item] +--------------------PhysicalDistribute +----------------------PhysicalProject +------------------------filter(t_meal_time IN ('breakfast', 'dinner')) +--------------------------PhysicalOlapScan[time_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query74.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query74.out index 3a5637d8c3..53ddf9c93f 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query74.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query74.out @@ -12,12 +12,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk))otherCondition=() --------------------PhysicalOlapScan[store_sales] --------------------PhysicalDistribute -----------------------PhysicalProject -------------------------filter(d_year IN (1999, 2000)) ---------------------------PhysicalOlapScan[date_dim] +----------------------filter(d_year IN (1999, 2000)) +------------------------PhysicalOlapScan[date_dim] ------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[customer] +--------------------PhysicalOlapScan[customer] ------PhysicalProject --------hashAgg[GLOBAL] ----------PhysicalDistribute @@ -28,12 +26,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk))otherCondition=() ----------------------PhysicalOlapScan[web_sales] ----------------------PhysicalDistribute -------------------------PhysicalProject ---------------------------filter(d_year IN (1999, 2000)) -----------------------------PhysicalOlapScan[date_dim] +------------------------filter(d_year IN (1999, 2000)) +--------------------------PhysicalOlapScan[date_dim] ------------------PhysicalDistribute ---------------------PhysicalProject -----------------------PhysicalOlapScan[customer] +--------------------PhysicalOlapScan[customer] --PhysicalResultSink ----PhysicalTopN ------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out index b369178902..3f7b1c8148 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out @@ -32,8 +32,7 @@ PhysicalResultSink --------------------------------------filter((promotion.p_channel_tv = 'N')) ----------------------------------------PhysicalOlapScan[promotion] ----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[store] +------------------------------------PhysicalOlapScan[store] --------------------PhysicalProject ----------------------hashAgg[GLOBAL] ------------------------PhysicalDistribute @@ -56,8 +55,7 @@ PhysicalResultSink --------------------------------------filter((promotion.p_channel_tv = 'N')) ----------------------------------------PhysicalOlapScan[promotion] ----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[catalog_page] +------------------------------------PhysicalOlapScan[catalog_page] --------------------PhysicalProject ----------------------hashAgg[GLOBAL] ------------------------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out index 32ea0dcffd..5f8da78aec 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out @@ -2,23 +2,24 @@ -- !ds_shape_81 -- PhysicalCteAnchor ( cteId=CTEId#0 ) --PhysicalCteProducer ( cteId=CTEId#0 ) -----hashAgg[GLOBAL] -------PhysicalDistribute ---------hashAgg[LOCAL] -----------PhysicalProject -------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returning_addr_sk = customer_address.ca_address_sk))otherCondition=() ---------------PhysicalDistribute -----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ---------------------PhysicalProject -----------------------PhysicalOlapScan[catalog_returns] ---------------------PhysicalDistribute +----PhysicalProject +------hashAgg[GLOBAL] +--------PhysicalDistribute +----------hashAgg[LOCAL] +------------PhysicalProject +--------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returning_addr_sk = customer_address.ca_address_sk))otherCondition=() +----------------PhysicalDistribute +------------------PhysicalProject +--------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() ----------------------PhysicalProject -------------------------filter((date_dim.d_year = 2002)) ---------------------------PhysicalOlapScan[date_dim] ---------------PhysicalDistribute -----------------PhysicalProject -------------------PhysicalOlapScan[customer_address] +------------------------PhysicalOlapScan[catalog_returns] +----------------------PhysicalDistribute +------------------------PhysicalProject +--------------------------filter((date_dim.d_year = 2002)) +----------------------------PhysicalOlapScan[date_dim] +----------------PhysicalDistribute +------------------PhysicalProject +--------------------PhysicalOlapScan[customer_address] --PhysicalResultSink ----PhysicalTopN ------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query83.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query83.out index affcd1c68b..f80f0bd9ca 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query83.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query83.out @@ -11,85 +11,79 @@ PhysicalResultSink ----------------PhysicalDistribute ------------------hashAgg[LOCAL] --------------------PhysicalProject -----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +----------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_item_sk = item.i_item_sk))otherCondition=() ------------------------PhysicalProject ---------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_item_sk = item.i_item_sk))otherCondition=() -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[catalog_returns] -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[item] -----------------------------PhysicalDistribute -------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[date_dim] +--------------------------PhysicalOlapScan[item] ------------------------PhysicalDistribute ---------------------------PhysicalProject -----------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +--------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[catalog_returns] +----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) +--------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +----------------------------------PhysicalProject ------------------------------------PhysicalOlapScan[date_dim] +----------------------------------PhysicalDistribute +------------------------------------PhysicalProject +--------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[date_dim] +----------------------------------------PhysicalDistribute +------------------------------------------PhysicalProject +--------------------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) +----------------------------------------------PhysicalOlapScan[date_dim] ------------hashJoin[INNER_JOIN] hashCondition=((sr_items.item_id = wr_items.item_id))otherCondition=() --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() ---------------------------PhysicalProject +------------------------hashJoin[INNER_JOIN] hashCondition=((store_returns.sr_item_sk = item.i_item_sk))otherCondition=() +--------------------------PhysicalDistribute ----------------------------hashJoin[INNER_JOIN] hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk))otherCondition=() -------------------------------hashJoin[INNER_JOIN] hashCondition=((store_returns.sr_item_sk = item.i_item_sk))otherCondition=() ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[store_returns] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------PhysicalOlapScan[item] +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[store_returns] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] +----------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +------------------------------------PhysicalProject +--------------------------------------PhysicalOlapScan[date_dim] +------------------------------------PhysicalDistribute +--------------------------------------PhysicalProject +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------PhysicalDistribute +--------------------------------------------PhysicalProject +----------------------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) +------------------------------------------------PhysicalOlapScan[date_dim] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) ---------------------------------------PhysicalOlapScan[date_dim] +------------------------------PhysicalOlapScan[item] --------------PhysicalProject ----------------hashAgg[GLOBAL] ------------------PhysicalDistribute --------------------hashAgg[LOCAL] ----------------------PhysicalProject -------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_item_sk = item.i_item_sk))otherCondition=() --------------------------PhysicalProject -----------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk))otherCondition=() -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_item_sk = item.i_item_sk))otherCondition=() -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------PhysicalOlapScan[web_returns] -------------------------------------PhysicalDistribute ---------------------------------------PhysicalProject -----------------------------------------PhysicalOlapScan[item] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] +----------------------------PhysicalOlapScan[item] --------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +----------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_returned_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------------PhysicalProject +--------------------------------PhysicalOlapScan[web_returns] +------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------PhysicalOlapScan[date_dim] ---------------------------------PhysicalDistribute -----------------------------------PhysicalProject -------------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) +----------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_date = date_dim.d_date))otherCondition=() +------------------------------------PhysicalProject --------------------------------------PhysicalOlapScan[date_dim] +------------------------------------PhysicalDistribute +--------------------------------------PhysicalProject +----------------------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((date_dim.d_week_seq = date_dim.d_week_seq))otherCondition=() +------------------------------------------PhysicalProject +--------------------------------------------PhysicalOlapScan[date_dim] +------------------------------------------PhysicalDistribute +--------------------------------------------PhysicalProject +----------------------------------------------filter(d_date IN (2001-06-06, 2001-09-02, 2001-11-11)) +------------------------------------------------PhysicalOlapScan[date_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out index c430d8c51c..7a9fdaaf58 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out @@ -9,40 +9,37 @@ PhysicalResultSink ------------PhysicalDistribute --------------hashAgg[LOCAL] ----------------PhysicalProject -------------------hashJoin[INNER_JOIN] hashCondition=((customer_address.ca_address_sk = customer.c_current_addr_sk))otherCondition=() +------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_call_center_sk = call_center.cc_call_center_sk))otherCondition=() --------------------PhysicalProject -----------------------filter((customer_address.ca_gmt_offset = -6.00)) -------------------------PhysicalOlapScan[customer_address] +----------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() +------------------------PhysicalProject +--------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returning_customer_sk = customer.c_customer_sk))otherCondition=() +----------------------------PhysicalProject +------------------------------PhysicalOlapScan[catalog_returns] +----------------------------PhysicalDistribute +------------------------------hashJoin[INNER_JOIN] hashCondition=((customer_address.ca_address_sk = customer.c_current_addr_sk))otherCondition=() +--------------------------------PhysicalProject +----------------------------------filter((customer_address.ca_gmt_offset = -6.00)) +------------------------------------PhysicalOlapScan[customer_address] +--------------------------------PhysicalDistribute +----------------------------------hashJoin[INNER_JOIN] hashCondition=((household_demographics.hd_demo_sk = customer.c_current_hdemo_sk))otherCondition=() +------------------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk))otherCondition=() +--------------------------------------PhysicalDistribute +----------------------------------------PhysicalProject +------------------------------------------PhysicalOlapScan[customer] +--------------------------------------PhysicalDistribute +----------------------------------------PhysicalProject +------------------------------------------filter((((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = 'Unknown')) OR ((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'Advanced Degree')))) +--------------------------------------------PhysicalOlapScan[customer_demographics] +------------------------------------PhysicalDistribute +--------------------------------------PhysicalProject +----------------------------------------filter((hd_buy_potential like '1001-5000%')) +------------------------------------------PhysicalOlapScan[household_demographics] +------------------------PhysicalDistribute +--------------------------PhysicalProject +----------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001)) +------------------------------PhysicalOlapScan[date_dim] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------hashJoin[INNER_JOIN] hashCondition=((customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk))otherCondition=() ---------------------------PhysicalDistribute -----------------------------PhysicalProject -------------------------------filter((((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = 'Unknown')) OR ((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'Advanced Degree')))) ---------------------------------PhysicalOlapScan[customer_demographics] ---------------------------PhysicalDistribute -----------------------------hashJoin[INNER_JOIN] hashCondition=((household_demographics.hd_demo_sk = customer.c_current_hdemo_sk))otherCondition=() -------------------------------PhysicalProject ---------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returning_customer_sk = customer.c_customer_sk))otherCondition=() -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------PhysicalOlapScan[customer] -----------------------------------PhysicalDistribute -------------------------------------PhysicalProject ---------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_returned_date_sk = date_dim.d_date_sk))otherCondition=() -----------------------------------------PhysicalProject -------------------------------------------hashJoin[INNER_JOIN] hashCondition=((catalog_returns.cr_call_center_sk = call_center.cc_call_center_sk))otherCondition=() ---------------------------------------------PhysicalProject -----------------------------------------------PhysicalOlapScan[catalog_returns] ---------------------------------------------PhysicalDistribute -----------------------------------------------PhysicalProject -------------------------------------------------PhysicalOlapScan[call_center] -----------------------------------------PhysicalDistribute -------------------------------------------PhysicalProject ---------------------------------------------filter((date_dim.d_moy = 11) and (date_dim.d_year = 2001)) -----------------------------------------------PhysicalOlapScan[date_dim] -------------------------------PhysicalDistribute ---------------------------------PhysicalProject -----------------------------------filter((hd_buy_potential like '1001-5000%')) -------------------------------------PhysicalOlapScan[household_demographics] +------------------------PhysicalOlapScan[call_center] diff --git a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q15.out b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q15.out index fbdc8c9187..d8dd2f9de4 100644 --- a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q15.out +++ b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q15.out @@ -10,12 +10,13 @@ PhysicalResultSink --------------PhysicalOlapScan[supplier] ------------PhysicalDistribute --------------hashJoin[INNER_JOIN] hashCondition=((revenue0.total_revenue = max(total_revenue)))otherCondition=() -----------------hashAgg[GLOBAL] -------------------PhysicalDistribute ---------------------hashAgg[LOCAL] -----------------------PhysicalProject -------------------------filter((lineitem.l_shipdate < 1996-04-01) and (lineitem.l_shipdate >= 1996-01-01)) ---------------------------PhysicalOlapScan[lineitem] +----------------PhysicalProject +------------------hashAgg[GLOBAL] +--------------------PhysicalDistribute +----------------------hashAgg[LOCAL] +------------------------PhysicalProject +--------------------------filter((lineitem.l_shipdate < 1996-04-01) and (lineitem.l_shipdate >= 1996-01-01)) +----------------------------PhysicalOlapScan[lineitem] ----------------PhysicalDistribute ------------------hashAgg[GLOBAL] --------------------PhysicalDistribute diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf4.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf4.groovy index 02998649b4..970a35f121 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf4.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf4.groovy @@ -168,5 +168,5 @@ limit 100; // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF1[d_date_sk->[ss_sold_date_sk],RF0[c_customer_sk->[ss_customer_sk],RF3[d_date_sk->[cs_sold_date_sk],RF2[c_customer_sk->[cs_bill_customer_sk],RF5[d_date_sk->[ws_sold_date_sk],RF4[c_customer_sk->[ws_bill_customer_sk]", getRuntimeFilters(plan)) + assertEquals("RF1[c_customer_sk->[ss_customer_sk],RF0[d_date_sk->[ss_sold_date_sk],RF3[c_customer_sk->[cs_bill_customer_sk],RF2[d_date_sk->[cs_sold_date_sk],RF5[c_customer_sk->[ws_bill_customer_sk],RF4[d_date_sk->[ws_sold_date_sk]", getRuntimeFilters(plan)) } diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf49.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf49.groovy index 9ea2f27d4e..6bba794d52 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf49.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf49.groovy @@ -181,5 +181,5 @@ suite("ds_rf49") { // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF1[ws_order_number->[wr_order_number],RF2[item->[wr_item_sk],RF0[d_date_sk->[ws_sold_date_sk],RF4[cs_order_number->[cr_order_number],RF5[item->[cr_item_sk],RF3[d_date_sk->[cs_sold_date_sk],RF7[ss_ticket_number->[sr_ticket_number],RF8[item->[sr_item_sk],RF6[d_date_sk->[ss_sold_date_sk]", getRuntimeFilters(plan)) + assertEquals("RF1[ws_order_number->[wr_order_number],RF2[ws_item_sk->[wr_item_sk],RF0[d_date_sk->[ws_sold_date_sk],RF4[cs_order_number->[cr_order_number],RF5[cs_item_sk->[cr_item_sk],RF3[d_date_sk->[cs_sold_date_sk],RF7[ss_ticket_number->[sr_ticket_number],RF8[ss_item_sk->[sr_item_sk],RF6[d_date_sk->[ss_sold_date_sk]", getRuntimeFilters(plan)) } diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf58.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf58.groovy index 93f40317d0..9c3c4ebc71 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf58.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf58.groovy @@ -117,5 +117,5 @@ suite("ds_rf58") { // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF13[item_id->[i_item_id],RF12[d_date->[d_date],RF11[d_date_sk->[cs_sold_date_sk],RF10[i_item_sk->[cs_item_sk],RF9[d_week_seq->[d_week_seq],RF8[item_id->[i_item_id],RF7[d_date->[d_date],RF6[d_date_sk->[ss_sold_date_sk],RF5[i_item_sk->[ss_item_sk],RF4[d_week_seq->[d_week_seq],RF3[d_date->[d_date],RF2[d_date_sk->[ws_sold_date_sk],RF1[i_item_sk->[ws_item_sk],RF0[d_week_seq->[d_week_seq]", getRuntimeFilters(plan)) + assertEquals("RF13[item_id->[i_item_id],RF12[i_item_sk->[cs_item_sk],RF11[d_date_sk->[cs_sold_date_sk],RF10[d_date->[d_date],RF9[d_week_seq->[d_week_seq],RF8[item_id->[i_item_id],RF7[i_item_sk->[ws_item_sk],RF6[d_date_sk->[ws_sold_date_sk],RF5[d_date->[d_date],RF4[d_week_seq->[d_week_seq],RF3[i_item_sk->[ss_item_sk],RF2[d_date_sk->[ss_sold_date_sk],RF1[d_date->[d_date],RF0[d_week_seq->[d_week_seq]", getRuntimeFilters(plan)) } diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf6.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf6.groovy index 7a01a6706d..914f2c1c01 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf6.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf6.groovy @@ -78,5 +78,5 @@ suite("ds_rf6") { // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF5[i_category->[i_category],RF4[i_item_sk->[ss_item_sk],RF3[d_month_seq->[d_month_seq],RF2[d_date_sk->[ss_sold_date_sk],RF1[c_customer_sk->[ss_customer_sk],RF0[ca_address_sk->[c_current_addr_sk]", getRuntimeFilters(plan)) + assertEquals("RF5[ca_address_sk->[c_current_addr_sk],RF4[ss_customer_sk->[c_customer_sk],RF3[i_category->[i_category],RF2[i_item_sk->[ss_item_sk],RF1[d_date_sk->[ss_sold_date_sk],RF0[d_month_seq->[d_month_seq]", getRuntimeFilters(plan)) } diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf83.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf83.groovy index 51be93e939..f7f462819e 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf83.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf83.groovy @@ -119,5 +119,5 @@ suite("ds_rf83") { // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF13[item_id->[i_item_id],RF12[d_date->[d_date],RF11[d_date_sk->[cr_returned_date_sk],RF10[i_item_sk->[cr_item_sk],RF9[d_week_seq->[d_week_seq],RF8[item_id->[i_item_id],RF7[d_date->[d_date],RF6[d_date_sk->[sr_returned_date_sk],RF5[i_item_sk->[sr_item_sk],RF4[d_week_seq->[d_week_seq],RF3[d_date->[d_date],RF2[d_date_sk->[wr_returned_date_sk],RF1[i_item_sk->[wr_item_sk],RF0[d_week_seq->[d_week_seq]", getRuntimeFilters(plan)) + assertEquals("RF13[item_id->[i_item_id],RF12[cr_item_sk->[i_item_sk],RF11[d_date_sk->[cr_returned_date_sk],RF10[d_date->[d_date],RF9[d_week_seq->[d_week_seq],RF8[item_id->[i_item_id],RF7[i_item_sk->[sr_item_sk],RF6[d_date_sk->[sr_returned_date_sk],RF5[d_date->[d_date],RF4[d_week_seq->[d_week_seq],RF3[wr_item_sk->[i_item_sk],RF2[d_date_sk->[wr_returned_date_sk],RF1[d_date->[d_date],RF0[d_week_seq->[d_week_seq]", getRuntimeFilters(plan)) } diff --git a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf91.groovy b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf91.groovy index a0a1ec8fe7..d8c9df4b04 100644 --- a/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf91.groovy +++ b/regression-test/suites/nereids_tpcds_shape_sf100_p0/rf/ds_rf91.groovy @@ -83,5 +83,5 @@ order by sum(cr_net_loss) desc; // File file = new File(outFile) // file.write(getRuntimeFilters(plan)) - assertEquals("RF5[c_current_addr_sk->[ca_address_sk],RF4[c_current_cdemo_sk->[cd_demo_sk],RF3[hd_demo_sk->[c_current_hdemo_sk],RF2[cr_returning_customer_sk->[c_customer_sk],RF1[d_date_sk->[cr_returned_date_sk],RF0[cc_call_center_sk->[cr_call_center_sk]", getRuntimeFilters(plan)) + assertEquals("RF5[cc_call_center_sk->[cr_call_center_sk],RF4[d_date_sk->[cr_returned_date_sk],RF3[c_customer_sk->[cr_returning_customer_sk],RF2[c_current_addr_sk->[ca_address_sk],RF1[hd_demo_sk->[c_current_hdemo_sk],RF0[cd_demo_sk->[c_current_cdemo_sk]", getRuntimeFilters(plan)) }