From 36289729861203da4672ad91c968b06cd16cde13 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Thu, 24 Sep 2020 08:30:59 +0300 Subject: [PATCH 01/11] CBO once --- .../org/apache/spark/sql/catalyst/optimizer/Optimizer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala index 6033c01a60f47..55641b273a6ee 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala @@ -190,7 +190,7 @@ abstract class Optimizer(catalogManager: CatalogManager) Batch("Early Filter and Projection Push-Down", Once, earlyScanPushDownRules: _*) :+ // Since join costs in AQP can change between multiple runs, there is no reason that we have an // idempotence enforcement on this batch. We thus make it FixedPoint(1) instead of Once. - Batch("Join Reorder", FixedPoint(1), + Batch("Join Reorder", Once, CostBasedJoinReorder) :+ Batch("Eliminate Sorts", Once, EliminateSorts) :+ From d58966ce5434d50044e8d610978f075cbcad92b1 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Fri, 25 Sep 2020 19:48:32 +0300 Subject: [PATCH 02/11] make CostBasedJoinReorder idempotent --- .../optimizer/CostBasedJoinReorder.scala | 30 +- .../sql/catalyst/optimizer/Optimizer.scala | 2 - .../q10.sf100/explain.txt | 322 +++--- .../q10.sf100/simplified.txt | 46 +- .../q27.sf100/explain.txt | 210 ++-- .../q27.sf100/simplified.txt | 22 +- .../q3.sf100/explain.txt | 108 +-- .../q3.sf100/simplified.txt | 12 +- .../q34.sf100/explain.txt | 128 +-- .../q34.sf100/simplified.txt | 10 +- .../q42.sf100/explain.txt | 112 +-- .../q42.sf100/simplified.txt | 12 +- .../q46.sf100/explain.txt | 378 ++++---- .../q46.sf100/simplified.txt | 66 +- .../q52.sf100/explain.txt | 112 +-- .../q52.sf100/simplified.txt | 12 +- .../q55.sf100/explain.txt | 96 +- .../q55.sf100/simplified.txt | 10 +- .../q63.sf100/explain.txt | 136 +-- .../q63.sf100/simplified.txt | 14 +- .../q65.sf100/explain.txt | 196 ++-- .../q65.sf100/simplified.txt | 54 +- .../q68.sf100/explain.txt | 366 +++---- .../q68.sf100/simplified.txt | 50 +- .../q79.sf100/explain.txt | 132 +-- .../q79.sf100/simplified.txt | 10 +- .../q98.sf100/explain.txt | 104 +- .../q98.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q10.sf100/explain.txt | 354 +++---- .../q10.sf100/simplified.txt | 50 +- .../approved-plans-v1_4/q11.sf100/explain.txt | 252 ++--- .../q11.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q12.sf100/explain.txt | 174 ++-- .../q12.sf100/simplified.txt | 52 +- .../q14a.sf100/explain.txt | 896 ++++++++--------- .../q14a.sf100/simplified.txt | 104 +- .../q14b.sf100/explain.txt | 772 +++++++-------- .../q14b.sf100/simplified.txt | 94 +- .../approved-plans-v1_4/q15.sf100/explain.txt | 240 ++--- .../q15.sf100/simplified.txt | 68 +- .../approved-plans-v1_4/q16.sf100/explain.txt | 62 +- .../q16.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q17.sf100/explain.txt | 276 +++--- .../q17.sf100/simplified.txt | 26 +- .../approved-plans-v1_4/q19.sf100/explain.txt | 132 +-- .../q19.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q20.sf100/explain.txt | 196 ++-- .../q20.sf100/simplified.txt | 52 +- .../approved-plans-v1_4/q21.sf100/explain.txt | 120 +-- .../q21.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q22.sf100/explain.txt | 92 +- .../q22.sf100/simplified.txt | 24 +- .../q23b.sf100/explain.txt | 914 +++++++++--------- .../q23b.sf100/simplified.txt | 110 +-- .../q24a.sf100/explain.txt | 282 +++--- .../q24a.sf100/simplified.txt | 34 +- .../q24b.sf100/explain.txt | 282 +++--- .../q24b.sf100/simplified.txt | 34 +- .../approved-plans-v1_4/q26.sf100/explain.txt | 108 +-- .../q26.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q29.sf100/explain.txt | 104 +- .../q29.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q3.sf100/explain.txt | 108 +-- .../q3.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q30.sf100/explain.txt | 550 +++++------ .../q30.sf100/simplified.txt | 94 +- .../approved-plans-v1_4/q31.sf100/explain.txt | 846 ++++++++-------- .../q31.sf100/simplified.txt | 292 +++--- .../approved-plans-v1_4/q32.sf100/explain.txt | 212 ++-- .../q32.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q33.sf100/explain.txt | 158 +-- .../q33.sf100/simplified.txt | 22 +- .../approved-plans-v1_4/q35.sf100/explain.txt | 378 ++++---- .../q35.sf100/simplified.txt | 62 +- .../approved-plans-v1_4/q36.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q37.sf100/explain.txt | 128 +-- .../q37.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q38.sf100/explain.txt | 156 +-- .../q38.sf100/simplified.txt | 16 +- .../q39a.sf100/explain.txt | 218 ++--- .../q39a.sf100/simplified.txt | 28 +- .../q39b.sf100/explain.txt | 218 ++--- .../q39b.sf100/simplified.txt | 28 +- .../approved-plans-v1_4/q4.sf100/explain.txt | 382 ++++---- .../q4.sf100/simplified.txt | 40 +- .../approved-plans-v1_4/q40.sf100/explain.txt | 188 ++-- .../q40.sf100/simplified.txt | 34 +- .../approved-plans-v1_4/q42.sf100/explain.txt | 112 +-- .../q42.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q43.sf100/explain.txt | 96 +- .../q43.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q45.sf100/explain.txt | 204 ++-- .../q45.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q46.sf100/explain.txt | 106 +- .../q46.sf100/simplified.txt | 22 +- .../approved-plans-v1_4/q50.sf100/explain.txt | 196 ++-- .../q50.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q52.sf100/explain.txt | 108 +-- .../q52.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q53.sf100/explain.txt | 136 +-- .../q53.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q55.sf100/explain.txt | 108 +-- .../q55.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q56.sf100/explain.txt | 56 +- .../q56.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q57.sf100/explain.txt | 166 ++-- .../q57.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q6.sf100/explain.txt | 90 +- .../q6.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q60.sf100/explain.txt | 56 +- .../q60.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q61.sf100/explain.txt | 28 +- .../q61.sf100/simplified.txt | 6 +- .../approved-plans-v1_4/q63.sf100/explain.txt | 136 +-- .../q63.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q65.sf100/explain.txt | 200 ++-- .../q65.sf100/simplified.txt | 54 +- .../approved-plans-v1_4/q67.sf100/explain.txt | 114 +-- .../q67.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q68.sf100/explain.txt | 224 ++--- .../q68.sf100/simplified.txt | 32 +- .../approved-plans-v1_4/q69.sf100/explain.txt | 342 +++---- .../q69.sf100/simplified.txt | 50 +- .../approved-plans-v1_4/q7.sf100/explain.txt | 108 +-- .../q7.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q70.sf100/explain.txt | 156 +-- .../q70.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q72.sf100/explain.txt | 218 ++--- .../q72.sf100/simplified.txt | 24 +- .../approved-plans-v1_4/q73.sf100/explain.txt | 128 +-- .../q73.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q74.sf100/explain.txt | 72 +- .../q74.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q76.sf100/explain.txt | 200 ++-- .../q76.sf100/simplified.txt | 32 +- .../approved-plans-v1_4/q77.sf100/explain.txt | 206 ++-- .../q77.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q78.sf100/explain.txt | 342 +++---- .../q78.sf100/simplified.txt | 100 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 64 +- .../q80.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q81.sf100/explain.txt | 188 ++-- .../q81.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q82.sf100/explain.txt | 128 +-- .../q82.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q83.sf100/explain.txt | 150 +-- .../q83.sf100/simplified.txt | 44 +- .../approved-plans-v1_4/q84.sf100/explain.txt | 210 ++-- .../q84.sf100/simplified.txt | 48 +- .../approved-plans-v1_4/q85.sf100/explain.txt | 122 +-- .../q85.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q86.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q87.sf100/explain.txt | 156 +-- .../q87.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q88.sf100/explain.txt | 466 ++++----- .../q88.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q89.sf100/explain.txt | 128 +-- .../q89.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q91.sf100/explain.txt | 202 ++-- .../q91.sf100/simplified.txt | 26 +- .../approved-plans-v1_4/q92.sf100/explain.txt | 224 ++--- .../q92.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q94.sf100/explain.txt | 300 +++--- .../q94.sf100/simplified.txt | 60 +- .../approved-plans-v1_4/q95.sf100/explain.txt | 428 ++++---- .../q95.sf100/simplified.txt | 84 +- .../approved-plans-v1_4/q96.sf100/explain.txt | 90 +- .../q96.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q98.sf100/explain.txt | 204 ++-- .../q98.sf100/simplified.txt | 52 +- .../approved-plans-v1_4/q99.sf100/explain.txt | 108 +-- .../q99.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q11.sf100/explain.txt | 36 +- .../q11.sf100/simplified.txt | 8 +- .../approved-plans-v2_7/q14.sf100/explain.txt | 196 ++-- .../q14.sf100/simplified.txt | 46 +- .../q14a.sf100/explain.txt | 28 +- .../q14a.sf100/simplified.txt | 6 +- .../q18a.sf100/explain.txt | 180 ++-- .../q18a.sf100/simplified.txt | 34 +- .../approved-plans-v2_7/q20.sf100/explain.txt | 104 +- .../q20.sf100/simplified.txt | 10 +- .../q22a.sf100/explain.txt | 174 ++-- .../q22a.sf100/simplified.txt | 30 +- .../approved-plans-v2_7/q24.sf100/explain.txt | 286 +++--- .../q24.sf100/simplified.txt | 36 +- .../q27a.sf100/explain.txt | 268 ++--- .../q27a.sf100/simplified.txt | 54 +- .../approved-plans-v2_7/q34.sf100/explain.txt | 132 +-- .../q34.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q35.sf100/explain.txt | 378 ++++---- .../q35.sf100/simplified.txt | 62 +- .../q36a.sf100/explain.txt | 114 +-- .../q36a.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q49.sf100/explain.txt | 188 ++-- .../q49.sf100/simplified.txt | 24 +- .../approved-plans-v2_7/q72.sf100/explain.txt | 334 +++---- .../q72.sf100/simplified.txt | 34 +- .../approved-plans-v2_7/q74.sf100/explain.txt | 278 +++--- .../q74.sf100/simplified.txt | 24 +- .../approved-plans-v2_7/q75.sf100/explain.txt | 272 +++--- .../q75.sf100/simplified.txt | 20 +- .../approved-plans-v2_7/q78.sf100/explain.txt | 342 +++---- .../q78.sf100/simplified.txt | 100 +- 204 files changed, 12472 insertions(+), 12466 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala index 8b019f35263f3..ceef1ebfd6602 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala @@ -40,15 +40,7 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { if (!conf.cboEnabled || !conf.joinReorderEnabled) { plan } else { - val result = plan transformDown { - // Start reordering with a joinable item, which is an InnerLike join with conditions. - // Avoid reordering if a join hint is present. - case j @ Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE) => - reorder(j, j.output) - case p @ Project(projectList, Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE)) - if projectList.forall(_.isInstanceOf[Attribute]) => - reorder(p, p.output) - } + val result = plan transformDown applyLocally // After reordering is finished, convert OrderedJoin back to Join. result transform { case OrderedJoin(left, right, jt, cond) => Join(left, right, jt, cond, JoinHint.NONE) @@ -56,6 +48,17 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { } } + private val applyLocally: PartialFunction[LogicalPlan, LogicalPlan] = { + // Start reordering with a joinable item, which is an InnerLike join with conditions. + // Avoid reordering if a join hint is present. + case j @ Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE) => + reorder(j, j.output) + case p @ Project(projectList, Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE)) + if projectList.forall(_.isInstanceOf[Attribute]) => + reorder(p, p.output) + + } + private def reorder(plan: LogicalPlan, output: Seq[Attribute]): LogicalPlan = { val (items, conditions) = extractInnerJoins(plan) val result = @@ -63,7 +66,9 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { // We also need to check if costs of all items can be evaluated. if (items.size > 2 && items.size <= conf.joinReorderDPThreshold && conditions.nonEmpty && items.forall(_.stats.rowCount.isDefined)) { - JoinReorderDP.search(conf, items, conditions, output) + // Transform and sort all the items to guarantee idempotence + val transformedItems = items.map(_ transformDown applyLocally).sortBy(_.semanticHash()) + JoinReorderDP.search(conf, transformedItems, conditions, output) } else { plan } @@ -342,7 +347,10 @@ object JoinReorderDP extends PredicateHelper with Logging { /** Get the cost of the root node of this plan tree. */ def rootCost(conf: SQLConf): Cost = { if (itemIds.size > 1) { - val rootStats = plan.stats + val rootStats = (plan transform { + // The OrderedJoin does not propagate stats + case OrderedJoin(left, right, jt, cond) => Join(left, right, jt, cond, JoinHint.NONE) + }).stats Cost(rootStats.rowCount.get, rootStats.sizeInBytes) } else { // If the plan is a leaf item, it has zero cost. diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala index 55641b273a6ee..9056f317a0c8d 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala @@ -188,8 +188,6 @@ abstract class Optimizer(catalogManager: CatalogManager) // plan may contain nodes that do not report stats. Anything that uses stats must run after // this batch. Batch("Early Filter and Projection Push-Down", Once, earlyScanPushDownRules: _*) :+ - // Since join costs in AQP can change between multiple runs, there is no reason that we have an - // idempotence enforcement on this batch. We thus make it FixedPoint(1) instead of Once. Batch("Join Reorder", Once, CostBasedJoinReorder) :+ Batch("Eliminate Sorts", Once, diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt index d39916159cb37..5fc91b10ea49d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt @@ -7,236 +7,236 @@ TakeOrderedAndProject (52) +- * BroadcastHashJoin Inner BuildLeft (47) :- BroadcastExchange (43) : +- * Project (42) - : +- * BroadcastHashJoin Inner BuildRight (41) - : :- * Project (35) - : : +- SortMergeJoin LeftSemi (34) - : : :- SortMergeJoin LeftSemi (25) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.customer (1) - : : : +- * Sort (24) - : : : +- Exchange (23) - : : : +- Union (22) - : : : :- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.web_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- * Project (21) - : : : +- * BroadcastHashJoin Inner BuildRight (20) - : : : :- * Filter (18) - : : : : +- * ColumnarToRow (17) - : : : : +- Scan parquet default.catalog_sales (16) - : : : +- ReusedExchange (19) - : : +- * Sort (33) - : : +- Exchange (32) - : : +- * Project (31) - : : +- * BroadcastHashJoin Inner BuildRight (30) - : : :- * Filter (28) - : : : +- * ColumnarToRow (27) - : : : +- Scan parquet default.store_sales (26) - : : +- ReusedExchange (29) - : +- BroadcastExchange (40) - : +- * Project (39) - : +- * Filter (38) - : +- * ColumnarToRow (37) - : +- Scan parquet default.customer_address (36) + : +- * BroadcastHashJoin Inner BuildLeft (41) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) + : +- * Project (40) + : +- SortMergeJoin LeftSemi (39) + : :- SortMergeJoin LeftSemi (30) + : : :- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.customer (6) + : : +- * Sort (29) + : : +- Exchange (28) + : : +- Union (27) + : : :- * Project (20) + : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : :- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.web_sales (11) + : : : +- BroadcastExchange (18) + : : : +- * Project (17) + : : : +- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.date_dim (14) + : : +- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * Filter (23) + : : : +- * ColumnarToRow (22) + : : : +- Scan parquet default.catalog_sales (21) + : : +- ReusedExchange (24) + : +- * Sort (38) + : +- Exchange (37) + : +- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Filter (33) + : : +- * ColumnarToRow (32) + : : +- Scan parquet default.store_sales (31) + : +- ReusedExchange (34) +- * Filter (46) +- * ColumnarToRow (45) +- Scan parquet default.customer_demographics (44) -(1) Scan parquet default.customer -Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_county#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_county#2] + +(3) Filter [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_county#2] +Condition : (ca_county#2 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#1] +Input [2]: [ca_address_sk#1, ca_county#2] + +(5) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.customer +Output [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +(7) ColumnarToRow [codegen id : 2] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -(3) Filter [codegen id : 1] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2)) +(8) Filter [codegen id : 2] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Condition : ((isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#6)) AND isnotnull(c_current_cdemo_sk#5)) -(4) Exchange -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#4] +(9) Exchange +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#7] -(5) Sort [codegen id : 2] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] +(11) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] +(12) ColumnarToRow [codegen id : 5] +Input [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] -(8) Filter [codegen id : 4] -Input [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] -Condition : (isnotnull(ws_sold_date_sk#5) AND isnotnull(ws_bill_customer_sk#6)) +(13) Filter [codegen id : 5] +Input [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] +Condition : (isnotnull(ws_sold_date_sk#8) AND isnotnull(ws_bill_customer_sk#9)) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#7, d_year#8, d_moy#9] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(15) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2002)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 7)) AND isnotnull(d_date_sk#7)) +(16) Filter [codegen id : 4] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#12)) AND (d_year#11 = 2002)) AND (d_moy#12 >= 4)) AND (d_moy#12 <= 7)) AND isnotnull(d_date_sk#10)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#7] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(17) Project [codegen id : 4] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -(13) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(18) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ws_sold_date_sk#5] -Right keys [1]: [d_date_sk#7] +(19) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] Join condition: None -(15) Project [codegen id : 4] -Output [1]: [ws_bill_customer_sk#6 AS customer_sk#11] -Input [3]: [ws_sold_date_sk#5, ws_bill_customer_sk#6, d_date_sk#7] +(20) Project [codegen id : 5] +Output [1]: [ws_bill_customer_sk#9 AS customer_sk#14] +Input [3]: [ws_sold_date_sk#8, ws_bill_customer_sk#9, d_date_sk#10] -(16) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] +(21) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_customer_sk)] ReadSchema: struct -(17) ColumnarToRow [codegen id : 6] -Input [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] +(22) ColumnarToRow [codegen id : 7] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -(18) Filter [codegen id : 6] -Input [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] -Condition : (isnotnull(cs_sold_date_sk#12) AND isnotnull(cs_ship_customer_sk#13)) +(23) Filter [codegen id : 7] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_ship_customer_sk#16)) -(19) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(24) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#10] -(20) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#12] -Right keys [1]: [d_date_sk#7] +(25) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_sold_date_sk#15] +Right keys [1]: [d_date_sk#10] Join condition: None -(21) Project [codegen id : 6] -Output [1]: [cs_ship_customer_sk#13 AS customer_sk#14] -Input [3]: [cs_sold_date_sk#12, cs_ship_customer_sk#13, d_date_sk#7] +(26) Project [codegen id : 7] +Output [1]: [cs_ship_customer_sk#16 AS customer_sk#17] +Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#10] -(22) Union +(27) Union -(23) Exchange -Input [1]: [customer_sk#11] -Arguments: hashpartitioning(customer_sk#11, 5), true, [id=#15] +(28) Exchange +Input [1]: [customer_sk#14] +Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#18] -(24) Sort [codegen id : 7] -Input [1]: [customer_sk#11] -Arguments: [customer_sk#11 ASC NULLS FIRST], false, 0 +(29) Sort [codegen id : 8] +Input [1]: [customer_sk#14] +Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 -(25) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#11] +(30) SortMergeJoin +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [customer_sk#14] Join condition: None -(26) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +(31) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#19, ss_customer_sk#20] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_customer_sk)] ReadSchema: struct -(27) ColumnarToRow [codegen id : 9] -Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +(32) ColumnarToRow [codegen id : 10] +Input [2]: [ss_sold_date_sk#19, ss_customer_sk#20] -(28) Filter [codegen id : 9] -Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] -Condition : (isnotnull(ss_sold_date_sk#16) AND isnotnull(ss_customer_sk#17)) +(33) Filter [codegen id : 10] +Input [2]: [ss_sold_date_sk#19, ss_customer_sk#20] +Condition : (isnotnull(ss_sold_date_sk#19) AND isnotnull(ss_customer_sk#20)) -(29) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(34) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#10] -(30) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#16] -Right keys [1]: [d_date_sk#7] +(35) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#19] +Right keys [1]: [d_date_sk#10] Join condition: None -(31) Project [codegen id : 9] -Output [1]: [ss_customer_sk#17 AS customer_sk#18] -Input [3]: [ss_sold_date_sk#16, ss_customer_sk#17, d_date_sk#7] +(36) Project [codegen id : 10] +Output [1]: [ss_customer_sk#20 AS customer_sk#21] +Input [3]: [ss_sold_date_sk#19, ss_customer_sk#20, d_date_sk#10] -(32) Exchange -Input [1]: [customer_sk#18] -Arguments: hashpartitioning(customer_sk#18, 5), true, [id=#19] +(37) Exchange +Input [1]: [customer_sk#21] +Arguments: hashpartitioning(customer_sk#21, 5), true, [id=#22] -(33) Sort [codegen id : 10] -Input [1]: [customer_sk#18] -Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0 +(38) Sort [codegen id : 11] +Input [1]: [customer_sk#21] +Arguments: [customer_sk#21 ASC NULLS FIRST], false, 0 -(34) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#18] +(39) SortMergeJoin +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [customer_sk#21] Join condition: None -(35) Project [codegen id : 12] -Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] - -(36) Scan parquet default.customer_address -Output [2]: [ca_address_sk#20, ca_county#21] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(37) ColumnarToRow [codegen id : 11] -Input [2]: [ca_address_sk#20, ca_county#21] - -(38) Filter [codegen id : 11] -Input [2]: [ca_address_sk#20, ca_county#21] -Condition : (ca_county#21 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#20)) - -(39) Project [codegen id : 11] -Output [1]: [ca_address_sk#20] -Input [2]: [ca_address_sk#20, ca_county#21] - -(40) BroadcastExchange -Input [1]: [ca_address_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(40) Project +Output [2]: [c_current_cdemo_sk#5, c_current_addr_sk#6] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] (41) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#20] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#6] Join condition: None (42) Project [codegen id : 12] -Output [1]: [c_current_cdemo_sk#2] -Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] +Output [1]: [c_current_cdemo_sk#5] +Input [3]: [ca_address_sk#1, c_current_cdemo_sk#5, c_current_addr_sk#6] (43) BroadcastExchange -Input [1]: [c_current_cdemo_sk#2] +Input [1]: [c_current_cdemo_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (44) Scan parquet default.customer_demographics @@ -254,13 +254,13 @@ Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_stat Condition : isnotnull(cd_demo_sk#24) (47) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [c_current_cdemo_sk#2] +Left keys [1]: [c_current_cdemo_sk#5] Right keys [1]: [cd_demo_sk#24] Join condition: None (48) Project [codegen id : 13] Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] -Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [10]: [c_current_cdemo_sk#5, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] (49) HashAggregate [codegen id : 13] Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt index 7d5fa795f98f8..73227ad66d180 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt @@ -11,26 +11,34 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha BroadcastExchange #2 WholeStageCodegen (12) Project [c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] Project [c_current_cdemo_sk,c_current_addr_sk] InputAdapter SortMergeJoin [c_customer_sk,customer_sk] SortMergeJoin [c_customer_sk,customer_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #3 - WholeStageCodegen (1) + Exchange [c_customer_sk] #4 + WholeStageCodegen (2) Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (7) + WholeStageCodegen (8) Sort [customer_sk] InputAdapter - Exchange [customer_sk] #4 + Exchange [customer_sk] #5 Union - WholeStageCodegen (4) + WholeStageCodegen (5) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_customer_sk] @@ -38,14 +46,14 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) + BroadcastExchange #6 + WholeStageCodegen (4) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (6) + WholeStageCodegen (7) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_ship_customer_sk] @@ -53,12 +61,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - WholeStageCodegen (10) + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (11) Sort [customer_sk] InputAdapter - Exchange [customer_sk] #6 - WholeStageCodegen (9) + Exchange [customer_sk] #7 + WholeStageCodegen (10) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_customer_sk] @@ -66,15 +74,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (11) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + ReusedExchange [d_date_sk] #6 Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt index b3b11b60ded0b..fa01042350149 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (77) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (8) - : : : : +- * Project (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -43,11 +43,11 @@ TakeOrderedAndProject (77) : : :- * Project (45) : : : +- * BroadcastHashJoin Inner BuildRight (44) : : : :- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : : :- * Filter (35) - : : : : : +- * ColumnarToRow (34) - : : : : : +- Scan parquet default.store_sales (33) - : : : : +- ReusedExchange (36) + : : : : +- * BroadcastHashJoin Inner BuildLeft (37) + : : : : :- ReusedExchange (33) + : : : : +- * Filter (36) + : : : : +- * ColumnarToRow (35) + : : : : +- Scan parquet default.store_sales (34) : : : +- BroadcastExchange (43) : : : +- * Project (42) : : : +- * Filter (41) @@ -65,11 +65,11 @@ TakeOrderedAndProject (77) : :- * Project (63) : : +- * BroadcastHashJoin Inner BuildRight (62) : : :- * Project (60) - : : : +- * BroadcastHashJoin Inner BuildRight (59) - : : : :- * Filter (57) - : : : : +- * ColumnarToRow (56) - : : : : +- Scan parquet default.store_sales (55) - : : : +- ReusedExchange (58) + : : : +- * BroadcastHashJoin Inner BuildLeft (59) + : : : :- ReusedExchange (55) + : : : +- * Filter (58) + : : : +- * ColumnarToRow (57) + : : : +- Scan parquet default.store_sales (56) : : +- ReusedExchange (61) : +- ReusedExchange (64) +- BroadcastExchange (70) @@ -78,50 +78,50 @@ TakeOrderedAndProject (77) +- Scan parquet default.item (67) -(1) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(3) Filter [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#9, d_year#10] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#9, d_year#10] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] + +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND (d_date_sk#1 >= 2451545)) AND (d_date_sk#1 <= 2451910)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#9, d_year#10] -Condition : ((((isnotnull(d_year#10) AND (d_year#10 = 2000)) AND (d_date_sk#9 >= 2451545)) AND (d_date_sk#9 <= 2451910)) AND isnotnull(d_date_sk#9)) +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#9] -Input [2]: [d_date_sk#9, d_year#10] +(6) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -(8) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] +(8) Filter +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] +Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] (11) Scan parquet default.customer_demographics Output [4]: [cd_demo_sk#12, cd_gender#13, cd_marital_status#14, cd_education_status#15] @@ -146,13 +146,13 @@ Input [1]: [cd_demo_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_cdemo_sk#3] +Left keys [1]: [ss_cdemo_sk#6] Right keys [1]: [cd_demo_sk#12] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] +Output [6]: [ss_item_sk#5, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -173,13 +173,13 @@ Input [2]: [s_store_sk#17, s_state#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 5] -Output [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18] -Input [8]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17, s_state#18] +Output [6]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_state#18] +Input [8]: [ss_item_sk#5, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17, s_state#18] (24) Scan parquet default.item Output [2]: [i_item_sk#20, i_item_id#21] @@ -200,13 +200,13 @@ Input [2]: [i_item_sk#20, i_item_id#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#20] Join condition: None (29) Project [codegen id : 5] -Output [6]: [i_item_id#21, s_state#18, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [8]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18, i_item_sk#20, i_item_id#21] +Output [6]: [i_item_id#21, s_state#18, ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] +Input [8]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_state#18, i_item_sk#20, i_item_id#21] (30) HashAggregate [codegen id : 5] Input [6]: [i_item_id#21, s_state#18, agg1#23, agg2#24, agg3#25, agg4#26] @@ -226,31 +226,31 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#44, avg(UnscaledValue(agg2#24))#45, avg(UnscaledValue(agg3#25))#46, avg(UnscaledValue(agg4#26))#47] Results [7]: [i_item_id#21, s_state#18, 0 AS g_state#48, avg(cast(agg1#23 as bigint))#44 AS agg1#49, cast((avg(UnscaledValue(agg2#24))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(agg3#25))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(agg4#26))#47 / 100.0) as decimal(11,6)) AS agg4#52] -(33) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +(33) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(34) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(35) Filter [codegen id : 11] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) +(35) ColumnarToRow +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -(36) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#9] +(36) Filter +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (38) Project [codegen id : 11] -Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] +Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] (39) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -275,37 +275,37 @@ Input [1]: [s_store_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] (44) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#17] Join condition: None (45) Project [codegen id : 11] -Output [6]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] +Output [6]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17] (46) ReusedExchange [Reuses operator id: 15] Output [1]: [cd_demo_sk#12] (47) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_cdemo_sk#3] +Left keys [1]: [ss_cdemo_sk#6] Right keys [1]: [cd_demo_sk#12] Join condition: None (48) Project [codegen id : 11] -Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] +Output [5]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] (49) ReusedExchange [Reuses operator id: 27] Output [2]: [i_item_sk#20, i_item_id#21] (50) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#20] Join condition: None (51) Project [codegen id : 11] -Output [5]: [i_item_id#21, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20, i_item_id#21] +Output [5]: [i_item_id#21, ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] +Input [7]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, i_item_sk#20, i_item_id#21] (52) HashAggregate [codegen id : 11] Input [5]: [i_item_id#21, agg1#23, agg2#24, agg3#25, agg4#26] @@ -325,55 +325,55 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#71, avg(UnscaledValue(agg2#24))#72, avg(UnscaledValue(agg3#25))#73, avg(UnscaledValue(agg4#26))#74] Results [7]: [i_item_id#21, null AS s_state#75, 1 AS g_state#76, avg(cast(agg1#23 as bigint))#71 AS agg1#77, cast((avg(UnscaledValue(agg2#24))#72 / 100.0) as decimal(11,6)) AS agg2#78, cast((avg(UnscaledValue(agg3#25))#73 / 100.0) as decimal(11,6)) AS agg3#79, cast((avg(UnscaledValue(agg4#26))#74 / 100.0) as decimal(11,6)) AS agg4#80] -(55) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +(55) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(56) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(56) ColumnarToRow [codegen id : 17] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(57) Filter [codegen id : 17] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) +(57) ColumnarToRow +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -(58) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#9] +(58) Filter +Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) (59) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (60) Project [codegen id : 17] -Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] +Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] (61) ReusedExchange [Reuses operator id: 43] Output [1]: [s_store_sk#17] (62) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#17] Join condition: None (63) Project [codegen id : 17] -Output [6]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] +Output [6]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17] (64) ReusedExchange [Reuses operator id: 15] Output [1]: [cd_demo_sk#12] (65) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_cdemo_sk#3] +Left keys [1]: [ss_cdemo_sk#6] Right keys [1]: [cd_demo_sk#12] Join condition: None (66) Project [codegen id : 17] -Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] +Output [5]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Input [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] (67) Scan parquet default.item Output [1]: [i_item_sk#20] @@ -394,13 +394,13 @@ Input [1]: [i_item_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] (71) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#20] Join condition: None (72) Project [codegen id : 17] -Output [4]: [ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20] +Output [4]: [ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] +Input [6]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, i_item_sk#20] (73) HashAggregate [codegen id : 17] Input [4]: [agg1#23, agg2#24, agg3#25, agg4#26] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt index d14061de1d1f4..fc7202e739bcc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt @@ -13,11 +13,7 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -26,6 +22,10 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -61,13 +61,13 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - InputAdapter - ReusedExchange [d_date_sk] #2 InputAdapter BroadcastExchange #7 WholeStageCodegen (8) @@ -93,13 +93,13 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - InputAdapter - ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [s_store_sk] #7 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt index 93736a83ebfc6..8fe4c15db5841 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.item (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2415355),LessThanOrEqual(ss_sold_date_sk,2415385)),And(GreaterThanOrEqual(ss_sold_date_sk,2415720),LessThanOrEqual(ss_sold_date_sk,2415750))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416085),LessThanOrEqual(ss_sold_date_sk,2416115)),And(GreaterThanOrEqual(ss_sold_date_sk,2416450),LessThanOrEqual(ss_sold_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416816),LessThanOrEqual(ss_sold_date_sk,2416846)),And(GreaterThanOrEqual(ss_sold_date_sk,2417181),LessThanOrEqual(ss_sold_date_sk,2417211))),And(GreaterThanOrEqual(ss_sold_date_sk,2417546),LessThanOrEqual(ss_sold_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2417911),LessThanOrEqual(ss_sold_date_sk,2417941)),And(GreaterThanOrEqual(ss_sold_date_sk,2418277),LessThanOrEqual(ss_sold_date_sk,2418307))),And(GreaterThanOrEqual(ss_sold_date_sk,2418642),LessThanOrEqual(ss_sold_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2419007),LessThanOrEqual(ss_sold_date_sk,2419037)),And(GreaterThanOrEqual(ss_sold_date_sk,2419372),LessThanOrEqual(ss_sold_date_sk,2419402))),And(GreaterThanOrEqual(ss_sold_date_sk,2419738),LessThanOrEqual(ss_sold_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2420103),LessThanOrEqual(ss_sold_date_sk,2420133)),And(GreaterThanOrEqual(ss_sold_date_sk,2420468),LessThanOrEqual(ss_sold_date_sk,2420498))),And(GreaterThanOrEqual(ss_sold_date_sk,2420833),LessThanOrEqual(ss_sold_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2421199),LessThanOrEqual(ss_sold_date_sk,2421229)),And(GreaterThanOrEqual(ss_sold_date_sk,2421564),LessThanOrEqual(ss_sold_date_sk,2421594))),And(GreaterThanOrEqual(ss_sold_date_sk,2421929),LessThanOrEqual(ss_sold_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2422294),LessThanOrEqual(ss_sold_date_sk,2422324)),And(GreaterThanOrEqual(ss_sold_date_sk,2422660),LessThanOrEqual(ss_sold_date_sk,2422690))),And(GreaterThanOrEqual(ss_sold_date_sk,2423025),LessThanOrEqual(ss_sold_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2423390),LessThanOrEqual(ss_sold_date_sk,2423420)),And(GreaterThanOrEqual(ss_sold_date_sk,2423755),LessThanOrEqual(ss_sold_date_sk,2423785))),And(GreaterThanOrEqual(ss_sold_date_sk,2424121),LessThanOrEqual(ss_sold_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2424486),LessThanOrEqual(ss_sold_date_sk,2424516)),And(GreaterThanOrEqual(ss_sold_date_sk,2424851),LessThanOrEqual(ss_sold_date_sk,2424881))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425216),LessThanOrEqual(ss_sold_date_sk,2425246)),And(GreaterThanOrEqual(ss_sold_date_sk,2425582),LessThanOrEqual(ss_sold_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425947),LessThanOrEqual(ss_sold_date_sk,2425977)),And(GreaterThanOrEqual(ss_sold_date_sk,2426312),LessThanOrEqual(ss_sold_date_sk,2426342))),And(GreaterThanOrEqual(ss_sold_date_sk,2426677),LessThanOrEqual(ss_sold_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2427043),LessThanOrEqual(ss_sold_date_sk,2427073)),And(GreaterThanOrEqual(ss_sold_date_sk,2427408),LessThanOrEqual(ss_sold_date_sk,2427438))),And(GreaterThanOrEqual(ss_sold_date_sk,2427773),LessThanOrEqual(ss_sold_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2428138),LessThanOrEqual(ss_sold_date_sk,2428168)),And(GreaterThanOrEqual(ss_sold_date_sk,2428504),LessThanOrEqual(ss_sold_date_sk,2428534))),And(GreaterThanOrEqual(ss_sold_date_sk,2428869),LessThanOrEqual(ss_sold_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2429234),LessThanOrEqual(ss_sold_date_sk,2429264)),And(GreaterThanOrEqual(ss_sold_date_sk,2429599),LessThanOrEqual(ss_sold_date_sk,2429629))),And(GreaterThanOrEqual(ss_sold_date_sk,2429965),LessThanOrEqual(ss_sold_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2430330),LessThanOrEqual(ss_sold_date_sk,2430360)),And(GreaterThanOrEqual(ss_sold_date_sk,2430695),LessThanOrEqual(ss_sold_date_sk,2430725))),And(GreaterThanOrEqual(ss_sold_date_sk,2431060),LessThanOrEqual(ss_sold_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2431426),LessThanOrEqual(ss_sold_date_sk,2431456)),And(GreaterThanOrEqual(ss_sold_date_sk,2431791),LessThanOrEqual(ss_sold_date_sk,2431821))),And(GreaterThanOrEqual(ss_sold_date_sk,2432156),LessThanOrEqual(ss_sold_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2432521),LessThanOrEqual(ss_sold_date_sk,2432551)),And(GreaterThanOrEqual(ss_sold_date_sk,2432887),LessThanOrEqual(ss_sold_date_sk,2432917))),And(GreaterThanOrEqual(ss_sold_date_sk,2433252),LessThanOrEqual(ss_sold_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2433617),LessThanOrEqual(ss_sold_date_sk,2433647)),And(GreaterThanOrEqual(ss_sold_date_sk,2433982),LessThanOrEqual(ss_sold_date_sk,2434012))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2434348),LessThanOrEqual(ss_sold_date_sk,2434378)),And(GreaterThanOrEqual(ss_sold_date_sk,2434713),LessThanOrEqual(ss_sold_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2435078),LessThanOrEqual(ss_sold_date_sk,2435108)),And(GreaterThanOrEqual(ss_sold_date_sk,2435443),LessThanOrEqual(ss_sold_date_sk,2435473))),And(GreaterThanOrEqual(ss_sold_date_sk,2435809),LessThanOrEqual(ss_sold_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2436174),LessThanOrEqual(ss_sold_date_sk,2436204)),And(GreaterThanOrEqual(ss_sold_date_sk,2436539),LessThanOrEqual(ss_sold_date_sk,2436569))),And(GreaterThanOrEqual(ss_sold_date_sk,2436904),LessThanOrEqual(ss_sold_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2437270),LessThanOrEqual(ss_sold_date_sk,2437300)),And(GreaterThanOrEqual(ss_sold_date_sk,2437635),LessThanOrEqual(ss_sold_date_sk,2437665))),And(GreaterThanOrEqual(ss_sold_date_sk,2438000),LessThanOrEqual(ss_sold_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2438365),LessThanOrEqual(ss_sold_date_sk,2438395)),And(GreaterThanOrEqual(ss_sold_date_sk,2438731),LessThanOrEqual(ss_sold_date_sk,2438761))),And(GreaterThanOrEqual(ss_sold_date_sk,2439096),LessThanOrEqual(ss_sold_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2439461),LessThanOrEqual(ss_sold_date_sk,2439491)),And(GreaterThanOrEqual(ss_sold_date_sk,2439826),LessThanOrEqual(ss_sold_date_sk,2439856))),And(GreaterThanOrEqual(ss_sold_date_sk,2440192),LessThanOrEqual(ss_sold_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2440557),LessThanOrEqual(ss_sold_date_sk,2440587)),And(GreaterThanOrEqual(ss_sold_date_sk,2440922),LessThanOrEqual(ss_sold_date_sk,2440952))),And(GreaterThanOrEqual(ss_sold_date_sk,2441287),LessThanOrEqual(ss_sold_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2441653),LessThanOrEqual(ss_sold_date_sk,2441683)),And(GreaterThanOrEqual(ss_sold_date_sk,2442018),LessThanOrEqual(ss_sold_date_sk,2442048))),And(GreaterThanOrEqual(ss_sold_date_sk,2442383),LessThanOrEqual(ss_sold_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2442748),LessThanOrEqual(ss_sold_date_sk,2442778)),And(GreaterThanOrEqual(ss_sold_date_sk,2443114),LessThanOrEqual(ss_sold_date_sk,2443144))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2443479),LessThanOrEqual(ss_sold_date_sk,2443509)),And(GreaterThanOrEqual(ss_sold_date_sk,2443844),LessThanOrEqual(ss_sold_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2444209),LessThanOrEqual(ss_sold_date_sk,2444239)),And(GreaterThanOrEqual(ss_sold_date_sk,2444575),LessThanOrEqual(ss_sold_date_sk,2444605))),And(GreaterThanOrEqual(ss_sold_date_sk,2444940),LessThanOrEqual(ss_sold_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2445305),LessThanOrEqual(ss_sold_date_sk,2445335)),And(GreaterThanOrEqual(ss_sold_date_sk,2445670),LessThanOrEqual(ss_sold_date_sk,2445700))),And(GreaterThanOrEqual(ss_sold_date_sk,2446036),LessThanOrEqual(ss_sold_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2446401),LessThanOrEqual(ss_sold_date_sk,2446431)),And(GreaterThanOrEqual(ss_sold_date_sk,2446766),LessThanOrEqual(ss_sold_date_sk,2446796))),And(GreaterThanOrEqual(ss_sold_date_sk,2447131),LessThanOrEqual(ss_sold_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2447497),LessThanOrEqual(ss_sold_date_sk,2447527)),And(GreaterThanOrEqual(ss_sold_date_sk,2447862),LessThanOrEqual(ss_sold_date_sk,2447892))),And(GreaterThanOrEqual(ss_sold_date_sk,2448227),LessThanOrEqual(ss_sold_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2448592),LessThanOrEqual(ss_sold_date_sk,2448622)),And(GreaterThanOrEqual(ss_sold_date_sk,2448958),LessThanOrEqual(ss_sold_date_sk,2448988))),And(GreaterThanOrEqual(ss_sold_date_sk,2449323),LessThanOrEqual(ss_sold_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2449688),LessThanOrEqual(ss_sold_date_sk,2449718)),And(GreaterThanOrEqual(ss_sold_date_sk,2450053),LessThanOrEqual(ss_sold_date_sk,2450083))),And(GreaterThanOrEqual(ss_sold_date_sk,2450419),LessThanOrEqual(ss_sold_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2450784),LessThanOrEqual(ss_sold_date_sk,2450814)),And(GreaterThanOrEqual(ss_sold_date_sk,2451149),LessThanOrEqual(ss_sold_date_sk,2451179))),And(GreaterThanOrEqual(ss_sold_date_sk,2451514),LessThanOrEqual(ss_sold_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2451880),LessThanOrEqual(ss_sold_date_sk,2451910)),And(GreaterThanOrEqual(ss_sold_date_sk,2452245),LessThanOrEqual(ss_sold_date_sk,2452275))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2452610),LessThanOrEqual(ss_sold_date_sk,2452640)),And(GreaterThanOrEqual(ss_sold_date_sk,2452975),LessThanOrEqual(ss_sold_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2453341),LessThanOrEqual(ss_sold_date_sk,2453371)),And(GreaterThanOrEqual(ss_sold_date_sk,2453706),LessThanOrEqual(ss_sold_date_sk,2453736))),And(GreaterThanOrEqual(ss_sold_date_sk,2454071),LessThanOrEqual(ss_sold_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2454436),LessThanOrEqual(ss_sold_date_sk,2454466)),And(GreaterThanOrEqual(ss_sold_date_sk,2454802),LessThanOrEqual(ss_sold_date_sk,2454832))),And(GreaterThanOrEqual(ss_sold_date_sk,2455167),LessThanOrEqual(ss_sold_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2455532),LessThanOrEqual(ss_sold_date_sk,2455562)),And(GreaterThanOrEqual(ss_sold_date_sk,2455897),LessThanOrEqual(ss_sold_date_sk,2455927))),And(GreaterThanOrEqual(ss_sold_date_sk,2456263),LessThanOrEqual(ss_sold_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2456628),LessThanOrEqual(ss_sold_date_sk,2456658)),And(GreaterThanOrEqual(ss_sold_date_sk,2456993),LessThanOrEqual(ss_sold_date_sk,2457023))),And(GreaterThanOrEqual(ss_sold_date_sk,2457358),LessThanOrEqual(ss_sold_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2457724),LessThanOrEqual(ss_sold_date_sk,2457754)),And(GreaterThanOrEqual(ss_sold_date_sk,2458089),LessThanOrEqual(ss_sold_date_sk,2458119))),And(GreaterThanOrEqual(ss_sold_date_sk,2458454),LessThanOrEqual(ss_sold_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2458819),LessThanOrEqual(ss_sold_date_sk,2458849)),And(GreaterThanOrEqual(ss_sold_date_sk,2459185),LessThanOrEqual(ss_sold_date_sk,2459215))),And(GreaterThanOrEqual(ss_sold_date_sk,2459550),LessThanOrEqual(ss_sold_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2459915),LessThanOrEqual(ss_sold_date_sk,2459945)),And(GreaterThanOrEqual(ss_sold_date_sk,2460280),LessThanOrEqual(ss_sold_date_sk,2460310))),And(GreaterThanOrEqual(ss_sold_date_sk,2460646),LessThanOrEqual(ss_sold_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461011),LessThanOrEqual(ss_sold_date_sk,2461041)),And(GreaterThanOrEqual(ss_sold_date_sk,2461376),LessThanOrEqual(ss_sold_date_sk,2461406))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461741),LessThanOrEqual(ss_sold_date_sk,2461771)),And(GreaterThanOrEqual(ss_sold_date_sk,2462107),LessThanOrEqual(ss_sold_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2462472),LessThanOrEqual(ss_sold_date_sk,2462502)),And(GreaterThanOrEqual(ss_sold_date_sk,2462837),LessThanOrEqual(ss_sold_date_sk,2462867))),And(GreaterThanOrEqual(ss_sold_date_sk,2463202),LessThanOrEqual(ss_sold_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2463568),LessThanOrEqual(ss_sold_date_sk,2463598)),And(GreaterThanOrEqual(ss_sold_date_sk,2463933),LessThanOrEqual(ss_sold_date_sk,2463963))),And(GreaterThanOrEqual(ss_sold_date_sk,2464298),LessThanOrEqual(ss_sold_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2464663),LessThanOrEqual(ss_sold_date_sk,2464693)),And(GreaterThanOrEqual(ss_sold_date_sk,2465029),LessThanOrEqual(ss_sold_date_sk,2465059))),And(GreaterThanOrEqual(ss_sold_date_sk,2465394),LessThanOrEqual(ss_sold_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2465759),LessThanOrEqual(ss_sold_date_sk,2465789)),And(GreaterThanOrEqual(ss_sold_date_sk,2466124),LessThanOrEqual(ss_sold_date_sk,2466154))),And(GreaterThanOrEqual(ss_sold_date_sk,2466490),LessThanOrEqual(ss_sold_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2466855),LessThanOrEqual(ss_sold_date_sk,2466885)),And(GreaterThanOrEqual(ss_sold_date_sk,2467220),LessThanOrEqual(ss_sold_date_sk,2467250))),And(GreaterThanOrEqual(ss_sold_date_sk,2467585),LessThanOrEqual(ss_sold_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2467951),LessThanOrEqual(ss_sold_date_sk,2467981)),And(GreaterThanOrEqual(ss_sold_date_sk,2468316),LessThanOrEqual(ss_sold_date_sk,2468346))),And(GreaterThanOrEqual(ss_sold_date_sk,2468681),LessThanOrEqual(ss_sold_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2469046),LessThanOrEqual(ss_sold_date_sk,2469076)),And(GreaterThanOrEqual(ss_sold_date_sk,2469412),LessThanOrEqual(ss_sold_date_sk,2469442))),And(GreaterThanOrEqual(ss_sold_date_sk,2469777),LessThanOrEqual(ss_sold_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470142),LessThanOrEqual(ss_sold_date_sk,2470172)),And(GreaterThanOrEqual(ss_sold_date_sk,2470507),LessThanOrEqual(ss_sold_date_sk,2470537))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470873),LessThanOrEqual(ss_sold_date_sk,2470903)),And(GreaterThanOrEqual(ss_sold_date_sk,2471238),LessThanOrEqual(ss_sold_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2471603),LessThanOrEqual(ss_sold_date_sk,2471633)),And(GreaterThanOrEqual(ss_sold_date_sk,2471968),LessThanOrEqual(ss_sold_date_sk,2471998))),And(GreaterThanOrEqual(ss_sold_date_sk,2472334),LessThanOrEqual(ss_sold_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2472699),LessThanOrEqual(ss_sold_date_sk,2472729)),And(GreaterThanOrEqual(ss_sold_date_sk,2473064),LessThanOrEqual(ss_sold_date_sk,2473094))),And(GreaterThanOrEqual(ss_sold_date_sk,2473429),LessThanOrEqual(ss_sold_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2473795),LessThanOrEqual(ss_sold_date_sk,2473825)),And(GreaterThanOrEqual(ss_sold_date_sk,2474160),LessThanOrEqual(ss_sold_date_sk,2474190))),And(GreaterThanOrEqual(ss_sold_date_sk,2474525),LessThanOrEqual(ss_sold_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2474890),LessThanOrEqual(ss_sold_date_sk,2474920)),And(GreaterThanOrEqual(ss_sold_date_sk,2475256),LessThanOrEqual(ss_sold_date_sk,2475286))),And(GreaterThanOrEqual(ss_sold_date_sk,2475621),LessThanOrEqual(ss_sold_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2475986),LessThanOrEqual(ss_sold_date_sk,2476016)),And(GreaterThanOrEqual(ss_sold_date_sk,2476351),LessThanOrEqual(ss_sold_date_sk,2476381))),And(GreaterThanOrEqual(ss_sold_date_sk,2476717),LessThanOrEqual(ss_sold_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2477082),LessThanOrEqual(ss_sold_date_sk,2477112)),And(GreaterThanOrEqual(ss_sold_date_sk,2477447),LessThanOrEqual(ss_sold_date_sk,2477477))),And(GreaterThanOrEqual(ss_sold_date_sk,2477812),LessThanOrEqual(ss_sold_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2478178),LessThanOrEqual(ss_sold_date_sk,2478208)),And(GreaterThanOrEqual(ss_sold_date_sk,2478543),LessThanOrEqual(ss_sold_date_sk,2478573))),And(GreaterThanOrEqual(ss_sold_date_sk,2478908),LessThanOrEqual(ss_sold_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2479273),LessThanOrEqual(ss_sold_date_sk,2479303)),And(GreaterThanOrEqual(ss_sold_date_sk,2479639),LessThanOrEqual(ss_sold_date_sk,2479669))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480004),LessThanOrEqual(ss_sold_date_sk,2480034)),And(GreaterThanOrEqual(ss_sold_date_sk,2480369),LessThanOrEqual(ss_sold_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480734),LessThanOrEqual(ss_sold_date_sk,2480764)),And(GreaterThanOrEqual(ss_sold_date_sk,2481100),LessThanOrEqual(ss_sold_date_sk,2481130))),And(GreaterThanOrEqual(ss_sold_date_sk,2481465),LessThanOrEqual(ss_sold_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2481830),LessThanOrEqual(ss_sold_date_sk,2481860)),And(GreaterThanOrEqual(ss_sold_date_sk,2482195),LessThanOrEqual(ss_sold_date_sk,2482225))),And(GreaterThanOrEqual(ss_sold_date_sk,2482561),LessThanOrEqual(ss_sold_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2482926),LessThanOrEqual(ss_sold_date_sk,2482956)),And(GreaterThanOrEqual(ss_sold_date_sk,2483291),LessThanOrEqual(ss_sold_date_sk,2483321))),And(GreaterThanOrEqual(ss_sold_date_sk,2483656),LessThanOrEqual(ss_sold_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2484022),LessThanOrEqual(ss_sold_date_sk,2484052)),And(GreaterThanOrEqual(ss_sold_date_sk,2484387),LessThanOrEqual(ss_sold_date_sk,2484417))),And(GreaterThanOrEqual(ss_sold_date_sk,2484752),LessThanOrEqual(ss_sold_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2485117),LessThanOrEqual(ss_sold_date_sk,2485147)),And(GreaterThanOrEqual(ss_sold_date_sk,2485483),LessThanOrEqual(ss_sold_date_sk,2485513))),And(GreaterThanOrEqual(ss_sold_date_sk,2485848),LessThanOrEqual(ss_sold_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2486213),LessThanOrEqual(ss_sold_date_sk,2486243)),And(GreaterThanOrEqual(ss_sold_date_sk,2486578),LessThanOrEqual(ss_sold_date_sk,2486608))),And(GreaterThanOrEqual(ss_sold_date_sk,2486944),LessThanOrEqual(ss_sold_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2487309),LessThanOrEqual(ss_sold_date_sk,2487339)),And(GreaterThanOrEqual(ss_sold_date_sk,2487674),LessThanOrEqual(ss_sold_date_sk,2487704))),And(GreaterThanOrEqual(ss_sold_date_sk,2488039),LessThanOrEqual(ss_sold_date_sk,2488069))))))))), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] -Condition : ((((((((((((ss_sold_date_sk#1 >= 2415355) AND (ss_sold_date_sk#1 <= 2415385)) OR ((ss_sold_date_sk#1 >= 2415720) AND (ss_sold_date_sk#1 <= 2415750))) OR (((ss_sold_date_sk#1 >= 2416085) AND (ss_sold_date_sk#1 <= 2416115)) OR ((ss_sold_date_sk#1 >= 2416450) AND (ss_sold_date_sk#1 <= 2416480)))) OR ((((ss_sold_date_sk#1 >= 2416816) AND (ss_sold_date_sk#1 <= 2416846)) OR ((ss_sold_date_sk#1 >= 2417181) AND (ss_sold_date_sk#1 <= 2417211))) OR ((ss_sold_date_sk#1 >= 2417546) AND (ss_sold_date_sk#1 <= 2417576)))) OR (((((ss_sold_date_sk#1 >= 2417911) AND (ss_sold_date_sk#1 <= 2417941)) OR ((ss_sold_date_sk#1 >= 2418277) AND (ss_sold_date_sk#1 <= 2418307))) OR ((ss_sold_date_sk#1 >= 2418642) AND (ss_sold_date_sk#1 <= 2418672))) OR ((((ss_sold_date_sk#1 >= 2419007) AND (ss_sold_date_sk#1 <= 2419037)) OR ((ss_sold_date_sk#1 >= 2419372) AND (ss_sold_date_sk#1 <= 2419402))) OR ((ss_sold_date_sk#1 >= 2419738) AND (ss_sold_date_sk#1 <= 2419768))))) OR ((((((ss_sold_date_sk#1 >= 2420103) AND (ss_sold_date_sk#1 <= 2420133)) OR ((ss_sold_date_sk#1 >= 2420468) AND (ss_sold_date_sk#1 <= 2420498))) OR ((ss_sold_date_sk#1 >= 2420833) AND (ss_sold_date_sk#1 <= 2420863))) OR ((((ss_sold_date_sk#1 >= 2421199) AND (ss_sold_date_sk#1 <= 2421229)) OR ((ss_sold_date_sk#1 >= 2421564) AND (ss_sold_date_sk#1 <= 2421594))) OR ((ss_sold_date_sk#1 >= 2421929) AND (ss_sold_date_sk#1 <= 2421959)))) OR (((((ss_sold_date_sk#1 >= 2422294) AND (ss_sold_date_sk#1 <= 2422324)) OR ((ss_sold_date_sk#1 >= 2422660) AND (ss_sold_date_sk#1 <= 2422690))) OR ((ss_sold_date_sk#1 >= 2423025) AND (ss_sold_date_sk#1 <= 2423055))) OR ((((ss_sold_date_sk#1 >= 2423390) AND (ss_sold_date_sk#1 <= 2423420)) OR ((ss_sold_date_sk#1 >= 2423755) AND (ss_sold_date_sk#1 <= 2423785))) OR ((ss_sold_date_sk#1 >= 2424121) AND (ss_sold_date_sk#1 <= 2424151)))))) OR (((((((ss_sold_date_sk#1 >= 2424486) AND (ss_sold_date_sk#1 <= 2424516)) OR ((ss_sold_date_sk#1 >= 2424851) AND (ss_sold_date_sk#1 <= 2424881))) OR (((ss_sold_date_sk#1 >= 2425216) AND (ss_sold_date_sk#1 <= 2425246)) OR ((ss_sold_date_sk#1 >= 2425582) AND (ss_sold_date_sk#1 <= 2425612)))) OR ((((ss_sold_date_sk#1 >= 2425947) AND (ss_sold_date_sk#1 <= 2425977)) OR ((ss_sold_date_sk#1 >= 2426312) AND (ss_sold_date_sk#1 <= 2426342))) OR ((ss_sold_date_sk#1 >= 2426677) AND (ss_sold_date_sk#1 <= 2426707)))) OR (((((ss_sold_date_sk#1 >= 2427043) AND (ss_sold_date_sk#1 <= 2427073)) OR ((ss_sold_date_sk#1 >= 2427408) AND (ss_sold_date_sk#1 <= 2427438))) OR ((ss_sold_date_sk#1 >= 2427773) AND (ss_sold_date_sk#1 <= 2427803))) OR ((((ss_sold_date_sk#1 >= 2428138) AND (ss_sold_date_sk#1 <= 2428168)) OR ((ss_sold_date_sk#1 >= 2428504) AND (ss_sold_date_sk#1 <= 2428534))) OR ((ss_sold_date_sk#1 >= 2428869) AND (ss_sold_date_sk#1 <= 2428899))))) OR ((((((ss_sold_date_sk#1 >= 2429234) AND (ss_sold_date_sk#1 <= 2429264)) OR ((ss_sold_date_sk#1 >= 2429599) AND (ss_sold_date_sk#1 <= 2429629))) OR ((ss_sold_date_sk#1 >= 2429965) AND (ss_sold_date_sk#1 <= 2429995))) OR ((((ss_sold_date_sk#1 >= 2430330) AND (ss_sold_date_sk#1 <= 2430360)) OR ((ss_sold_date_sk#1 >= 2430695) AND (ss_sold_date_sk#1 <= 2430725))) OR ((ss_sold_date_sk#1 >= 2431060) AND (ss_sold_date_sk#1 <= 2431090)))) OR (((((ss_sold_date_sk#1 >= 2431426) AND (ss_sold_date_sk#1 <= 2431456)) OR ((ss_sold_date_sk#1 >= 2431791) AND (ss_sold_date_sk#1 <= 2431821))) OR ((ss_sold_date_sk#1 >= 2432156) AND (ss_sold_date_sk#1 <= 2432186))) OR ((((ss_sold_date_sk#1 >= 2432521) AND (ss_sold_date_sk#1 <= 2432551)) OR ((ss_sold_date_sk#1 >= 2432887) AND (ss_sold_date_sk#1 <= 2432917))) OR ((ss_sold_date_sk#1 >= 2433252) AND (ss_sold_date_sk#1 <= 2433282))))))) OR ((((((((ss_sold_date_sk#1 >= 2433617) AND (ss_sold_date_sk#1 <= 2433647)) OR ((ss_sold_date_sk#1 >= 2433982) AND (ss_sold_date_sk#1 <= 2434012))) OR (((ss_sold_date_sk#1 >= 2434348) AND (ss_sold_date_sk#1 <= 2434378)) OR ((ss_sold_date_sk#1 >= 2434713) AND (ss_sold_date_sk#1 <= 2434743)))) OR ((((ss_sold_date_sk#1 >= 2435078) AND (ss_sold_date_sk#1 <= 2435108)) OR ((ss_sold_date_sk#1 >= 2435443) AND (ss_sold_date_sk#1 <= 2435473))) OR ((ss_sold_date_sk#1 >= 2435809) AND (ss_sold_date_sk#1 <= 2435839)))) OR (((((ss_sold_date_sk#1 >= 2436174) AND (ss_sold_date_sk#1 <= 2436204)) OR ((ss_sold_date_sk#1 >= 2436539) AND (ss_sold_date_sk#1 <= 2436569))) OR ((ss_sold_date_sk#1 >= 2436904) AND (ss_sold_date_sk#1 <= 2436934))) OR ((((ss_sold_date_sk#1 >= 2437270) AND (ss_sold_date_sk#1 <= 2437300)) OR ((ss_sold_date_sk#1 >= 2437635) AND (ss_sold_date_sk#1 <= 2437665))) OR ((ss_sold_date_sk#1 >= 2438000) AND (ss_sold_date_sk#1 <= 2438030))))) OR ((((((ss_sold_date_sk#1 >= 2438365) AND (ss_sold_date_sk#1 <= 2438395)) OR ((ss_sold_date_sk#1 >= 2438731) AND (ss_sold_date_sk#1 <= 2438761))) OR ((ss_sold_date_sk#1 >= 2439096) AND (ss_sold_date_sk#1 <= 2439126))) OR ((((ss_sold_date_sk#1 >= 2439461) AND (ss_sold_date_sk#1 <= 2439491)) OR ((ss_sold_date_sk#1 >= 2439826) AND (ss_sold_date_sk#1 <= 2439856))) OR ((ss_sold_date_sk#1 >= 2440192) AND (ss_sold_date_sk#1 <= 2440222)))) OR (((((ss_sold_date_sk#1 >= 2440557) AND (ss_sold_date_sk#1 <= 2440587)) OR ((ss_sold_date_sk#1 >= 2440922) AND (ss_sold_date_sk#1 <= 2440952))) OR ((ss_sold_date_sk#1 >= 2441287) AND (ss_sold_date_sk#1 <= 2441317))) OR ((((ss_sold_date_sk#1 >= 2441653) AND (ss_sold_date_sk#1 <= 2441683)) OR ((ss_sold_date_sk#1 >= 2442018) AND (ss_sold_date_sk#1 <= 2442048))) OR ((ss_sold_date_sk#1 >= 2442383) AND (ss_sold_date_sk#1 <= 2442413)))))) OR (((((((ss_sold_date_sk#1 >= 2442748) AND (ss_sold_date_sk#1 <= 2442778)) OR ((ss_sold_date_sk#1 >= 2443114) AND (ss_sold_date_sk#1 <= 2443144))) OR (((ss_sold_date_sk#1 >= 2443479) AND (ss_sold_date_sk#1 <= 2443509)) OR ((ss_sold_date_sk#1 >= 2443844) AND (ss_sold_date_sk#1 <= 2443874)))) OR ((((ss_sold_date_sk#1 >= 2444209) AND (ss_sold_date_sk#1 <= 2444239)) OR ((ss_sold_date_sk#1 >= 2444575) AND (ss_sold_date_sk#1 <= 2444605))) OR ((ss_sold_date_sk#1 >= 2444940) AND (ss_sold_date_sk#1 <= 2444970)))) OR (((((ss_sold_date_sk#1 >= 2445305) AND (ss_sold_date_sk#1 <= 2445335)) OR ((ss_sold_date_sk#1 >= 2445670) AND (ss_sold_date_sk#1 <= 2445700))) OR ((ss_sold_date_sk#1 >= 2446036) AND (ss_sold_date_sk#1 <= 2446066))) OR ((((ss_sold_date_sk#1 >= 2446401) AND (ss_sold_date_sk#1 <= 2446431)) OR ((ss_sold_date_sk#1 >= 2446766) AND (ss_sold_date_sk#1 <= 2446796))) OR ((ss_sold_date_sk#1 >= 2447131) AND (ss_sold_date_sk#1 <= 2447161))))) OR ((((((ss_sold_date_sk#1 >= 2447497) AND (ss_sold_date_sk#1 <= 2447527)) OR ((ss_sold_date_sk#1 >= 2447862) AND (ss_sold_date_sk#1 <= 2447892))) OR ((ss_sold_date_sk#1 >= 2448227) AND (ss_sold_date_sk#1 <= 2448257))) OR ((((ss_sold_date_sk#1 >= 2448592) AND (ss_sold_date_sk#1 <= 2448622)) OR ((ss_sold_date_sk#1 >= 2448958) AND (ss_sold_date_sk#1 <= 2448988))) OR ((ss_sold_date_sk#1 >= 2449323) AND (ss_sold_date_sk#1 <= 2449353)))) OR (((((ss_sold_date_sk#1 >= 2449688) AND (ss_sold_date_sk#1 <= 2449718)) OR ((ss_sold_date_sk#1 >= 2450053) AND (ss_sold_date_sk#1 <= 2450083))) OR ((ss_sold_date_sk#1 >= 2450419) AND (ss_sold_date_sk#1 <= 2450449))) OR ((((ss_sold_date_sk#1 >= 2450784) AND (ss_sold_date_sk#1 <= 2450814)) OR ((ss_sold_date_sk#1 >= 2451149) AND (ss_sold_date_sk#1 <= 2451179))) OR ((ss_sold_date_sk#1 >= 2451514) AND (ss_sold_date_sk#1 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#1 >= 2451880) AND (ss_sold_date_sk#1 <= 2451910)) OR ((ss_sold_date_sk#1 >= 2452245) AND (ss_sold_date_sk#1 <= 2452275))) OR (((ss_sold_date_sk#1 >= 2452610) AND (ss_sold_date_sk#1 <= 2452640)) OR ((ss_sold_date_sk#1 >= 2452975) AND (ss_sold_date_sk#1 <= 2453005)))) OR ((((ss_sold_date_sk#1 >= 2453341) AND (ss_sold_date_sk#1 <= 2453371)) OR ((ss_sold_date_sk#1 >= 2453706) AND (ss_sold_date_sk#1 <= 2453736))) OR ((ss_sold_date_sk#1 >= 2454071) AND (ss_sold_date_sk#1 <= 2454101)))) OR (((((ss_sold_date_sk#1 >= 2454436) AND (ss_sold_date_sk#1 <= 2454466)) OR ((ss_sold_date_sk#1 >= 2454802) AND (ss_sold_date_sk#1 <= 2454832))) OR ((ss_sold_date_sk#1 >= 2455167) AND (ss_sold_date_sk#1 <= 2455197))) OR ((((ss_sold_date_sk#1 >= 2455532) AND (ss_sold_date_sk#1 <= 2455562)) OR ((ss_sold_date_sk#1 >= 2455897) AND (ss_sold_date_sk#1 <= 2455927))) OR ((ss_sold_date_sk#1 >= 2456263) AND (ss_sold_date_sk#1 <= 2456293))))) OR ((((((ss_sold_date_sk#1 >= 2456628) AND (ss_sold_date_sk#1 <= 2456658)) OR ((ss_sold_date_sk#1 >= 2456993) AND (ss_sold_date_sk#1 <= 2457023))) OR ((ss_sold_date_sk#1 >= 2457358) AND (ss_sold_date_sk#1 <= 2457388))) OR ((((ss_sold_date_sk#1 >= 2457724) AND (ss_sold_date_sk#1 <= 2457754)) OR ((ss_sold_date_sk#1 >= 2458089) AND (ss_sold_date_sk#1 <= 2458119))) OR ((ss_sold_date_sk#1 >= 2458454) AND (ss_sold_date_sk#1 <= 2458484)))) OR (((((ss_sold_date_sk#1 >= 2458819) AND (ss_sold_date_sk#1 <= 2458849)) OR ((ss_sold_date_sk#1 >= 2459185) AND (ss_sold_date_sk#1 <= 2459215))) OR ((ss_sold_date_sk#1 >= 2459550) AND (ss_sold_date_sk#1 <= 2459580))) OR ((((ss_sold_date_sk#1 >= 2459915) AND (ss_sold_date_sk#1 <= 2459945)) OR ((ss_sold_date_sk#1 >= 2460280) AND (ss_sold_date_sk#1 <= 2460310))) OR ((ss_sold_date_sk#1 >= 2460646) AND (ss_sold_date_sk#1 <= 2460676)))))) OR (((((((ss_sold_date_sk#1 >= 2461011) AND (ss_sold_date_sk#1 <= 2461041)) OR ((ss_sold_date_sk#1 >= 2461376) AND (ss_sold_date_sk#1 <= 2461406))) OR (((ss_sold_date_sk#1 >= 2461741) AND (ss_sold_date_sk#1 <= 2461771)) OR ((ss_sold_date_sk#1 >= 2462107) AND (ss_sold_date_sk#1 <= 2462137)))) OR ((((ss_sold_date_sk#1 >= 2462472) AND (ss_sold_date_sk#1 <= 2462502)) OR ((ss_sold_date_sk#1 >= 2462837) AND (ss_sold_date_sk#1 <= 2462867))) OR ((ss_sold_date_sk#1 >= 2463202) AND (ss_sold_date_sk#1 <= 2463232)))) OR (((((ss_sold_date_sk#1 >= 2463568) AND (ss_sold_date_sk#1 <= 2463598)) OR ((ss_sold_date_sk#1 >= 2463933) AND (ss_sold_date_sk#1 <= 2463963))) OR ((ss_sold_date_sk#1 >= 2464298) AND (ss_sold_date_sk#1 <= 2464328))) OR ((((ss_sold_date_sk#1 >= 2464663) AND (ss_sold_date_sk#1 <= 2464693)) OR ((ss_sold_date_sk#1 >= 2465029) AND (ss_sold_date_sk#1 <= 2465059))) OR ((ss_sold_date_sk#1 >= 2465394) AND (ss_sold_date_sk#1 <= 2465424))))) OR ((((((ss_sold_date_sk#1 >= 2465759) AND (ss_sold_date_sk#1 <= 2465789)) OR ((ss_sold_date_sk#1 >= 2466124) AND (ss_sold_date_sk#1 <= 2466154))) OR ((ss_sold_date_sk#1 >= 2466490) AND (ss_sold_date_sk#1 <= 2466520))) OR ((((ss_sold_date_sk#1 >= 2466855) AND (ss_sold_date_sk#1 <= 2466885)) OR ((ss_sold_date_sk#1 >= 2467220) AND (ss_sold_date_sk#1 <= 2467250))) OR ((ss_sold_date_sk#1 >= 2467585) AND (ss_sold_date_sk#1 <= 2467615)))) OR (((((ss_sold_date_sk#1 >= 2467951) AND (ss_sold_date_sk#1 <= 2467981)) OR ((ss_sold_date_sk#1 >= 2468316) AND (ss_sold_date_sk#1 <= 2468346))) OR ((ss_sold_date_sk#1 >= 2468681) AND (ss_sold_date_sk#1 <= 2468711))) OR ((((ss_sold_date_sk#1 >= 2469046) AND (ss_sold_date_sk#1 <= 2469076)) OR ((ss_sold_date_sk#1 >= 2469412) AND (ss_sold_date_sk#1 <= 2469442))) OR ((ss_sold_date_sk#1 >= 2469777) AND (ss_sold_date_sk#1 <= 2469807))))))) OR ((((((((ss_sold_date_sk#1 >= 2470142) AND (ss_sold_date_sk#1 <= 2470172)) OR ((ss_sold_date_sk#1 >= 2470507) AND (ss_sold_date_sk#1 <= 2470537))) OR (((ss_sold_date_sk#1 >= 2470873) AND (ss_sold_date_sk#1 <= 2470903)) OR ((ss_sold_date_sk#1 >= 2471238) AND (ss_sold_date_sk#1 <= 2471268)))) OR ((((ss_sold_date_sk#1 >= 2471603) AND (ss_sold_date_sk#1 <= 2471633)) OR ((ss_sold_date_sk#1 >= 2471968) AND (ss_sold_date_sk#1 <= 2471998))) OR ((ss_sold_date_sk#1 >= 2472334) AND (ss_sold_date_sk#1 <= 2472364)))) OR (((((ss_sold_date_sk#1 >= 2472699) AND (ss_sold_date_sk#1 <= 2472729)) OR ((ss_sold_date_sk#1 >= 2473064) AND (ss_sold_date_sk#1 <= 2473094))) OR ((ss_sold_date_sk#1 >= 2473429) AND (ss_sold_date_sk#1 <= 2473459))) OR ((((ss_sold_date_sk#1 >= 2473795) AND (ss_sold_date_sk#1 <= 2473825)) OR ((ss_sold_date_sk#1 >= 2474160) AND (ss_sold_date_sk#1 <= 2474190))) OR ((ss_sold_date_sk#1 >= 2474525) AND (ss_sold_date_sk#1 <= 2474555))))) OR ((((((ss_sold_date_sk#1 >= 2474890) AND (ss_sold_date_sk#1 <= 2474920)) OR ((ss_sold_date_sk#1 >= 2475256) AND (ss_sold_date_sk#1 <= 2475286))) OR ((ss_sold_date_sk#1 >= 2475621) AND (ss_sold_date_sk#1 <= 2475651))) OR ((((ss_sold_date_sk#1 >= 2475986) AND (ss_sold_date_sk#1 <= 2476016)) OR ((ss_sold_date_sk#1 >= 2476351) AND (ss_sold_date_sk#1 <= 2476381))) OR ((ss_sold_date_sk#1 >= 2476717) AND (ss_sold_date_sk#1 <= 2476747)))) OR (((((ss_sold_date_sk#1 >= 2477082) AND (ss_sold_date_sk#1 <= 2477112)) OR ((ss_sold_date_sk#1 >= 2477447) AND (ss_sold_date_sk#1 <= 2477477))) OR ((ss_sold_date_sk#1 >= 2477812) AND (ss_sold_date_sk#1 <= 2477842))) OR ((((ss_sold_date_sk#1 >= 2478178) AND (ss_sold_date_sk#1 <= 2478208)) OR ((ss_sold_date_sk#1 >= 2478543) AND (ss_sold_date_sk#1 <= 2478573))) OR ((ss_sold_date_sk#1 >= 2478908) AND (ss_sold_date_sk#1 <= 2478938)))))) OR (((((((ss_sold_date_sk#1 >= 2479273) AND (ss_sold_date_sk#1 <= 2479303)) OR ((ss_sold_date_sk#1 >= 2479639) AND (ss_sold_date_sk#1 <= 2479669))) OR (((ss_sold_date_sk#1 >= 2480004) AND (ss_sold_date_sk#1 <= 2480034)) OR ((ss_sold_date_sk#1 >= 2480369) AND (ss_sold_date_sk#1 <= 2480399)))) OR ((((ss_sold_date_sk#1 >= 2480734) AND (ss_sold_date_sk#1 <= 2480764)) OR ((ss_sold_date_sk#1 >= 2481100) AND (ss_sold_date_sk#1 <= 2481130))) OR ((ss_sold_date_sk#1 >= 2481465) AND (ss_sold_date_sk#1 <= 2481495)))) OR (((((ss_sold_date_sk#1 >= 2481830) AND (ss_sold_date_sk#1 <= 2481860)) OR ((ss_sold_date_sk#1 >= 2482195) AND (ss_sold_date_sk#1 <= 2482225))) OR ((ss_sold_date_sk#1 >= 2482561) AND (ss_sold_date_sk#1 <= 2482591))) OR ((((ss_sold_date_sk#1 >= 2482926) AND (ss_sold_date_sk#1 <= 2482956)) OR ((ss_sold_date_sk#1 >= 2483291) AND (ss_sold_date_sk#1 <= 2483321))) OR ((ss_sold_date_sk#1 >= 2483656) AND (ss_sold_date_sk#1 <= 2483686))))) OR ((((((ss_sold_date_sk#1 >= 2484022) AND (ss_sold_date_sk#1 <= 2484052)) OR ((ss_sold_date_sk#1 >= 2484387) AND (ss_sold_date_sk#1 <= 2484417))) OR ((ss_sold_date_sk#1 >= 2484752) AND (ss_sold_date_sk#1 <= 2484782))) OR ((((ss_sold_date_sk#1 >= 2485117) AND (ss_sold_date_sk#1 <= 2485147)) OR ((ss_sold_date_sk#1 >= 2485483) AND (ss_sold_date_sk#1 <= 2485513))) OR ((ss_sold_date_sk#1 >= 2485848) AND (ss_sold_date_sk#1 <= 2485878)))) OR (((((ss_sold_date_sk#1 >= 2486213) AND (ss_sold_date_sk#1 <= 2486243)) OR ((ss_sold_date_sk#1 >= 2486578) AND (ss_sold_date_sk#1 <= 2486608))) OR ((ss_sold_date_sk#1 >= 2486944) AND (ss_sold_date_sk#1 <= 2486974))) OR ((((ss_sold_date_sk#1 >= 2487309) AND (ss_sold_date_sk#1 <= 2487339)) OR ((ss_sold_date_sk#1 >= 2487674) AND (ss_sold_date_sk#1 <= 2487704))) OR ((ss_sold_date_sk#1 >= 2488039) AND (ss_sold_date_sk#1 <= 2488069))))))))) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -Condition : ((isnotnull(i_manufact_id#7) AND (i_manufact_id#7 = 436)) AND isnotnull(i_item_sk#4)) +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +Condition : ((isnotnull(i_manufact_id#4) AND (i_manufact_id#4 = 436)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2415355),LessThanOrEqual(ss_sold_date_sk,2415385)),And(GreaterThanOrEqual(ss_sold_date_sk,2415720),LessThanOrEqual(ss_sold_date_sk,2415750))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416085),LessThanOrEqual(ss_sold_date_sk,2416115)),And(GreaterThanOrEqual(ss_sold_date_sk,2416450),LessThanOrEqual(ss_sold_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416816),LessThanOrEqual(ss_sold_date_sk,2416846)),And(GreaterThanOrEqual(ss_sold_date_sk,2417181),LessThanOrEqual(ss_sold_date_sk,2417211))),And(GreaterThanOrEqual(ss_sold_date_sk,2417546),LessThanOrEqual(ss_sold_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2417911),LessThanOrEqual(ss_sold_date_sk,2417941)),And(GreaterThanOrEqual(ss_sold_date_sk,2418277),LessThanOrEqual(ss_sold_date_sk,2418307))),And(GreaterThanOrEqual(ss_sold_date_sk,2418642),LessThanOrEqual(ss_sold_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2419007),LessThanOrEqual(ss_sold_date_sk,2419037)),And(GreaterThanOrEqual(ss_sold_date_sk,2419372),LessThanOrEqual(ss_sold_date_sk,2419402))),And(GreaterThanOrEqual(ss_sold_date_sk,2419738),LessThanOrEqual(ss_sold_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2420103),LessThanOrEqual(ss_sold_date_sk,2420133)),And(GreaterThanOrEqual(ss_sold_date_sk,2420468),LessThanOrEqual(ss_sold_date_sk,2420498))),And(GreaterThanOrEqual(ss_sold_date_sk,2420833),LessThanOrEqual(ss_sold_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2421199),LessThanOrEqual(ss_sold_date_sk,2421229)),And(GreaterThanOrEqual(ss_sold_date_sk,2421564),LessThanOrEqual(ss_sold_date_sk,2421594))),And(GreaterThanOrEqual(ss_sold_date_sk,2421929),LessThanOrEqual(ss_sold_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2422294),LessThanOrEqual(ss_sold_date_sk,2422324)),And(GreaterThanOrEqual(ss_sold_date_sk,2422660),LessThanOrEqual(ss_sold_date_sk,2422690))),And(GreaterThanOrEqual(ss_sold_date_sk,2423025),LessThanOrEqual(ss_sold_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2423390),LessThanOrEqual(ss_sold_date_sk,2423420)),And(GreaterThanOrEqual(ss_sold_date_sk,2423755),LessThanOrEqual(ss_sold_date_sk,2423785))),And(GreaterThanOrEqual(ss_sold_date_sk,2424121),LessThanOrEqual(ss_sold_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2424486),LessThanOrEqual(ss_sold_date_sk,2424516)),And(GreaterThanOrEqual(ss_sold_date_sk,2424851),LessThanOrEqual(ss_sold_date_sk,2424881))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425216),LessThanOrEqual(ss_sold_date_sk,2425246)),And(GreaterThanOrEqual(ss_sold_date_sk,2425582),LessThanOrEqual(ss_sold_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425947),LessThanOrEqual(ss_sold_date_sk,2425977)),And(GreaterThanOrEqual(ss_sold_date_sk,2426312),LessThanOrEqual(ss_sold_date_sk,2426342))),And(GreaterThanOrEqual(ss_sold_date_sk,2426677),LessThanOrEqual(ss_sold_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2427043),LessThanOrEqual(ss_sold_date_sk,2427073)),And(GreaterThanOrEqual(ss_sold_date_sk,2427408),LessThanOrEqual(ss_sold_date_sk,2427438))),And(GreaterThanOrEqual(ss_sold_date_sk,2427773),LessThanOrEqual(ss_sold_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2428138),LessThanOrEqual(ss_sold_date_sk,2428168)),And(GreaterThanOrEqual(ss_sold_date_sk,2428504),LessThanOrEqual(ss_sold_date_sk,2428534))),And(GreaterThanOrEqual(ss_sold_date_sk,2428869),LessThanOrEqual(ss_sold_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2429234),LessThanOrEqual(ss_sold_date_sk,2429264)),And(GreaterThanOrEqual(ss_sold_date_sk,2429599),LessThanOrEqual(ss_sold_date_sk,2429629))),And(GreaterThanOrEqual(ss_sold_date_sk,2429965),LessThanOrEqual(ss_sold_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2430330),LessThanOrEqual(ss_sold_date_sk,2430360)),And(GreaterThanOrEqual(ss_sold_date_sk,2430695),LessThanOrEqual(ss_sold_date_sk,2430725))),And(GreaterThanOrEqual(ss_sold_date_sk,2431060),LessThanOrEqual(ss_sold_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2431426),LessThanOrEqual(ss_sold_date_sk,2431456)),And(GreaterThanOrEqual(ss_sold_date_sk,2431791),LessThanOrEqual(ss_sold_date_sk,2431821))),And(GreaterThanOrEqual(ss_sold_date_sk,2432156),LessThanOrEqual(ss_sold_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2432521),LessThanOrEqual(ss_sold_date_sk,2432551)),And(GreaterThanOrEqual(ss_sold_date_sk,2432887),LessThanOrEqual(ss_sold_date_sk,2432917))),And(GreaterThanOrEqual(ss_sold_date_sk,2433252),LessThanOrEqual(ss_sold_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2433617),LessThanOrEqual(ss_sold_date_sk,2433647)),And(GreaterThanOrEqual(ss_sold_date_sk,2433982),LessThanOrEqual(ss_sold_date_sk,2434012))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2434348),LessThanOrEqual(ss_sold_date_sk,2434378)),And(GreaterThanOrEqual(ss_sold_date_sk,2434713),LessThanOrEqual(ss_sold_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2435078),LessThanOrEqual(ss_sold_date_sk,2435108)),And(GreaterThanOrEqual(ss_sold_date_sk,2435443),LessThanOrEqual(ss_sold_date_sk,2435473))),And(GreaterThanOrEqual(ss_sold_date_sk,2435809),LessThanOrEqual(ss_sold_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2436174),LessThanOrEqual(ss_sold_date_sk,2436204)),And(GreaterThanOrEqual(ss_sold_date_sk,2436539),LessThanOrEqual(ss_sold_date_sk,2436569))),And(GreaterThanOrEqual(ss_sold_date_sk,2436904),LessThanOrEqual(ss_sold_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2437270),LessThanOrEqual(ss_sold_date_sk,2437300)),And(GreaterThanOrEqual(ss_sold_date_sk,2437635),LessThanOrEqual(ss_sold_date_sk,2437665))),And(GreaterThanOrEqual(ss_sold_date_sk,2438000),LessThanOrEqual(ss_sold_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2438365),LessThanOrEqual(ss_sold_date_sk,2438395)),And(GreaterThanOrEqual(ss_sold_date_sk,2438731),LessThanOrEqual(ss_sold_date_sk,2438761))),And(GreaterThanOrEqual(ss_sold_date_sk,2439096),LessThanOrEqual(ss_sold_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2439461),LessThanOrEqual(ss_sold_date_sk,2439491)),And(GreaterThanOrEqual(ss_sold_date_sk,2439826),LessThanOrEqual(ss_sold_date_sk,2439856))),And(GreaterThanOrEqual(ss_sold_date_sk,2440192),LessThanOrEqual(ss_sold_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2440557),LessThanOrEqual(ss_sold_date_sk,2440587)),And(GreaterThanOrEqual(ss_sold_date_sk,2440922),LessThanOrEqual(ss_sold_date_sk,2440952))),And(GreaterThanOrEqual(ss_sold_date_sk,2441287),LessThanOrEqual(ss_sold_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2441653),LessThanOrEqual(ss_sold_date_sk,2441683)),And(GreaterThanOrEqual(ss_sold_date_sk,2442018),LessThanOrEqual(ss_sold_date_sk,2442048))),And(GreaterThanOrEqual(ss_sold_date_sk,2442383),LessThanOrEqual(ss_sold_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2442748),LessThanOrEqual(ss_sold_date_sk,2442778)),And(GreaterThanOrEqual(ss_sold_date_sk,2443114),LessThanOrEqual(ss_sold_date_sk,2443144))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2443479),LessThanOrEqual(ss_sold_date_sk,2443509)),And(GreaterThanOrEqual(ss_sold_date_sk,2443844),LessThanOrEqual(ss_sold_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2444209),LessThanOrEqual(ss_sold_date_sk,2444239)),And(GreaterThanOrEqual(ss_sold_date_sk,2444575),LessThanOrEqual(ss_sold_date_sk,2444605))),And(GreaterThanOrEqual(ss_sold_date_sk,2444940),LessThanOrEqual(ss_sold_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2445305),LessThanOrEqual(ss_sold_date_sk,2445335)),And(GreaterThanOrEqual(ss_sold_date_sk,2445670),LessThanOrEqual(ss_sold_date_sk,2445700))),And(GreaterThanOrEqual(ss_sold_date_sk,2446036),LessThanOrEqual(ss_sold_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2446401),LessThanOrEqual(ss_sold_date_sk,2446431)),And(GreaterThanOrEqual(ss_sold_date_sk,2446766),LessThanOrEqual(ss_sold_date_sk,2446796))),And(GreaterThanOrEqual(ss_sold_date_sk,2447131),LessThanOrEqual(ss_sold_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2447497),LessThanOrEqual(ss_sold_date_sk,2447527)),And(GreaterThanOrEqual(ss_sold_date_sk,2447862),LessThanOrEqual(ss_sold_date_sk,2447892))),And(GreaterThanOrEqual(ss_sold_date_sk,2448227),LessThanOrEqual(ss_sold_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2448592),LessThanOrEqual(ss_sold_date_sk,2448622)),And(GreaterThanOrEqual(ss_sold_date_sk,2448958),LessThanOrEqual(ss_sold_date_sk,2448988))),And(GreaterThanOrEqual(ss_sold_date_sk,2449323),LessThanOrEqual(ss_sold_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2449688),LessThanOrEqual(ss_sold_date_sk,2449718)),And(GreaterThanOrEqual(ss_sold_date_sk,2450053),LessThanOrEqual(ss_sold_date_sk,2450083))),And(GreaterThanOrEqual(ss_sold_date_sk,2450419),LessThanOrEqual(ss_sold_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2450784),LessThanOrEqual(ss_sold_date_sk,2450814)),And(GreaterThanOrEqual(ss_sold_date_sk,2451149),LessThanOrEqual(ss_sold_date_sk,2451179))),And(GreaterThanOrEqual(ss_sold_date_sk,2451514),LessThanOrEqual(ss_sold_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2451880),LessThanOrEqual(ss_sold_date_sk,2451910)),And(GreaterThanOrEqual(ss_sold_date_sk,2452245),LessThanOrEqual(ss_sold_date_sk,2452275))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2452610),LessThanOrEqual(ss_sold_date_sk,2452640)),And(GreaterThanOrEqual(ss_sold_date_sk,2452975),LessThanOrEqual(ss_sold_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2453341),LessThanOrEqual(ss_sold_date_sk,2453371)),And(GreaterThanOrEqual(ss_sold_date_sk,2453706),LessThanOrEqual(ss_sold_date_sk,2453736))),And(GreaterThanOrEqual(ss_sold_date_sk,2454071),LessThanOrEqual(ss_sold_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2454436),LessThanOrEqual(ss_sold_date_sk,2454466)),And(GreaterThanOrEqual(ss_sold_date_sk,2454802),LessThanOrEqual(ss_sold_date_sk,2454832))),And(GreaterThanOrEqual(ss_sold_date_sk,2455167),LessThanOrEqual(ss_sold_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2455532),LessThanOrEqual(ss_sold_date_sk,2455562)),And(GreaterThanOrEqual(ss_sold_date_sk,2455897),LessThanOrEqual(ss_sold_date_sk,2455927))),And(GreaterThanOrEqual(ss_sold_date_sk,2456263),LessThanOrEqual(ss_sold_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2456628),LessThanOrEqual(ss_sold_date_sk,2456658)),And(GreaterThanOrEqual(ss_sold_date_sk,2456993),LessThanOrEqual(ss_sold_date_sk,2457023))),And(GreaterThanOrEqual(ss_sold_date_sk,2457358),LessThanOrEqual(ss_sold_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2457724),LessThanOrEqual(ss_sold_date_sk,2457754)),And(GreaterThanOrEqual(ss_sold_date_sk,2458089),LessThanOrEqual(ss_sold_date_sk,2458119))),And(GreaterThanOrEqual(ss_sold_date_sk,2458454),LessThanOrEqual(ss_sold_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2458819),LessThanOrEqual(ss_sold_date_sk,2458849)),And(GreaterThanOrEqual(ss_sold_date_sk,2459185),LessThanOrEqual(ss_sold_date_sk,2459215))),And(GreaterThanOrEqual(ss_sold_date_sk,2459550),LessThanOrEqual(ss_sold_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2459915),LessThanOrEqual(ss_sold_date_sk,2459945)),And(GreaterThanOrEqual(ss_sold_date_sk,2460280),LessThanOrEqual(ss_sold_date_sk,2460310))),And(GreaterThanOrEqual(ss_sold_date_sk,2460646),LessThanOrEqual(ss_sold_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461011),LessThanOrEqual(ss_sold_date_sk,2461041)),And(GreaterThanOrEqual(ss_sold_date_sk,2461376),LessThanOrEqual(ss_sold_date_sk,2461406))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461741),LessThanOrEqual(ss_sold_date_sk,2461771)),And(GreaterThanOrEqual(ss_sold_date_sk,2462107),LessThanOrEqual(ss_sold_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2462472),LessThanOrEqual(ss_sold_date_sk,2462502)),And(GreaterThanOrEqual(ss_sold_date_sk,2462837),LessThanOrEqual(ss_sold_date_sk,2462867))),And(GreaterThanOrEqual(ss_sold_date_sk,2463202),LessThanOrEqual(ss_sold_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2463568),LessThanOrEqual(ss_sold_date_sk,2463598)),And(GreaterThanOrEqual(ss_sold_date_sk,2463933),LessThanOrEqual(ss_sold_date_sk,2463963))),And(GreaterThanOrEqual(ss_sold_date_sk,2464298),LessThanOrEqual(ss_sold_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2464663),LessThanOrEqual(ss_sold_date_sk,2464693)),And(GreaterThanOrEqual(ss_sold_date_sk,2465029),LessThanOrEqual(ss_sold_date_sk,2465059))),And(GreaterThanOrEqual(ss_sold_date_sk,2465394),LessThanOrEqual(ss_sold_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2465759),LessThanOrEqual(ss_sold_date_sk,2465789)),And(GreaterThanOrEqual(ss_sold_date_sk,2466124),LessThanOrEqual(ss_sold_date_sk,2466154))),And(GreaterThanOrEqual(ss_sold_date_sk,2466490),LessThanOrEqual(ss_sold_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2466855),LessThanOrEqual(ss_sold_date_sk,2466885)),And(GreaterThanOrEqual(ss_sold_date_sk,2467220),LessThanOrEqual(ss_sold_date_sk,2467250))),And(GreaterThanOrEqual(ss_sold_date_sk,2467585),LessThanOrEqual(ss_sold_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2467951),LessThanOrEqual(ss_sold_date_sk,2467981)),And(GreaterThanOrEqual(ss_sold_date_sk,2468316),LessThanOrEqual(ss_sold_date_sk,2468346))),And(GreaterThanOrEqual(ss_sold_date_sk,2468681),LessThanOrEqual(ss_sold_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2469046),LessThanOrEqual(ss_sold_date_sk,2469076)),And(GreaterThanOrEqual(ss_sold_date_sk,2469412),LessThanOrEqual(ss_sold_date_sk,2469442))),And(GreaterThanOrEqual(ss_sold_date_sk,2469777),LessThanOrEqual(ss_sold_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470142),LessThanOrEqual(ss_sold_date_sk,2470172)),And(GreaterThanOrEqual(ss_sold_date_sk,2470507),LessThanOrEqual(ss_sold_date_sk,2470537))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470873),LessThanOrEqual(ss_sold_date_sk,2470903)),And(GreaterThanOrEqual(ss_sold_date_sk,2471238),LessThanOrEqual(ss_sold_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2471603),LessThanOrEqual(ss_sold_date_sk,2471633)),And(GreaterThanOrEqual(ss_sold_date_sk,2471968),LessThanOrEqual(ss_sold_date_sk,2471998))),And(GreaterThanOrEqual(ss_sold_date_sk,2472334),LessThanOrEqual(ss_sold_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2472699),LessThanOrEqual(ss_sold_date_sk,2472729)),And(GreaterThanOrEqual(ss_sold_date_sk,2473064),LessThanOrEqual(ss_sold_date_sk,2473094))),And(GreaterThanOrEqual(ss_sold_date_sk,2473429),LessThanOrEqual(ss_sold_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2473795),LessThanOrEqual(ss_sold_date_sk,2473825)),And(GreaterThanOrEqual(ss_sold_date_sk,2474160),LessThanOrEqual(ss_sold_date_sk,2474190))),And(GreaterThanOrEqual(ss_sold_date_sk,2474525),LessThanOrEqual(ss_sold_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2474890),LessThanOrEqual(ss_sold_date_sk,2474920)),And(GreaterThanOrEqual(ss_sold_date_sk,2475256),LessThanOrEqual(ss_sold_date_sk,2475286))),And(GreaterThanOrEqual(ss_sold_date_sk,2475621),LessThanOrEqual(ss_sold_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2475986),LessThanOrEqual(ss_sold_date_sk,2476016)),And(GreaterThanOrEqual(ss_sold_date_sk,2476351),LessThanOrEqual(ss_sold_date_sk,2476381))),And(GreaterThanOrEqual(ss_sold_date_sk,2476717),LessThanOrEqual(ss_sold_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2477082),LessThanOrEqual(ss_sold_date_sk,2477112)),And(GreaterThanOrEqual(ss_sold_date_sk,2477447),LessThanOrEqual(ss_sold_date_sk,2477477))),And(GreaterThanOrEqual(ss_sold_date_sk,2477812),LessThanOrEqual(ss_sold_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2478178),LessThanOrEqual(ss_sold_date_sk,2478208)),And(GreaterThanOrEqual(ss_sold_date_sk,2478543),LessThanOrEqual(ss_sold_date_sk,2478573))),And(GreaterThanOrEqual(ss_sold_date_sk,2478908),LessThanOrEqual(ss_sold_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2479273),LessThanOrEqual(ss_sold_date_sk,2479303)),And(GreaterThanOrEqual(ss_sold_date_sk,2479639),LessThanOrEqual(ss_sold_date_sk,2479669))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480004),LessThanOrEqual(ss_sold_date_sk,2480034)),And(GreaterThanOrEqual(ss_sold_date_sk,2480369),LessThanOrEqual(ss_sold_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480734),LessThanOrEqual(ss_sold_date_sk,2480764)),And(GreaterThanOrEqual(ss_sold_date_sk,2481100),LessThanOrEqual(ss_sold_date_sk,2481130))),And(GreaterThanOrEqual(ss_sold_date_sk,2481465),LessThanOrEqual(ss_sold_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2481830),LessThanOrEqual(ss_sold_date_sk,2481860)),And(GreaterThanOrEqual(ss_sold_date_sk,2482195),LessThanOrEqual(ss_sold_date_sk,2482225))),And(GreaterThanOrEqual(ss_sold_date_sk,2482561),LessThanOrEqual(ss_sold_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2482926),LessThanOrEqual(ss_sold_date_sk,2482956)),And(GreaterThanOrEqual(ss_sold_date_sk,2483291),LessThanOrEqual(ss_sold_date_sk,2483321))),And(GreaterThanOrEqual(ss_sold_date_sk,2483656),LessThanOrEqual(ss_sold_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2484022),LessThanOrEqual(ss_sold_date_sk,2484052)),And(GreaterThanOrEqual(ss_sold_date_sk,2484387),LessThanOrEqual(ss_sold_date_sk,2484417))),And(GreaterThanOrEqual(ss_sold_date_sk,2484752),LessThanOrEqual(ss_sold_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2485117),LessThanOrEqual(ss_sold_date_sk,2485147)),And(GreaterThanOrEqual(ss_sold_date_sk,2485483),LessThanOrEqual(ss_sold_date_sk,2485513))),And(GreaterThanOrEqual(ss_sold_date_sk,2485848),LessThanOrEqual(ss_sold_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2486213),LessThanOrEqual(ss_sold_date_sk,2486243)),And(GreaterThanOrEqual(ss_sold_date_sk,2486578),LessThanOrEqual(ss_sold_date_sk,2486608))),And(GreaterThanOrEqual(ss_sold_date_sk,2486944),LessThanOrEqual(ss_sold_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2487309),LessThanOrEqual(ss_sold_date_sk,2487339)),And(GreaterThanOrEqual(ss_sold_date_sk,2487674),LessThanOrEqual(ss_sold_date_sk,2487704))),And(GreaterThanOrEqual(ss_sold_date_sk,2488039),LessThanOrEqual(ss_sold_date_sk,2488069))))))))), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] -(8) BroadcastExchange -Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] +Condition : ((((((((((((ss_sold_date_sk#6 >= 2415355) AND (ss_sold_date_sk#6 <= 2415385)) OR ((ss_sold_date_sk#6 >= 2415720) AND (ss_sold_date_sk#6 <= 2415750))) OR (((ss_sold_date_sk#6 >= 2416085) AND (ss_sold_date_sk#6 <= 2416115)) OR ((ss_sold_date_sk#6 >= 2416450) AND (ss_sold_date_sk#6 <= 2416480)))) OR ((((ss_sold_date_sk#6 >= 2416816) AND (ss_sold_date_sk#6 <= 2416846)) OR ((ss_sold_date_sk#6 >= 2417181) AND (ss_sold_date_sk#6 <= 2417211))) OR ((ss_sold_date_sk#6 >= 2417546) AND (ss_sold_date_sk#6 <= 2417576)))) OR (((((ss_sold_date_sk#6 >= 2417911) AND (ss_sold_date_sk#6 <= 2417941)) OR ((ss_sold_date_sk#6 >= 2418277) AND (ss_sold_date_sk#6 <= 2418307))) OR ((ss_sold_date_sk#6 >= 2418642) AND (ss_sold_date_sk#6 <= 2418672))) OR ((((ss_sold_date_sk#6 >= 2419007) AND (ss_sold_date_sk#6 <= 2419037)) OR ((ss_sold_date_sk#6 >= 2419372) AND (ss_sold_date_sk#6 <= 2419402))) OR ((ss_sold_date_sk#6 >= 2419738) AND (ss_sold_date_sk#6 <= 2419768))))) OR ((((((ss_sold_date_sk#6 >= 2420103) AND (ss_sold_date_sk#6 <= 2420133)) OR ((ss_sold_date_sk#6 >= 2420468) AND (ss_sold_date_sk#6 <= 2420498))) OR ((ss_sold_date_sk#6 >= 2420833) AND (ss_sold_date_sk#6 <= 2420863))) OR ((((ss_sold_date_sk#6 >= 2421199) AND (ss_sold_date_sk#6 <= 2421229)) OR ((ss_sold_date_sk#6 >= 2421564) AND (ss_sold_date_sk#6 <= 2421594))) OR ((ss_sold_date_sk#6 >= 2421929) AND (ss_sold_date_sk#6 <= 2421959)))) OR (((((ss_sold_date_sk#6 >= 2422294) AND (ss_sold_date_sk#6 <= 2422324)) OR ((ss_sold_date_sk#6 >= 2422660) AND (ss_sold_date_sk#6 <= 2422690))) OR ((ss_sold_date_sk#6 >= 2423025) AND (ss_sold_date_sk#6 <= 2423055))) OR ((((ss_sold_date_sk#6 >= 2423390) AND (ss_sold_date_sk#6 <= 2423420)) OR ((ss_sold_date_sk#6 >= 2423755) AND (ss_sold_date_sk#6 <= 2423785))) OR ((ss_sold_date_sk#6 >= 2424121) AND (ss_sold_date_sk#6 <= 2424151)))))) OR (((((((ss_sold_date_sk#6 >= 2424486) AND (ss_sold_date_sk#6 <= 2424516)) OR ((ss_sold_date_sk#6 >= 2424851) AND (ss_sold_date_sk#6 <= 2424881))) OR (((ss_sold_date_sk#6 >= 2425216) AND (ss_sold_date_sk#6 <= 2425246)) OR ((ss_sold_date_sk#6 >= 2425582) AND (ss_sold_date_sk#6 <= 2425612)))) OR ((((ss_sold_date_sk#6 >= 2425947) AND (ss_sold_date_sk#6 <= 2425977)) OR ((ss_sold_date_sk#6 >= 2426312) AND (ss_sold_date_sk#6 <= 2426342))) OR ((ss_sold_date_sk#6 >= 2426677) AND (ss_sold_date_sk#6 <= 2426707)))) OR (((((ss_sold_date_sk#6 >= 2427043) AND (ss_sold_date_sk#6 <= 2427073)) OR ((ss_sold_date_sk#6 >= 2427408) AND (ss_sold_date_sk#6 <= 2427438))) OR ((ss_sold_date_sk#6 >= 2427773) AND (ss_sold_date_sk#6 <= 2427803))) OR ((((ss_sold_date_sk#6 >= 2428138) AND (ss_sold_date_sk#6 <= 2428168)) OR ((ss_sold_date_sk#6 >= 2428504) AND (ss_sold_date_sk#6 <= 2428534))) OR ((ss_sold_date_sk#6 >= 2428869) AND (ss_sold_date_sk#6 <= 2428899))))) OR ((((((ss_sold_date_sk#6 >= 2429234) AND (ss_sold_date_sk#6 <= 2429264)) OR ((ss_sold_date_sk#6 >= 2429599) AND (ss_sold_date_sk#6 <= 2429629))) OR ((ss_sold_date_sk#6 >= 2429965) AND (ss_sold_date_sk#6 <= 2429995))) OR ((((ss_sold_date_sk#6 >= 2430330) AND (ss_sold_date_sk#6 <= 2430360)) OR ((ss_sold_date_sk#6 >= 2430695) AND (ss_sold_date_sk#6 <= 2430725))) OR ((ss_sold_date_sk#6 >= 2431060) AND (ss_sold_date_sk#6 <= 2431090)))) OR (((((ss_sold_date_sk#6 >= 2431426) AND (ss_sold_date_sk#6 <= 2431456)) OR ((ss_sold_date_sk#6 >= 2431791) AND (ss_sold_date_sk#6 <= 2431821))) OR ((ss_sold_date_sk#6 >= 2432156) AND (ss_sold_date_sk#6 <= 2432186))) OR ((((ss_sold_date_sk#6 >= 2432521) AND (ss_sold_date_sk#6 <= 2432551)) OR ((ss_sold_date_sk#6 >= 2432887) AND (ss_sold_date_sk#6 <= 2432917))) OR ((ss_sold_date_sk#6 >= 2433252) AND (ss_sold_date_sk#6 <= 2433282))))))) OR ((((((((ss_sold_date_sk#6 >= 2433617) AND (ss_sold_date_sk#6 <= 2433647)) OR ((ss_sold_date_sk#6 >= 2433982) AND (ss_sold_date_sk#6 <= 2434012))) OR (((ss_sold_date_sk#6 >= 2434348) AND (ss_sold_date_sk#6 <= 2434378)) OR ((ss_sold_date_sk#6 >= 2434713) AND (ss_sold_date_sk#6 <= 2434743)))) OR ((((ss_sold_date_sk#6 >= 2435078) AND (ss_sold_date_sk#6 <= 2435108)) OR ((ss_sold_date_sk#6 >= 2435443) AND (ss_sold_date_sk#6 <= 2435473))) OR ((ss_sold_date_sk#6 >= 2435809) AND (ss_sold_date_sk#6 <= 2435839)))) OR (((((ss_sold_date_sk#6 >= 2436174) AND (ss_sold_date_sk#6 <= 2436204)) OR ((ss_sold_date_sk#6 >= 2436539) AND (ss_sold_date_sk#6 <= 2436569))) OR ((ss_sold_date_sk#6 >= 2436904) AND (ss_sold_date_sk#6 <= 2436934))) OR ((((ss_sold_date_sk#6 >= 2437270) AND (ss_sold_date_sk#6 <= 2437300)) OR ((ss_sold_date_sk#6 >= 2437635) AND (ss_sold_date_sk#6 <= 2437665))) OR ((ss_sold_date_sk#6 >= 2438000) AND (ss_sold_date_sk#6 <= 2438030))))) OR ((((((ss_sold_date_sk#6 >= 2438365) AND (ss_sold_date_sk#6 <= 2438395)) OR ((ss_sold_date_sk#6 >= 2438731) AND (ss_sold_date_sk#6 <= 2438761))) OR ((ss_sold_date_sk#6 >= 2439096) AND (ss_sold_date_sk#6 <= 2439126))) OR ((((ss_sold_date_sk#6 >= 2439461) AND (ss_sold_date_sk#6 <= 2439491)) OR ((ss_sold_date_sk#6 >= 2439826) AND (ss_sold_date_sk#6 <= 2439856))) OR ((ss_sold_date_sk#6 >= 2440192) AND (ss_sold_date_sk#6 <= 2440222)))) OR (((((ss_sold_date_sk#6 >= 2440557) AND (ss_sold_date_sk#6 <= 2440587)) OR ((ss_sold_date_sk#6 >= 2440922) AND (ss_sold_date_sk#6 <= 2440952))) OR ((ss_sold_date_sk#6 >= 2441287) AND (ss_sold_date_sk#6 <= 2441317))) OR ((((ss_sold_date_sk#6 >= 2441653) AND (ss_sold_date_sk#6 <= 2441683)) OR ((ss_sold_date_sk#6 >= 2442018) AND (ss_sold_date_sk#6 <= 2442048))) OR ((ss_sold_date_sk#6 >= 2442383) AND (ss_sold_date_sk#6 <= 2442413)))))) OR (((((((ss_sold_date_sk#6 >= 2442748) AND (ss_sold_date_sk#6 <= 2442778)) OR ((ss_sold_date_sk#6 >= 2443114) AND (ss_sold_date_sk#6 <= 2443144))) OR (((ss_sold_date_sk#6 >= 2443479) AND (ss_sold_date_sk#6 <= 2443509)) OR ((ss_sold_date_sk#6 >= 2443844) AND (ss_sold_date_sk#6 <= 2443874)))) OR ((((ss_sold_date_sk#6 >= 2444209) AND (ss_sold_date_sk#6 <= 2444239)) OR ((ss_sold_date_sk#6 >= 2444575) AND (ss_sold_date_sk#6 <= 2444605))) OR ((ss_sold_date_sk#6 >= 2444940) AND (ss_sold_date_sk#6 <= 2444970)))) OR (((((ss_sold_date_sk#6 >= 2445305) AND (ss_sold_date_sk#6 <= 2445335)) OR ((ss_sold_date_sk#6 >= 2445670) AND (ss_sold_date_sk#6 <= 2445700))) OR ((ss_sold_date_sk#6 >= 2446036) AND (ss_sold_date_sk#6 <= 2446066))) OR ((((ss_sold_date_sk#6 >= 2446401) AND (ss_sold_date_sk#6 <= 2446431)) OR ((ss_sold_date_sk#6 >= 2446766) AND (ss_sold_date_sk#6 <= 2446796))) OR ((ss_sold_date_sk#6 >= 2447131) AND (ss_sold_date_sk#6 <= 2447161))))) OR ((((((ss_sold_date_sk#6 >= 2447497) AND (ss_sold_date_sk#6 <= 2447527)) OR ((ss_sold_date_sk#6 >= 2447862) AND (ss_sold_date_sk#6 <= 2447892))) OR ((ss_sold_date_sk#6 >= 2448227) AND (ss_sold_date_sk#6 <= 2448257))) OR ((((ss_sold_date_sk#6 >= 2448592) AND (ss_sold_date_sk#6 <= 2448622)) OR ((ss_sold_date_sk#6 >= 2448958) AND (ss_sold_date_sk#6 <= 2448988))) OR ((ss_sold_date_sk#6 >= 2449323) AND (ss_sold_date_sk#6 <= 2449353)))) OR (((((ss_sold_date_sk#6 >= 2449688) AND (ss_sold_date_sk#6 <= 2449718)) OR ((ss_sold_date_sk#6 >= 2450053) AND (ss_sold_date_sk#6 <= 2450083))) OR ((ss_sold_date_sk#6 >= 2450419) AND (ss_sold_date_sk#6 <= 2450449))) OR ((((ss_sold_date_sk#6 >= 2450784) AND (ss_sold_date_sk#6 <= 2450814)) OR ((ss_sold_date_sk#6 >= 2451149) AND (ss_sold_date_sk#6 <= 2451179))) OR ((ss_sold_date_sk#6 >= 2451514) AND (ss_sold_date_sk#6 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#6 >= 2451880) AND (ss_sold_date_sk#6 <= 2451910)) OR ((ss_sold_date_sk#6 >= 2452245) AND (ss_sold_date_sk#6 <= 2452275))) OR (((ss_sold_date_sk#6 >= 2452610) AND (ss_sold_date_sk#6 <= 2452640)) OR ((ss_sold_date_sk#6 >= 2452975) AND (ss_sold_date_sk#6 <= 2453005)))) OR ((((ss_sold_date_sk#6 >= 2453341) AND (ss_sold_date_sk#6 <= 2453371)) OR ((ss_sold_date_sk#6 >= 2453706) AND (ss_sold_date_sk#6 <= 2453736))) OR ((ss_sold_date_sk#6 >= 2454071) AND (ss_sold_date_sk#6 <= 2454101)))) OR (((((ss_sold_date_sk#6 >= 2454436) AND (ss_sold_date_sk#6 <= 2454466)) OR ((ss_sold_date_sk#6 >= 2454802) AND (ss_sold_date_sk#6 <= 2454832))) OR ((ss_sold_date_sk#6 >= 2455167) AND (ss_sold_date_sk#6 <= 2455197))) OR ((((ss_sold_date_sk#6 >= 2455532) AND (ss_sold_date_sk#6 <= 2455562)) OR ((ss_sold_date_sk#6 >= 2455897) AND (ss_sold_date_sk#6 <= 2455927))) OR ((ss_sold_date_sk#6 >= 2456263) AND (ss_sold_date_sk#6 <= 2456293))))) OR ((((((ss_sold_date_sk#6 >= 2456628) AND (ss_sold_date_sk#6 <= 2456658)) OR ((ss_sold_date_sk#6 >= 2456993) AND (ss_sold_date_sk#6 <= 2457023))) OR ((ss_sold_date_sk#6 >= 2457358) AND (ss_sold_date_sk#6 <= 2457388))) OR ((((ss_sold_date_sk#6 >= 2457724) AND (ss_sold_date_sk#6 <= 2457754)) OR ((ss_sold_date_sk#6 >= 2458089) AND (ss_sold_date_sk#6 <= 2458119))) OR ((ss_sold_date_sk#6 >= 2458454) AND (ss_sold_date_sk#6 <= 2458484)))) OR (((((ss_sold_date_sk#6 >= 2458819) AND (ss_sold_date_sk#6 <= 2458849)) OR ((ss_sold_date_sk#6 >= 2459185) AND (ss_sold_date_sk#6 <= 2459215))) OR ((ss_sold_date_sk#6 >= 2459550) AND (ss_sold_date_sk#6 <= 2459580))) OR ((((ss_sold_date_sk#6 >= 2459915) AND (ss_sold_date_sk#6 <= 2459945)) OR ((ss_sold_date_sk#6 >= 2460280) AND (ss_sold_date_sk#6 <= 2460310))) OR ((ss_sold_date_sk#6 >= 2460646) AND (ss_sold_date_sk#6 <= 2460676)))))) OR (((((((ss_sold_date_sk#6 >= 2461011) AND (ss_sold_date_sk#6 <= 2461041)) OR ((ss_sold_date_sk#6 >= 2461376) AND (ss_sold_date_sk#6 <= 2461406))) OR (((ss_sold_date_sk#6 >= 2461741) AND (ss_sold_date_sk#6 <= 2461771)) OR ((ss_sold_date_sk#6 >= 2462107) AND (ss_sold_date_sk#6 <= 2462137)))) OR ((((ss_sold_date_sk#6 >= 2462472) AND (ss_sold_date_sk#6 <= 2462502)) OR ((ss_sold_date_sk#6 >= 2462837) AND (ss_sold_date_sk#6 <= 2462867))) OR ((ss_sold_date_sk#6 >= 2463202) AND (ss_sold_date_sk#6 <= 2463232)))) OR (((((ss_sold_date_sk#6 >= 2463568) AND (ss_sold_date_sk#6 <= 2463598)) OR ((ss_sold_date_sk#6 >= 2463933) AND (ss_sold_date_sk#6 <= 2463963))) OR ((ss_sold_date_sk#6 >= 2464298) AND (ss_sold_date_sk#6 <= 2464328))) OR ((((ss_sold_date_sk#6 >= 2464663) AND (ss_sold_date_sk#6 <= 2464693)) OR ((ss_sold_date_sk#6 >= 2465029) AND (ss_sold_date_sk#6 <= 2465059))) OR ((ss_sold_date_sk#6 >= 2465394) AND (ss_sold_date_sk#6 <= 2465424))))) OR ((((((ss_sold_date_sk#6 >= 2465759) AND (ss_sold_date_sk#6 <= 2465789)) OR ((ss_sold_date_sk#6 >= 2466124) AND (ss_sold_date_sk#6 <= 2466154))) OR ((ss_sold_date_sk#6 >= 2466490) AND (ss_sold_date_sk#6 <= 2466520))) OR ((((ss_sold_date_sk#6 >= 2466855) AND (ss_sold_date_sk#6 <= 2466885)) OR ((ss_sold_date_sk#6 >= 2467220) AND (ss_sold_date_sk#6 <= 2467250))) OR ((ss_sold_date_sk#6 >= 2467585) AND (ss_sold_date_sk#6 <= 2467615)))) OR (((((ss_sold_date_sk#6 >= 2467951) AND (ss_sold_date_sk#6 <= 2467981)) OR ((ss_sold_date_sk#6 >= 2468316) AND (ss_sold_date_sk#6 <= 2468346))) OR ((ss_sold_date_sk#6 >= 2468681) AND (ss_sold_date_sk#6 <= 2468711))) OR ((((ss_sold_date_sk#6 >= 2469046) AND (ss_sold_date_sk#6 <= 2469076)) OR ((ss_sold_date_sk#6 >= 2469412) AND (ss_sold_date_sk#6 <= 2469442))) OR ((ss_sold_date_sk#6 >= 2469777) AND (ss_sold_date_sk#6 <= 2469807))))))) OR ((((((((ss_sold_date_sk#6 >= 2470142) AND (ss_sold_date_sk#6 <= 2470172)) OR ((ss_sold_date_sk#6 >= 2470507) AND (ss_sold_date_sk#6 <= 2470537))) OR (((ss_sold_date_sk#6 >= 2470873) AND (ss_sold_date_sk#6 <= 2470903)) OR ((ss_sold_date_sk#6 >= 2471238) AND (ss_sold_date_sk#6 <= 2471268)))) OR ((((ss_sold_date_sk#6 >= 2471603) AND (ss_sold_date_sk#6 <= 2471633)) OR ((ss_sold_date_sk#6 >= 2471968) AND (ss_sold_date_sk#6 <= 2471998))) OR ((ss_sold_date_sk#6 >= 2472334) AND (ss_sold_date_sk#6 <= 2472364)))) OR (((((ss_sold_date_sk#6 >= 2472699) AND (ss_sold_date_sk#6 <= 2472729)) OR ((ss_sold_date_sk#6 >= 2473064) AND (ss_sold_date_sk#6 <= 2473094))) OR ((ss_sold_date_sk#6 >= 2473429) AND (ss_sold_date_sk#6 <= 2473459))) OR ((((ss_sold_date_sk#6 >= 2473795) AND (ss_sold_date_sk#6 <= 2473825)) OR ((ss_sold_date_sk#6 >= 2474160) AND (ss_sold_date_sk#6 <= 2474190))) OR ((ss_sold_date_sk#6 >= 2474525) AND (ss_sold_date_sk#6 <= 2474555))))) OR ((((((ss_sold_date_sk#6 >= 2474890) AND (ss_sold_date_sk#6 <= 2474920)) OR ((ss_sold_date_sk#6 >= 2475256) AND (ss_sold_date_sk#6 <= 2475286))) OR ((ss_sold_date_sk#6 >= 2475621) AND (ss_sold_date_sk#6 <= 2475651))) OR ((((ss_sold_date_sk#6 >= 2475986) AND (ss_sold_date_sk#6 <= 2476016)) OR ((ss_sold_date_sk#6 >= 2476351) AND (ss_sold_date_sk#6 <= 2476381))) OR ((ss_sold_date_sk#6 >= 2476717) AND (ss_sold_date_sk#6 <= 2476747)))) OR (((((ss_sold_date_sk#6 >= 2477082) AND (ss_sold_date_sk#6 <= 2477112)) OR ((ss_sold_date_sk#6 >= 2477447) AND (ss_sold_date_sk#6 <= 2477477))) OR ((ss_sold_date_sk#6 >= 2477812) AND (ss_sold_date_sk#6 <= 2477842))) OR ((((ss_sold_date_sk#6 >= 2478178) AND (ss_sold_date_sk#6 <= 2478208)) OR ((ss_sold_date_sk#6 >= 2478543) AND (ss_sold_date_sk#6 <= 2478573))) OR ((ss_sold_date_sk#6 >= 2478908) AND (ss_sold_date_sk#6 <= 2478938)))))) OR (((((((ss_sold_date_sk#6 >= 2479273) AND (ss_sold_date_sk#6 <= 2479303)) OR ((ss_sold_date_sk#6 >= 2479639) AND (ss_sold_date_sk#6 <= 2479669))) OR (((ss_sold_date_sk#6 >= 2480004) AND (ss_sold_date_sk#6 <= 2480034)) OR ((ss_sold_date_sk#6 >= 2480369) AND (ss_sold_date_sk#6 <= 2480399)))) OR ((((ss_sold_date_sk#6 >= 2480734) AND (ss_sold_date_sk#6 <= 2480764)) OR ((ss_sold_date_sk#6 >= 2481100) AND (ss_sold_date_sk#6 <= 2481130))) OR ((ss_sold_date_sk#6 >= 2481465) AND (ss_sold_date_sk#6 <= 2481495)))) OR (((((ss_sold_date_sk#6 >= 2481830) AND (ss_sold_date_sk#6 <= 2481860)) OR ((ss_sold_date_sk#6 >= 2482195) AND (ss_sold_date_sk#6 <= 2482225))) OR ((ss_sold_date_sk#6 >= 2482561) AND (ss_sold_date_sk#6 <= 2482591))) OR ((((ss_sold_date_sk#6 >= 2482926) AND (ss_sold_date_sk#6 <= 2482956)) OR ((ss_sold_date_sk#6 >= 2483291) AND (ss_sold_date_sk#6 <= 2483321))) OR ((ss_sold_date_sk#6 >= 2483656) AND (ss_sold_date_sk#6 <= 2483686))))) OR ((((((ss_sold_date_sk#6 >= 2484022) AND (ss_sold_date_sk#6 <= 2484052)) OR ((ss_sold_date_sk#6 >= 2484387) AND (ss_sold_date_sk#6 <= 2484417))) OR ((ss_sold_date_sk#6 >= 2484752) AND (ss_sold_date_sk#6 <= 2484782))) OR ((((ss_sold_date_sk#6 >= 2485117) AND (ss_sold_date_sk#6 <= 2485147)) OR ((ss_sold_date_sk#6 >= 2485483) AND (ss_sold_date_sk#6 <= 2485513))) OR ((ss_sold_date_sk#6 >= 2485848) AND (ss_sold_date_sk#6 <= 2485878)))) OR (((((ss_sold_date_sk#6 >= 2486213) AND (ss_sold_date_sk#6 <= 2486243)) OR ((ss_sold_date_sk#6 >= 2486578) AND (ss_sold_date_sk#6 <= 2486608))) OR ((ss_sold_date_sk#6 >= 2486944) AND (ss_sold_date_sk#6 <= 2486974))) OR ((((ss_sold_date_sk#6 >= 2487309) AND (ss_sold_date_sk#6 <= 2487339)) OR ((ss_sold_date_sk#6 >= 2487674) AND (ss_sold_date_sk#6 <= 2487704))) OR ((ss_sold_date_sk#6 >= 2488039) AND (ss_sold_date_sk#6 <= 2488069))))))))) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [4]: [ss_sold_date_sk#1, ss_net_profit#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3, i_item_sk#4, i_brand_id#5, i_brand#6] +Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_net_profit#8] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_net_profit#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_net_profit#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_net_profit#8, i_brand_id#2, i_brand#3] +Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_net_profit#8, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_net_profit#3, i_brand_id#5, i_brand#6] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] +Input [4]: [d_year#10, ss_net_profit#8, i_brand_id#2, i_brand#3] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#8))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#16] -Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#16,17,2) AS sum_agg#19] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [sum(UnscaledValue(ss_net_profit#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#8))#16] +Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#16,17,2) AS sum_agg#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, sum_agg#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt index 6ab00e122c5c5..1412978aac023 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_net_profit] [sum,sum] Project [d_year,ss_net_profit,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_net_profit,i_brand_id,i_brand] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_net_profit] + Project [i_brand_id,i_brand,ss_sold_date_sk,ss_net_profit] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_net_profit] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt index ac1fca4f67a02..1672f33d47adb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450816), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] - -(3) Filter [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2450816)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_dom#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -Condition : (((((((d_dom#8 >= 1) AND (d_dom#8 <= 3)) OR ((d_dom#8 >= 25) AND (d_dom#8 <= 28))) AND d_year#7 IN (1998,1999,2000)) AND (d_date_sk#6 >= 2450816)) AND (d_date_sk#6 <= 2451910)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +Condition : (((((((d_dom#3 >= 1) AND (d_dom#3 <= 3)) OR ((d_dom#3 >= 25) AND (d_dom#3 <= 28))) AND d_year#2 IN (1998,1999,2000)) AND (d_date_sk#1 >= 2450816)) AND (d_date_sk#1 <= 2451910)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450816), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) Filter +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Condition : (((((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2450816)) AND (ss_sold_date_sk#5 <= 2451910)) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] +Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#8] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] -Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] +Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] +Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] +Left keys [1]: [ss_hdemo_sk#7] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#2, ss_ticket_number#5] -Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] +Output [2]: [ss_customer_sk#6, ss_ticket_number#9] +Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#2, ss_ticket_number#5] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [2]: [ss_customer_sk#6, ss_ticket_number#9] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] (26) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] Condition : ((cnt#22 >= 15) AND (cnt#22 <= 20)) (29) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#6] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] -Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt index d9b416ddba9ef..ba415dbb4e9a4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt @@ -22,11 +22,7 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt index 10f7d4b9d3b4b..da9a33f01e806 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451149)) AND (ss_sold_date_sk#1 <= 2451179)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [2]: [d_date_sk#1, d_year#2] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 12)) AND (d_year#5 = 1998)) AND (d_date_sk#4 >= 2451149)) AND (d_date_sk#4 <= 2451179)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_year#5] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(8) Filter -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2451149)) AND (ss_sold_date_sk#5 <= 2451179)) AND isnotnull(ss_item_sk#6)) +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_year#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [3]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7] -Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Output [3]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] @@ -90,33 +90,33 @@ Input [3]: [i_item_sk#8, i_category_id#9, i_category#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#6] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#2, ss_ext_sales_price#7, i_category_id#9, i_category#10] -Input [6]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_category_id#9, i_category#10] +Output [4]: [d_year#5, ss_ext_sales_price#3, i_category_id#9, i_category#10] +Input [6]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5, i_item_sk#8, i_category_id#9, i_category#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#2, ss_ext_sales_price#7, i_category_id#9, i_category#10] -Keys [3]: [d_year#2, i_category_id#9, i_category#10] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Input [4]: [d_year#5, ss_ext_sales_price#3, i_category_id#9, i_category#10] +Keys [3]: [d_year#5, i_category_id#9, i_category#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Results [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] (19) Exchange -Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] -Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), true, [id=#15] +Input [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] +Arguments: hashpartitioning(d_year#5, i_category_id#9, i_category#10, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] -Keys [3]: [d_year#2, i_category_id#9, i_category#10] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] -Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS sum(ss_ext_sales_price)#17] +Input [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] +Keys [3]: [d_year#5, i_category_id#9, i_category#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [4]: [d_year#5, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum(ss_ext_sales_price)#17] (21) TakeOrderedAndProject -Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] -Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Input [4]: [d_year#5, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#5 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#5, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt index 96e2f0b12cfb1..f010e3f1ac2d5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_category_id,i_category] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [d_year,ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_item_sk,ss_ext_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt index 7e82e34c4c637..ed9f51c2db1e9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt @@ -6,276 +6,276 @@ TakeOrderedAndProject (51) : +- Exchange (45) : +- * Project (44) : +- * SortMergeJoin Inner (43) - : :- * Sort (37) - : : +- Exchange (36) - : : +- * HashAggregate (35) - : : +- * HashAggregate (34) - : : +- * Project (33) - : : +- * SortMergeJoin Inner (32) - : : :- * Sort (26) - : : : +- Exchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Project (17) - : : : : +- * BroadcastHashJoin Inner BuildRight (16) - : : : : :- * Project (10) - : : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : : :- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.store_sales (1) - : : : : : +- BroadcastExchange (8) - : : : : : +- * Project (7) - : : : : : +- * Filter (6) - : : : : : +- * ColumnarToRow (5) - : : : : : +- Scan parquet default.date_dim (4) - : : : : +- BroadcastExchange (15) - : : : : +- * Project (14) - : : : : +- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store (11) - : : : +- BroadcastExchange (22) - : : : +- * Project (21) - : : : +- * Filter (20) - : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.household_demographics (18) - : : +- * Sort (31) - : : +- Exchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.customer_address (27) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer (1) : +- * Sort (42) : +- Exchange (41) - : +- * Filter (40) - : +- * ColumnarToRow (39) - : +- Scan parquet default.customer (38) + : +- * HashAggregate (40) + : +- * HashAggregate (39) + : +- * Project (38) + : +- * SortMergeJoin Inner (37) + : :- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildLeft (14) + : : : : :- BroadcastExchange (10) + : : : : : +- * Project (9) + : : : : : +- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.date_dim (6) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store_sales (11) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.store (16) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * Filter (25) + : : +- * ColumnarToRow (24) + : : +- Scan parquet default.household_demographics (23) + : +- * Sort (36) + : +- Exchange (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.customer_address (32) +- * Sort (48) +- ReusedExchange (47) -(1) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [In(ss_sold_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -(3) Filter [codegen id : 4] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Condition : (((((ss_sold_date_sk#1 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_addr_sk#4)) AND isnotnull(ss_customer_sk#2)) +(3) Filter [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#10, d_dow#11] +(4) Exchange +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#5] + +(5) Sort [codegen id : 2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_dow#8] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#6, d_year#7, d_dow#8] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -Condition : (((d_dow#11 IN (6,0) AND d_year#10 IN (1999,2000,2001)) AND d_date_sk#9 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#9)) +(8) Filter [codegen id : 3] +Input [3]: [d_date_sk#6, d_year#7, d_dow#8] +Condition : (((d_dow#8 IN (6,0) AND d_year#7 IN (1999,2000,2001)) AND d_date_sk#6 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#6)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +(9) Project [codegen id : 3] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_dow#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(10) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] -(9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +(11) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [In(ss_sold_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(12) ColumnarToRow +Input [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] + +(13) Filter +Input [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Condition : (((((ss_sold_date_sk#10 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028) AND isnotnull(ss_sold_date_sk#10)) AND isnotnull(ss_store_sk#14)) AND isnotnull(ss_hdemo_sk#12)) AND isnotnull(ss_addr_sk#13)) AND isnotnull(ss_customer_sk#11)) + +(14) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [d_date_sk#6] +Right keys [1]: [ss_sold_date_sk#10] Join condition: None -(10) Project [codegen id : 4] -Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, d_date_sk#9] +(15) Project [codegen id : 6] +Output [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Input [9]: [d_date_sk#6, ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -(11) Scan parquet default.store -Output [2]: [s_store_sk#13, s_city#14] +(16) Scan parquet default.store +Output [2]: [s_store_sk#18, s_city#19] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [In(s_city, [Midway,Concord,Spring Hill,Brownsville,Greenville]), IsNotNull(s_store_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 2] -Input [2]: [s_store_sk#13, s_city#14] +(17) ColumnarToRow [codegen id : 4] +Input [2]: [s_store_sk#18, s_city#19] -(13) Filter [codegen id : 2] -Input [2]: [s_store_sk#13, s_city#14] -Condition : (s_city#14 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#13)) +(18) Filter [codegen id : 4] +Input [2]: [s_store_sk#18, s_city#19] +Condition : (s_city#19 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#18)) -(14) Project [codegen id : 2] -Output [1]: [s_store_sk#13] -Input [2]: [s_store_sk#13, s_city#14] +(19) Project [codegen id : 4] +Output [1]: [s_store_sk#18] +Input [2]: [s_store_sk#18, s_city#19] -(15) BroadcastExchange -Input [1]: [s_store_sk#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(20) BroadcastExchange +Input [1]: [s_store_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] -(16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#5] -Right keys [1]: [s_store_sk#13] +(21) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#14] +Right keys [1]: [s_store_sk#18] Join condition: None -(17) Project [codegen id : 4] -Output [6]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#13] +(22) Project [codegen id : 6] +Output [6]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Input [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, s_store_sk#18] -(18) Scan parquet default.household_demographics -Output [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] +(23) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] Batched: true Location [not included in comparison]/{warehouse_dir}/household_demographics] PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 3] -Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] +(24) ColumnarToRow [codegen id : 5] +Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] -(20) Filter [codegen id : 3] -Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] -Condition : (((hd_dep_count#17 = 5) OR (hd_vehicle_count#18 = 3)) AND isnotnull(hd_demo_sk#16)) +(25) Filter [codegen id : 5] +Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] +Condition : (((hd_dep_count#22 = 5) OR (hd_vehicle_count#23 = 3)) AND isnotnull(hd_demo_sk#21)) -(21) Project [codegen id : 3] -Output [1]: [hd_demo_sk#16] -Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] +(26) Project [codegen id : 5] +Output [1]: [hd_demo_sk#21] +Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] -(22) BroadcastExchange -Input [1]: [hd_demo_sk#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] +(27) BroadcastExchange +Input [1]: [hd_demo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] -(23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] -Right keys [1]: [hd_demo_sk#16] +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_hdemo_sk#12] +Right keys [1]: [hd_demo_sk#21] Join condition: None -(24) Project [codegen id : 4] -Output [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, hd_demo_sk#16] +(29) Project [codegen id : 6] +Output [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Input [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, hd_demo_sk#21] -(25) Exchange -Input [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Arguments: hashpartitioning(ss_addr_sk#4, 5), true, [id=#20] +(30) Exchange +Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#25] -(26) Sort [codegen id : 5] -Input [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Arguments: [ss_addr_sk#4 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 7] +Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 -(27) Scan parquet default.customer_address -Output [2]: [ca_address_sk#21, ca_city#22] +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#26, ca_city#27] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 6] -Input [2]: [ca_address_sk#21, ca_city#22] +(33) ColumnarToRow [codegen id : 8] +Input [2]: [ca_address_sk#26, ca_city#27] -(29) Filter [codegen id : 6] -Input [2]: [ca_address_sk#21, ca_city#22] -Condition : (isnotnull(ca_address_sk#21) AND isnotnull(ca_city#22)) +(34) Filter [codegen id : 8] +Input [2]: [ca_address_sk#26, ca_city#27] +Condition : (isnotnull(ca_address_sk#26) AND isnotnull(ca_city#27)) -(30) Exchange -Input [2]: [ca_address_sk#21, ca_city#22] -Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] +(35) Exchange +Input [2]: [ca_address_sk#26, ca_city#27] +Arguments: hashpartitioning(ca_address_sk#26, 5), true, [id=#28] -(31) Sort [codegen id : 7] -Input [2]: [ca_address_sk#21, ca_city#22] -Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 +(36) Sort [codegen id : 9] +Input [2]: [ca_address_sk#26, ca_city#27] +Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 -(32) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_addr_sk#4] -Right keys [1]: [ca_address_sk#21] +(37) SortMergeJoin [codegen id : 10] +Left keys [1]: [ss_addr_sk#13] +Right keys [1]: [ca_address_sk#26] Join condition: None -(33) Project [codegen id : 8] -Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_city#22] -Input [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_address_sk#21, ca_city#22] - -(34) HashAggregate [codegen id : 8] -Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_city#22] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22] -Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#7)), partial_sum(UnscaledValue(ss_net_profit#8))] -Aggregate Attributes [2]: [sum#24, sum#25] -Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22, sum#26, sum#27] - -(35) HashAggregate [codegen id : 8] -Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22, sum#26, sum#27] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22] -Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#28, sum(UnscaledValue(ss_net_profit#8))#29] -Results [5]: [ss_ticket_number#6, ss_customer_sk#2, ca_city#22 AS bought_city#30, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#28,17,2) AS amt#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#29,17,2) AS profit#32] - -(36) Exchange -Input [5]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#33] - -(37) Sort [codegen id : 9] -Input [5]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 - -(38) Scan parquet default.customer -Output [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +(38) Project [codegen id : 10] +Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#27] +Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#26, ca_city#27] -(39) ColumnarToRow [codegen id : 10] -Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +(39) HashAggregate [codegen id : 10] +Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#27] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#16)), partial_sum(UnscaledValue(ss_net_profit#17))] +Aggregate Attributes [2]: [sum#29, sum#30] +Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27, sum#31, sum#32] -(40) Filter [codegen id : 10] -Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Condition : (isnotnull(c_customer_sk#34) AND isnotnull(c_current_addr_sk#35)) +(40) HashAggregate [codegen id : 10] +Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27, sum#31, sum#32] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#16)), sum(UnscaledValue(ss_net_profit#17))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#16))#33, sum(UnscaledValue(ss_net_profit#17))#34] +Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#27 AS bought_city#35, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#33,17,2) AS amt#36, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#34,17,2) AS profit#37] (41) Exchange -Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Arguments: hashpartitioning(c_customer_sk#34, 5), true, [id=#38] +Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] +Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#38] (42) Sort [codegen id : 11] -Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Arguments: [c_customer_sk#34 ASC NULLS FIRST], false, 0 +Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] +Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_customer_sk#2] -Right keys [1]: [c_customer_sk#34] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#11] Join condition: None (44) Project [codegen id : 12] -Output [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Input [9]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32, c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Output [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] +Input [9]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] (45) Exchange -Input [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Arguments: hashpartitioning(c_current_addr_sk#35, 5), true, [id=#39] +Input [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#39] (46) Sort [codegen id : 13] -Input [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -Arguments: [c_current_addr_sk#35 ASC NULLS FIRST], false, 0 +Input [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 -(47) ReusedExchange [Reuses operator id: 30] -Output [2]: [ca_address_sk#21, ca_city#22] +(47) ReusedExchange [Reuses operator id: 35] +Output [2]: [ca_address_sk#26, ca_city#27] (48) Sort [codegen id : 15] -Input [2]: [ca_address_sk#21, ca_city#22] -Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#26, ca_city#27] +Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#35] -Right keys [1]: [ca_address_sk#21] -Join condition: NOT (ca_city#22 = bought_city#30) +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#26] +Join condition: NOT (ca_city#27 = bought_city#35) (50) Project [codegen id : 16] -Output [7]: [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] -Input [9]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37, ca_address_sk#21, ca_city#22] +Output [7]: [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] +Input [9]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37, ca_address_sk#26, ca_city#27] (51) TakeOrderedAndProject -Input [7]: [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] -Arguments: 100, [c_last_name#37 ASC NULLS FIRST, c_first_name#36 ASC NULLS FIRST, ca_city#22 ASC NULLS FIRST, bought_city#30 ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST], [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] +Input [7]: [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, c_first_name#3 ASC NULLS FIRST, ca_city#27 ASC NULLS FIRST, bought_city#35 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt index bc83e3b7e2eba..3bb84cbbada01 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt @@ -8,80 +8,80 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu InputAdapter Exchange [c_current_addr_sk] #1 WholeStageCodegen (12) - Project [ss_ticket_number,bought_city,amt,profit,c_current_addr_sk,c_first_name,c_last_name] - SortMergeJoin [ss_customer_sk,c_customer_sk] + Project [c_current_addr_sk,c_first_name,c_last_name,ss_ticket_number,bought_city,amt,profit] + SortMergeJoin [c_customer_sk,ss_customer_sk] InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #2 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (11) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #2 - WholeStageCodegen (8) + Exchange [ss_customer_sk] #3 + WholeStageCodegen (10) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] SortMergeJoin [ss_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (7) Sort [ss_addr_sk] InputAdapter - Exchange [ss_addr_sk] #3 - WholeStageCodegen (4) + Exchange [ss_addr_sk] #4 + WholeStageCodegen (6) Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_dow,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (2) + BroadcastExchange #6 + WholeStageCodegen (4) Project [s_store_sk] Filter [s_city,s_store_sk] ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_city] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (3) + BroadcastExchange #7 + WholeStageCodegen (5) Project [hd_demo_sk] Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] ColumnarToRow InputAdapter Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (9) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #7 - WholeStageCodegen (6) + Exchange [ca_address_sk] #8 + WholeStageCodegen (8) Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_city] - InputAdapter - WholeStageCodegen (11) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #8 - WholeStageCodegen (10) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (15) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #7 + ReusedExchange [ca_address_sk,ca_city] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt index aa33cd1be7482..69b361736c334 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451149)) AND (ss_sold_date_sk#1 <= 2451179)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [2]: [d_date_sk#1, d_year#2] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 12)) AND (d_year#5 = 1998)) AND (d_date_sk#4 >= 2451149)) AND (d_date_sk#4 <= 2451179)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_year#5] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(8) Filter -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2451149)) AND (ss_sold_date_sk#5 <= 2451179)) AND isnotnull(ss_item_sk#6)) +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_year#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [3]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7] -Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Output [3]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] @@ -90,33 +90,33 @@ Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#6] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#2, ss_ext_sales_price#7, i_brand_id#9, i_brand#10] -Input [6]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_brand_id#9, i_brand#10] +Output [4]: [d_year#5, ss_ext_sales_price#3, i_brand_id#9, i_brand#10] +Input [6]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5, i_item_sk#8, i_brand_id#9, i_brand#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#2, ss_ext_sales_price#7, i_brand_id#9, i_brand#10] -Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Input [4]: [d_year#5, ss_ext_sales_price#3, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#5, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Results [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] (19) Exchange -Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] -Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), true, [id=#15] +Input [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#5, i_brand#10, i_brand_id#9, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] -Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] -Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS ext_price#19] +Input [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#5, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [4]: [d_year#5, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject -Input [4]: [d_year#2, brand_id#17, brand#18, ext_price#19] -Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, ext_price#19] +Input [4]: [d_year#5, brand_id#17, brand#18, ext_price#19] +Arguments: 100, [d_year#5 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#5, brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt index f4aaf3df75135..b39ff773cb600 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [d_year,ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_item_sk,ss_ext_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt index 6d9a28f187916..d1438c53682b9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2001), GreaterThanOrEqual(d_date_sk,2452215), LessThanOrEqual(d_date_sk,2452244), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452215), LessThanOrEqual(ss_sold_date_sk,2452244), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2001)) AND (d_date_sk#1 >= 2452215)) AND (d_date_sk#1 <= 2452244)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2452215)) AND (ss_sold_date_sk#1 <= 2452244)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2001), GreaterThanOrEqual(d_date_sk,2452215), LessThanOrEqual(d_date_sk,2452244), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452215), LessThanOrEqual(ss_sold_date_sk,2452244), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 11)) AND (d_year#5 = 2001)) AND (d_date_sk#4 >= 2452215)) AND (d_date_sk#4 <= 2452244)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -(8) Filter -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2452215)) AND (ss_sold_date_sk#5 <= 2452244)) AND isnotnull(ss_item_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [2]: [ss_item_sk#6, ss_ext_sales_price#7] -Input [4]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] @@ -90,18 +90,18 @@ Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#6] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#7, i_brand_id#9, i_brand#10] -Input [5]: [ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_brand_id#9, i_brand#10] +Output [3]: [ss_ext_sales_price#3, i_brand_id#9, i_brand#10] +Input [5]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_brand_id#9, i_brand#10] (18) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#7, i_brand_id#9, i_brand#10] +Input [3]: [ss_ext_sales_price#3, i_brand_id#9, i_brand#10] Keys [2]: [i_brand#10, i_brand_id#9] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] Results [3]: [i_brand#10, i_brand_id#9, sum#14] @@ -112,9 +112,9 @@ Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] Input [3]: [i_brand#10, i_brand_id#9, sum#14] Keys [2]: [i_brand#10, i_brand_id#9] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] -Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS ext_price#19] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [3]: [brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt index 4f375c80678e8..8e1c7d56dc223 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt @@ -8,7 +8,11 @@ TakeOrderedAndProject [ext_price,brand_id,brand] Project [ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt index 5c4a69d38637d..25c306bc1ec64 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.store_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.item -Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452123), LessThanOrEqual(ss_sold_date_sk,2452487), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -(3) Filter [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,reference,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +Condition : ((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2452123)) AND (ss_sold_date_sk#1 <= 2452487)) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_store_sk#3)) -(4) Project [codegen id : 1] -Output [2]: [i_item_sk#1, i_manager_id#5] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(4) Scan parquet default.item +Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [i_item_sk#1, i_manager_id#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(5) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452123), LessThanOrEqual(ss_sold_date_sk,2452487), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,reference,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) -(7) ColumnarToRow -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +(7) Project [codegen id : 1] +Output [2]: [i_item_sk#5, i_manager_id#9] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -(8) Filter -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Condition : ((((isnotnull(ss_sold_date_sk#11) AND (ss_sold_date_sk#11 >= 2452123)) AND (ss_sold_date_sk#11 <= 2452487)) AND isnotnull(ss_item_sk#12)) AND isnotnull(ss_store_sk#13)) +(8) BroadcastExchange +Input [2]: [i_item_sk#5, i_manager_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#12] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] -Input [6]: [i_item_sk#1, i_manager_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manager_id#9] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#13] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14] -Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] +Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9] +Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_moy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_moy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#11] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] -Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_moy#19] +Output [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] +Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9, d_date_sk#17, d_moy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] -Keys [2]: [i_manager_id#5, d_moy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] +Input [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] +Keys [2]: [i_manager_id#9, d_moy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manager_id#5, d_moy#19, sum#22] +Results [3]: [i_manager_id#9, d_moy#19, sum#22] (25) Exchange -Input [3]: [i_manager_id#5, d_moy#19, sum#22] -Arguments: hashpartitioning(i_manager_id#5, d_moy#19, 5), true, [id=#23] +Input [3]: [i_manager_id#9, d_moy#19, sum#22] +Arguments: hashpartitioning(i_manager_id#9, d_moy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manager_id#5, d_moy#19, sum#22] -Keys [2]: [i_manager_id#5, d_moy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] -Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] +Input [3]: [i_manager_id#9, d_moy#19, sum#22] +Keys [2]: [i_manager_id#9, d_moy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] +Results [3]: [i_manager_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manager_id#5, 5), true, [id=#27] +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manager_id#9, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: [i_manager_id#9 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#5] +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#9] (30) Filter [codegen id : 7] -Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] +Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] Condition : (CASE WHEN (avg_monthly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] -Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] +Output [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] -Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Input [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Arguments: 100, [i_manager_id#9 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt index 3570e17b2f176..659a892c7ff2e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt @@ -16,10 +16,14 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] Project [i_manager_id,ss_sales_price,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_manager_id,ss_sold_date_sk,ss_sales_price] + Project [ss_sold_date_sk,ss_sales_price,i_manager_id] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [i_manager_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,10 +32,6 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] - Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt index 6601207c6587b..8589ca31275ea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt @@ -7,34 +7,34 @@ TakeOrderedAndProject (42) : +- * BroadcastHashJoin Inner BuildLeft (34) : :- BroadcastExchange (30) : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- BroadcastExchange (27) + : : +- * BroadcastHashJoin Inner BuildLeft (28) + : : :- BroadcastExchange (17) + : : : +- * HashAggregate (16) + : : : +- Exchange (15) + : : : +- * HashAggregate (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Filter (27) : : +- * HashAggregate (26) : : +- Exchange (25) : : +- * HashAggregate (24) - : : +- * HashAggregate (23) - : : +- Exchange (22) - : : +- * HashAggregate (21) - : : +- * Project (20) - : : +- * BroadcastHashJoin Inner BuildRight (19) - : : :- * Filter (17) - : : : +- * ColumnarToRow (16) - : : : +- Scan parquet default.store_sales (15) - : : +- ReusedExchange (18) + : : +- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.store_sales (18) + : : +- ReusedExchange (21) : +- * Filter (33) : +- * ColumnarToRow (32) : +- Scan parquet default.store (31) @@ -47,7 +47,7 @@ TakeOrderedAndProject (42) Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 2] @@ -55,7 +55,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] (3) Filter [codegen id : 2] Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2452275)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) +Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2452275)) AND isnotnull(ss_store_sk#3)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#5, d_month_seq#6] @@ -99,94 +99,94 @@ Results [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Arguments: hashpartitioning(ss_store_sk#3, ss_item_sk#2, 5), true, [id=#10] -(13) HashAggregate [codegen id : 7] +(13) HashAggregate [codegen id : 3] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Keys [2]: [ss_store_sk#3, ss_item_sk#2] Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#11] -Results [3]: [ss_store_sk#3, ss_item_sk#2, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] - -(14) Filter [codegen id : 7] -Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] -Condition : isnotnull(revenue#12) - -(15) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Results [2]: [ss_store_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] + +(14) HashAggregate [codegen id : 3] +Input [2]: [ss_store_sk#3, revenue#12] +Keys [1]: [ss_store_sk#3] +Functions [1]: [partial_avg(revenue#12)] +Aggregate Attributes [2]: [sum#13, count#14] +Results [3]: [ss_store_sk#3, sum#15, count#16] + +(15) Exchange +Input [3]: [ss_store_sk#3, sum#15, count#16] +Arguments: hashpartitioning(ss_store_sk#3, 5), true, [id=#17] + +(16) HashAggregate [codegen id : 4] +Input [3]: [ss_store_sk#3, sum#15, count#16] +Keys [1]: [ss_store_sk#3] +Functions [1]: [avg(revenue#12)] +Aggregate Attributes [1]: [avg(revenue#12)#18] +Results [2]: [ss_store_sk#3, avg(revenue#12)#18 AS ave#19] + +(17) BroadcastExchange +Input [2]: [ss_store_sk#3, ave#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(18) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(16) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +(19) ColumnarToRow [codegen id : 6] +Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -(17) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Condition : (((isnotnull(ss_sold_date_sk#13) AND (ss_sold_date_sk#13 >= 2451911)) AND (ss_sold_date_sk#13 <= 2452275)) AND isnotnull(ss_store_sk#15)) +(20) Filter [codegen id : 6] +Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Condition : ((((isnotnull(ss_sold_date_sk#21) AND (ss_sold_date_sk#21 >= 2451911)) AND (ss_sold_date_sk#21 <= 2452275)) AND isnotnull(ss_store_sk#23)) AND isnotnull(ss_item_sk#22)) -(18) ReusedExchange [Reuses operator id: 8] +(21) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#5] -(19) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#13] +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#21] Right keys [1]: [d_date_sk#5] Join condition: None -(20) Project [codegen id : 4] -Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Input [5]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, d_date_sk#5] - -(21) HashAggregate [codegen id : 4] -Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Keys [2]: [ss_store_sk#15, ss_item_sk#14] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] -Aggregate Attributes [1]: [sum#17] -Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] - -(22) Exchange -Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] -Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), true, [id=#19] - -(23) HashAggregate [codegen id : 5] -Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] -Keys [2]: [ss_store_sk#15, ss_item_sk#14] -Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#20] -Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#20,17,2) AS revenue#21] - -(24) HashAggregate [codegen id : 5] -Input [2]: [ss_store_sk#15, revenue#21] -Keys [1]: [ss_store_sk#15] -Functions [1]: [partial_avg(revenue#21)] -Aggregate Attributes [2]: [sum#22, count#23] -Results [3]: [ss_store_sk#15, sum#24, count#25] +(23) Project [codegen id : 6] +Output [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Input [5]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24, d_date_sk#5] + +(24) HashAggregate [codegen id : 6] +Input [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Keys [2]: [ss_store_sk#23, ss_item_sk#22] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#24))] +Aggregate Attributes [1]: [sum#25] +Results [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] (25) Exchange -Input [3]: [ss_store_sk#15, sum#24, count#25] -Arguments: hashpartitioning(ss_store_sk#15, 5), true, [id=#26] +Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +Arguments: hashpartitioning(ss_store_sk#23, ss_item_sk#22, 5), true, [id=#27] -(26) HashAggregate [codegen id : 6] -Input [3]: [ss_store_sk#15, sum#24, count#25] -Keys [1]: [ss_store_sk#15] -Functions [1]: [avg(revenue#21)] -Aggregate Attributes [1]: [avg(revenue#21)#27] -Results [2]: [ss_store_sk#15, avg(revenue#21)#27 AS ave#28] +(26) HashAggregate +Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +Keys [2]: [ss_store_sk#23, ss_item_sk#22] +Functions [1]: [sum(UnscaledValue(ss_sales_price#24))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#24))#28] +Results [3]: [ss_store_sk#23, ss_item_sk#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#24))#28,17,2) AS revenue#29] -(27) BroadcastExchange -Input [2]: [ss_store_sk#15, ave#28] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +(27) Filter +Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] +Condition : isnotnull(revenue#29) (28) BroadcastHashJoin [codegen id : 7] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [ss_store_sk#15] -Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true)) +Right keys [1]: [ss_store_sk#23] +Join condition: (cast(revenue#29 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#19)), DecimalType(23,7), true)) (29) Project [codegen id : 7] -Output [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] -Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, ss_store_sk#15, ave#28] +Output [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] +Input [5]: [ss_store_sk#3, ave#19, ss_store_sk#23, ss_item_sk#22, revenue#29] (30) BroadcastExchange -Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] +Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] (31) Scan parquet default.store @@ -204,16 +204,16 @@ Input [2]: [s_store_sk#31, s_store_name#32] Condition : isnotnull(s_store_sk#31) (34) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#23] Right keys [1]: [s_store_sk#31] Join condition: None (35) Project [codegen id : 8] -Output [3]: [ss_item_sk#2, revenue#12, s_store_name#32] -Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, s_store_sk#31, s_store_name#32] +Output [3]: [ss_item_sk#22, revenue#29, s_store_name#32] +Input [5]: [ss_store_sk#23, ss_item_sk#22, revenue#29, s_store_sk#31, s_store_name#32] (36) BroadcastExchange -Input [3]: [ss_item_sk#2, revenue#12, s_store_name#32] +Input [3]: [ss_item_sk#22, revenue#29, s_store_name#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33] (37) Scan parquet default.item @@ -231,15 +231,15 @@ Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#3 Condition : isnotnull(i_item_sk#34) (40) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#22] Right keys [1]: [i_item_sk#34] Join condition: None (41) Project [codegen id : 9] -Output [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Input [8]: [ss_item_sk#2, revenue#12, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Output [6]: [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [8]: [ss_item_sk#22, revenue#29, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] (42) TakeOrderedAndProject -Input [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [6]: [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt index 21aa4974877f6..0ab5c13022fea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt @@ -12,38 +12,18 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes WholeStageCodegen (7) Project [ss_store_sk,ss_item_sk,revenue] BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] - Filter [revenue] - HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] - InputAdapter - Exchange [ss_store_sk,ss_item_sk] #3 - WholeStageCodegen (2) - HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] - Project [ss_item_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (6) + BroadcastExchange #3 + WholeStageCodegen (4) HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] InputAdapter - Exchange [ss_store_sk] #6 - WholeStageCodegen (5) + Exchange [ss_store_sk] #4 + WholeStageCodegen (3) HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] InputAdapter - Exchange [ss_store_sk,ss_item_sk] #7 - WholeStageCodegen (4) + Exchange [ss_store_sk,ss_item_sk] #5 + WholeStageCodegen (2) HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] Project [ss_item_sk,ss_store_sk,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -52,7 +32,27 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter - ReusedExchange [d_date_sk] #4 + BroadcastExchange #6 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #7 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #6 Filter [s_store_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt index 52641b6986146..4d5b12418398f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt @@ -6,46 +6,46 @@ TakeOrderedAndProject (52) : +- Exchange (43) : +- * Project (42) : +- * SortMergeJoin Inner (41) - : :- * Sort (35) - : : +- Exchange (34) - : : +- * HashAggregate (33) - : : +- Exchange (32) - : : +- * HashAggregate (31) - : : +- * Project (30) - : : +- * BroadcastHashJoin Inner BuildLeft (29) - : : :- BroadcastExchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Project (17) - : : : : +- * BroadcastHashJoin Inner BuildRight (16) - : : : : :- * Project (10) - : : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : : :- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.store_sales (1) - : : : : : +- BroadcastExchange (8) - : : : : : +- * Project (7) - : : : : : +- * Filter (6) - : : : : : +- * ColumnarToRow (5) - : : : : : +- Scan parquet default.date_dim (4) - : : : : +- BroadcastExchange (15) - : : : : +- * Project (14) - : : : : +- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store (11) - : : : +- BroadcastExchange (22) - : : : +- * Project (21) - : : : +- * Filter (20) - : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.household_demographics (18) - : : +- * Filter (28) - : : +- * ColumnarToRow (27) - : : +- Scan parquet default.customer_address (26) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer (1) : +- * Sort (40) : +- Exchange (39) - : +- * Filter (38) - : +- * ColumnarToRow (37) - : +- Scan parquet default.customer (36) + : +- * HashAggregate (38) + : +- Exchange (37) + : +- * HashAggregate (36) + : +- * Project (35) + : +- * BroadcastHashJoin Inner BuildLeft (34) + : :- BroadcastExchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.store (16) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * Filter (25) + : : +- * ColumnarToRow (24) + : : +- Scan parquet default.household_demographics (23) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.customer_address (31) +- * Sort (49) +- Exchange (48) +- * Filter (47) @@ -53,237 +53,237 @@ TakeOrderedAndProject (52) +- Scan parquet default.customer_address (45) -(1) Scan parquet default.store_sales -Output [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] + +(3) Filter [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) + +(4) Exchange +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#5] + +(5) Sort [codegen id : 2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [In(ss_sold_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +(7) ColumnarToRow [codegen id : 6] +Input [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -(3) Filter [codegen id : 4] -Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -Condition : (((((ss_sold_date_sk#1 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_addr_sk#4)) AND isnotnull(ss_customer_sk#2)) +(8) Filter [codegen id : 6] +Input [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +Condition : (((((ss_sold_date_sk#6 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_hdemo_sk#8)) AND isnotnull(ss_addr_sk#9)) AND isnotnull(ss_customer_sk#7)) -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#10, d_year#11, d_dom#12] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#15, d_year#16, d_dom#17] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#15, d_year#16, d_dom#17] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] -Condition : (((((isnotnull(d_dom#12) AND (d_dom#12 >= 1)) AND (d_dom#12 <= 2)) AND d_year#11 IN (1999,2000,2001)) AND d_date_sk#10 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#10)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#15, d_year#16, d_dom#17] +Condition : (((((isnotnull(d_dom#17) AND (d_dom#17 >= 1)) AND (d_dom#17 <= 2)) AND d_year#16 IN (1999,2000,2001)) AND d_date_sk#15 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#15)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#10] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#15] +Input [3]: [d_date_sk#15, d_year#16, d_dom#17] -(8) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(13) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] -(9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +(14) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#15] Join condition: None -(10) Project [codegen id : 4] -Output [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -Input [10]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, d_date_sk#10] +(15) Project [codegen id : 6] +Output [8]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +Input [10]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, d_date_sk#15] -(11) Scan parquet default.store -Output [2]: [s_store_sk#14, s_city#15] +(16) Scan parquet default.store +Output [2]: [s_store_sk#19, s_city#20] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 2] -Input [2]: [s_store_sk#14, s_city#15] +(17) ColumnarToRow [codegen id : 4] +Input [2]: [s_store_sk#19, s_city#20] -(13) Filter [codegen id : 2] -Input [2]: [s_store_sk#14, s_city#15] -Condition : (s_city#15 IN (Midway,Fairview) AND isnotnull(s_store_sk#14)) +(18) Filter [codegen id : 4] +Input [2]: [s_store_sk#19, s_city#20] +Condition : (s_city#20 IN (Midway,Fairview) AND isnotnull(s_store_sk#19)) -(14) Project [codegen id : 2] -Output [1]: [s_store_sk#14] -Input [2]: [s_store_sk#14, s_city#15] +(19) Project [codegen id : 4] +Output [1]: [s_store_sk#19] +Input [2]: [s_store_sk#19, s_city#20] -(15) BroadcastExchange -Input [1]: [s_store_sk#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +(20) BroadcastExchange +Input [1]: [s_store_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] -(16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#5] -Right keys [1]: [s_store_sk#14] +(21) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#10] +Right keys [1]: [s_store_sk#19] Join condition: None -(17) Project [codegen id : 4] -Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -Input [9]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, s_store_sk#14] +(22) Project [codegen id : 6] +Output [7]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +Input [9]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, s_store_sk#19] -(18) Scan parquet default.household_demographics -Output [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +(23) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] Batched: true Location [not included in comparison]/{warehouse_dir}/household_demographics] PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 3] -Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +(24) ColumnarToRow [codegen id : 5] +Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] -(20) Filter [codegen id : 3] -Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] -Condition : (((hd_dep_count#18 = 5) OR (hd_vehicle_count#19 = 3)) AND isnotnull(hd_demo_sk#17)) +(25) Filter [codegen id : 5] +Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] +Condition : (((hd_dep_count#23 = 5) OR (hd_vehicle_count#24 = 3)) AND isnotnull(hd_demo_sk#22)) -(21) Project [codegen id : 3] -Output [1]: [hd_demo_sk#17] -Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +(26) Project [codegen id : 5] +Output [1]: [hd_demo_sk#22] +Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] -(22) BroadcastExchange -Input [1]: [hd_demo_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(27) BroadcastExchange +Input [1]: [hd_demo_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] -(23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] -Right keys [1]: [hd_demo_sk#17] +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_hdemo_sk#8] +Right keys [1]: [hd_demo_sk#22] Join condition: None -(24) Project [codegen id : 4] -Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, hd_demo_sk#17] +(29) Project [codegen id : 6] +Output [6]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +Input [8]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, hd_demo_sk#22] -(25) BroadcastExchange -Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#21] +(30) BroadcastExchange +Input [6]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#26] -(26) Scan parquet default.customer_address -Output [2]: [ca_address_sk#22, ca_city#23] +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#27, ca_city#28] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct -(27) ColumnarToRow -Input [2]: [ca_address_sk#22, ca_city#23] +(32) ColumnarToRow +Input [2]: [ca_address_sk#27, ca_city#28] -(28) Filter -Input [2]: [ca_address_sk#22, ca_city#23] -Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) +(33) Filter +Input [2]: [ca_address_sk#27, ca_city#28] +Condition : (isnotnull(ca_address_sk#27) AND isnotnull(ca_city#28)) -(29) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_addr_sk#4] -Right keys [1]: [ca_address_sk#22] +(34) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_addr_sk#9] +Right keys [1]: [ca_address_sk#27] Join condition: None -(30) Project [codegen id : 5] -Output [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_city#23] -Input [8]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_address_sk#22, ca_city#23] - -(31) HashAggregate [codegen id : 5] -Input [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_city#23] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23] -Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#7)), partial_sum(UnscaledValue(ss_ext_list_price#8)), partial_sum(UnscaledValue(ss_ext_tax#9))] -Aggregate Attributes [3]: [sum#24, sum#25, sum#26] -Results [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] - -(32) Exchange -Input [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] -Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, 5), true, [id=#30] - -(33) HashAggregate [codegen id : 6] -Input [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23] -Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#7)), sum(UnscaledValue(ss_ext_list_price#8)), sum(UnscaledValue(ss_ext_tax#9))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#7))#31, sum(UnscaledValue(ss_ext_list_price#8))#32, sum(UnscaledValue(ss_ext_tax#9))#33] -Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ca_city#23 AS bought_city#34, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#31,17,2) AS extended_price#35, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#8))#32,17,2) AS list_price#36, MakeDecimal(sum(UnscaledValue(ss_ext_tax#9))#33,17,2) AS extended_tax#37] - -(34) Exchange -Input [6]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#38] - -(35) Sort [codegen id : 7] -Input [6]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 - -(36) Scan parquet default.customer -Output [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +(35) Project [codegen id : 7] +Output [7]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_city#28] +Input [8]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_address_sk#27, ca_city#28] + +(36) HashAggregate [codegen id : 7] +Input [7]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_city#28] +Keys [4]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#12)), partial_sum(UnscaledValue(ss_ext_list_price#13)), partial_sum(UnscaledValue(ss_ext_tax#14))] +Aggregate Attributes [3]: [sum#29, sum#30, sum#31] +Results [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] -(37) ColumnarToRow [codegen id : 8] -Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +(37) Exchange +Input [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] +Arguments: hashpartitioning(ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, 5), true, [id=#35] -(38) Filter [codegen id : 8] -Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#40)) +(38) HashAggregate [codegen id : 8] +Input [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] +Keys [4]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#12)), sum(UnscaledValue(ss_ext_list_price#13)), sum(UnscaledValue(ss_ext_tax#14))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#12))#36, sum(UnscaledValue(ss_ext_list_price#13))#37, sum(UnscaledValue(ss_ext_tax#14))#38] +Results [6]: [ss_ticket_number#11, ss_customer_sk#7, ca_city#28 AS bought_city#39, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#12))#36,17,2) AS extended_price#40, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#13))#37,17,2) AS list_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_tax#14))#38,17,2) AS extended_tax#42] (39) Exchange -Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Arguments: hashpartitioning(c_customer_sk#39, 5), true, [id=#43] +Input [6]: [ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Arguments: hashpartitioning(ss_customer_sk#7, 5), true, [id=#43] (40) Sort [codegen id : 9] -Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Arguments: [c_customer_sk#39 ASC NULLS FIRST], false, 0 +Input [6]: [ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0 (41) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_customer_sk#2] -Right keys [1]: [c_customer_sk#39] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#7] Join condition: None (42) Project [codegen id : 10] -Output [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Input [10]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Output [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Input [10]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] (43) Exchange -Input [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Arguments: hashpartitioning(c_current_addr_sk#40, 5), true, [id=#44] +Input [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#44] (44) Sort [codegen id : 11] -Input [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -Arguments: [c_current_addr_sk#40 ASC NULLS FIRST], false, 0 +Input [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 (45) Scan parquet default.customer_address -Output [2]: [ca_address_sk#22, ca_city#23] +Output [2]: [ca_address_sk#27, ca_city#28] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct (46) ColumnarToRow [codegen id : 12] -Input [2]: [ca_address_sk#22, ca_city#23] +Input [2]: [ca_address_sk#27, ca_city#28] (47) Filter [codegen id : 12] -Input [2]: [ca_address_sk#22, ca_city#23] -Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) +Input [2]: [ca_address_sk#27, ca_city#28] +Condition : (isnotnull(ca_address_sk#27) AND isnotnull(ca_city#28)) (48) Exchange -Input [2]: [ca_address_sk#22, ca_city#23] -Arguments: hashpartitioning(ca_address_sk#22, 5), true, [id=#45] +Input [2]: [ca_address_sk#27, ca_city#28] +Arguments: hashpartitioning(ca_address_sk#27, 5), true, [id=#45] (49) Sort [codegen id : 13] -Input [2]: [ca_address_sk#22, ca_city#23] -Arguments: [ca_address_sk#22 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#27, ca_city#28] +Arguments: [ca_address_sk#27 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 14] -Left keys [1]: [c_current_addr_sk#40] -Right keys [1]: [ca_address_sk#22] -Join condition: NOT (ca_city#23 = bought_city#34) +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#27] +Join condition: NOT (ca_city#28 = bought_city#39) (51) Project [codegen id : 14] -Output [8]: [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] -Input [10]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42, ca_address_sk#22, ca_city#23] +Output [8]: [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] +Input [10]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42, ca_address_sk#27, ca_city#28] (52) TakeOrderedAndProject -Input [8]: [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] -Arguments: 100, [c_last_name#42 ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] +Input [8]: [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, ss_ticket_number#11 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt index 6fd7148b9a8fb..eaa24f00b9cfe 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt @@ -8,24 +8,34 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Exchange [c_current_addr_sk] #1 WholeStageCodegen (10) - Project [ss_ticket_number,bought_city,extended_price,list_price,extended_tax,c_current_addr_sk,c_first_name,c_last_name] - SortMergeJoin [ss_customer_sk,c_customer_sk] + Project [c_current_addr_sk,c_first_name,c_last_name,ss_ticket_number,bought_city,extended_price,list_price,extended_tax] + SortMergeJoin [c_customer_sk,ss_customer_sk] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #2 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (9) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #2 - WholeStageCodegen (6) + Exchange [ss_customer_sk] #3 + WholeStageCodegen (8) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] InputAdapter - Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #3 - WholeStageCodegen (5) + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #4 + WholeStageCodegen (7) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] BroadcastHashJoin [ss_addr_sk,ca_address_sk] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (6) Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] @@ -37,24 +47,24 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) + BroadcastExchange #6 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_dom,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (2) + BroadcastExchange #7 + WholeStageCodegen (4) Project [s_store_sk] Filter [s_city,s_store_sk] ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_city] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (3) + BroadcastExchange #8 + WholeStageCodegen (5) Project [hd_demo_sk] Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] ColumnarToRow @@ -64,16 +74,6 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_city] - InputAdapter - WholeStageCodegen (9) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #8 - WholeStageCodegen (8) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (13) Sort [ca_address_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt index 034d9fd0344b0..4fcabebfce591 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (37) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -38,50 +38,50 @@ TakeOrderedAndProject (37) +- Scan parquet default.customer (30) -(1) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450819), LessThanOrEqual(ss_sold_date_sk,2451904), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] - -(3) Filter [codegen id : 4] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2450819)) AND (ss_sold_date_sk#1 <= 2451904)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#10, d_dow#11] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_dow#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dow#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -Condition : (((((isnotnull(d_dow#11) AND (d_dow#11 = 1)) AND d_year#10 IN (1998,1999,2000)) AND (d_date_sk#9 >= 2450819)) AND (d_date_sk#9 <= 2451904)) AND isnotnull(d_date_sk#9)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dow#3] +Condition : (((((isnotnull(d_dow#3) AND (d_dow#3 = 1)) AND d_year#2 IN (1998,1999,2000)) AND (d_date_sk#1 >= 2450819)) AND (d_date_sk#1 <= 2451904)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_dow#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450819), LessThanOrEqual(ss_sold_date_sk,2451904), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +(7) ColumnarToRow +Input [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] -(8) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(8) Filter +Input [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +Condition : (((((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2450819)) AND (ss_sold_date_sk#5 <= 2451904)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, d_date_sk#9] +Output [7]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +Input [9]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] (11) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15] @@ -106,13 +106,13 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] +Left keys [1]: [ss_hdemo_sk#7] Right keys [1]: [hd_demo_sk#13] Join condition: None (17) Project [codegen id : 4] -Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, hd_demo_sk#13] +Output [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +Input [8]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, hd_demo_sk#13] (18) Scan parquet default.store Output [3]: [s_store_sk#17, s_number_employees#18, s_city#19] @@ -137,39 +137,39 @@ Input [2]: [s_store_sk#17, s_city#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#5] +Left keys [1]: [ss_store_sk#9] Right keys [1]: [s_store_sk#17] Join condition: None (24) Project [codegen id : 4] -Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#19] -Input [8]: [ss_customer_sk#2, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#17, s_city#19] +Output [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_city#19] +Input [8]: [ss_customer_sk#6, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_store_sk#17, s_city#19] (25) HashAggregate [codegen id : 4] -Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#19] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19] -Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#7)), partial_sum(UnscaledValue(ss_net_profit#8))] +Input [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_city#19] +Keys [4]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#11)), partial_sum(UnscaledValue(ss_net_profit#12))] Aggregate Attributes [2]: [sum#21, sum#22] -Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] +Results [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] (26) Exchange -Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] -Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, 5), true, [id=#25] +Input [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] +Arguments: hashpartitioning(ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, 5), true, [id=#25] (27) HashAggregate [codegen id : 5] -Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] -Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19] -Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#26, sum(UnscaledValue(ss_net_profit#8))#27] -Results [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#26,17,2) AS amt#28, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#27,17,2) AS profit#29] +Input [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] +Keys [4]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#11)), sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#11))#26, sum(UnscaledValue(ss_net_profit#12))#27] +Results [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#26,17,2) AS amt#28, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#27,17,2) AS profit#29] (28) Exchange -Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30] +Input [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29] +Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 (30) Scan parquet default.customer Output [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] @@ -194,15 +194,15 @@ Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 (35) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#6] Right keys [1]: [c_customer_sk#31] Join condition: None (36) Project [codegen id : 9] -Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#19, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29, s_city#19] -Input [8]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29, c_customer_sk#31, c_first_name#32, c_last_name#33] +Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#19, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29, s_city#19] +Input [8]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29, c_customer_sk#31, c_first_name#32, c_last_name#33] (37) TakeOrderedAndProject -Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29, s_city#19] -Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#19, 1, 30) ASC NULLS FIRST, profit#29 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29] +Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29, s_city#19] +Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#19, 1, 30) ASC NULLS FIRST, profit#29 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt index e031b8c4c836c..c4063593260b3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt @@ -18,11 +18,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, Project [ss_customer_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -31,6 +27,10 @@ TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt index 47842568c1bc7..45502e5d3db55 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt @@ -14,15 +14,15 @@ :- * Sort (12) : +- Exchange (11) : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- * Sort (17) +- Exchange (16) +- * Filter (15) @@ -30,58 +30,58 @@ +- Scan parquet default.item (13) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2451941), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2451941)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_date#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((((isnotnull(d_date#5) AND (d_date#5 >= 11323)) AND (d_date#5 <= 11353)) AND (d_date_sk#4 >= 2451911)) AND (d_date_sk#4 <= 2451941)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] +Condition : (((((isnotnull(d_date#2) AND (d_date#2 >= 11323)) AND (d_date#2 <= 11353)) AND (d_date_sk#1 >= 2451911)) AND (d_date_sk#1 <= 2451941)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_date#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2451941), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter +Input [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] +Condition : (((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451911)) AND (ss_sold_date_sk#4 <= 2451941)) AND isnotnull(ss_item_sk#5)) (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 2] -Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] +Output [2]: [ss_item_sk#5, ss_ext_sales_price#6] +Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] (11) Exchange -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] +Input [2]: [ss_item_sk#5, ss_ext_sales_price#6] +Arguments: hashpartitioning(ss_item_sk#5, 5), true, [id=#7] (12) Sort [codegen id : 3] -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +Input [2]: [ss_item_sk#5, ss_ext_sales_price#6] +Arguments: [ss_item_sk#5 ASC NULLS FIRST], false, 0 (13) Scan parquet default.item Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -106,18 +106,18 @@ Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_clas Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 (18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ss_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [6]: [ss_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))] Aggregate Attributes [1]: [sum#15] Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -128,9 +128,9 @@ Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class# (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#18] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt index 7146d246053b3..03c07cdabbf00 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt @@ -26,11 +26,7 @@ WholeStageCodegen (10) Exchange [ss_item_sk] #4 WholeStageCodegen (2) Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -39,6 +35,10 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt index 5bd420ff1a820..f8ff205c69fea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt @@ -8,50 +8,50 @@ TakeOrderedAndProject (58) :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildRight (44) - : :- * Project (38) - : : +- * Filter (37) - : : +- SortMergeJoin ExistenceJoin(exists#1) (36) - : : :- SortMergeJoin ExistenceJoin(exists#2) (27) - : : : :- SortMergeJoin LeftSemi (18) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- * Sort (17) - : : : : +- Exchange (16) - : : : : +- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.store_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- * Sort (26) - : : : +- Exchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Sort (35) - : : +- Exchange (34) - : : +- * Project (33) - : : +- * BroadcastHashJoin Inner BuildRight (32) - : : :- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.catalog_sales (28) - : : +- ReusedExchange (31) - : +- BroadcastExchange (43) - : +- * Project (42) - : +- * Filter (41) - : +- * ColumnarToRow (40) - : +- Scan parquet default.customer_address (39) + : +- * BroadcastHashJoin Inner BuildLeft (44) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) + : +- * Project (43) + : +- * Filter (42) + : +- SortMergeJoin ExistenceJoin(exists#1) (41) + : :- SortMergeJoin ExistenceJoin(exists#2) (32) + : : :- SortMergeJoin LeftSemi (23) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer (6) + : : : +- * Sort (22) + : : : +- Exchange (21) + : : : +- * Project (20) + : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : :- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store_sales (11) + : : : +- BroadcastExchange (18) + : : : +- * Project (17) + : : : +- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.date_dim (14) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.web_sales (24) + : : +- ReusedExchange (27) + : +- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.catalog_sales (33) + : +- ReusedExchange (36) +- * Sort (52) +- Exchange (51) +- * Filter (50) @@ -59,210 +59,210 @@ TakeOrderedAndProject (58) +- Scan parquet default.customer_demographics (48) -(1) Scan parquet default.customer -Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#3, ca_county#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#3, ca_county#4] + +(3) Filter [codegen id : 1] +Input [2]: [ca_address_sk#3, ca_county#4] +Condition : (ca_county#4 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#3)) + +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#3] +Input [2]: [ca_address_sk#3, ca_county#4] + +(5) BroadcastExchange +Input [1]: [ca_address_sk#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.customer +Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +(7) ColumnarToRow [codegen id : 2] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -(3) Filter [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) +(8) Filter [codegen id : 2] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) -(4) Exchange -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] +(9) Exchange +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] -(5) Sort [codegen id : 2] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(11) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(12) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -(8) Filter [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -Condition : isnotnull(ss_sold_date_sk#7) +(13) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +Condition : isnotnull(ss_sold_date_sk#10) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#10, d_moy#11] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#12, d_year#13, d_moy#14] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_moy#11] +(15) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#12, d_year#13, d_moy#14] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_moy#11] -Condition : (((((isnotnull(d_year#10) AND isnotnull(d_moy#11)) AND (d_year#10 = 2002)) AND (d_moy#11 >= 1)) AND (d_moy#11 <= 4)) AND isnotnull(d_date_sk#9)) +(16) Filter [codegen id : 4] +Input [3]: [d_date_sk#12, d_year#13, d_moy#14] +Condition : (((((isnotnull(d_year#13) AND isnotnull(d_moy#14)) AND (d_year#13 = 2002)) AND (d_moy#14 >= 1)) AND (d_moy#14 <= 4)) AND isnotnull(d_date_sk#12)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#10, d_moy#11] +(17) Project [codegen id : 4] +Output [1]: [d_date_sk#12] +Input [3]: [d_date_sk#12, d_year#13, d_moy#14] -(13) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(18) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#7] -Right keys [1]: [d_date_sk#9] +(19) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#12] Join condition: None -(15) Project [codegen id : 4] -Output [1]: [ss_customer_sk#8] -Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] +(20) Project [codegen id : 5] +Output [1]: [ss_customer_sk#11] +Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] -(16) Exchange -Input [1]: [ss_customer_sk#8] -Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] +(21) Exchange +Input [1]: [ss_customer_sk#11] +Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] -(17) Sort [codegen id : 5] -Input [1]: [ss_customer_sk#8] -Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 6] +Input [1]: [ss_customer_sk#11] +Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ss_customer_sk#8] +(23) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ss_customer_sk#11] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(24) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(25) ColumnarToRow [codegen id : 8] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -Condition : isnotnull(ws_sold_date_sk#14) +(26) Filter [codegen id : 8] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +Condition : isnotnull(ws_sold_date_sk#17) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(27) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#14] -Right keys [1]: [d_date_sk#9] +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#17] +Right keys [1]: [d_date_sk#12] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#15] -Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] +(29) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#18] +Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] -(25) Exchange -Input [1]: [ws_bill_customer_sk#15] -Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] +(30) Exchange +Input [1]: [ws_bill_customer_sk#18] +Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] -(26) Sort [codegen id : 8] -Input [1]: [ws_bill_customer_sk#15] -Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#18] +Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 -(27) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ws_bill_customer_sk#15] +(32) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ws_bill_customer_sk#18] Join condition: None -(28) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(33) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(34) ColumnarToRow [codegen id : 11] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -(30) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -Condition : isnotnull(cs_sold_date_sk#17) +(35) Filter [codegen id : 11] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +Condition : isnotnull(cs_sold_date_sk#20) -(31) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(36) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#17] -Right keys [1]: [d_date_sk#9] +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#12] Join condition: None -(33) Project [codegen id : 10] -Output [1]: [cs_ship_customer_sk#18] -Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] +(38) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#21] +Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] -(34) Exchange -Input [1]: [cs_ship_customer_sk#18] -Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] +(39) Exchange +Input [1]: [cs_ship_customer_sk#21] +Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] -(35) Sort [codegen id : 11] -Input [1]: [cs_ship_customer_sk#18] -Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 +(40) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#21] +Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 -(36) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [cs_ship_customer_sk#18] +(41) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [cs_ship_customer_sk#21] Join condition: None -(37) Filter [codegen id : 13] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +(42) Filter +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] Condition : (exists#2 OR exists#1) -(38) Project [codegen id : 13] -Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] - -(39) Scan parquet default.customer_address -Output [2]: [ca_address_sk#20, ca_county#21] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(40) ColumnarToRow [codegen id : 12] -Input [2]: [ca_address_sk#20, ca_county#21] - -(41) Filter [codegen id : 12] -Input [2]: [ca_address_sk#20, ca_county#21] -Condition : (ca_county#21 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#20)) - -(42) Project [codegen id : 12] -Output [1]: [ca_address_sk#20] -Input [2]: [ca_address_sk#20, ca_county#21] - -(43) BroadcastExchange -Input [1]: [ca_address_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(43) Project +Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] (44) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [c_current_addr_sk#5] -Right keys [1]: [ca_address_sk#20] +Left keys [1]: [ca_address_sk#3] +Right keys [1]: [c_current_addr_sk#8] Join condition: None (45) Project [codegen id : 13] -Output [1]: [c_current_cdemo_sk#4] -Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#20] +Output [1]: [c_current_cdemo_sk#7] +Input [3]: [ca_address_sk#3, c_current_cdemo_sk#7, c_current_addr_sk#8] (46) Exchange -Input [1]: [c_current_cdemo_sk#4] -Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#23] +Input [1]: [c_current_cdemo_sk#7] +Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#23] (47) Sort [codegen id : 14] -Input [1]: [c_current_cdemo_sk#4] -Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 +Input [1]: [c_current_cdemo_sk#7] +Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 (48) Scan parquet default.customer_demographics Output [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] @@ -287,13 +287,13 @@ Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_stat Arguments: [cd_demo_sk#24 ASC NULLS FIRST], false, 0 (53) SortMergeJoin [codegen id : 17] -Left keys [1]: [c_current_cdemo_sk#4] +Left keys [1]: [c_current_cdemo_sk#7] Right keys [1]: [cd_demo_sk#24] Join condition: None (54) Project [codegen id : 17] Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] -Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [10]: [c_current_cdemo_sk#7, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] (55) HashAggregate [codegen id : 17] Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt index 85b7f1195a257..e49432924d06d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt @@ -14,27 +14,35 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (13) Project [c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #3 - WholeStageCodegen (1) + Exchange [c_customer_sk] #4 + WholeStageCodegen (2) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (5) + WholeStageCodegen (6) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #4 - WholeStageCodegen (4) + Exchange [ss_customer_sk] #5 + WholeStageCodegen (5) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -42,18 +50,18 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) + BroadcastExchange #6 + WholeStageCodegen (4) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (8) + WholeStageCodegen (9) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #6 - WholeStageCodegen (7) + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (8) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -61,12 +69,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - WholeStageCodegen (11) + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (12) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #7 - WholeStageCodegen (10) + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (11) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -74,15 +82,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (12) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + ReusedExchange [d_date_sk] #6 InputAdapter WholeStageCodegen (16) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt index d8dbb6d131d66..3e1c71d76a5f0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt @@ -17,14 +17,14 @@ TakeOrderedAndProject (87) : : : :- * Sort (11) : : : : +- Exchange (10) : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : :- BroadcastExchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_sales (5) : : : +- * Sort (16) : : : +- Exchange (15) : : : +- * Filter (14) @@ -62,11 +62,11 @@ TakeOrderedAndProject (87) : :- * Sort (54) : : +- Exchange (53) : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildRight (51) - : : :- * Filter (49) - : : : +- * ColumnarToRow (48) - : : : +- Scan parquet default.web_sales (47) - : : +- ReusedExchange (50) + : : +- * BroadcastHashJoin Inner BuildLeft (51) + : : :- ReusedExchange (47) + : : +- * Filter (50) + : : +- * ColumnarToRow (49) + : : +- Scan parquet default.web_sales (48) : +- * Sort (56) : +- ReusedExchange (55) +- * Sort (84) @@ -88,54 +88,54 @@ TakeOrderedAndProject (87) +- ReusedExchange (76) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] - -(3) Filter [codegen id : 2] -Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#5, d_year#6] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#5, d_year#6] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#5, d_year#6] -Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2001)) AND isnotnull(d_date_sk#5)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) -(7) BroadcastExchange -Input [2]: [d_date_sk#5, d_year#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] +(4) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] + +(5) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] + +(7) Filter +Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_date_sk#5, d_year#6] +Output [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Input [6]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] (10) Exchange -Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#8] +Input [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#8] (11) Sort [codegen id : 3] -Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] @@ -160,31 +160,31 @@ Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#9] Join condition: None (18) Project [codegen id : 6] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Input [12]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Input [12]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (19) HashAggregate [codegen id : 6] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#18] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] (20) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#20] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#20] (21) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21] -Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#21] +Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] (22) Filter [codegen id : 7] Input [2]: [customer_id#22, year_total#23] @@ -199,53 +199,53 @@ Input [2]: [customer_id#22, year_total#23] Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 (25) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] +Output [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (26) ColumnarToRow [codegen id : 10] -Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] +Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] (27) Filter [codegen id : 10] -Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) +Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) (28) Scan parquet default.date_dim -Output [2]: [d_date_sk#5, d_year#6] +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] ReadSchema: struct (29) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#5, d_year#6] +Input [2]: [d_date_sk#1, d_year#2] (30) Filter [codegen id : 9] -Input [2]: [d_date_sk#5, d_year#6] -Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2002)) AND isnotnull(d_date_sk#5)) +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND isnotnull(d_date_sk#1)) (31) BroadcastExchange -Input [2]: [d_date_sk#5, d_year#6] +Input [2]: [d_date_sk#1, d_year#2] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#1] Join condition: None (33) Project [codegen id : 10] -Output [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_date_sk#5, d_year#6] +Output [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_date_sk#1, d_year#2] (34) Exchange -Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#26] +Input [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#26] (35) Sort [codegen id : 11] -Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] @@ -255,31 +255,31 @@ Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#9] Join condition: None (39) Project [codegen id : 14] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Input [12]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Input [12]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (40) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#27] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] (41) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#29] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#29] (42) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30] -Results [3]: [c_customer_id#10 AS customer_id#31, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#32, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30,18,2) AS year_total#33] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#30] +Results [3]: [c_customer_id#10 AS customer_id#31, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#32, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#30,18,2) AS year_total#33] (43) Exchange Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] @@ -298,38 +298,38 @@ Join condition: None Output [4]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33] Input [5]: [customer_id#22, year_total#23, customer_id#31, customer_preferred_cust_flag#32, year_total#33] -(47) Scan parquet default.web_sales +(47) ReusedExchange [Reuses operator id: 4] +Output [2]: [d_date_sk#1, d_year#2] + +(48) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow [codegen id : 19] +(49) ColumnarToRow Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] -(49) Filter [codegen id : 19] +(50) Filter Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Condition : (isnotnull(ws_bill_customer_sk#36) AND isnotnull(ws_sold_date_sk#35)) -(50) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#5, d_year#6] - (51) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#35] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#35] Join condition: None (52) Project [codegen id : 19] -Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#5, d_year#6] +Output [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] +Input [6]: [d_date_sk#1, d_year#2, ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] (53) Exchange -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Arguments: hashpartitioning(ws_bill_customer_sk#36, 5), true, [id=#39] (54) Sort [codegen id : 20] -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 (55) ReusedExchange [Reuses operator id: 15] @@ -345,23 +345,23 @@ Right keys [1]: [c_customer_sk#9] Join condition: None (58) Project [codegen id : 23] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Input [12]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (59) HashAggregate [codegen id : 23] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#40] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] (60) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#42] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, 5), true, [id=#42] (61) HashAggregate [codegen id : 24] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#43] Results [2]: [c_customer_id#10 AS customer_id#44, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#43,18,2) AS year_total#45] @@ -406,23 +406,23 @@ Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, Condition : (isnotnull(ws_bill_customer_sk#36) AND isnotnull(ws_sold_date_sk#35)) (71) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#5, d_year#6] +Output [2]: [d_date_sk#1, d_year#2] (72) BroadcastHashJoin [codegen id : 28] Left keys [1]: [ws_sold_date_sk#35] -Right keys [1]: [d_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None (73) Project [codegen id : 28] -Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#5, d_year#6] +Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#1, d_year#2] (74) Exchange -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] Arguments: hashpartitioning(ws_bill_customer_sk#36, 5), true, [id=#49] (75) Sort [codegen id : 29] -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 (76) ReusedExchange [Reuses operator id: 15] @@ -438,23 +438,23 @@ Right keys [1]: [c_customer_sk#9] Join condition: None (79) Project [codegen id : 32] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (80) HashAggregate [codegen id : 32] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#50] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] (81) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#52] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, 5), true, [id=#52] (82) HashAggregate [codegen id : 33] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#53] Results [2]: [c_customer_id#10 AS customer_id#54, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#53,18,2) AS year_total#55] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt index 72588fa138fc5..bcb61d9a84823 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt @@ -30,12 +30,8 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] + Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -43,6 +39,10 @@ TakeOrderedAndProject [customer_preferred_cust_flag] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -111,14 +111,14 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt index b4dd8173664b6..d6da0e09de6be 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt index e9b94a6b4651c..2207b0fee23ce 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (2) - Project [ws_item_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (1) Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt index b346701fa3148..77f9c05a340e6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt @@ -13,76 +13,76 @@ TakeOrderedAndProject (131) : +- * Project (82) : +- * BroadcastHashJoin Inner BuildRight (81) : :- * Project (71) - : : +- * BroadcastHashJoin Inner BuildRight (70) - : : :- SortMergeJoin LeftSemi (64) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- * Sort (63) - : : : +- Exchange (62) - : : : +- * Project (61) - : : : +- * BroadcastHashJoin Inner BuildRight (60) - : : : :- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.item (6) - : : : +- BroadcastExchange (59) - : : : +- * HashAggregate (58) - : : : +- * HashAggregate (57) - : : : +- * HashAggregate (56) - : : : +- Exchange (55) - : : : +- * HashAggregate (54) - : : : +- SortMergeJoin LeftSemi (53) - : : : :- SortMergeJoin LeftSemi (41) - : : : : :- * Sort (26) - : : : : : +- Exchange (25) - : : : : : +- * Project (24) - : : : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : : : :- * Project (18) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) - : : : : : : :- * Filter (11) - : : : : : : : +- * ColumnarToRow (10) - : : : : : : : +- Scan parquet default.store_sales (9) - : : : : : : +- BroadcastExchange (16) - : : : : : : +- * Project (15) - : : : : : : +- * Filter (14) - : : : : : : +- * ColumnarToRow (13) - : : : : : : +- Scan parquet default.date_dim (12) - : : : : : +- BroadcastExchange (22) - : : : : : +- * Filter (21) - : : : : : +- * ColumnarToRow (20) - : : : : : +- Scan parquet default.item (19) - : : : : +- * Sort (40) - : : : : +- Exchange (39) - : : : : +- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : : :- * Project (32) - : : : : : +- * BroadcastHashJoin Inner BuildRight (31) - : : : : : :- * Filter (29) - : : : : : : +- * ColumnarToRow (28) - : : : : : : +- Scan parquet default.catalog_sales (27) - : : : : : +- ReusedExchange (30) - : : : : +- BroadcastExchange (36) - : : : : +- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.item (33) - : : : +- * Sort (52) - : : : +- Exchange (51) - : : : +- * Project (50) - : : : +- * BroadcastHashJoin Inner BuildRight (49) - : : : :- * Project (47) - : : : : +- * BroadcastHashJoin Inner BuildRight (46) - : : : : :- * Filter (44) - : : : : : +- * ColumnarToRow (43) - : : : : : +- Scan parquet default.web_sales (42) - : : : : +- ReusedExchange (45) - : : : +- ReusedExchange (48) - : : +- BroadcastExchange (69) - : : +- * Project (68) - : : +- * Filter (67) - : : +- * ColumnarToRow (66) - : : +- Scan parquet default.date_dim (65) + : : +- * BroadcastHashJoin Inner BuildLeft (70) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- SortMergeJoin LeftSemi (69) + : : :- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) + : : +- * Sort (68) + : : +- Exchange (67) + : : +- * Project (66) + : : +- * BroadcastHashJoin Inner BuildRight (65) + : : :- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.item (11) + : : +- BroadcastExchange (64) + : : +- * HashAggregate (63) + : : +- * HashAggregate (62) + : : +- * HashAggregate (61) + : : +- Exchange (60) + : : +- * HashAggregate (59) + : : +- SortMergeJoin LeftSemi (58) + : : :- SortMergeJoin LeftSemi (46) + : : : :- * Sort (31) + : : : : +- Exchange (30) + : : : : +- * Project (29) + : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : :- * Project (23) + : : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : : :- * Filter (16) + : : : : : : +- * ColumnarToRow (15) + : : : : : : +- Scan parquet default.store_sales (14) + : : : : : +- BroadcastExchange (21) + : : : : : +- * Project (20) + : : : : : +- * Filter (19) + : : : : : +- * ColumnarToRow (18) + : : : : : +- Scan parquet default.date_dim (17) + : : : : +- BroadcastExchange (27) + : : : : +- * Filter (26) + : : : : +- * ColumnarToRow (25) + : : : : +- Scan parquet default.item (24) + : : : +- * Sort (45) + : : : +- Exchange (44) + : : : +- * Project (43) + : : : +- * BroadcastHashJoin Inner BuildRight (42) + : : : :- * Project (37) + : : : : +- * BroadcastHashJoin Inner BuildRight (36) + : : : : :- * Filter (34) + : : : : : +- * ColumnarToRow (33) + : : : : : +- Scan parquet default.catalog_sales (32) + : : : : +- ReusedExchange (35) + : : : +- BroadcastExchange (41) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.item (38) + : : +- * Sort (57) + : : +- Exchange (56) + : : +- * Project (55) + : : +- * BroadcastHashJoin Inner BuildRight (54) + : : :- * Project (52) + : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : :- * Filter (49) + : : : : +- * ColumnarToRow (48) + : : : : +- Scan parquet default.web_sales (47) + : : : +- ReusedExchange (50) + : : +- ReusedExchange (53) : +- BroadcastExchange (80) : +- SortMergeJoin LeftSemi (79) : :- * Sort (76) @@ -100,16 +100,16 @@ TakeOrderedAndProject (131) : +- * Project (101) : +- * BroadcastHashJoin Inner BuildRight (100) : :- * Project (98) - : : +- * BroadcastHashJoin Inner BuildRight (97) - : : :- SortMergeJoin LeftSemi (95) - : : : :- * Sort (92) - : : : : +- Exchange (91) - : : : : +- * Filter (90) - : : : : +- * ColumnarToRow (89) - : : : : +- Scan parquet default.catalog_sales (88) - : : : +- * Sort (94) - : : : +- ReusedExchange (93) - : : +- ReusedExchange (96) + : : +- * BroadcastHashJoin Inner BuildLeft (97) + : : :- ReusedExchange (88) + : : +- SortMergeJoin LeftSemi (96) + : : :- * Sort (93) + : : : +- Exchange (92) + : : : +- * Filter (91) + : : : +- * ColumnarToRow (90) + : : : +- Scan parquet default.catalog_sales (89) + : : +- * Sort (95) + : : +- ReusedExchange (94) : +- ReusedExchange (99) +- * Project (125) +- * Filter (124) @@ -119,587 +119,587 @@ TakeOrderedAndProject (131) +- * Project (120) +- * BroadcastHashJoin Inner BuildRight (119) :- * Project (117) - : +- * BroadcastHashJoin Inner BuildRight (116) - : :- SortMergeJoin LeftSemi (114) - : : :- * Sort (111) - : : : +- Exchange (110) - : : : +- * Filter (109) - : : : +- * ColumnarToRow (108) - : : : +- Scan parquet default.web_sales (107) - : : +- * Sort (113) - : : +- ReusedExchange (112) - : +- ReusedExchange (115) + : +- * BroadcastHashJoin Inner BuildLeft (116) + : :- ReusedExchange (107) + : +- SortMergeJoin LeftSemi (115) + : :- * Sort (112) + : : +- Exchange (111) + : : +- * Filter (110) + : : +- * ColumnarToRow (109) + : : +- Scan parquet default.web_sales (108) + : +- * Sort (114) + : +- ReusedExchange (113) +- ReusedExchange (118) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 11)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +(7) ColumnarToRow [codegen id : 2] +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] -(3) Filter [codegen id : 1] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(8) Filter [codegen id : 2] +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +Condition : (isnotnull(ss_item_sk#6) AND isnotnull(ss_sold_date_sk#5)) -(4) Exchange -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#5] +(9) Exchange +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +Arguments: hashpartitioning(ss_item_sk#6, 5), true, [id=#9] -(5) Sort [codegen id : 2] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +Arguments: [ss_item_sk#6 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(11) Scan parquet default.item +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 17] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(12) ColumnarToRow [codegen id : 18] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(8) Filter [codegen id : 17] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) +(13) Filter [codegen id : 18] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Condition : ((isnotnull(i_brand_id#11) AND isnotnull(i_class_id#12)) AND isnotnull(i_category_id#13)) -(9) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] +(14) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#5, ss_item_sk#6] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +(15) ColumnarToRow [codegen id : 6] +Input [2]: [ss_sold_date_sk#5, ss_item_sk#6] -(11) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(16) Filter [codegen id : 6] +Input [2]: [ss_sold_date_sk#5, ss_item_sk#6] +Condition : (isnotnull(ss_item_sk#6) AND isnotnull(ss_sold_date_sk#5)) -(12) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_year#11] +(17) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(13) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#10, d_year#11] +(18) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#1, d_year#2] -(14) Filter [codegen id : 3] -Input [2]: [d_date_sk#10, d_year#11] -Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) +(19) Filter [codegen id : 4] +Input [2]: [d_date_sk#1, d_year#2] +Condition : (((isnotnull(d_year#2) AND (d_year#2 >= 1999)) AND (d_year#2 <= 2001)) AND isnotnull(d_date_sk#1)) -(15) Project [codegen id : 3] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_year#11] +(20) Project [codegen id : 4] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#2] -(16) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(21) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(17) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None -(18) Project [codegen id : 5] -Output [1]: [ss_item_sk#2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] +(23) Project [codegen id : 6] +Output [1]: [ss_item_sk#6] +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, d_date_sk#1] -(19) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(24) Scan parquet default.item +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 4] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(25) ColumnarToRow [codegen id : 5] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(21) Filter [codegen id : 4] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) +(26) Filter [codegen id : 5] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Condition : (((isnotnull(i_item_sk#10) AND isnotnull(i_brand_id#11)) AND isnotnull(i_class_id#12)) AND isnotnull(i_category_id#13)) -(22) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] +(27) BroadcastExchange +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] -(23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#6] +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#6] +Right keys [1]: [i_item_sk#10] Join condition: None -(24) Project [codegen id : 5] -Output [3]: [i_brand_id#7 AS brand_id#14, i_class_id#8 AS class_id#15, i_category_id#9 AS category_id#16] -Input [5]: [ss_item_sk#2, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(29) Project [codegen id : 6] +Output [3]: [i_brand_id#11 AS brand_id#16, i_class_id#12 AS class_id#17, i_category_id#13 AS category_id#18] +Input [5]: [ss_item_sk#6, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(25) Exchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16), 5), true, [id=#17] +(30) Exchange +Input [3]: [brand_id#16, class_id#17, category_id#18] +Arguments: hashpartitioning(coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18), 5), true, [id=#19] -(26) Sort [codegen id : 6] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 7] +Input [3]: [brand_id#16, class_id#17, category_id#18] +Arguments: [coalesce(brand_id#16, 0) ASC NULLS FIRST, isnull(brand_id#16) ASC NULLS FIRST, coalesce(class_id#17, 0) ASC NULLS FIRST, isnull(class_id#17) ASC NULLS FIRST, coalesce(category_id#18, 0) ASC NULLS FIRST, isnull(category_id#18) ASC NULLS FIRST], false, 0 -(27) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] +(32) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#20, cs_item_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] +(33) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#20, cs_item_sk#21] -(29) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) +(34) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#20, cs_item_sk#21] +Condition : (isnotnull(cs_item_sk#21) AND isnotnull(cs_sold_date_sk#20)) -(30) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] +(35) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#1] -(31) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +(36) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#1] Join condition: None -(32) Project [codegen id : 9] -Output [1]: [cs_item_sk#19] -Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] +(37) Project [codegen id : 10] +Output [1]: [cs_item_sk#21] +Input [3]: [cs_sold_date_sk#20, cs_item_sk#21, d_date_sk#1] -(33) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(38) Scan parquet default.item +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 8] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(39) ColumnarToRow [codegen id : 9] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(35) Filter [codegen id : 8] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : isnotnull(i_item_sk#6) +(40) Filter [codegen id : 9] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Condition : isnotnull(i_item_sk#10) -(36) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(41) BroadcastExchange +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] -(37) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_item_sk#19] -Right keys [1]: [i_item_sk#6] +(42) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#21] +Right keys [1]: [i_item_sk#10] Join condition: None -(38) Project [codegen id : 9] -Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Input [5]: [cs_item_sk#19, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(43) Project [codegen id : 10] +Output [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [5]: [cs_item_sk#21, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(39) Exchange -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#21] +(44) Exchange +Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: hashpartitioning(coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13), 5), true, [id=#23] -(40) Sort [codegen id : 10] -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 11] +Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: [coalesce(i_brand_id#11, 0) ASC NULLS FIRST, isnull(i_brand_id#11) ASC NULLS FIRST, coalesce(i_class_id#12, 0) ASC NULLS FIRST, isnull(i_class_id#12) ASC NULLS FIRST, coalesce(i_category_id#13, 0) ASC NULLS FIRST, isnull(i_category_id#13) ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] -Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] +(46) SortMergeJoin +Left keys [6]: [coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18)] +Right keys [6]: [coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13)] Join condition: None -(42) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] +(47) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#24, ws_item_sk#25] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 13] -Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] +(48) ColumnarToRow [codegen id : 14] +Input [2]: [ws_sold_date_sk#24, ws_item_sk#25] -(44) Filter [codegen id : 13] -Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) +(49) Filter [codegen id : 14] +Input [2]: [ws_sold_date_sk#24, ws_item_sk#25] +Condition : (isnotnull(ws_item_sk#25) AND isnotnull(ws_sold_date_sk#24)) -(45) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] +(50) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#1] -(46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +(51) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#24] +Right keys [1]: [d_date_sk#1] Join condition: None -(47) Project [codegen id : 13] -Output [1]: [ws_item_sk#23] -Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] +(52) Project [codegen id : 14] +Output [1]: [ws_item_sk#25] +Input [3]: [ws_sold_date_sk#24, ws_item_sk#25, d_date_sk#1] -(48) ReusedExchange [Reuses operator id: 36] -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(53) ReusedExchange [Reuses operator id: 41] +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(49) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_item_sk#23] -Right keys [1]: [i_item_sk#6] +(54) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_item_sk#25] +Right keys [1]: [i_item_sk#10] Join condition: None -(50) Project [codegen id : 13] -Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Input [5]: [ws_item_sk#23, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(55) Project [codegen id : 14] +Output [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [5]: [ws_item_sk#25, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -(51) Exchange -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#24] +(56) Exchange +Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: hashpartitioning(coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13), 5), true, [id=#26] -(52) Sort [codegen id : 14] -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 +(57) Sort [codegen id : 15] +Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: [coalesce(i_brand_id#11, 0) ASC NULLS FIRST, isnull(i_brand_id#11) ASC NULLS FIRST, coalesce(i_class_id#12, 0) ASC NULLS FIRST, isnull(i_class_id#12) ASC NULLS FIRST, coalesce(i_category_id#13, 0) ASC NULLS FIRST, isnull(i_category_id#13) ASC NULLS FIRST], false, 0 -(53) SortMergeJoin -Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] -Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] +(58) SortMergeJoin +Left keys [6]: [coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18)] +Right keys [6]: [coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13)] Join condition: None -(54) HashAggregate [codegen id : 15] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(59) HashAggregate [codegen id : 16] +Input [3]: [brand_id#16, class_id#17, category_id#18] +Keys [3]: [brand_id#16, class_id#17, category_id#18] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#16, class_id#17, category_id#18] -(55) Exchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: hashpartitioning(brand_id#14, class_id#15, category_id#16, 5), true, [id=#25] +(60) Exchange +Input [3]: [brand_id#16, class_id#17, category_id#18] +Arguments: hashpartitioning(brand_id#16, class_id#17, category_id#18, 5), true, [id=#27] -(56) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(61) HashAggregate [codegen id : 17] +Input [3]: [brand_id#16, class_id#17, category_id#18] +Keys [3]: [brand_id#16, class_id#17, category_id#18] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#16, class_id#17, category_id#18] -(57) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(62) HashAggregate [codegen id : 17] +Input [3]: [brand_id#16, class_id#17, category_id#18] +Keys [3]: [brand_id#16, class_id#17, category_id#18] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#16, class_id#17, category_id#18] -(58) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(63) HashAggregate [codegen id : 17] +Input [3]: [brand_id#16, class_id#17, category_id#18] +Keys [3]: [brand_id#16, class_id#17, category_id#18] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#16, class_id#17, category_id#18] -(59) BroadcastExchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#26] +(64) BroadcastExchange +Input [3]: [brand_id#16, class_id#17, category_id#18] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#28] -(60) BroadcastHashJoin [codegen id : 17] -Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Right keys [3]: [brand_id#14, class_id#15, category_id#16] +(65) BroadcastHashJoin [codegen id : 18] +Left keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Right keys [3]: [brand_id#16, class_id#17, category_id#18] Join condition: None -(61) Project [codegen id : 17] -Output [1]: [i_item_sk#6 AS ss_item_sk#27] -Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#14, class_id#15, category_id#16] +(66) Project [codegen id : 18] +Output [1]: [i_item_sk#10 AS ss_item_sk#29] +Input [7]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13, brand_id#16, class_id#17, category_id#18] -(62) Exchange -Input [1]: [ss_item_sk#27] -Arguments: hashpartitioning(ss_item_sk#27, 5), true, [id=#28] +(67) Exchange +Input [1]: [ss_item_sk#29] +Arguments: hashpartitioning(ss_item_sk#29, 5), true, [id=#30] -(63) Sort [codegen id : 18] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +(68) Sort [codegen id : 19] +Input [1]: [ss_item_sk#29] +Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 -(64) SortMergeJoin -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [ss_item_sk#27] +(69) SortMergeJoin +Left keys [1]: [ss_item_sk#6] +Right keys [1]: [ss_item_sk#29] Join condition: None -(65) Scan parquet default.date_dim -Output [3]: [d_date_sk#10, d_year#11, d_moy#29] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] -ReadSchema: struct - -(66) ColumnarToRow [codegen id : 19] -Input [3]: [d_date_sk#10, d_year#11, d_moy#29] - -(67) Filter [codegen id : 19] -Input [3]: [d_date_sk#10, d_year#11, d_moy#29] -Condition : ((((isnotnull(d_year#11) AND isnotnull(d_moy#29)) AND (d_year#11 = 2001)) AND (d_moy#29 = 11)) AND isnotnull(d_date_sk#10)) - -(68) Project [codegen id : 19] -Output [1]: [d_date_sk#10] -Input [3]: [d_date_sk#10, d_year#11, d_moy#29] - -(69) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] - (70) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (71) Project [codegen id : 38] -Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Output [3]: [ss_item_sk#6, ss_quantity#7, ss_list_price#8] +Input [5]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] (72) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (73) ColumnarToRow [codegen id : 20] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (74) Filter [codegen id : 20] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : isnotnull(i_item_sk#6) +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Condition : isnotnull(i_item_sk#10) (75) Exchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#31] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: hashpartitioning(i_item_sk#10, 5), true, [id=#31] (76) Sort [codegen id : 21] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: [i_item_sk#10 ASC NULLS FIRST], false, 0 -(77) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] +(77) ReusedExchange [Reuses operator id: 67] +Output [1]: [ss_item_sk#29] (78) Sort [codegen id : 37] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#29] +Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 (79) SortMergeJoin -Left keys [1]: [i_item_sk#6] -Right keys [1]: [ss_item_sk#27] +Left keys [1]: [i_item_sk#10] +Right keys [1]: [ss_item_sk#29] Join condition: None (80) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (81) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ss_item_sk#6] +Right keys [1]: [i_item_sk#10] Join condition: None (82) Project [codegen id : 38] -Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [5]: [ss_quantity#7, ss_list_price#8, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [7]: [ss_item_sk#6, ss_quantity#7, ss_list_price#8, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (83) HashAggregate [codegen id : 38] -Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Input [5]: [ss_quantity#7, ss_list_price#8, i_brand_id#11, i_class_id#12, i_category_id#13] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#33, isEmpty#34, count#35] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] (84) Exchange -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] -Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#39] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] +Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#39] (85) HashAggregate [codegen id : 39] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40, count(1)#41] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sales#42, count(1)#41 AS number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40, count(1)#41] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sales#42, count(1)#41 AS number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] (86) Filter [codegen id : 39] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44 as decimal(32,6)) > cast(Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44 as decimal(32,6)) > cast(Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (87) Project [codegen id : 39] -Output [6]: [sales#42, number_sales#43, store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] +Output [6]: [sales#42, number_sales#43, store AS channel#47, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] + +(88) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] -(88) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] +(89) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(89) ColumnarToRow [codegen id : 40] -Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] +(90) ColumnarToRow [codegen id : 41] +Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] -(90) Filter [codegen id : 40] -Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] -Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) +(91) Filter [codegen id : 41] +Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +Condition : (isnotnull(cs_item_sk#21) AND isnotnull(cs_sold_date_sk#20)) -(91) Exchange -Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] -Arguments: hashpartitioning(cs_item_sk#19, 5), true, [id=#50] +(92) Exchange +Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +Arguments: hashpartitioning(cs_item_sk#21, 5), true, [id=#50] -(92) Sort [codegen id : 41] -Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] -Arguments: [cs_item_sk#19 ASC NULLS FIRST], false, 0 +(93) Sort [codegen id : 42] +Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +Arguments: [cs_item_sk#21 ASC NULLS FIRST], false, 0 -(93) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] +(94) ReusedExchange [Reuses operator id: 67] +Output [1]: [ss_item_sk#29] -(94) Sort [codegen id : 57] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +(95) Sort [codegen id : 58] +Input [1]: [ss_item_sk#29] +Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 -(95) SortMergeJoin -Left keys [1]: [cs_item_sk#19] -Right keys [1]: [ss_item_sk#27] +(96) SortMergeJoin +Left keys [1]: [cs_item_sk#21] +Right keys [1]: [ss_item_sk#29] Join condition: None -(96) ReusedExchange [Reuses operator id: 69] -Output [1]: [d_date_sk#10] - (97) BroadcastHashJoin [codegen id : 77] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#20] Join condition: None (98) Project [codegen id : 77] -Output [3]: [cs_item_sk#19, cs_quantity#48, cs_list_price#49] -Input [5]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49, d_date_sk#10] +Output [3]: [cs_item_sk#21, cs_quantity#48, cs_list_price#49] +Input [5]: [d_date_sk#1, cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] (99) ReusedExchange [Reuses operator id: 80] -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (100) BroadcastHashJoin [codegen id : 77] -Left keys [1]: [cs_item_sk#19] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [cs_item_sk#21] +Right keys [1]: [i_item_sk#10] Join condition: None (101) Project [codegen id : 77] -Output [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [7]: [cs_item_sk#19, cs_quantity#48, cs_list_price#49, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [7]: [cs_item_sk#21, cs_quantity#48, cs_list_price#49, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (102) HashAggregate [codegen id : 77] -Input [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#7, i_class_id#8, i_category_id#9] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#11, i_class_id#12, i_category_id#13] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#51, isEmpty#52, count#53] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] (103) Exchange -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] -Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#57] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] +Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#57] (104) HashAggregate [codegen id : 78] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58, count(1)#59] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sales#60, count(1)#59 AS number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sales#60, count(1)#59 AS number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] (105) Filter [codegen id : 78] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (106) Project [codegen id : 78] -Output [6]: [sales#60, number_sales#61, catalog AS channel#63, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] +Output [6]: [sales#60, number_sales#61, catalog AS channel#63, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] + +(107) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] -(107) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] +(108) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(108) ColumnarToRow [codegen id : 79] -Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] +(109) ColumnarToRow [codegen id : 80] +Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] -(109) Filter [codegen id : 79] -Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] -Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) +(110) Filter [codegen id : 80] +Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +Condition : (isnotnull(ws_item_sk#25) AND isnotnull(ws_sold_date_sk#24)) -(110) Exchange -Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] -Arguments: hashpartitioning(ws_item_sk#23, 5), true, [id=#66] +(111) Exchange +Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +Arguments: hashpartitioning(ws_item_sk#25, 5), true, [id=#66] -(111) Sort [codegen id : 80] -Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] -Arguments: [ws_item_sk#23 ASC NULLS FIRST], false, 0 +(112) Sort [codegen id : 81] +Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +Arguments: [ws_item_sk#25 ASC NULLS FIRST], false, 0 -(112) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] +(113) ReusedExchange [Reuses operator id: 67] +Output [1]: [ss_item_sk#29] -(113) Sort [codegen id : 96] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +(114) Sort [codegen id : 97] +Input [1]: [ss_item_sk#29] +Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 -(114) SortMergeJoin -Left keys [1]: [ws_item_sk#23] -Right keys [1]: [ss_item_sk#27] +(115) SortMergeJoin +Left keys [1]: [ws_item_sk#25] +Right keys [1]: [ss_item_sk#29] Join condition: None -(115) ReusedExchange [Reuses operator id: 69] -Output [1]: [d_date_sk#10] - (116) BroadcastHashJoin [codegen id : 116] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#24] Join condition: None (117) Project [codegen id : 116] -Output [3]: [ws_item_sk#23, ws_quantity#64, ws_list_price#65] -Input [5]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65, d_date_sk#10] +Output [3]: [ws_item_sk#25, ws_quantity#64, ws_list_price#65] +Input [5]: [d_date_sk#1, ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] (118) ReusedExchange [Reuses operator id: 80] -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (119) BroadcastHashJoin [codegen id : 116] -Left keys [1]: [ws_item_sk#23] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ws_item_sk#25] +Right keys [1]: [i_item_sk#10] Join condition: None (120) Project [codegen id : 116] -Output [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [7]: [ws_item_sk#23, ws_quantity#64, ws_list_price#65, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [7]: [ws_item_sk#25, ws_quantity#64, ws_list_price#65, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] (121) HashAggregate [codegen id : 116] -Input [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#7, i_class_id#8, i_category_id#9] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#11, i_class_id#12, i_category_id#13] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#67, isEmpty#68, count#69] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] (122) Exchange -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] -Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#73] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] +Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#73] (123) HashAggregate [codegen id : 117] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] +Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74, count(1)#75] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sales#76, count(1)#75 AS number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sales#76, count(1)#75 AS number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] (124) Filter [codegen id : 117] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (125) Project [codegen id : 117] -Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] (126) Union (127) Expand [codegen id : 118] -Input [6]: [sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [List(sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 0), List(sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, null, 1), List(sales#42, number_sales#43, channel#47, i_brand_id#7, null, null, 3), List(sales#42, number_sales#43, channel#47, null, null, null, 7), List(sales#42, number_sales#43, null, null, null, null, 15)], [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] +Input [6]: [sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, i_category_id#13] +Arguments: [List(sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, i_category_id#13, 0), List(sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, null, 1), List(sales#42, number_sales#43, channel#47, i_brand_id#11, null, null, 3), List(sales#42, number_sales#43, channel#47, null, null, null, 7), List(sales#42, number_sales#43, null, null, null, null, 15)], [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] (128) HashAggregate [codegen id : 118] Input [7]: [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] @@ -755,101 +755,101 @@ Subquery:1 Hosting operator id = 86 Hosting Expression = Subquery scalar-subquer (132) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Output [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct (133) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Input [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] (134) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] -Condition : isnotnull(ss_sold_date_sk#1) +Input [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] +Condition : isnotnull(ss_sold_date_sk#5) (135) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_year#11] +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (136) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#10, d_year#11] +Input [2]: [d_date_sk#1, d_year#2] (137) Filter [codegen id : 1] -Input [2]: [d_date_sk#10, d_year#11] -Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) +Input [2]: [d_date_sk#1, d_year#2] +Condition : (((isnotnull(d_year#2) AND (d_year#2 >= 1999)) AND (d_year#2 <= 2001)) AND isnotnull(d_date_sk#1)) (138) Project [codegen id : 1] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_year#11] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#2] (139) BroadcastExchange -Input [1]: [d_date_sk#10] +Input [1]: [d_date_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#96] (140) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None (141) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#97, ss_list_price#4 AS list_price#98] -Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Output [2]: [ss_quantity#7 AS quantity#97, ss_list_price#8 AS list_price#98] +Input [4]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8, d_date_sk#1] (142) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] +Output [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct (143) ColumnarToRow [codegen id : 4] -Input [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] +Input [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] (144) Filter [codegen id : 4] -Input [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] -Condition : isnotnull(cs_sold_date_sk#18) +Input [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] +Condition : isnotnull(cs_sold_date_sk#20) (145) ReusedExchange [Reuses operator id: 139] -Output [1]: [d_date_sk#10] +Output [1]: [d_date_sk#1] (146) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#1] Join condition: None (147) Project [codegen id : 4] Output [2]: [cs_quantity#48 AS quantity#99, cs_list_price#49 AS list_price#100] -Input [4]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49, d_date_sk#10] +Input [4]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49, d_date_sk#1] (148) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] +Output [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct (149) ColumnarToRow [codegen id : 6] -Input [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] +Input [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] (150) Filter [codegen id : 6] -Input [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] -Condition : isnotnull(ws_sold_date_sk#22) +Input [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] +Condition : isnotnull(ws_sold_date_sk#24) (151) ReusedExchange [Reuses operator id: 139] -Output [1]: [d_date_sk#10] +Output [1]: [d_date_sk#1] (152) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [ws_sold_date_sk#24] +Right keys [1]: [d_date_sk#1] Join condition: None (153) Project [codegen id : 6] Output [2]: [ws_quantity#64 AS quantity#101, ws_list_price#65 AS list_price#102] -Input [4]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65, d_date_sk#10] +Input [4]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65, d_date_sk#1] (154) Union diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt index 5b93392d023db..1c435feeb64ac 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt @@ -61,23 +61,31 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] InputAdapter SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #3 - WholeStageCodegen (1) + Exchange [ss_item_sk] #4 + WholeStageCodegen (2) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] - WholeStageCodegen (18) + WholeStageCodegen (19) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (17) + Exchange [ss_item_sk] #5 + WholeStageCodegen (18) Project [i_item_sk] BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] Filter [i_brand_id,i_class_id,i_category_id] @@ -85,23 +93,23 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (16) + BroadcastExchange #6 + WholeStageCodegen (17) HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #6 - WholeStageCodegen (15) + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (16) HashAggregate [brand_id,class_id,category_id] InputAdapter SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (6) + WholeStageCodegen (7) Sort [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #7 - WholeStageCodegen (5) + Exchange [brand_id,class_id,category_id] #8 + WholeStageCodegen (6) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] @@ -111,25 +119,25 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #8 - WholeStageCodegen (3) + BroadcastExchange #9 + WholeStageCodegen (4) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter - BroadcastExchange #9 - WholeStageCodegen (4) + BroadcastExchange #10 + WholeStageCodegen (5) Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (10) + WholeStageCodegen (11) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #10 - WholeStageCodegen (9) + Exchange [i_brand_id,i_class_id,i_category_id] #11 + WholeStageCodegen (10) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] @@ -139,19 +147,19 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [d_date_sk] #9 InputAdapter - BroadcastExchange #11 - WholeStageCodegen (8) + BroadcastExchange #12 + WholeStageCodegen (9) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (14) + WholeStageCodegen (15) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #12 - WholeStageCodegen (13) + Exchange [i_brand_id,i_class_id,i_category_id] #13 + WholeStageCodegen (14) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] @@ -161,17 +169,9 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [d_date_sk] #9 InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 - InputAdapter - BroadcastExchange #13 - WholeStageCodegen (19) - Project [d_date_sk] - Filter [d_year,d_moy,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12 InputAdapter BroadcastExchange #14 SortMergeJoin [i_item_sk,ss_item_sk] @@ -187,7 +187,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (37) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #4 + ReusedExchange [ss_item_sk] #5 WholeStageCodegen (78) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -200,24 +200,24 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk,cs_quantity,cs_list_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter SortMergeJoin [cs_item_sk,ss_item_sk] - WholeStageCodegen (41) + WholeStageCodegen (42) Sort [cs_item_sk] InputAdapter Exchange [cs_item_sk] #19 - WholeStageCodegen (40) + WholeStageCodegen (41) Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price] - WholeStageCodegen (57) + WholeStageCodegen (58) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #4 - InputAdapter - ReusedExchange [d_date_sk] #13 + ReusedExchange [ss_item_sk] #5 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #14 WholeStageCodegen (117) @@ -232,23 +232,23 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_quantity,ws_list_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter SortMergeJoin [ws_item_sk,ss_item_sk] - WholeStageCodegen (80) + WholeStageCodegen (81) Sort [ws_item_sk] InputAdapter Exchange [ws_item_sk] #21 - WholeStageCodegen (79) + WholeStageCodegen (80) Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_quantity,ws_list_price] - WholeStageCodegen (96) + WholeStageCodegen (97) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #4 - InputAdapter - ReusedExchange [d_date_sk] #13 + ReusedExchange [ss_item_sk] #5 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #14 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt index 2d2b56e32bdb8..b4b32c16cb496 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt @@ -9,76 +9,76 @@ TakeOrderedAndProject (110) : +- * Project (82) : +- * BroadcastHashJoin Inner BuildRight (81) : :- * Project (71) - : : +- * BroadcastHashJoin Inner BuildRight (70) - : : :- SortMergeJoin LeftSemi (64) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- * Sort (63) - : : : +- Exchange (62) - : : : +- * Project (61) - : : : +- * BroadcastHashJoin Inner BuildRight (60) - : : : :- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.item (6) - : : : +- BroadcastExchange (59) - : : : +- * HashAggregate (58) - : : : +- * HashAggregate (57) - : : : +- * HashAggregate (56) - : : : +- Exchange (55) - : : : +- * HashAggregate (54) - : : : +- SortMergeJoin LeftSemi (53) - : : : :- SortMergeJoin LeftSemi (41) - : : : : :- * Sort (26) - : : : : : +- Exchange (25) - : : : : : +- * Project (24) - : : : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : : : :- * Project (18) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) - : : : : : : :- * Filter (11) - : : : : : : : +- * ColumnarToRow (10) - : : : : : : : +- Scan parquet default.store_sales (9) - : : : : : : +- BroadcastExchange (16) - : : : : : : +- * Project (15) - : : : : : : +- * Filter (14) - : : : : : : +- * ColumnarToRow (13) - : : : : : : +- Scan parquet default.date_dim (12) - : : : : : +- BroadcastExchange (22) - : : : : : +- * Filter (21) - : : : : : +- * ColumnarToRow (20) - : : : : : +- Scan parquet default.item (19) - : : : : +- * Sort (40) - : : : : +- Exchange (39) - : : : : +- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : : :- * Project (32) - : : : : : +- * BroadcastHashJoin Inner BuildRight (31) - : : : : : :- * Filter (29) - : : : : : : +- * ColumnarToRow (28) - : : : : : : +- Scan parquet default.catalog_sales (27) - : : : : : +- ReusedExchange (30) - : : : : +- BroadcastExchange (36) - : : : : +- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.item (33) - : : : +- * Sort (52) - : : : +- Exchange (51) - : : : +- * Project (50) - : : : +- * BroadcastHashJoin Inner BuildRight (49) - : : : :- * Project (47) - : : : : +- * BroadcastHashJoin Inner BuildRight (46) - : : : : :- * Filter (44) - : : : : : +- * ColumnarToRow (43) - : : : : : +- Scan parquet default.web_sales (42) - : : : : +- ReusedExchange (45) - : : : +- ReusedExchange (48) - : : +- BroadcastExchange (69) - : : +- * Project (68) - : : +- * Filter (67) - : : +- * ColumnarToRow (66) - : : +- Scan parquet default.date_dim (65) + : : +- * BroadcastHashJoin Inner BuildLeft (70) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- SortMergeJoin LeftSemi (69) + : : :- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) + : : +- * Sort (68) + : : +- Exchange (67) + : : +- * Project (66) + : : +- * BroadcastHashJoin Inner BuildRight (65) + : : :- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.item (11) + : : +- BroadcastExchange (64) + : : +- * HashAggregate (63) + : : +- * HashAggregate (62) + : : +- * HashAggregate (61) + : : +- Exchange (60) + : : +- * HashAggregate (59) + : : +- SortMergeJoin LeftSemi (58) + : : :- SortMergeJoin LeftSemi (46) + : : : :- * Sort (31) + : : : : +- Exchange (30) + : : : : +- * Project (29) + : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : :- * Project (23) + : : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : : :- * Filter (16) + : : : : : : +- * ColumnarToRow (15) + : : : : : : +- Scan parquet default.store_sales (14) + : : : : : +- BroadcastExchange (21) + : : : : : +- * Project (20) + : : : : : +- * Filter (19) + : : : : : +- * ColumnarToRow (18) + : : : : : +- Scan parquet default.date_dim (17) + : : : : +- BroadcastExchange (27) + : : : : +- * Filter (26) + : : : : +- * ColumnarToRow (25) + : : : : +- Scan parquet default.item (24) + : : : +- * Sort (45) + : : : +- Exchange (44) + : : : +- * Project (43) + : : : +- * BroadcastHashJoin Inner BuildRight (42) + : : : :- * Project (37) + : : : : +- * BroadcastHashJoin Inner BuildRight (36) + : : : : :- * Filter (34) + : : : : : +- * ColumnarToRow (33) + : : : : : +- Scan parquet default.catalog_sales (32) + : : : : +- ReusedExchange (35) + : : : +- BroadcastExchange (41) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.item (38) + : : +- * Sort (57) + : : +- Exchange (56) + : : +- * Project (55) + : : +- * BroadcastHashJoin Inner BuildRight (54) + : : :- * Project (52) + : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : :- * Filter (49) + : : : : +- * ColumnarToRow (48) + : : : : +- Scan parquet default.web_sales (47) + : : : +- ReusedExchange (50) + : : +- ReusedExchange (53) : +- BroadcastExchange (80) : +- SortMergeJoin LeftSemi (79) : :- * Sort (76) @@ -111,467 +111,467 @@ TakeOrderedAndProject (110) +- ReusedExchange (100) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_week_seq#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_week_seq#2] + +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_week_seq#2] +Condition : ((isnotnull(d_week_seq#2) AND (d_week_seq#2 = Subquery scalar-subquery#3, [id=#4])) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_week_seq#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +(7) ColumnarToRow [codegen id : 2] +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] -(3) Filter [codegen id : 1] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(8) Filter [codegen id : 2] +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Condition : (isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) -(4) Exchange -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#5] +(9) Exchange +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Arguments: hashpartitioning(ss_item_sk#7, 5), true, [id=#10] -(5) Sort [codegen id : 2] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Arguments: [ss_item_sk#7 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(11) Scan parquet default.item +Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 17] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(12) ColumnarToRow [codegen id : 18] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(8) Filter [codegen id : 17] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) +(13) Filter [codegen id : 18] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Condition : ((isnotnull(i_brand_id#12) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) -(9) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] +(14) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#6, ss_item_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +(15) ColumnarToRow [codegen id : 6] +Input [2]: [ss_sold_date_sk#6, ss_item_sk#7] -(11) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(16) Filter [codegen id : 6] +Input [2]: [ss_sold_date_sk#6, ss_item_sk#7] +Condition : (isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) -(12) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_year#11] +(17) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#15] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(13) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#10, d_year#11] +(18) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#1, d_year#15] -(14) Filter [codegen id : 3] -Input [2]: [d_date_sk#10, d_year#11] -Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) +(19) Filter [codegen id : 4] +Input [2]: [d_date_sk#1, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#1)) -(15) Project [codegen id : 3] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_year#11] +(20) Project [codegen id : 4] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#15] -(16) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(21) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] -(17) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#1] Join condition: None -(18) Project [codegen id : 5] -Output [1]: [ss_item_sk#2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] +(23) Project [codegen id : 6] +Output [1]: [ss_item_sk#7] +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, d_date_sk#1] -(19) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(24) Scan parquet default.item +Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 4] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(25) ColumnarToRow [codegen id : 5] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(21) Filter [codegen id : 4] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) +(26) Filter [codegen id : 5] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Condition : (((isnotnull(i_item_sk#11) AND isnotnull(i_brand_id#12)) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) -(22) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] +(27) BroadcastExchange +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] -(23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#6] +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [i_item_sk#11] Join condition: None -(24) Project [codegen id : 5] -Output [3]: [i_brand_id#7 AS brand_id#14, i_class_id#8 AS class_id#15, i_category_id#9 AS category_id#16] -Input [5]: [ss_item_sk#2, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(29) Project [codegen id : 6] +Output [3]: [i_brand_id#12 AS brand_id#18, i_class_id#13 AS class_id#19, i_category_id#14 AS category_id#20] +Input [5]: [ss_item_sk#7, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(25) Exchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16), 5), true, [id=#17] +(30) Exchange +Input [3]: [brand_id#18, class_id#19, category_id#20] +Arguments: hashpartitioning(coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20), 5), true, [id=#21] -(26) Sort [codegen id : 6] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 7] +Input [3]: [brand_id#18, class_id#19, category_id#20] +Arguments: [coalesce(brand_id#18, 0) ASC NULLS FIRST, isnull(brand_id#18) ASC NULLS FIRST, coalesce(class_id#19, 0) ASC NULLS FIRST, isnull(class_id#19) ASC NULLS FIRST, coalesce(category_id#20, 0) ASC NULLS FIRST, isnull(category_id#20) ASC NULLS FIRST], false, 0 -(27) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] +(32) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#22, cs_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] +(33) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#22, cs_item_sk#23] -(29) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) +(34) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#22, cs_item_sk#23] +Condition : (isnotnull(cs_item_sk#23) AND isnotnull(cs_sold_date_sk#22)) -(30) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] +(35) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#1] -(31) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +(36) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#22] +Right keys [1]: [d_date_sk#1] Join condition: None -(32) Project [codegen id : 9] -Output [1]: [cs_item_sk#19] -Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] +(37) Project [codegen id : 10] +Output [1]: [cs_item_sk#23] +Input [3]: [cs_sold_date_sk#22, cs_item_sk#23, d_date_sk#1] -(33) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(38) Scan parquet default.item +Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 8] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(39) ColumnarToRow [codegen id : 9] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(35) Filter [codegen id : 8] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : isnotnull(i_item_sk#6) +(40) Filter [codegen id : 9] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Condition : isnotnull(i_item_sk#11) -(36) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(41) BroadcastExchange +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] -(37) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_item_sk#19] -Right keys [1]: [i_item_sk#6] +(42) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#23] +Right keys [1]: [i_item_sk#11] Join condition: None -(38) Project [codegen id : 9] -Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Input [5]: [cs_item_sk#19, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(43) Project [codegen id : 10] +Output [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Input [5]: [cs_item_sk#23, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(39) Exchange -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#21] +(44) Exchange +Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: hashpartitioning(coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14), 5), true, [id=#25] -(40) Sort [codegen id : 10] -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 11] +Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: [coalesce(i_brand_id#12, 0) ASC NULLS FIRST, isnull(i_brand_id#12) ASC NULLS FIRST, coalesce(i_class_id#13, 0) ASC NULLS FIRST, isnull(i_class_id#13) ASC NULLS FIRST, coalesce(i_category_id#14, 0) ASC NULLS FIRST, isnull(i_category_id#14) ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] -Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] +(46) SortMergeJoin +Left keys [6]: [coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20)] +Right keys [6]: [coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14)] Join condition: None -(42) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] +(47) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#26, ws_item_sk#27] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 13] -Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] +(48) ColumnarToRow [codegen id : 14] +Input [2]: [ws_sold_date_sk#26, ws_item_sk#27] -(44) Filter [codegen id : 13] -Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) +(49) Filter [codegen id : 14] +Input [2]: [ws_sold_date_sk#26, ws_item_sk#27] +Condition : (isnotnull(ws_item_sk#27) AND isnotnull(ws_sold_date_sk#26)) -(45) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] +(50) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#1] -(46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +(51) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#26] +Right keys [1]: [d_date_sk#1] Join condition: None -(47) Project [codegen id : 13] -Output [1]: [ws_item_sk#23] -Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] +(52) Project [codegen id : 14] +Output [1]: [ws_item_sk#27] +Input [3]: [ws_sold_date_sk#26, ws_item_sk#27, d_date_sk#1] -(48) ReusedExchange [Reuses operator id: 36] -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(53) ReusedExchange [Reuses operator id: 41] +Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(49) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_item_sk#23] -Right keys [1]: [i_item_sk#6] +(54) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_item_sk#27] +Right keys [1]: [i_item_sk#11] Join condition: None -(50) Project [codegen id : 13] -Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Input [5]: [ws_item_sk#23, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +(55) Project [codegen id : 14] +Output [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Input [5]: [ws_item_sk#27, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -(51) Exchange -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#24] +(56) Exchange +Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: hashpartitioning(coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14), 5), true, [id=#28] -(52) Sort [codegen id : 14] -Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 +(57) Sort [codegen id : 15] +Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: [coalesce(i_brand_id#12, 0) ASC NULLS FIRST, isnull(i_brand_id#12) ASC NULLS FIRST, coalesce(i_class_id#13, 0) ASC NULLS FIRST, isnull(i_class_id#13) ASC NULLS FIRST, coalesce(i_category_id#14, 0) ASC NULLS FIRST, isnull(i_category_id#14) ASC NULLS FIRST], false, 0 -(53) SortMergeJoin -Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] -Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] +(58) SortMergeJoin +Left keys [6]: [coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20)] +Right keys [6]: [coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14)] Join condition: None -(54) HashAggregate [codegen id : 15] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(59) HashAggregate [codegen id : 16] +Input [3]: [brand_id#18, class_id#19, category_id#20] +Keys [3]: [brand_id#18, class_id#19, category_id#20] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#18, class_id#19, category_id#20] -(55) Exchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: hashpartitioning(brand_id#14, class_id#15, category_id#16, 5), true, [id=#25] +(60) Exchange +Input [3]: [brand_id#18, class_id#19, category_id#20] +Arguments: hashpartitioning(brand_id#18, class_id#19, category_id#20, 5), true, [id=#29] -(56) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(61) HashAggregate [codegen id : 17] +Input [3]: [brand_id#18, class_id#19, category_id#20] +Keys [3]: [brand_id#18, class_id#19, category_id#20] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#18, class_id#19, category_id#20] -(57) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(62) HashAggregate [codegen id : 17] +Input [3]: [brand_id#18, class_id#19, category_id#20] +Keys [3]: [brand_id#18, class_id#19, category_id#20] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#18, class_id#19, category_id#20] -(58) HashAggregate [codegen id : 16] -Input [3]: [brand_id#14, class_id#15, category_id#16] -Keys [3]: [brand_id#14, class_id#15, category_id#16] +(63) HashAggregate [codegen id : 17] +Input [3]: [brand_id#18, class_id#19, category_id#20] +Keys [3]: [brand_id#18, class_id#19, category_id#20] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#14, class_id#15, category_id#16] +Results [3]: [brand_id#18, class_id#19, category_id#20] -(59) BroadcastExchange -Input [3]: [brand_id#14, class_id#15, category_id#16] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#26] +(64) BroadcastExchange +Input [3]: [brand_id#18, class_id#19, category_id#20] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#30] -(60) BroadcastHashJoin [codegen id : 17] -Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Right keys [3]: [brand_id#14, class_id#15, category_id#16] +(65) BroadcastHashJoin [codegen id : 18] +Left keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Right keys [3]: [brand_id#18, class_id#19, category_id#20] Join condition: None -(61) Project [codegen id : 17] -Output [1]: [i_item_sk#6 AS ss_item_sk#27] -Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#14, class_id#15, category_id#16] +(66) Project [codegen id : 18] +Output [1]: [i_item_sk#11 AS ss_item_sk#31] +Input [7]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14, brand_id#18, class_id#19, category_id#20] -(62) Exchange -Input [1]: [ss_item_sk#27] -Arguments: hashpartitioning(ss_item_sk#27, 5), true, [id=#28] +(67) Exchange +Input [1]: [ss_item_sk#31] +Arguments: hashpartitioning(ss_item_sk#31, 5), true, [id=#32] -(63) Sort [codegen id : 18] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +(68) Sort [codegen id : 19] +Input [1]: [ss_item_sk#31] +Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 -(64) SortMergeJoin -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [ss_item_sk#27] +(69) SortMergeJoin +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [ss_item_sk#31] Join condition: None -(65) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_week_seq#29] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct - -(66) ColumnarToRow [codegen id : 19] -Input [2]: [d_date_sk#10, d_week_seq#29] - -(67) Filter [codegen id : 19] -Input [2]: [d_date_sk#10, d_week_seq#29] -Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#30, [id=#31])) AND isnotnull(d_date_sk#10)) - -(68) Project [codegen id : 19] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_week_seq#29] - -(69) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] - (70) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] Join condition: None (71) Project [codegen id : 38] -Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Output [3]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Input [5]: [d_date_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] (72) Scan parquet default.item -Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct (73) ColumnarToRow [codegen id : 20] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] (74) Filter [codegen id : 20] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Condition : (((isnotnull(i_item_sk#11) AND isnotnull(i_brand_id#12)) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) (75) Exchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#33] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: hashpartitioning(i_item_sk#11, 5), true, [id=#33] (76) Sort [codegen id : 21] -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Arguments: [i_item_sk#11 ASC NULLS FIRST], false, 0 -(77) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] +(77) ReusedExchange [Reuses operator id: 67] +Output [1]: [ss_item_sk#31] (78) Sort [codegen id : 37] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#31] +Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 (79) SortMergeJoin -Left keys [1]: [i_item_sk#6] -Right keys [1]: [ss_item_sk#27] +Left keys [1]: [i_item_sk#11] +Right keys [1]: [ss_item_sk#31] Join condition: None (80) BroadcastExchange -Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] (81) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [i_item_sk#11] Join condition: None (82) Project [codegen id : 38] -Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] -Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Output [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#12, i_class_id#13, i_category_id#14] +Input [7]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] (83) HashAggregate [codegen id : 38] -Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Input [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#12, i_class_id#13, i_category_id#14] +Keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#35, isEmpty#36, count#37] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] +Results [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] (84) Exchange -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] -Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#41] +Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] +Arguments: hashpartitioning(i_brand_id#12, i_class_id#13, i_category_id#14, 5), true, [id=#41] (85) HashAggregate [codegen id : 78] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] -Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42, count(1)#43] -Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sales#44, count(1)#43 AS number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] +Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] +Keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42, count(1)#43] +Results [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sales#44, count(1)#43 AS number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] (86) Filter [codegen id : 78] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46 as decimal(32,6)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) +Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46 as decimal(32,6)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) (87) Project [codegen id : 78] -Output [6]: [store AS channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] +Output [6]: [store AS channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45] +Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] -(88) ReusedExchange [Reuses operator id: 4] -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +(88) ReusedExchange [Reuses operator id: 9] +Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] (89) Sort [codegen id : 40] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Arguments: [ss_item_sk#7 ASC NULLS FIRST], false, 0 -(90) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] +(90) ReusedExchange [Reuses operator id: 67] +Output [1]: [ss_item_sk#31] (91) Sort [codegen id : 56] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#31] +Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 (92) SortMergeJoin -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [ss_item_sk#27] +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [ss_item_sk#31] Join condition: None (93) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_week_seq#29] +Output [2]: [d_date_sk#1, d_week_seq#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] ReadSchema: struct (94) ColumnarToRow [codegen id : 57] -Input [2]: [d_date_sk#10, d_week_seq#29] +Input [2]: [d_date_sk#1, d_week_seq#2] (95) Filter [codegen id : 57] -Input [2]: [d_date_sk#10, d_week_seq#29] -Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#10)) +Input [2]: [d_date_sk#1, d_week_seq#2] +Condition : ((isnotnull(d_week_seq#2) AND (d_week_seq#2 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#1)) (96) Project [codegen id : 57] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_week_seq#29] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_week_seq#2] (97) BroadcastExchange -Input [1]: [d_date_sk#10] +Input [1]: [d_date_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] (98) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#1] Join condition: None (99) Project [codegen id : 76] -Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Output [3]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Input [5]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9, d_date_sk#1] (100) ReusedExchange [Reuses operator id: 80] Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] (101) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#7] Right keys [1]: [i_item_sk#53] Join condition: None (102) Project [codegen id : 76] -Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#54, i_class_id#55, i_category_id#56] -Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Output [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [7]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] (103) HashAggregate [codegen id : 76] -Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#54, i_class_id#55, i_category_id#56] Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#57, isEmpty#58, count#59] Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#60, isEmpty#61, count#62] @@ -582,30 +582,30 @@ Arguments: hashpartitioning(i_brand_id#54, i_class_id#55, i_category_id#56, 5), (105) HashAggregate [codegen id : 77] Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#60, isEmpty#61, count#62] Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64, count(1)#65] -Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sales#66, count(1)#65 AS number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64, count(1)#65] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sales#66, count(1)#65 AS number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] (106) Filter [codegen id : 77] -Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) (107) Project [codegen id : 77] Output [6]: [store AS channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] -Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] (108) BroadcastExchange Input [6]: [channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#70] (109) BroadcastHashJoin [codegen id : 78] -Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Left keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] Right keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] Join condition: None (110) TakeOrderedAndProject -Input [12]: [channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] -Arguments: 100, [i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST], [channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] +Input [12]: [channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] +Arguments: 100, [i_brand_id#12 ASC NULLS FIRST, i_class_id#13 ASC NULLS FIRST, i_category_id#14 ASC NULLS FIRST], [channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] ===== Subqueries ===== @@ -639,101 +639,101 @@ Subquery:1 Hosting operator id = 86 Hosting Expression = Subquery scalar-subquer (111) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Output [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct (112) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Input [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] (113) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] -Condition : isnotnull(ss_sold_date_sk#1) +Input [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] +Condition : isnotnull(ss_sold_date_sk#6) (114) Scan parquet default.date_dim -Output [2]: [d_date_sk#10, d_year#11] +Output [2]: [d_date_sk#1, d_year#15] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (115) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#10, d_year#11] +Input [2]: [d_date_sk#1, d_year#15] (116) Filter [codegen id : 1] -Input [2]: [d_date_sk#10, d_year#11] -Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) +Input [2]: [d_date_sk#1, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#1)) (117) Project [codegen id : 1] -Output [1]: [d_date_sk#10] -Input [2]: [d_date_sk#10, d_year#11] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#15] (118) BroadcastExchange -Input [1]: [d_date_sk#10] +Input [1]: [d_date_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#71] (119) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#1] Join condition: None (120) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#72, ss_list_price#4 AS list_price#73] -Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Output [2]: [ss_quantity#8 AS quantity#72, ss_list_price#9 AS list_price#73] +Input [4]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9, d_date_sk#1] (121) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] +Output [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct (122) ColumnarToRow [codegen id : 4] -Input [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] +Input [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] (123) Filter [codegen id : 4] -Input [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] -Condition : isnotnull(cs_sold_date_sk#18) +Input [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] +Condition : isnotnull(cs_sold_date_sk#22) (124) ReusedExchange [Reuses operator id: 118] -Output [1]: [d_date_sk#10] +Output [1]: [d_date_sk#1] (125) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [cs_sold_date_sk#22] +Right keys [1]: [d_date_sk#1] Join condition: None (126) Project [codegen id : 4] Output [2]: [cs_quantity#74 AS quantity#76, cs_list_price#75 AS list_price#77] -Input [4]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75, d_date_sk#10] +Input [4]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75, d_date_sk#1] (127) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] +Output [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct (128) ColumnarToRow [codegen id : 6] -Input [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] +Input [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] (129) Filter [codegen id : 6] -Input [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] -Condition : isnotnull(ws_sold_date_sk#22) +Input [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] +Condition : isnotnull(ws_sold_date_sk#26) (130) ReusedExchange [Reuses operator id: 118] -Output [1]: [d_date_sk#10] +Output [1]: [d_date_sk#1] (131) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [ws_sold_date_sk#26] +Right keys [1]: [d_date_sk#1] Join condition: None (132) Project [codegen id : 6] Output [2]: [ws_quantity#78 AS quantity#80, ws_list_price#79 AS list_price#81] -Input [4]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79, d_date_sk#10] +Input [4]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79, d_date_sk#1] (133) Union @@ -755,7 +755,7 @@ Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as de Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#73 as decimal(12,2)))), DecimalType(18,2), true))#87] Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#73 as decimal(12,2)))), DecimalType(18,2), true))#87 AS average_sales#88] -Subquery:2 Hosting operator id = 67 Hosting Expression = Subquery scalar-subquery#30, [id=#31] +Subquery:2 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#3, [id=#4] * Project (140) +- * Filter (139) +- * ColumnarToRow (138) @@ -763,22 +763,22 @@ Subquery:2 Hosting operator id = 67 Hosting Expression = Subquery scalar-subquer (137) Scan parquet default.date_dim -Output [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Output [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)] ReadSchema: struct (138) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] (139) Filter [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#11 = 2000)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Condition : (((((isnotnull(d_year#15) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#15 = 2000)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) (140) Project [codegen id : 1] -Output [1]: [d_week_seq#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Output [1]: [d_week_seq#2] +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] @@ -790,21 +790,21 @@ Subquery:4 Hosting operator id = 95 Hosting Expression = Subquery scalar-subquer (141) Scan parquet default.date_dim -Output [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Output [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)] ReadSchema: struct (142) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] (143) Filter [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#11 = 1999)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Condition : (((((isnotnull(d_year#15) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#15 = 1999)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) (144) Project [codegen id : 1] -Output [1]: [d_week_seq#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Output [1]: [d_week_seq#2] +Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt index d6b8ba4395d2e..7c6035cef4d71 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt @@ -53,23 +53,38 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #1 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #2 - WholeStageCodegen (1) + Exchange [ss_item_sk] #3 + WholeStageCodegen (2) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] - WholeStageCodegen (18) + WholeStageCodegen (19) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #3 - WholeStageCodegen (17) + Exchange [ss_item_sk] #4 + WholeStageCodegen (18) Project [i_item_sk] BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] Filter [i_brand_id,i_class_id,i_category_id] @@ -77,23 +92,23 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (16) + BroadcastExchange #5 + WholeStageCodegen (17) HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #5 - WholeStageCodegen (15) + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (16) HashAggregate [brand_id,class_id,category_id] InputAdapter SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (6) + WholeStageCodegen (7) Sort [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #6 - WholeStageCodegen (5) + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (6) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] @@ -103,25 +118,25 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (3) + BroadcastExchange #8 + WholeStageCodegen (4) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter - BroadcastExchange #8 - WholeStageCodegen (4) + BroadcastExchange #9 + WholeStageCodegen (5) Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (10) + WholeStageCodegen (11) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #9 - WholeStageCodegen (9) + Exchange [i_brand_id,i_class_id,i_category_id] #10 + WholeStageCodegen (10) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] @@ -131,19 +146,19 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [d_date_sk] #8 InputAdapter - BroadcastExchange #10 - WholeStageCodegen (8) + BroadcastExchange #11 + WholeStageCodegen (9) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (14) + WholeStageCodegen (15) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #11 - WholeStageCodegen (13) + Exchange [i_brand_id,i_class_id,i_category_id] #12 + WholeStageCodegen (14) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] @@ -153,24 +168,9 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [d_date_sk] #8 InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10 - InputAdapter - BroadcastExchange #12 - WholeStageCodegen (19) - Project [d_date_sk] - Filter [d_week_seq,d_date_sk] - Subquery #1 - WholeStageCodegen (1) - Project [d_week_seq] - Filter [d_year,d_moy,d_dom] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 InputAdapter BroadcastExchange #13 SortMergeJoin [i_item_sk,ss_item_sk] @@ -186,7 +186,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (37) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #3 + ReusedExchange [ss_item_sk] #4 InputAdapter BroadcastExchange #17 WholeStageCodegen (77) @@ -207,11 +207,11 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (40) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 + ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #3 WholeStageCodegen (56) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #3 + ReusedExchange [ss_item_sk] #4 InputAdapter BroadcastExchange #19 WholeStageCodegen (57) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt index 5aa95486f8209..6b86b55b2aa4f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt @@ -5,176 +5,176 @@ TakeOrderedAndProject (32) +- * HashAggregate (29) +- * Project (28) +- * SortMergeJoin Inner (27) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + :- * Sort (14) + : +- Exchange (13) + : +- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.customer (6) +- * Sort (26) +- Exchange (25) +- * Project (24) - +- * SortMergeJoin Inner (23) - :- * Sort (17) - : +- Exchange (16) - : +- * Filter (15) - : +- * ColumnarToRow (14) - : +- Scan parquet default.customer (13) - +- * Sort (22) - +- Exchange (21) + +- * BroadcastHashJoin Inner BuildRight (23) + :- * Filter (17) + : +- * ColumnarToRow (16) + : +- Scan parquet default.catalog_sales (15) + +- BroadcastExchange (22) + +- * Project (21) +- * Filter (20) +- * ColumnarToRow (19) - +- Scan parquet default.customer_address (18) + +- Scan parquet default.date_dim (18) -(1) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] +(1) Scan parquet default.customer_address +Output [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] -(2) ColumnarToRow [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] +(3) Filter [codegen id : 1] +Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] +Condition : isnotnull(ca_address_sk#1) -(3) Filter [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] -Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1)) +(4) Exchange +Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] +Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#4] -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#4, d_year#5, d_qoy#6] +(5) Sort [codegen id : 2] +Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.customer +Output [2]: [c_customer_sk#5, c_current_addr_sk#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] +(7) ColumnarToRow [codegen id : 3] +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] -Condition : ((((isnotnull(d_qoy#6) AND isnotnull(d_year#5)) AND (d_qoy#6 = 2)) AND (d_year#5 = 2001)) AND isnotnull(d_date_sk#4)) +(8) Filter [codegen id : 3] +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +Condition : (isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#6)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] +(9) Exchange +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +Arguments: hashpartitioning(c_current_addr_sk#6, 5), true, [id=#7] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(10) Sort [codegen id : 4] +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +Arguments: [c_current_addr_sk#6 ASC NULLS FIRST], false, 0 -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +(11) SortMergeJoin [codegen id : 5] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#6] Join condition: None -(10) Project [codegen id : 2] -Output [2]: [cs_bill_customer_sk#2, cs_sales_price#3] -Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3, d_date_sk#4] +(12) Project [codegen id : 5] +Output [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] +Input [5]: [ca_address_sk#1, ca_state#2, ca_zip#3, c_customer_sk#5, c_current_addr_sk#6] -(11) Exchange -Input [2]: [cs_bill_customer_sk#2, cs_sales_price#3] -Arguments: hashpartitioning(cs_bill_customer_sk#2, 5), true, [id=#8] +(13) Exchange +Input [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] +Arguments: hashpartitioning(c_customer_sk#5, 5), true, [id=#8] -(12) Sort [codegen id : 3] -Input [2]: [cs_bill_customer_sk#2, cs_sales_price#3] -Arguments: [cs_bill_customer_sk#2 ASC NULLS FIRST], false, 0 +(14) Sort [codegen id : 6] +Input [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] +Arguments: [c_customer_sk#5 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.customer -Output [2]: [c_customer_sk#9, c_current_addr_sk#10] +(15) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct - -(14) ColumnarToRow [codegen id : 4] -Input [2]: [c_customer_sk#9, c_current_addr_sk#10] - -(15) Filter [codegen id : 4] -Input [2]: [c_customer_sk#9, c_current_addr_sk#10] -Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_current_addr_sk#10)) +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(16) Exchange -Input [2]: [c_customer_sk#9, c_current_addr_sk#10] -Arguments: hashpartitioning(c_current_addr_sk#10, 5), true, [id=#11] +(16) ColumnarToRow [codegen id : 8] +Input [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] -(17) Sort [codegen id : 5] -Input [2]: [c_customer_sk#9, c_current_addr_sk#10] -Arguments: [c_current_addr_sk#10 ASC NULLS FIRST], false, 0 +(17) Filter [codegen id : 8] +Input [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] +Condition : (isnotnull(cs_bill_customer_sk#10) AND isnotnull(cs_sold_date_sk#9)) -(18) Scan parquet default.customer_address -Output [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(19) ColumnarToRow [codegen id : 6] -Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] +(19) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(20) Filter [codegen id : 6] -Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] -Condition : isnotnull(ca_address_sk#12) +(20) Filter [codegen id : 7] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +Condition : ((((isnotnull(d_qoy#14) AND isnotnull(d_year#13)) AND (d_qoy#14 = 2)) AND (d_year#13 = 2001)) AND isnotnull(d_date_sk#12)) -(21) Exchange -Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] -Arguments: hashpartitioning(ca_address_sk#12, 5), true, [id=#15] +(21) Project [codegen id : 7] +Output [1]: [d_date_sk#12] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(22) Sort [codegen id : 7] -Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] -Arguments: [ca_address_sk#12 ASC NULLS FIRST], false, 0 +(22) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(23) SortMergeJoin [codegen id : 8] -Left keys [1]: [c_current_addr_sk#10] -Right keys [1]: [ca_address_sk#12] +(23) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#9] +Right keys [1]: [d_date_sk#12] Join condition: None (24) Project [codegen id : 8] -Output [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] -Input [5]: [c_customer_sk#9, c_current_addr_sk#10, ca_address_sk#12, ca_state#13, ca_zip#14] +Output [2]: [cs_bill_customer_sk#10, cs_sales_price#11] +Input [4]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11, d_date_sk#12] (25) Exchange -Input [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] -Arguments: hashpartitioning(c_customer_sk#9, 5), true, [id=#16] +Input [2]: [cs_bill_customer_sk#10, cs_sales_price#11] +Arguments: hashpartitioning(cs_bill_customer_sk#10, 5), true, [id=#16] (26) Sort [codegen id : 9] -Input [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] -Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 +Input [2]: [cs_bill_customer_sk#10, cs_sales_price#11] +Arguments: [cs_bill_customer_sk#10 ASC NULLS FIRST], false, 0 (27) SortMergeJoin [codegen id : 10] -Left keys [1]: [cs_bill_customer_sk#2] -Right keys [1]: [c_customer_sk#9] -Join condition: ((substr(ca_zip#14, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#13 IN (CA,WA,GA)) OR (cs_sales_price#3 > 500.00)) +Left keys [1]: [c_customer_sk#5] +Right keys [1]: [cs_bill_customer_sk#10] +Join condition: ((substr(ca_zip#3, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#2 IN (CA,WA,GA)) OR (cs_sales_price#11 > 500.00)) (28) Project [codegen id : 10] -Output [2]: [cs_sales_price#3, ca_zip#14] -Input [5]: [cs_bill_customer_sk#2, cs_sales_price#3, c_customer_sk#9, ca_state#13, ca_zip#14] +Output [2]: [cs_sales_price#11, ca_zip#3] +Input [5]: [ca_state#2, ca_zip#3, c_customer_sk#5, cs_bill_customer_sk#10, cs_sales_price#11] (29) HashAggregate [codegen id : 10] -Input [2]: [cs_sales_price#3, ca_zip#14] -Keys [1]: [ca_zip#14] -Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#3))] +Input [2]: [cs_sales_price#11, ca_zip#3] +Keys [1]: [ca_zip#3] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#11))] Aggregate Attributes [1]: [sum#17] -Results [2]: [ca_zip#14, sum#18] +Results [2]: [ca_zip#3, sum#18] (30) Exchange -Input [2]: [ca_zip#14, sum#18] -Arguments: hashpartitioning(ca_zip#14, 5), true, [id=#19] +Input [2]: [ca_zip#3, sum#18] +Arguments: hashpartitioning(ca_zip#3, 5), true, [id=#19] (31) HashAggregate [codegen id : 11] -Input [2]: [ca_zip#14, sum#18] -Keys [1]: [ca_zip#14] -Functions [1]: [sum(UnscaledValue(cs_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#20] -Results [2]: [ca_zip#14, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#20,17,2) AS sum(cs_sales_price)#21] +Input [2]: [ca_zip#3, sum#18] +Keys [1]: [ca_zip#3] +Functions [1]: [sum(UnscaledValue(cs_sales_price#11))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#11))#20] +Results [2]: [ca_zip#3, MakeDecimal(sum(UnscaledValue(cs_sales_price#11))#20,17,2) AS sum(cs_sales_price)#21] (32) TakeOrderedAndProject -Input [2]: [ca_zip#14, sum(cs_sales_price)#21] -Arguments: 100, [ca_zip#14 ASC NULLS FIRST], [ca_zip#14, sum(cs_sales_price)#21] +Input [2]: [ca_zip#3, sum(cs_sales_price)#21] +Arguments: 100, [ca_zip#3 ASC NULLS FIRST], [ca_zip#3, sum(cs_sales_price)#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt index cd452ad14548c..710bcac90b971 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt @@ -6,13 +6,41 @@ TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] WholeStageCodegen (10) HashAggregate [ca_zip,cs_sales_price] [sum,sum] Project [cs_sales_price,ca_zip] - SortMergeJoin [cs_bill_customer_sk,c_customer_sk,ca_zip,ca_state,cs_sales_price] + SortMergeJoin [c_customer_sk,cs_bill_customer_sk,ca_zip,ca_state,cs_sales_price] InputAdapter - WholeStageCodegen (3) + WholeStageCodegen (6) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #2 + WholeStageCodegen (5) + Project [ca_state,ca_zip,c_customer_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #3 + WholeStageCodegen (1) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] + InputAdapter + WholeStageCodegen (4) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #4 + WholeStageCodegen (3) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (9) Sort [cs_bill_customer_sk] InputAdapter - Exchange [cs_bill_customer_sk] #2 - WholeStageCodegen (2) + Exchange [cs_bill_customer_sk] #5 + WholeStageCodegen (8) Project [cs_bill_customer_sk,cs_sales_price] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_bill_customer_sk,cs_sold_date_sk] @@ -20,38 +48,10 @@ TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_sales_price] InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) + BroadcastExchange #6 + WholeStageCodegen (7) Project [d_date_sk] Filter [d_qoy,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - InputAdapter - WholeStageCodegen (9) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (8) - Project [c_customer_sk,ca_state,ca_zip] - SortMergeJoin [c_current_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (5) - Sort [c_current_addr_sk] - InputAdapter - Exchange [c_current_addr_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] - InputAdapter - WholeStageCodegen (7) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #6 - WholeStageCodegen (6) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt index 509fb0133095b..d7e8e52208058 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -37,12 +37,12 @@ TakeOrderedAndProject (44) : +- * Project (28) : +- * Filter (27) : +- * ColumnarToRow (26) - : +- Scan parquet default.call_center (25) + : +- Scan parquet default.date_dim (25) +- BroadcastExchange (36) +- * Project (35) +- * Filter (34) +- * ColumnarToRow (33) - +- Scan parquet default.date_dim (32) + +- Scan parquet default.call_center (32) (1) Scan parquet default.catalog_sales @@ -150,67 +150,67 @@ Join condition: None Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#14] -(25) Scan parquet default.call_center -Output [2]: [cc_call_center_sk#17, cc_county#18] +(25) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/call_center] -PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (26) ColumnarToRow [codegen id : 9] -Input [2]: [cc_call_center_sk#17, cc_county#18] +Input [2]: [d_date_sk#17, d_date#18] (27) Filter [codegen id : 9] -Input [2]: [cc_call_center_sk#17, cc_county#18] -Condition : ((isnotnull(cc_county#18) AND (cc_county#18 = Williamson County)) AND isnotnull(cc_call_center_sk#17)) +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 11719)) AND (d_date#18 <= 11779)) AND isnotnull(d_date_sk#17)) (28) Project [codegen id : 9] -Output [1]: [cc_call_center_sk#17] -Input [2]: [cc_call_center_sk#17, cc_county#18] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] (29) BroadcastExchange -Input [1]: [cc_call_center_sk#17] +Input [1]: [d_date_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (30) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_call_center_sk#3] -Right keys [1]: [cc_call_center_sk#17] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#17] Join condition: None (31) Project [codegen id : 11] -Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#17] +Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#17] -(32) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_date#21] +(32) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#20, cc_county#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] +ReadSchema: struct (33) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#20, d_date#21] +Input [2]: [cc_call_center_sk#20, cc_county#21] (34) Filter [codegen id : 10] -Input [2]: [d_date_sk#20, d_date#21] -Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 11719)) AND (d_date#21 <= 11779)) AND isnotnull(d_date_sk#20)) +Input [2]: [cc_call_center_sk#20, cc_county#21] +Condition : ((isnotnull(cc_county#21) AND (cc_county#21 = Williamson County)) AND isnotnull(cc_call_center_sk#20)) (35) Project [codegen id : 10] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_date#21] +Output [1]: [cc_call_center_sk#20] +Input [2]: [cc_call_center_sk#20, cc_county#21] (36) BroadcastExchange -Input [1]: [d_date_sk#20] +Input [1]: [cc_call_center_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_ship_date_sk#1] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#20] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#20] +Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#20] (39) HashAggregate [codegen id : 11] Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt index ea9a0b27ff700..d2b88a409c0ab 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt @@ -8,9 +8,9 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] Project [cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_ship_date_sk,d_date_sk] - Project [cs_ship_date_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] Project [cs_ship_date_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk] InputAdapter @@ -56,16 +56,16 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] InputAdapter BroadcastExchange #6 WholeStageCodegen (9) - Project [cc_call_center_sk] - Filter [cc_county,cc_call_center_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.call_center [cc_call_center_sk,cc_county] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #7 WholeStageCodegen (10) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [cc_call_center_sk] + Filter [cc_county,cc_call_center_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.call_center [cc_call_center_sk,cc_county] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt index a17356ae04a03..4495dcd5821ad 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt @@ -18,15 +18,15 @@ TakeOrderedAndProject (57) : : : +- * Project (16) : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (8) - : : : : +- * Project (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) : : : +- BroadcastExchange (14) : : : +- * Filter (13) : : : +- * ColumnarToRow (12) @@ -39,69 +39,69 @@ TakeOrderedAndProject (57) : +- * Sort (39) : +- Exchange (38) : +- * Project (37) - : +- * BroadcastHashJoin Inner BuildRight (36) - : :- * Filter (30) - : : +- * ColumnarToRow (29) - : : +- Scan parquet default.store_returns (28) - : +- BroadcastExchange (35) - : +- * Project (34) - : +- * Filter (33) - : +- * ColumnarToRow (32) - : +- Scan parquet default.date_dim (31) + : +- * BroadcastHashJoin Inner BuildLeft (36) + : :- BroadcastExchange (32) + : : +- * Project (31) + : : +- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.date_dim (28) + : +- * Filter (35) + : +- * ColumnarToRow (34) + : +- Scan parquet default.store_returns (33) +- * Sort (51) +- Exchange (50) +- * Project (49) - +- * BroadcastHashJoin Inner BuildRight (48) - :- * Filter (46) - : +- * ColumnarToRow (45) - : +- Scan parquet default.catalog_sales (44) - +- ReusedExchange (47) + +- * BroadcastHashJoin Inner BuildLeft (48) + :- ReusedExchange (44) + +- * Filter (47) + +- * ColumnarToRow (46) + +- Scan parquet default.catalog_sales (45) -(1) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] - -(3) Filter [codegen id : 3] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] -Condition : ((((isnotnull(ss_customer_sk#3) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_ticket_number#5)) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_quarter_name#8] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_quarter_name#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#7, d_quarter_name#8] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_quarter_name#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#7, d_quarter_name#8] -Condition : ((isnotnull(d_quarter_name#8) AND (d_quarter_name#8 = 2001Q1)) AND isnotnull(d_date_sk#7)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_quarter_name#2] +Condition : ((isnotnull(d_quarter_name#2) AND (d_quarter_name#2 = 2001Q1)) AND isnotnull(d_date_sk#1)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_quarter_name#8] +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_quarter_name#2] -(8) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] + +(8) Filter +Input [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] +Condition : ((((isnotnull(ss_customer_sk#6) AND isnotnull(ss_item_sk#5)) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_sold_date_sk#4)) AND isnotnull(ss_store_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6, d_date_sk#7] +Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] +Input [7]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_state#11] @@ -122,21 +122,21 @@ Input [2]: [s_store_sk#10, s_state#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#10] Join condition: None (16) Project [codegen id : 3] -Output [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] -Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6, s_store_sk#10, s_state#11] +Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] +Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9, s_store_sk#10, s_state#11] (17) Exchange -Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#13] +Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] +Arguments: hashpartitioning(ss_item_sk#5, 5), true, [id=#13] (18) Sort [codegen id : 4] -Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] +Arguments: [ss_item_sk#5 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [3]: [i_item_sk#14, i_item_id#15, i_item_desc#16] @@ -161,139 +161,139 @@ Input [3]: [i_item_sk#14, i_item_id#15, i_item_desc#16] Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#14] Join condition: None (25) Project [codegen id : 7] -Output [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] -Input [8]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_sk#14, i_item_id#15, i_item_desc#16] +Output [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] +Input [8]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_sk#14, i_item_id#15, i_item_desc#16] (26) Exchange -Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] -Arguments: hashpartitioning(cast(ss_customer_sk#3 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint), 5), true, [id=#18] +Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] +Arguments: hashpartitioning(cast(ss_customer_sk#6 as bigint), cast(ss_item_sk#5 as bigint), cast(ss_ticket_number#8 as bigint), 5), true, [id=#18] (27) Sort [codegen id : 8] -Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] -Arguments: [cast(ss_customer_sk#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#5 as bigint) ASC NULLS FIRST], false, 0 - -(28) Scan parquet default.store_returns -Output [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct +Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] +Arguments: [cast(ss_customer_sk#6 as bigint) ASC NULLS FIRST, cast(ss_item_sk#5 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#8 as bigint) ASC NULLS FIRST], false, 0 -(29) ColumnarToRow [codegen id : 10] -Input [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] - -(30) Filter [codegen id : 10] -Input [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Condition : (((isnotnull(sr_customer_sk#21) AND isnotnull(sr_item_sk#20)) AND isnotnull(sr_ticket_number#22)) AND isnotnull(sr_returned_date_sk#19)) - -(31) Scan parquet default.date_dim -Output [2]: [d_date_sk#24, d_quarter_name#25] +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_quarter_name#20] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] ReadSchema: struct -(32) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#24, d_quarter_name#25] +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#19, d_quarter_name#20] -(33) Filter [codegen id : 9] -Input [2]: [d_date_sk#24, d_quarter_name#25] -Condition : (d_quarter_name#25 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#24)) +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#19, d_quarter_name#20] +Condition : (d_quarter_name#20 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#19)) -(34) Project [codegen id : 9] -Output [1]: [d_date_sk#24] -Input [2]: [d_date_sk#24, d_quarter_name#25] +(31) Project [codegen id : 9] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_quarter_name#20] -(35) BroadcastExchange -Input [1]: [d_date_sk#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] +(32) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(33) Scan parquet default.store_returns +Output [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct + +(34) ColumnarToRow +Input [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] + +(35) Filter +Input [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Condition : (((isnotnull(sr_customer_sk#24) AND isnotnull(sr_item_sk#23)) AND isnotnull(sr_ticket_number#25)) AND isnotnull(sr_returned_date_sk#22)) (36) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [sr_returned_date_sk#19] -Right keys [1]: [cast(d_date_sk#24 as bigint)] +Left keys [1]: [cast(d_date_sk#19 as bigint)] +Right keys [1]: [sr_returned_date_sk#22] Join condition: None (37) Project [codegen id : 10] -Output [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Input [6]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, d_date_sk#24] +Output [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Input [6]: [d_date_sk#19, sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] (38) Exchange -Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22, 5), true, [id=#27] +Input [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Arguments: hashpartitioning(sr_customer_sk#24, sr_item_sk#23, sr_ticket_number#25, 5), true, [id=#27] (39) Sort [codegen id : 11] -Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST, sr_ticket_number#22 ASC NULLS FIRST], false, 0 +Input [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Arguments: [sr_customer_sk#24 ASC NULLS FIRST, sr_item_sk#23 ASC NULLS FIRST, sr_ticket_number#25 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [3]: [cast(ss_customer_sk#3 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint)] -Right keys [3]: [sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22] +Left keys [3]: [cast(ss_customer_sk#6 as bigint), cast(ss_item_sk#5 as bigint), cast(ss_ticket_number#8 as bigint)] +Right keys [3]: [sr_customer_sk#24, sr_item_sk#23, sr_ticket_number#25] Join condition: None (41) Project [codegen id : 12] -Output [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] -Input [11]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Output [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] +Input [11]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] (42) Exchange -Input [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] -Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, 5), true, [id=#28] +Input [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] +Arguments: hashpartitioning(sr_customer_sk#24, sr_item_sk#23, 5), true, [id=#28] (43) Sort [codegen id : 13] -Input [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] -Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST], false, 0 +Input [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] +Arguments: [sr_customer_sk#24 ASC NULLS FIRST, sr_item_sk#23 ASC NULLS FIRST], false, 0 + +(44) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#29] -(44) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +(45) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(45) ColumnarToRow [codegen id : 15] -Input [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] - -(46) Filter [codegen id : 15] -Input [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Condition : ((isnotnull(cs_bill_customer_sk#30) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_sold_date_sk#29)) +(46) ColumnarToRow +Input [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] -(47) ReusedExchange [Reuses operator id: 35] -Output [1]: [d_date_sk#33] +(47) Filter +Input [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Condition : ((isnotnull(cs_bill_customer_sk#31) AND isnotnull(cs_item_sk#32)) AND isnotnull(cs_sold_date_sk#30)) (48) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [cs_sold_date_sk#29] -Right keys [1]: [d_date_sk#33] +Left keys [1]: [d_date_sk#29] +Right keys [1]: [cs_sold_date_sk#30] Join condition: None (49) Project [codegen id : 15] -Output [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Input [5]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, d_date_sk#33] +Output [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Input [5]: [d_date_sk#29, cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] (50) Exchange -Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint), 5), true, [id=#34] +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: hashpartitioning(cast(cs_bill_customer_sk#31 as bigint), cast(cs_item_sk#32 as bigint), 5), true, [id=#34] (51) Sort [codegen id : 16] -Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] -Arguments: [cast(cs_bill_customer_sk#30 as bigint) ASC NULLS FIRST, cast(cs_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: [cast(cs_bill_customer_sk#31 as bigint) ASC NULLS FIRST, cast(cs_item_sk#32 as bigint) ASC NULLS FIRST], false, 0 (52) SortMergeJoin [codegen id : 17] -Left keys [2]: [sr_customer_sk#21, sr_item_sk#20] -Right keys [2]: [cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint)] +Left keys [2]: [sr_customer_sk#24, sr_item_sk#23] +Right keys [2]: [cast(cs_bill_customer_sk#31 as bigint), cast(cs_item_sk#32 as bigint)] Join condition: None (53) Project [codegen id : 17] -Output [6]: [ss_quantity#6, sr_return_quantity#23, cs_quantity#32, s_state#11, i_item_id#15, i_item_desc#16] -Input [10]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Output [6]: [ss_quantity#9, sr_return_quantity#26, cs_quantity#33, s_state#11, i_item_id#15, i_item_desc#16] +Input [10]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] (54) HashAggregate [codegen id : 17] -Input [6]: [ss_quantity#6, sr_return_quantity#23, cs_quantity#32, s_state#11, i_item_id#15, i_item_desc#16] +Input [6]: [ss_quantity#9, sr_return_quantity#26, cs_quantity#33, s_state#11, i_item_id#15, i_item_desc#16] Keys [3]: [i_item_id#15, i_item_desc#16, s_state#11] -Functions [9]: [partial_count(ss_quantity#6), partial_avg(cast(ss_quantity#6 as bigint)), partial_stddev_samp(cast(ss_quantity#6 as double)), partial_count(sr_return_quantity#23), partial_avg(cast(sr_return_quantity#23 as bigint)), partial_stddev_samp(cast(sr_return_quantity#23 as double)), partial_count(cs_quantity#32), partial_avg(cast(cs_quantity#32 as bigint)), partial_stddev_samp(cast(cs_quantity#32 as double))] +Functions [9]: [partial_count(ss_quantity#9), partial_avg(cast(ss_quantity#9 as bigint)), partial_stddev_samp(cast(ss_quantity#9 as double)), partial_count(sr_return_quantity#26), partial_avg(cast(sr_return_quantity#26 as bigint)), partial_stddev_samp(cast(sr_return_quantity#26 as double)), partial_count(cs_quantity#33), partial_avg(cast(cs_quantity#33 as bigint)), partial_stddev_samp(cast(cs_quantity#33 as double))] Aggregate Attributes [18]: [count#35, sum#36, count#37, n#38, avg#39, m2#40, count#41, sum#42, count#43, n#44, avg#45, m2#46, count#47, sum#48, count#49, n#50, avg#51, m2#52] Results [21]: [i_item_id#15, i_item_desc#16, s_state#11, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] @@ -304,9 +304,9 @@ Arguments: hashpartitioning(i_item_id#15, i_item_desc#16, s_state#11, 5), true, (56) HashAggregate [codegen id : 18] Input [21]: [i_item_id#15, i_item_desc#16, s_state#11, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] Keys [3]: [i_item_id#15, i_item_desc#16, s_state#11] -Functions [9]: [count(ss_quantity#6), avg(cast(ss_quantity#6 as bigint)), stddev_samp(cast(ss_quantity#6 as double)), count(sr_return_quantity#23), avg(cast(sr_return_quantity#23 as bigint)), stddev_samp(cast(sr_return_quantity#23 as double)), count(cs_quantity#32), avg(cast(cs_quantity#32 as bigint)), stddev_samp(cast(cs_quantity#32 as double))] -Aggregate Attributes [9]: [count(ss_quantity#6)#72, avg(cast(ss_quantity#6 as bigint))#73, stddev_samp(cast(ss_quantity#6 as double))#74, count(sr_return_quantity#23)#75, avg(cast(sr_return_quantity#23 as bigint))#76, stddev_samp(cast(sr_return_quantity#23 as double))#77, count(cs_quantity#32)#78, avg(cast(cs_quantity#32 as bigint))#79, stddev_samp(cast(cs_quantity#32 as double))#80] -Results [15]: [i_item_id#15, i_item_desc#16, s_state#11, count(ss_quantity#6)#72 AS store_sales_quantitycount#81, avg(cast(ss_quantity#6 as bigint))#73 AS store_sales_quantityave#82, stddev_samp(cast(ss_quantity#6 as double))#74 AS store_sales_quantitystdev#83, (stddev_samp(cast(ss_quantity#6 as double))#74 / avg(cast(ss_quantity#6 as bigint))#73) AS store_sales_quantitycov#84, count(sr_return_quantity#23)#75 AS as_store_returns_quantitycount#85, avg(cast(sr_return_quantity#23 as bigint))#76 AS as_store_returns_quantityave#86, stddev_samp(cast(sr_return_quantity#23 as double))#77 AS as_store_returns_quantitystdev#87, (stddev_samp(cast(sr_return_quantity#23 as double))#77 / avg(cast(sr_return_quantity#23 as bigint))#76) AS store_returns_quantitycov#88, count(cs_quantity#32)#78 AS catalog_sales_quantitycount#89, avg(cast(cs_quantity#32 as bigint))#79 AS catalog_sales_quantityave#90, (stddev_samp(cast(cs_quantity#32 as double))#80 / avg(cast(cs_quantity#32 as bigint))#79) AS catalog_sales_quantitystdev#91, (stddev_samp(cast(cs_quantity#32 as double))#80 / avg(cast(cs_quantity#32 as bigint))#79) AS catalog_sales_quantitycov#92] +Functions [9]: [count(ss_quantity#9), avg(cast(ss_quantity#9 as bigint)), stddev_samp(cast(ss_quantity#9 as double)), count(sr_return_quantity#26), avg(cast(sr_return_quantity#26 as bigint)), stddev_samp(cast(sr_return_quantity#26 as double)), count(cs_quantity#33), avg(cast(cs_quantity#33 as bigint)), stddev_samp(cast(cs_quantity#33 as double))] +Aggregate Attributes [9]: [count(ss_quantity#9)#72, avg(cast(ss_quantity#9 as bigint))#73, stddev_samp(cast(ss_quantity#9 as double))#74, count(sr_return_quantity#26)#75, avg(cast(sr_return_quantity#26 as bigint))#76, stddev_samp(cast(sr_return_quantity#26 as double))#77, count(cs_quantity#33)#78, avg(cast(cs_quantity#33 as bigint))#79, stddev_samp(cast(cs_quantity#33 as double))#80] +Results [15]: [i_item_id#15, i_item_desc#16, s_state#11, count(ss_quantity#9)#72 AS store_sales_quantitycount#81, avg(cast(ss_quantity#9 as bigint))#73 AS store_sales_quantityave#82, stddev_samp(cast(ss_quantity#9 as double))#74 AS store_sales_quantitystdev#83, (stddev_samp(cast(ss_quantity#9 as double))#74 / avg(cast(ss_quantity#9 as bigint))#73) AS store_sales_quantitycov#84, count(sr_return_quantity#26)#75 AS as_store_returns_quantitycount#85, avg(cast(sr_return_quantity#26 as bigint))#76 AS as_store_returns_quantityave#86, stddev_samp(cast(sr_return_quantity#26 as double))#77 AS as_store_returns_quantitystdev#87, (stddev_samp(cast(sr_return_quantity#26 as double))#77 / avg(cast(sr_return_quantity#26 as bigint))#76) AS store_returns_quantitycov#88, count(cs_quantity#33)#78 AS catalog_sales_quantitycount#89, avg(cast(cs_quantity#33 as bigint))#79 AS catalog_sales_quantityave#90, (stddev_samp(cast(cs_quantity#33 as double))#80 / avg(cast(cs_quantity#33 as bigint))#79) AS catalog_sales_quantitystdev#91, (stddev_samp(cast(cs_quantity#33 as double))#80 / avg(cast(cs_quantity#33 as bigint))#79) AS catalog_sales_quantitycov#92] (57) TakeOrderedAndProject Input [15]: [i_item_id#15, i_item_desc#16, s_state#11, store_sales_quantitycount#81, store_sales_quantityave#82, store_sales_quantitystdev#83, store_sales_quantitycov#84, as_store_returns_quantitycount#85, as_store_returns_quantityave#86, as_store_returns_quantitystdev#87, store_returns_quantitycov#88, catalog_sales_quantitycount#89, catalog_sales_quantityave#90, catalog_sales_quantitystdev#91, catalog_sales_quantitycov#92] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt index bfb59441f483b..1bb1679d6208e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt @@ -32,11 +32,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -45,6 +41,10 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_quarter_name] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) @@ -69,11 +69,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 WholeStageCodegen (10) Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Filter [sr_customer_sk,sr_item_sk,sr_ticket_number,sr_returned_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] + BroadcastHashJoin [d_date_sk,sr_returned_date_sk] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -82,6 +78,10 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_quarter_name] + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number,sr_returned_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] InputAdapter WholeStageCodegen (16) Sort [cs_bill_customer_sk,cs_item_sk] @@ -89,10 +89,10 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Exchange [cs_bill_customer_sk,cs_item_sk] #10 WholeStageCodegen (15) Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #9 Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] - InputAdapter - ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt index 88b5168f6049c..353620897fc40 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (45) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.item (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.item (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -46,50 +46,50 @@ TakeOrderedAndProject (45) +- Scan parquet default.customer_address (31) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] - -(3) Filter [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] -Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_store_sk#4)) - -(4) Scan parquet default.item -Output [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] -(6) Filter [codegen id : 1] -Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] -Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 8)) AND isnotnull(i_item_sk#6)) +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] +Condition : ((isnotnull(i_manager_id#6) AND (i_manager_id#6 = 8)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [5]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] + +(5) BroadcastExchange +Input [5]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [5]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] -(8) BroadcastExchange -Input [5]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(8) Filter +Input [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +Condition : (((isnotnull(ss_sold_date_sk#8) AND isnotnull(ss_item_sk#9)) AND isnotnull(ss_customer_sk#10)) AND isnotnull(ss_store_sk#11)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#9] Join condition: None (10) Project [codegen id : 4] -Output [8]: [ss_sold_date_sk#1, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Input [10]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Output [8]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +Input [10]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#13, d_year#14, d_moy#15] @@ -114,13 +114,13 @@ Input [1]: [d_date_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#8] Right keys [1]: [d_date_sk#13] Join condition: None (17) Project [codegen id : 4] -Output [7]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Input [9]: [ss_sold_date_sk#1, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, d_date_sk#13] +Output [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12, d_date_sk#13] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_zip#18] @@ -141,21 +141,21 @@ Input [2]: [s_store_sk#17, s_zip#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#11] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] -Input [9]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_store_sk#17, s_zip#18] +Output [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] +Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12, s_store_sk#17, s_zip#18] (24) Exchange -Input [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] -Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#20] +Input [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] +Arguments: hashpartitioning(ss_customer_sk#10, 5), true, [id=#20] (25) Sort [codegen id : 5] -Input [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] -Arguments: [ss_customer_sk#3 ASC NULLS FIRST], false, 0 +Input [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] +Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false, 0 (26) Scan parquet default.customer Output [2]: [c_customer_sk#21, c_current_addr_sk#22] @@ -219,33 +219,33 @@ Input [2]: [c_customer_sk#21, ca_zip#25] Arguments: [c_customer_sk#21 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_customer_sk#3] +Left keys [1]: [ss_customer_sk#10] Right keys [1]: [c_customer_sk#21] Join condition: NOT (substr(ca_zip#25, 1, 5) = substr(s_zip#18, 1, 5)) (41) Project [codegen id : 12] -Output [5]: [ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Input [9]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18, c_customer_sk#21, ca_zip#25] +Output [5]: [ss_ext_sales_price#12, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] +Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18, c_customer_sk#21, ca_zip#25] (42) HashAggregate [codegen id : 12] -Input [5]: [ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] -Keys [4]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Input [5]: [ss_ext_sales_price#12, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] +Keys [4]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#12))] Aggregate Attributes [1]: [sum#28] -Results [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] +Results [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] (43) Exchange -Input [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] -Arguments: hashpartitioning(i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, 5), true, [id=#30] +Input [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, 5), true, [id=#30] (44) HashAggregate [codegen id : 13] -Input [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] -Keys [4]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#31] -Results [5]: [i_brand_id#7 AS brand_id#32, i_brand#8 AS brand#33, i_manufact_id#9, i_manufact#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#31,17,2) AS ext_price#34] +Input [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] +Keys [4]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#12))#31] +Results [5]: [i_brand_id#2 AS brand_id#32, i_brand#3 AS brand#33, i_manufact_id#4, i_manufact#5, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#12))#31,17,2) AS ext_price#34] (45) TakeOrderedAndProject -Input [5]: [brand_id#32, brand#33, i_manufact_id#9, i_manufact#10, ext_price#34] -Arguments: 100, [ext_price#34 DESC NULLS LAST, brand#33 ASC NULLS FIRST, brand_id#32 ASC NULLS FIRST, i_manufact_id#9 ASC NULLS FIRST, i_manufact#10 ASC NULLS FIRST], [brand_id#32, brand#33, i_manufact_id#9, i_manufact#10, ext_price#34] +Input [5]: [brand_id#32, brand#33, i_manufact_id#4, i_manufact#5, ext_price#34] +Arguments: 100, [ext_price#34 DESC NULLS LAST, brand#33 ASC NULLS FIRST, brand_id#32 ASC NULLS FIRST, i_manufact_id#4 ASC NULLS FIRST, i_manufact#5 ASC NULLS FIRST], [brand_id#32, brand#33, i_manufact_id#4, i_manufact#5, ext_price#34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt index 05fa3f82e27df..749e88cdd49c4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt @@ -13,16 +13,12 @@ TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] InputAdapter Exchange [ss_customer_sk] #2 WholeStageCodegen (4) - Project [ss_customer_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,s_zip] + Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_customer_sk,ss_ext_sales_price,s_zip] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_customer_sk,ss_store_sk,ss_ext_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_sold_date_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -31,6 +27,10 @@ TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt index 2ef3660bc7ba4..d297bea4aec63 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -8,145 +8,145 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.catalog_sales (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) -(1) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -(3) Filter [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Condition : (i_category#6 IN (Sports,Books,Home) AND isnotnull(i_item_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#7] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +Arguments: hashpartitioning(cs_item_sk#9, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +Arguments: [cs_item_sk#9 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#9] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_ext_sales_price#10] +Input [9]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [cs_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Input [8]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_ext_sales_price#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] +Input [6]: [cs_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#10))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#10))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#10))#18] +Results [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS _w1#21, i_item_id#2] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: hashpartitioning(i_class#5, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: [i_class#5 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#5] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#2] +Input [9]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] +Arguments: 100, [i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt index 1e8ab18f5e21a..aad2b527cb44d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [cs_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (2) - Project [cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [i_item_id,i_item_desc,i_current_price,i_class,i_category,cs_sold_date_sk,cs_ext_sales_price] + SortMergeJoin [i_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #3 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + WholeStageCodegen (4) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #4 + WholeStageCodegen (3) Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt index 9de369f611d0e..04cd0813d6471 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt @@ -9,15 +9,15 @@ TakeOrderedAndProject (27) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.item (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.inventory (6) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -28,50 +28,50 @@ TakeOrderedAndProject (27) +- Scan parquet default.warehouse (17) -(1) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] - -(3) Filter [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_warehouse_sk#3) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) - -(4) Scan parquet default.item -Output [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] -(6) Filter [codegen id : 1] -Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] -Condition : (((isnotnull(i_current_price#7) AND (i_current_price#7 >= 0.99)) AND (i_current_price#7 <= 1.49)) AND isnotnull(i_item_sk#5)) +(3) Filter [codegen id : 1] +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +Condition : (((isnotnull(i_current_price#3) AND (i_current_price#3 >= 0.99)) AND (i_current_price#3 <= 1.49)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_item_id#2] +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] + +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_item_id#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.inventory +Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [i_item_sk#5, i_item_id#6] -Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] +(7) ColumnarToRow +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -(8) BroadcastExchange -Input [2]: [i_item_sk#5, i_item_id#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Condition : ((isnotnull(inv_warehouse_sk#7) AND isnotnull(inv_item_sk#6)) AND isnotnull(inv_date_sk#5)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_item_sk#2] -Right keys [1]: [i_item_sk#5] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [4]: [inv_date_sk#1, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6] -Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_sk#5, i_item_id#6] +Output [4]: [i_item_id#2, inv_date_sk#5, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Input [6]: [i_item_sk#1, i_item_id#2, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#9, d_date#10] @@ -92,13 +92,13 @@ Input [2]: [d_date_sk#9, d_date#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_date_sk#1] +Left keys [1]: [inv_date_sk#5] Right keys [1]: [d_date_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date#10] -Input [6]: [inv_date_sk#1, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date_sk#9, d_date#10] +Output [4]: [i_item_id#2, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date#10] +Input [6]: [i_item_id#2, inv_date_sk#5, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date_sk#9, d_date#10] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#12, w_warehouse_name#13] @@ -119,37 +119,37 @@ Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#3] +Left keys [1]: [inv_warehouse_sk#7] Right keys [1]: [w_warehouse_sk#12] Join condition: None (22) Project [codegen id : 4] -Output [4]: [inv_quantity_on_hand#4, w_warehouse_name#13, i_item_id#6, d_date#10] -Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date#10, w_warehouse_sk#12, w_warehouse_name#13] +Output [4]: [inv_quantity_on_hand#8, w_warehouse_name#13, i_item_id#2, d_date#10] +Input [6]: [i_item_id#2, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date#10, w_warehouse_sk#12, w_warehouse_name#13] (23) HashAggregate [codegen id : 4] -Input [4]: [inv_quantity_on_hand#4, w_warehouse_name#13, i_item_id#6, d_date#10] -Keys [2]: [w_warehouse_name#13, i_item_id#6] -Functions [2]: [partial_sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))] +Input [4]: [inv_quantity_on_hand#8, w_warehouse_name#13, i_item_id#2, d_date#10] +Keys [2]: [w_warehouse_name#13, i_item_id#2] +Functions [2]: [partial_sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))] Aggregate Attributes [2]: [sum#15, sum#16] -Results [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] +Results [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] (24) Exchange -Input [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] -Arguments: hashpartitioning(w_warehouse_name#13, i_item_id#6, 5), true, [id=#19] +Input [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] +Arguments: hashpartitioning(w_warehouse_name#13, i_item_id#2, 5), true, [id=#19] (25) HashAggregate [codegen id : 5] -Input [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] -Keys [2]: [w_warehouse_name#13, i_item_id#6] -Functions [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint)), sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))] -Aggregate Attributes [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#20, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#21] -Results [4]: [w_warehouse_name#13, i_item_id#6, sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#20 AS inv_before#22, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#21 AS inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] +Keys [2]: [w_warehouse_name#13, i_item_id#2] +Functions [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint)), sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))] +Aggregate Attributes [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#20, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#21] +Results [4]: [w_warehouse_name#13, i_item_id#2, sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#20 AS inv_before#22, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#21 AS inv_after#23] (26) Filter [codegen id : 5] -Input [4]: [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] Condition : ((CASE WHEN (inv_before#22 > 0) THEN (cast(inv_after#23 as double) / cast(inv_before#22 as double)) ELSE null END >= 0.666667) AND (CASE WHEN (inv_before#22 > 0) THEN (cast(inv_after#23 as double) / cast(inv_before#22 as double)) ELSE null END <= 1.5)) (27) TakeOrderedAndProject -Input [4]: [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] -Arguments: 100, [w_warehouse_name#13 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST], [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] +Arguments: 100, [w_warehouse_name#13 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST], [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt index 0ee47d05af65b..80beaf66c66a0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt @@ -8,14 +8,10 @@ TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] HashAggregate [w_warehouse_name,i_item_id,d_date,inv_quantity_on_hand] [sum,sum,sum,sum] Project [inv_quantity_on_hand,w_warehouse_name,i_item_id,d_date] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_warehouse_sk,inv_quantity_on_hand,i_item_id,d_date] + Project [i_item_id,inv_warehouse_sk,inv_quantity_on_hand,d_date] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,inv_warehouse_sk,inv_quantity_on_hand,i_item_id] - BroadcastHashJoin [inv_item_sk,i_item_sk] - Filter [inv_warehouse_sk,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [i_item_id,inv_date_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [i_item_sk,inv_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -24,6 +20,10 @@ TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + Filter [inv_warehouse_sk,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt index a405f658951d3..9319644f52d16 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt @@ -10,20 +10,20 @@ TakeOrderedAndProject (30) : +- Exchange (17) : +- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) - : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) : : :- * Filter (3) : : : +- * ColumnarToRow (2) : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.warehouse (4) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (14) - : +- * Project (13) - : +- * Filter (12) - : +- * ColumnarToRow (11) - : +- Scan parquet default.date_dim (10) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.warehouse (11) +- * Sort (23) +- Exchange (22) +- * Filter (21) @@ -45,63 +45,63 @@ Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_ha Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) -(4) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#5] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [1]: [w_warehouse_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] (6) Filter [codegen id : 1] -Input [1]: [w_warehouse_sk#5] -Condition : isnotnull(w_warehouse_sk#5) +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) -(7) BroadcastExchange -Input [1]: [w_warehouse_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] -(8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#3] -Right keys [1]: [w_warehouse_sk#5] +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None -(9) Project [codegen id : 3] -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] -Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] +(10) Project [codegen id : 3] +Output [3]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5] -(10) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_month_seq#8] +(11) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct - -(11) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct -(12) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] -Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1200)) AND (d_month_seq#8 <= 1211)) AND isnotnull(d_date_sk#7)) +(12) ColumnarToRow [codegen id : 2] +Input [1]: [w_warehouse_sk#8] -(13) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_month_seq#8] +(13) Filter [codegen id : 2] +Input [1]: [w_warehouse_sk#8] +Condition : isnotnull(w_warehouse_sk#8) (14) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +Input [1]: [w_warehouse_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [inv_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#8] Join condition: None (16) Project [codegen id : 3] Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] +Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#8] (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt index 2c4258c9d48e6..484a6d5dd2288 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt @@ -15,9 +15,9 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter @@ -25,18 +25,18 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt index 51b85142f37ff..93f04b0c81375 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt @@ -7,64 +7,64 @@ TakeOrderedAndProject (130) : +- * Project (79) : +- * SortMergeJoin Inner (78) : :- * Project (59) - : : +- * BroadcastHashJoin Inner BuildRight (58) - : : :- SortMergeJoin LeftSemi (52) - : : : :- * Sort (34) - : : : : +- Exchange (33) - : : : : +- * Project (32) - : : : : +- SortMergeJoin LeftSemi (31) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.catalog_sales (1) - : : : : +- * Sort (30) - : : : : +- Exchange (29) - : : : : +- * Project (28) - : : : : +- * Filter (27) - : : : : +- * HashAggregate (26) - : : : : +- * HashAggregate (25) - : : : : +- * Project (24) - : : : : +- * SortMergeJoin Inner (23) - : : : : :- * Sort (17) - : : : : : +- Exchange (16) - : : : : : +- * Project (15) - : : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : : :- * Filter (8) - : : : : : : +- * ColumnarToRow (7) - : : : : : : +- Scan parquet default.store_sales (6) - : : : : : +- BroadcastExchange (13) - : : : : : +- * Project (12) - : : : : : +- * Filter (11) - : : : : : +- * ColumnarToRow (10) - : : : : : +- Scan parquet default.date_dim (9) - : : : : +- * Sort (22) - : : : : +- Exchange (21) - : : : : +- * Filter (20) - : : : : +- * ColumnarToRow (19) - : : : : +- Scan parquet default.item (18) - : : : +- * Sort (51) - : : : +- * Project (50) - : : : +- * Filter (49) - : : : +- * HashAggregate (48) - : : : +- * HashAggregate (47) - : : : +- * Project (46) - : : : +- * SortMergeJoin Inner (45) - : : : :- * Sort (39) - : : : : +- Exchange (38) - : : : : +- * Filter (37) - : : : : +- * ColumnarToRow (36) - : : : : +- Scan parquet default.store_sales (35) - : : : +- * Sort (44) - : : : +- Exchange (43) - : : : +- * Filter (42) - : : : +- * ColumnarToRow (41) - : : : +- Scan parquet default.customer (40) - : : +- BroadcastExchange (57) - : : +- * Project (56) - : : +- * Filter (55) - : : +- * ColumnarToRow (54) - : : +- Scan parquet default.date_dim (53) + : : +- * BroadcastHashJoin Inner BuildLeft (58) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- SortMergeJoin LeftSemi (57) + : : :- * Sort (39) + : : : +- Exchange (38) + : : : +- * Project (37) + : : : +- SortMergeJoin LeftSemi (36) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.catalog_sales (6) + : : : +- * Sort (35) + : : : +- Exchange (34) + : : : +- * Project (33) + : : : +- * Filter (32) + : : : +- * HashAggregate (31) + : : : +- * HashAggregate (30) + : : : +- * Project (29) + : : : +- * SortMergeJoin Inner (28) + : : : :- * Sort (22) + : : : : +- Exchange (21) + : : : : +- * Project (20) + : : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : : :- * Filter (13) + : : : : : +- * ColumnarToRow (12) + : : : : : +- Scan parquet default.store_sales (11) + : : : : +- BroadcastExchange (18) + : : : : +- * Project (17) + : : : : +- * Filter (16) + : : : : +- * ColumnarToRow (15) + : : : : +- Scan parquet default.date_dim (14) + : : : +- * Sort (27) + : : : +- Exchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.item (23) + : : +- * Sort (56) + : : +- * Project (55) + : : +- * Filter (54) + : : +- * HashAggregate (53) + : : +- * HashAggregate (52) + : : +- * Project (51) + : : +- * SortMergeJoin Inner (50) + : : :- * Sort (44) + : : : +- Exchange (43) + : : : +- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.store_sales (40) + : : +- * Sort (49) + : : +- Exchange (48) + : : +- * Filter (47) + : : +- * ColumnarToRow (46) + : : +- Scan parquet default.customer (45) : +- SortMergeJoin LeftSemi (77) : :- * Sort (64) : : +- Exchange (63) @@ -89,31 +89,31 @@ TakeOrderedAndProject (130) +- * Project (125) +- * SortMergeJoin Inner (124) :- * Project (108) - : +- * BroadcastHashJoin Inner BuildRight (107) - : :- SortMergeJoin LeftSemi (105) - : : :- * Sort (93) - : : : +- Exchange (92) - : : : +- * Project (91) - : : : +- SortMergeJoin LeftSemi (90) - : : : :- * Sort (87) - : : : : +- Exchange (86) - : : : : +- * Filter (85) - : : : : +- * ColumnarToRow (84) - : : : : +- Scan parquet default.web_sales (83) - : : : +- * Sort (89) - : : : +- ReusedExchange (88) - : : +- * Sort (104) - : : +- * Project (103) - : : +- * Filter (102) - : : +- * HashAggregate (101) - : : +- * HashAggregate (100) - : : +- * Project (99) - : : +- * SortMergeJoin Inner (98) - : : :- * Sort (95) - : : : +- ReusedExchange (94) - : : +- * Sort (97) - : : +- ReusedExchange (96) - : +- ReusedExchange (106) + : +- * BroadcastHashJoin Inner BuildLeft (107) + : :- ReusedExchange (83) + : +- SortMergeJoin LeftSemi (106) + : :- * Sort (94) + : : +- Exchange (93) + : : +- * Project (92) + : : +- SortMergeJoin LeftSemi (91) + : : :- * Sort (88) + : : : +- Exchange (87) + : : : +- * Filter (86) + : : : +- * ColumnarToRow (85) + : : : +- Scan parquet default.web_sales (84) + : : +- * Sort (90) + : : +- ReusedExchange (89) + : +- * Sort (105) + : +- * Project (104) + : +- * Filter (103) + : +- * HashAggregate (102) + : +- * HashAggregate (101) + : +- * Project (100) + : +- * SortMergeJoin Inner (99) + : :- * Sort (96) + : : +- ReusedExchange (95) + : +- * Sort (98) + : +- ReusedExchange (97) +- SortMergeJoin LeftSemi (123) :- * Sort (110) : +- ReusedExchange (109) @@ -131,367 +131,367 @@ TakeOrderedAndProject (130) +- ReusedExchange (113) -(1) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2000)) AND (d_moy#3 = 2)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +(7) ColumnarToRow [codegen id : 2] +Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] -(3) Filter [codegen id : 1] -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] -Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1)) +(8) Filter [codegen id : 2] +Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +Condition : (isnotnull(cs_bill_customer_sk#6) AND isnotnull(cs_sold_date_sk#5)) -(4) Exchange -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] -Arguments: hashpartitioning(cs_item_sk#3, 5), true, [id=#6] +(9) Exchange +Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +Arguments: hashpartitioning(cs_item_sk#7, 5), true, [id=#10] -(5) Sort [codegen id : 2] -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] -Arguments: [cs_item_sk#3 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +Arguments: [cs_item_sk#7 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#7, ss_item_sk#8] +(11) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#11, ss_item_sk#12] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_item_sk#8] +(12) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#11, ss_item_sk#12] -(8) Filter [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_item_sk#8] -Condition : (isnotnull(ss_sold_date_sk#7) AND isnotnull(ss_item_sk#8)) +(13) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#11, ss_item_sk#12] +Condition : (isnotnull(ss_sold_date_sk#11) AND isnotnull(ss_item_sk#12)) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_date#10, d_year#11] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_date#13, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_date#10, d_year#11] +(15) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#1, d_date#13, d_year#2] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_date#10, d_year#11] -Condition : (d_year#11 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#9)) +(16) Filter [codegen id : 4] +Input [3]: [d_date_sk#1, d_date#13, d_year#2] +Condition : (d_year#2 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#1)) -(12) Project [codegen id : 3] -Output [2]: [d_date_sk#9, d_date#10] -Input [3]: [d_date_sk#9, d_date#10, d_year#11] +(17) Project [codegen id : 4] +Output [2]: [d_date_sk#1, d_date#13] +Input [3]: [d_date_sk#1, d_date#13, d_year#2] -(13) BroadcastExchange -Input [2]: [d_date_sk#9, d_date#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(18) BroadcastExchange +Input [2]: [d_date_sk#1, d_date#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#7] -Right keys [1]: [d_date_sk#9] +(19) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#1] Join condition: None -(15) Project [codegen id : 4] -Output [2]: [ss_item_sk#8, d_date#10] -Input [4]: [ss_sold_date_sk#7, ss_item_sk#8, d_date_sk#9, d_date#10] +(20) Project [codegen id : 5] +Output [2]: [ss_item_sk#12, d_date#13] +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, d_date_sk#1, d_date#13] -(16) Exchange -Input [2]: [ss_item_sk#8, d_date#10] -Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#13] +(21) Exchange +Input [2]: [ss_item_sk#12, d_date#13] +Arguments: hashpartitioning(ss_item_sk#12, 5), true, [id=#15] -(17) Sort [codegen id : 5] -Input [2]: [ss_item_sk#8, d_date#10] -Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 6] +Input [2]: [ss_item_sk#12, d_date#13] +Arguments: [ss_item_sk#12 ASC NULLS FIRST], false, 0 -(18) Scan parquet default.item -Output [2]: [i_item_sk#14, i_item_desc#15] +(23) Scan parquet default.item +Output [2]: [i_item_sk#16, i_item_desc#17] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 6] -Input [2]: [i_item_sk#14, i_item_desc#15] +(24) ColumnarToRow [codegen id : 7] +Input [2]: [i_item_sk#16, i_item_desc#17] -(20) Filter [codegen id : 6] -Input [2]: [i_item_sk#14, i_item_desc#15] -Condition : isnotnull(i_item_sk#14) +(25) Filter [codegen id : 7] +Input [2]: [i_item_sk#16, i_item_desc#17] +Condition : isnotnull(i_item_sk#16) -(21) Exchange -Input [2]: [i_item_sk#14, i_item_desc#15] -Arguments: hashpartitioning(i_item_sk#14, 5), true, [id=#16] +(26) Exchange +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: hashpartitioning(i_item_sk#16, 5), true, [id=#18] -(22) Sort [codegen id : 7] -Input [2]: [i_item_sk#14, i_item_desc#15] -Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 +(27) Sort [codegen id : 8] +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 -(23) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_item_sk#8] -Right keys [1]: [i_item_sk#14] +(28) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#12] +Right keys [1]: [i_item_sk#16] Join condition: None -(24) Project [codegen id : 8] -Output [3]: [d_date#10, i_item_sk#14, i_item_desc#15] -Input [4]: [ss_item_sk#8, d_date#10, i_item_sk#14, i_item_desc#15] +(29) Project [codegen id : 9] +Output [3]: [d_date#13, i_item_sk#16, i_item_desc#17] +Input [4]: [ss_item_sk#12, d_date#13, i_item_sk#16, i_item_desc#17] -(25) HashAggregate [codegen id : 8] -Input [3]: [d_date#10, i_item_sk#14, i_item_desc#15] -Keys [3]: [substr(i_item_desc#15, 1, 30) AS substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10] +(30) HashAggregate [codegen id : 9] +Input [3]: [d_date#13, i_item_sk#16, i_item_desc#17] +Keys [3]: [substr(i_item_desc#17, 1, 30) AS substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#18] -Results [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19] +Aggregate Attributes [1]: [count#20] +Results [4]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13, count#21] -(26) HashAggregate [codegen id : 8] -Input [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19] -Keys [3]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10] +(31) HashAggregate [codegen id : 9] +Input [4]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13, count#21] +Keys [3]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#20] -Results [2]: [i_item_sk#14 AS item_sk#21, count(1)#20 AS count(1)#22] +Aggregate Attributes [1]: [count(1)#22] +Results [2]: [i_item_sk#16 AS item_sk#23, count(1)#22 AS count(1)#24] -(27) Filter [codegen id : 8] -Input [2]: [item_sk#21, count(1)#22] -Condition : (count(1)#22 > 4) +(32) Filter [codegen id : 9] +Input [2]: [item_sk#23, count(1)#24] +Condition : (count(1)#24 > 4) -(28) Project [codegen id : 8] -Output [1]: [item_sk#21] -Input [2]: [item_sk#21, count(1)#22] +(33) Project [codegen id : 9] +Output [1]: [item_sk#23] +Input [2]: [item_sk#23, count(1)#24] -(29) Exchange -Input [1]: [item_sk#21] -Arguments: hashpartitioning(item_sk#21, 5), true, [id=#23] +(34) Exchange +Input [1]: [item_sk#23] +Arguments: hashpartitioning(item_sk#23, 5), true, [id=#25] -(30) Sort [codegen id : 9] -Input [1]: [item_sk#21] -Arguments: [item_sk#21 ASC NULLS FIRST], false, 0 +(35) Sort [codegen id : 10] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 -(31) SortMergeJoin -Left keys [1]: [cs_item_sk#3] -Right keys [1]: [item_sk#21] +(36) SortMergeJoin +Left keys [1]: [cs_item_sk#7] +Right keys [1]: [item_sk#23] Join condition: None -(32) Project [codegen id : 10] -Output [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +(37) Project [codegen id : 11] +Output [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] +Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] -(33) Exchange -Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] -Arguments: hashpartitioning(cs_bill_customer_sk#2, 5), true, [id=#24] +(38) Exchange +Input [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] +Arguments: hashpartitioning(cs_bill_customer_sk#6, 5), true, [id=#26] -(34) Sort [codegen id : 11] -Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] -Arguments: [cs_bill_customer_sk#2 ASC NULLS FIRST], false, 0 +(39) Sort [codegen id : 12] +Input [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] +Arguments: [cs_bill_customer_sk#6 ASC NULLS FIRST], false, 0 -(35) Scan parquet default.store_sales -Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +(40) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk)] ReadSchema: struct -(36) ColumnarToRow [codegen id : 12] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +(41) ColumnarToRow [codegen id : 13] +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -(37) Filter [codegen id : 12] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Condition : isnotnull(ss_customer_sk#25) +(42) Filter [codegen id : 13] +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Condition : isnotnull(ss_customer_sk#27) -(38) Exchange -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#28] +(43) Exchange +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: hashpartitioning(ss_customer_sk#27, 5), true, [id=#30] -(39) Sort [codegen id : 13] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 14] +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 -(40) Scan parquet default.customer -Output [1]: [c_customer_sk#29] +(45) Scan parquet default.customer +Output [1]: [c_customer_sk#31] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 14] -Input [1]: [c_customer_sk#29] +(46) ColumnarToRow [codegen id : 15] +Input [1]: [c_customer_sk#31] -(42) Filter [codegen id : 14] -Input [1]: [c_customer_sk#29] -Condition : isnotnull(c_customer_sk#29) +(47) Filter [codegen id : 15] +Input [1]: [c_customer_sk#31] +Condition : isnotnull(c_customer_sk#31) -(43) Exchange -Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#30] +(48) Exchange +Input [1]: [c_customer_sk#31] +Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#32] -(44) Sort [codegen id : 15] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +(49) Sort [codegen id : 16] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 16] -Left keys [1]: [ss_customer_sk#25] -Right keys [1]: [c_customer_sk#29] +(50) SortMergeJoin [codegen id : 17] +Left keys [1]: [ss_customer_sk#27] +Right keys [1]: [c_customer_sk#31] Join condition: None -(46) Project [codegen id : 16] -Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] - -(47) HashAggregate [codegen id : 16] -Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Keys [1]: [c_customer_sk#29] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#31, isEmpty#32] -Results [3]: [c_customer_sk#29, sum#33, isEmpty#34] - -(48) HashAggregate [codegen id : 16] -Input [3]: [c_customer_sk#29, sum#33, isEmpty#34] -Keys [1]: [c_customer_sk#29] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35] -Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] - -(49) Filter [codegen id : 16] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) - -(50) Project [codegen id : 16] -Output [1]: [c_customer_sk#29] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] - -(51) Sort [codegen id : 16] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 - -(52) SortMergeJoin -Left keys [1]: [cs_bill_customer_sk#2] -Right keys [1]: [c_customer_sk#29] +(51) Project [codegen id : 17] +Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] + +(52) HashAggregate [codegen id : 17] +Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#33, isEmpty#34] +Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] + +(53) HashAggregate [codegen id : 17] +Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] + +(54) Filter [codegen id : 17] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) + +(55) Project [codegen id : 17] +Output [1]: [c_customer_sk#31] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] + +(56) Sort [codegen id : 17] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(57) SortMergeJoin +Left keys [1]: [cs_bill_customer_sk#6] +Right keys [1]: [c_customer_sk#31] Join condition: None -(53) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#11, d_moy#39] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] -ReadSchema: struct - -(54) ColumnarToRow [codegen id : 17] -Input [3]: [d_date_sk#9, d_year#11, d_moy#39] - -(55) Filter [codegen id : 17] -Input [3]: [d_date_sk#9, d_year#11, d_moy#39] -Condition : ((((isnotnull(d_year#11) AND isnotnull(d_moy#39)) AND (d_year#11 = 2000)) AND (d_moy#39 = 2)) AND isnotnull(d_date_sk#9)) - -(56) Project [codegen id : 17] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#11, d_moy#39] - -(57) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] - (58) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#5] Join condition: None (59) Project [codegen id : 18] -Output [3]: [cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] -Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5, d_date_sk#9] +Output [3]: [cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] +Input [5]: [d_date_sk#1, cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] (60) Scan parquet default.customer -Output [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Output [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 19] -Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] (62) Filter [codegen id : 19] -Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] -Condition : isnotnull(c_customer_sk#29) +Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Condition : isnotnull(c_customer_sk#31) (63) Exchange -Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#43] +Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#43] (64) Sort [codegen id : 20] -Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 -(65) ReusedExchange [Reuses operator id: 38] -Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +(65) ReusedExchange [Reuses operator id: 43] +Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] (66) Sort [codegen id : 22] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 -(67) ReusedExchange [Reuses operator id: 43] -Output [1]: [c_customer_sk#29] +(67) ReusedExchange [Reuses operator id: 48] +Output [1]: [c_customer_sk#31] (68) Sort [codegen id : 24] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 (69) SortMergeJoin [codegen id : 25] -Left keys [1]: [ss_customer_sk#25] -Right keys [1]: [c_customer_sk#29] +Left keys [1]: [ss_customer_sk#27] +Right keys [1]: [c_customer_sk#31] Join condition: None (70) Project [codegen id : 25] -Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] (71) HashAggregate [codegen id : 25] -Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Keys [1]: [c_customer_sk#29] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#31, isEmpty#32] -Results [3]: [c_customer_sk#29, sum#33, isEmpty#34] +Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#33, isEmpty#34] +Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] (72) HashAggregate [codegen id : 25] -Input [3]: [c_customer_sk#29, sum#33, isEmpty#34] -Keys [1]: [c_customer_sk#29] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35] -Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] +Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] (73) Filter [codegen id : 25] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) (74) Project [codegen id : 25] -Output [1]: [c_customer_sk#29 AS c_customer_sk#29#44] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] +Output [1]: [c_customer_sk#31 AS c_customer_sk#31#44] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] (75) Exchange -Input [1]: [c_customer_sk#29#44] -Arguments: hashpartitioning(c_customer_sk#29#44, 5), true, [id=#45] +Input [1]: [c_customer_sk#31#44] +Arguments: hashpartitioning(c_customer_sk#31#44, 5), true, [id=#45] (76) Sort [codegen id : 26] -Input [1]: [c_customer_sk#29#44] -Arguments: [c_customer_sk#29#44 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#31#44] +Arguments: [c_customer_sk#31#44 ASC NULLS FIRST], false, 0 (77) SortMergeJoin -Left keys [1]: [c_customer_sk#29] -Right keys [1]: [c_customer_sk#29#44] +Left keys [1]: [c_customer_sk#31] +Right keys [1]: [c_customer_sk#31#44] Join condition: None (78) SortMergeJoin [codegen id : 27] -Left keys [1]: [cs_bill_customer_sk#2] -Right keys [1]: [c_customer_sk#29] +Left keys [1]: [cs_bill_customer_sk#6] +Right keys [1]: [c_customer_sk#31] Join condition: None (79) Project [codegen id : 27] -Output [4]: [cs_quantity#4, cs_list_price#5, c_first_name#41, c_last_name#42] -Input [6]: [cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5, c_customer_sk#29, c_first_name#41, c_last_name#42] +Output [4]: [cs_quantity#8, cs_list_price#9, c_first_name#41, c_last_name#42] +Input [6]: [cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9, c_customer_sk#31, c_first_name#41, c_last_name#42] (80) HashAggregate [codegen id : 27] -Input [4]: [cs_quantity#4, cs_list_price#5, c_first_name#41, c_last_name#42] +Input [4]: [cs_quantity#8, cs_list_price#9, c_first_name#41, c_last_name#42] Keys [2]: [c_last_name#42, c_first_name#41] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#46, isEmpty#47] Results [4]: [c_last_name#42, c_first_name#41, sum#48, isEmpty#49] @@ -502,195 +502,195 @@ Arguments: hashpartitioning(c_last_name#42, c_first_name#41, 5), true, [id=#50] (82) HashAggregate [codegen id : 28] Input [4]: [c_last_name#42, c_first_name#41, sum#48, isEmpty#49] Keys [2]: [c_last_name#42, c_first_name#41] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#51] -Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#51 AS sales#52] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#51] +Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#51 AS sales#52] + +(83) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] -(83) Scan parquet default.web_sales +(84) Scan parquet default.web_sales Output [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(84) ColumnarToRow [codegen id : 29] +(85) ColumnarToRow [codegen id : 30] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -(85) Filter [codegen id : 29] +(86) Filter [codegen id : 30] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Condition : (isnotnull(ws_bill_customer_sk#55) AND isnotnull(ws_sold_date_sk#53)) -(86) Exchange +(87) Exchange Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: hashpartitioning(ws_item_sk#54, 5), true, [id=#58] -(87) Sort [codegen id : 30] +(88) Sort [codegen id : 31] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: [ws_item_sk#54 ASC NULLS FIRST], false, 0 -(88) ReusedExchange [Reuses operator id: 29] -Output [1]: [item_sk#21] +(89) ReusedExchange [Reuses operator id: 34] +Output [1]: [item_sk#23] -(89) Sort [codegen id : 37] -Input [1]: [item_sk#21] -Arguments: [item_sk#21 ASC NULLS FIRST], false, 0 +(90) Sort [codegen id : 38] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 -(90) SortMergeJoin +(91) SortMergeJoin Left keys [1]: [ws_item_sk#54] -Right keys [1]: [item_sk#21] +Right keys [1]: [item_sk#23] Join condition: None -(91) Project [codegen id : 38] +(92) Project [codegen id : 39] Output [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -(92) Exchange +(93) Exchange Input [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: hashpartitioning(ws_bill_customer_sk#55, 5), true, [id=#59] -(93) Sort [codegen id : 39] +(94) Sort [codegen id : 40] Input [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: [ws_bill_customer_sk#55 ASC NULLS FIRST], false, 0 -(94) ReusedExchange [Reuses operator id: 38] -Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +(95) ReusedExchange [Reuses operator id: 43] +Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -(95) Sort [codegen id : 41] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 +(96) Sort [codegen id : 42] +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 -(96) ReusedExchange [Reuses operator id: 43] -Output [1]: [c_customer_sk#29] +(97) ReusedExchange [Reuses operator id: 48] +Output [1]: [c_customer_sk#31] -(97) Sort [codegen id : 43] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +(98) Sort [codegen id : 44] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 -(98) SortMergeJoin [codegen id : 44] -Left keys [1]: [ss_customer_sk#25] -Right keys [1]: [c_customer_sk#29] +(99) SortMergeJoin [codegen id : 45] +Left keys [1]: [ss_customer_sk#27] +Right keys [1]: [c_customer_sk#31] Join condition: None -(99) Project [codegen id : 44] -Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +(100) Project [codegen id : 45] +Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -(100) HashAggregate [codegen id : 44] -Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Keys [1]: [c_customer_sk#29] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +(101) HashAggregate [codegen id : 45] +Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#60, isEmpty#61] -Results [3]: [c_customer_sk#29, sum#62, isEmpty#63] +Results [3]: [c_customer_sk#31, sum#62, isEmpty#63] -(101) HashAggregate [codegen id : 44] -Input [3]: [c_customer_sk#29, sum#62, isEmpty#63] -Keys [1]: [c_customer_sk#29] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64] -Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +(102) HashAggregate [codegen id : 45] +Input [3]: [c_customer_sk#31, sum#62, isEmpty#63] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] -(102) Filter [codegen id : 44] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) +(103) Filter [codegen id : 45] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) -(103) Project [codegen id : 44] -Output [1]: [c_customer_sk#29] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +(104) Project [codegen id : 45] +Output [1]: [c_customer_sk#31] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] -(104) Sort [codegen id : 44] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +(105) Sort [codegen id : 45] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 -(105) SortMergeJoin +(106) SortMergeJoin Left keys [1]: [ws_bill_customer_sk#55] -Right keys [1]: [c_customer_sk#29] +Right keys [1]: [c_customer_sk#31] Join condition: None -(106) ReusedExchange [Reuses operator id: 57] -Output [1]: [d_date_sk#9] - (107) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#53] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#53] Join condition: None (108) Project [codegen id : 46] Output [3]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -Input [5]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, d_date_sk#9] +Input [5]: [d_date_sk#1, ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] (109) ReusedExchange [Reuses operator id: 63] -Output [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Output [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] (110) Sort [codegen id : 48] -Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 -(111) ReusedExchange [Reuses operator id: 38] -Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +(111) ReusedExchange [Reuses operator id: 43] +Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] (112) Sort [codegen id : 50] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 -(113) ReusedExchange [Reuses operator id: 43] -Output [1]: [c_customer_sk#29] +(113) ReusedExchange [Reuses operator id: 48] +Output [1]: [c_customer_sk#31] (114) Sort [codegen id : 52] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 (115) SortMergeJoin [codegen id : 53] -Left keys [1]: [ss_customer_sk#25] -Right keys [1]: [c_customer_sk#29] +Left keys [1]: [ss_customer_sk#27] +Right keys [1]: [c_customer_sk#31] Join condition: None (116) Project [codegen id : 53] -Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] (117) HashAggregate [codegen id : 53] -Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Keys [1]: [c_customer_sk#29] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#60, isEmpty#61] -Results [3]: [c_customer_sk#29, sum#62, isEmpty#63] +Results [3]: [c_customer_sk#31, sum#62, isEmpty#63] (118) HashAggregate [codegen id : 53] -Input [3]: [c_customer_sk#29, sum#62, isEmpty#63] -Keys [1]: [c_customer_sk#29] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64] -Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +Input [3]: [c_customer_sk#31, sum#62, isEmpty#63] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] (119) Filter [codegen id : 53] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) (120) Project [codegen id : 53] -Output [1]: [c_customer_sk#29 AS c_customer_sk#29#66] -Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +Output [1]: [c_customer_sk#31 AS c_customer_sk#31#66] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] (121) Exchange -Input [1]: [c_customer_sk#29#66] -Arguments: hashpartitioning(c_customer_sk#29#66, 5), true, [id=#67] +Input [1]: [c_customer_sk#31#66] +Arguments: hashpartitioning(c_customer_sk#31#66, 5), true, [id=#67] (122) Sort [codegen id : 54] -Input [1]: [c_customer_sk#29#66] -Arguments: [c_customer_sk#29#66 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#31#66] +Arguments: [c_customer_sk#31#66 ASC NULLS FIRST], false, 0 (123) SortMergeJoin -Left keys [1]: [c_customer_sk#29] -Right keys [1]: [c_customer_sk#29#66] +Left keys [1]: [c_customer_sk#31] +Right keys [1]: [c_customer_sk#31#66] Join condition: None (124) SortMergeJoin [codegen id : 55] Left keys [1]: [ws_bill_customer_sk#55] -Right keys [1]: [c_customer_sk#29] +Right keys [1]: [c_customer_sk#31] Join condition: None (125) Project [codegen id : 55] Output [4]: [ws_quantity#56, ws_list_price#57, c_first_name#41, c_last_name#42] -Input [6]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, c_customer_sk#29, c_first_name#41, c_last_name#42] +Input [6]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, c_customer_sk#31, c_first_name#41, c_last_name#42] (126) HashAggregate [codegen id : 55] Input [4]: [ws_quantity#56, ws_list_price#57, c_first_name#41, c_last_name#42] @@ -718,7 +718,7 @@ Arguments: 100, [c_last_name#42 ASC NULLS FIRST, c_first_name#41 ASC NULLS FIRST ===== Subqueries ===== -Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#37, [id=#38] +Subquery:1 Hosting operator id = 54 Hosting Expression = Subquery scalar-subquery#39, [id=#40] * HashAggregate (154) +- Exchange (153) +- * HashAggregate (152) @@ -746,102 +746,102 @@ Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Output [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (132) ColumnarToRow [codegen id : 2] -Input [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Input [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] (133) Filter [codegen id : 2] -Input [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Condition : (isnotnull(ss_customer_sk#25) AND isnotnull(ss_sold_date_sk#7)) +Input [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Condition : (isnotnull(ss_customer_sk#27) AND isnotnull(ss_sold_date_sk#11)) (134) Scan parquet default.date_dim -Output [2]: [d_date_sk#9, d_year#11] +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] ReadSchema: struct (135) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#9, d_year#11] +Input [2]: [d_date_sk#1, d_year#2] (136) Filter [codegen id : 1] -Input [2]: [d_date_sk#9, d_year#11] -Condition : (d_year#11 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#9)) +Input [2]: [d_date_sk#1, d_year#2] +Condition : (d_year#2 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#1)) (137) Project [codegen id : 1] -Output [1]: [d_date_sk#9] -Input [2]: [d_date_sk#9, d_year#11] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#2] (138) BroadcastExchange -Input [1]: [d_date_sk#9] +Input [1]: [d_date_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#75] (139) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#7] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#1] Join condition: None (140) Project [codegen id : 2] -Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, d_date_sk#9] +Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Input [5]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, d_date_sk#1] (141) Exchange -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#76] +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: hashpartitioning(ss_customer_sk#27, 5), true, [id=#76] (142) Sort [codegen id : 3] -Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 (143) Scan parquet default.customer -Output [1]: [c_customer_sk#29] +Output [1]: [c_customer_sk#31] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct (144) ColumnarToRow [codegen id : 4] -Input [1]: [c_customer_sk#29] +Input [1]: [c_customer_sk#31] (145) Filter [codegen id : 4] -Input [1]: [c_customer_sk#29] -Condition : isnotnull(c_customer_sk#29) +Input [1]: [c_customer_sk#31] +Condition : isnotnull(c_customer_sk#31) (146) Exchange -Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#77] +Input [1]: [c_customer_sk#31] +Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#77] (147) Sort [codegen id : 5] -Input [1]: [c_customer_sk#29] -Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 (148) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#25] -Right keys [1]: [c_customer_sk#29] +Left keys [1]: [ss_customer_sk#27] +Right keys [1]: [c_customer_sk#31] Join condition: None (149) Project [codegen id : 6] -Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] (150) HashAggregate [codegen id : 6] -Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -Keys [1]: [c_customer_sk#29] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#78, isEmpty#79] -Results [3]: [c_customer_sk#29, sum#80, isEmpty#81] +Results [3]: [c_customer_sk#31, sum#80, isEmpty#81] (151) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#29, sum#80, isEmpty#81] -Keys [1]: [c_customer_sk#29] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#82] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] +Input [3]: [c_customer_sk#31, sum#80, isEmpty#81] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] (152) HashAggregate [codegen id : 6] Input [1]: [csales#83] @@ -861,10 +861,10 @@ Functions [1]: [max(csales#83)] Aggregate Attributes [1]: [max(csales#83)#87] Results [1]: [max(csales#83)#87 AS tpcds_cmax#88] -Subquery:2 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] +Subquery:2 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] -Subquery:3 Hosting operator id = 102 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] +Subquery:3 Hosting operator id = 103 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] -Subquery:4 Hosting operator id = 119 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] +Subquery:4 Hosting operator id = 119 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt index e8891f032a091..c91cd4d02f430 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt @@ -11,31 +11,39 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter WholeStageCodegen (18) Project [cs_bill_customer_sk,cs_quantity,cs_list_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] InputAdapter SortMergeJoin [cs_bill_customer_sk,c_customer_sk] - WholeStageCodegen (11) + WholeStageCodegen (12) Sort [cs_bill_customer_sk] InputAdapter - Exchange [cs_bill_customer_sk] #2 - WholeStageCodegen (10) + Exchange [cs_bill_customer_sk] #3 + WholeStageCodegen (11) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_quantity,cs_list_price] InputAdapter SortMergeJoin [cs_item_sk,item_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [cs_item_sk] InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (1) + Exchange [cs_item_sk] #4 + WholeStageCodegen (2) Filter [cs_bill_customer_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price] - WholeStageCodegen (9) + WholeStageCodegen (10) Sort [item_sk] InputAdapter - Exchange [item_sk] #4 - WholeStageCodegen (8) + Exchange [item_sk] #5 + WholeStageCodegen (9) Project [item_sk] Filter [count(1)] HashAggregate [substr(i_item_desc, 1, 30),i_item_sk,d_date,count] [count(1),item_sk,count(1),count] @@ -43,11 +51,11 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [d_date,i_item_sk,i_item_desc] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (6) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #5 - WholeStageCodegen (4) + Exchange [ss_item_sk] #6 + WholeStageCodegen (5) Project [ss_item_sk,d_date] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_item_sk] @@ -55,24 +63,24 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (3) + BroadcastExchange #7 + WholeStageCodegen (4) Project [d_date_sk,d_date] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_year] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (8) Sort [i_item_sk] InputAdapter - Exchange [i_item_sk] #7 - WholeStageCodegen (6) + Exchange [i_item_sk] #8 + WholeStageCodegen (7) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_desc] - WholeStageCodegen (16) + WholeStageCodegen (17) Sort [c_customer_sk] Project [c_customer_sk] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -80,7 +88,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (7) HashAggregate [max] [max(csales),tpcds_cmax,max] InputAdapter - Exchange #10 + Exchange #11 WholeStageCodegen (6) HashAggregate [csales] [max,max] HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] @@ -91,7 +99,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (3) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #11 + Exchange [ss_customer_sk] #12 WholeStageCodegen (2) Project [ss_customer_sk,ss_quantity,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -100,7 +108,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_quantity,ss_sales_price] InputAdapter - BroadcastExchange #12 + BroadcastExchange #13 WholeStageCodegen (1) Project [d_date_sk] Filter [d_year,d_date_sk] @@ -111,7 +119,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (5) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #13 + Exchange [c_customer_sk] #14 WholeStageCodegen (4) Filter [c_customer_sk] ColumnarToRow @@ -122,33 +130,25 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [ss_quantity,ss_sales_price,c_customer_sk] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (13) + WholeStageCodegen (14) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #8 - WholeStageCodegen (12) + Exchange [ss_customer_sk] #9 + WholeStageCodegen (13) Filter [ss_customer_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price] InputAdapter - WholeStageCodegen (15) + WholeStageCodegen (16) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #9 - WholeStageCodegen (14) + Exchange [c_customer_sk] #10 + WholeStageCodegen (15) Filter [c_customer_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk] - InputAdapter - BroadcastExchange #14 - WholeStageCodegen (17) - Project [d_date_sk] - Filter [d_year,d_moy,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_moy] InputAdapter SortMergeJoin [c_customer_sk,c_customer_sk] WholeStageCodegen (20) @@ -176,12 +176,12 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (22) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 InputAdapter WholeStageCodegen (24) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #9 + ReusedExchange [c_customer_sk] #10 WholeStageCodegen (56) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] InputAdapter @@ -193,31 +193,33 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter WholeStageCodegen (46) Project [ws_bill_customer_sk,ws_quantity,ws_list_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter SortMergeJoin [ws_bill_customer_sk,c_customer_sk] - WholeStageCodegen (39) + WholeStageCodegen (40) Sort [ws_bill_customer_sk] InputAdapter Exchange [ws_bill_customer_sk] #18 - WholeStageCodegen (38) + WholeStageCodegen (39) Project [ws_sold_date_sk,ws_bill_customer_sk,ws_quantity,ws_list_price] InputAdapter SortMergeJoin [ws_item_sk,item_sk] - WholeStageCodegen (30) + WholeStageCodegen (31) Sort [ws_item_sk] InputAdapter Exchange [ws_item_sk] #19 - WholeStageCodegen (29) + WholeStageCodegen (30) Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price] - WholeStageCodegen (37) + WholeStageCodegen (38) Sort [item_sk] InputAdapter - ReusedExchange [item_sk] #4 - WholeStageCodegen (44) + ReusedExchange [item_sk] #5 + WholeStageCodegen (45) Sort [c_customer_sk] Project [c_customer_sk] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -227,17 +229,15 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [ss_quantity,ss_sales_price,c_customer_sk] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (41) + WholeStageCodegen (42) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 InputAdapter - WholeStageCodegen (43) + WholeStageCodegen (44) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #9 - InputAdapter - ReusedExchange [d_date_sk] #14 + ReusedExchange [c_customer_sk] #10 InputAdapter SortMergeJoin [c_customer_sk,c_customer_sk] WholeStageCodegen (48) @@ -260,9 +260,9 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (50) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 InputAdapter WholeStageCodegen (52) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #9 + ReusedExchange [c_customer_sk] #10 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt index ffcf6bd4f6d47..5ef9d39db59fb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt @@ -18,14 +18,14 @@ : : :- * Sort (11) : : : +- Exchange (10) : : : +- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.item (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : :- BroadcastExchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.item (1) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.store_sales (5) : : +- * Sort (16) : : +- Exchange (15) : : +- * Filter (14) @@ -49,54 +49,54 @@ +- Scan parquet default.store_returns (34) -(1) Scan parquet default.store_sales -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] - -(3) Filter [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.item -Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] + +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Condition : ((isnotnull(i_color#4) AND (i_color#4 = pale)) AND isnotnull(i_item_sk#1)) + +(4) BroadcastExchange +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(5) Scan parquet default.store_sales +Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Condition : ((isnotnull(i_color#9) AND (i_color#9 = pale)) AND isnotnull(i_item_sk#6)) +(6) ColumnarToRow +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -(7) BroadcastExchange -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] +(7) Filter +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#8] Join condition: None (9) Project [codegen id : 2] -Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Input [11]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] (10) Exchange -Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#13] +Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#13] (11) Sort [codegen id : 3] -Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -121,13 +121,13 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#9] Right keys [1]: [c_customer_sk#14] Join condition: None (18) Project [codegen id : 8] -Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [12]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (19) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] @@ -179,21 +179,21 @@ Input [5]: [s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country# Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#28] (30) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#3, c_birth_country#17] +Left keys [2]: [ss_store_sk#10, c_birth_country#17] Right keys [2]: [s_store_sk#19, upper(ca_country#27)] Join condition: None (31) Project [codegen id : 8] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] +Output [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Input [17]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] (32) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#29] +Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#29] (33) Sort [codegen id : 9] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 (34) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -218,31 +218,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (40) Project [codegen id : 12] -Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (41) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] Aggregate Attributes [1]: [sum#33] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] (42) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#35] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#35] (43) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#36] -Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#36,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#36] +Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#36,17,2) AS netpaid#37] (44) HashAggregate [codegen id : 13] Input [4]: [c_last_name#16, c_first_name#15, s_store_name#20, netpaid#37] @@ -296,15 +296,15 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer : : : :- * Sort (60) : : : : +- Exchange (59) : : : : +- * Project (58) - : : : : +- * BroadcastHashJoin Inner BuildRight (57) - : : : : :- * Filter (51) - : : : : : +- * ColumnarToRow (50) - : : : : : +- Scan parquet default.store_sales (49) - : : : : +- BroadcastExchange (56) - : : : : +- * Project (55) - : : : : +- * Filter (54) - : : : : +- * ColumnarToRow (53) - : : : : +- Scan parquet default.store (52) + : : : : +- * BroadcastHashJoin Inner BuildLeft (57) + : : : : :- BroadcastExchange (53) + : : : : : +- * Project (52) + : : : : : +- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.store (49) + : : : : +- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.store_sales (54) : : : +- * Sort (65) : : : +- Exchange (64) : : : +- * Filter (63) @@ -327,97 +327,97 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (88) -(49) Scan parquet default.store_sales -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(50) ColumnarToRow [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] - -(51) Filter [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(52) Scan parquet default.store +(49) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(53) ColumnarToRow [codegen id : 1] +(50) ColumnarToRow [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(54) Filter [codegen id : 1] +(51) Filter [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Condition : (((isnotnull(s_market_id#21) AND (s_market_id#21 = 8)) AND isnotnull(s_store_sk#19)) AND isnotnull(s_zip#23)) -(55) Project [codegen id : 1] +(52) Project [codegen id : 1] Output [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(56) BroadcastExchange +(53) BroadcastExchange Input [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] +(54) Scan parquet default.store_sales +Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(55) ColumnarToRow +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] + +(56) Filter +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) + (57) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_store_sk#3] -Right keys [1]: [s_store_sk#19] +Left keys [1]: [s_store_sk#19] +Right keys [1]: [ss_store_sk#10] Join condition: None (58) Project [codegen id : 2] -Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] +Output [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Input [9]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] (59) Exchange -Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Arguments: hashpartitioning(ss_item_sk#1, 5), true, [id=#49] +Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#49] (60) Sort [codegen id : 3] -Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 +Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 (61) Scan parquet default.item -Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (62) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] (63) Filter [codegen id : 4] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Condition : isnotnull(i_item_sk#6) +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Condition : isnotnull(i_item_sk#1) (64) Exchange -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#50] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#50] (65) Sort [codegen id : 5] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 (66) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ss_item_sk#8] +Right keys [1]: [i_item_sk#1] Join condition: None (67) Project [codegen id : 6] -Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Input [13]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] (68) Exchange -Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#51] +Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#51] (69) Sort [codegen id : 7] -Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 (70) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -442,20 +442,20 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (75) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#9] Right keys [1]: [c_customer_sk#14] Join condition: None (76) Project [codegen id : 10] -Output [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [16]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [16]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (77) Exchange -Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: hashpartitioning(c_birth_country#17, s_zip#23, 5), true, [id=#53] (78) Sort [codegen id : 11] -Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: [c_birth_country#17 ASC NULLS FIRST, s_zip#23 ASC NULLS FIRST], false, 0 (79) Scan parquet default.customer_address @@ -486,16 +486,16 @@ Right keys [2]: [upper(ca_country#27), ca_zip#26] Join condition: None (85) Project [codegen id : 14] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [17]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] +Output [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [17]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] (86) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#55] +Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#55] (87) Sort [codegen id : 15] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 (88) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -520,31 +520,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (93) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (94) Project [codegen id : 18] -Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (95) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] (96) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#59] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#59] (97) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#60] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#60,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#60] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#60,17,2) AS netpaid#37] (98) HashAggregate [codegen id : 19] Input [1]: [netpaid#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt index 10f874f8f5543..8311b07f7525a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (14) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + Project [s_store_name,s_state,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (11) @@ -29,7 +29,7 @@ WholeStageCodegen (14) InputAdapter Exchange [c_birth_country,s_zip] #13 WholeStageCodegen (10) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (7) @@ -37,7 +37,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #14 WholeStageCodegen (6) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (3) @@ -45,12 +45,8 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_item_sk] #15 WholeStageCodegen (2) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [s_store_sk,ss_store_sk] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -59,6 +55,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] @@ -117,9 +117,9 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #3 WholeStageCodegen (8) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,s_store_name,s_state,ca_state] BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] - Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (3) @@ -127,12 +127,8 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #4 WholeStageCodegen (2) - Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -140,6 +136,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt index 73f36e3a9ca23..ae97fa1b7350b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt @@ -18,14 +18,14 @@ : : :- * Sort (11) : : : +- Exchange (10) : : : +- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.item (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : :- BroadcastExchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.item (1) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.store_sales (5) : : +- * Sort (16) : : +- Exchange (15) : : +- * Filter (14) @@ -49,54 +49,54 @@ +- Scan parquet default.store_returns (34) -(1) Scan parquet default.store_sales -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] - -(3) Filter [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.item -Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] + +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Condition : ((isnotnull(i_color#4) AND (i_color#4 = chiffon)) AND isnotnull(i_item_sk#1)) + +(4) BroadcastExchange +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(5) Scan parquet default.store_sales +Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Condition : ((isnotnull(i_color#9) AND (i_color#9 = chiffon)) AND isnotnull(i_item_sk#6)) +(6) ColumnarToRow +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -(7) BroadcastExchange -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] +(7) Filter +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#8] Join condition: None (9) Project [codegen id : 2] -Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Input [11]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] (10) Exchange -Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#13] +Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#13] (11) Sort [codegen id : 3] -Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -121,13 +121,13 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#9] Right keys [1]: [c_customer_sk#14] Join condition: None (18) Project [codegen id : 8] -Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [12]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (19) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] @@ -179,21 +179,21 @@ Input [5]: [s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country# Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#28] (30) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#3, c_birth_country#17] +Left keys [2]: [ss_store_sk#10, c_birth_country#17] Right keys [2]: [s_store_sk#19, upper(ca_country#27)] Join condition: None (31) Project [codegen id : 8] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] +Output [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Input [17]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] (32) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#29] +Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#29] (33) Sort [codegen id : 9] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 (34) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -218,31 +218,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (40) Project [codegen id : 12] -Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (41) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] Aggregate Attributes [1]: [sum#33] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] (42) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#35] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#35] (43) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#36] -Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#36,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#36] +Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#36,17,2) AS netpaid#37] (44) HashAggregate [codegen id : 13] Input [4]: [c_last_name#16, c_first_name#15, s_store_name#20, netpaid#37] @@ -296,15 +296,15 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer : : : :- * Sort (60) : : : : +- Exchange (59) : : : : +- * Project (58) - : : : : +- * BroadcastHashJoin Inner BuildRight (57) - : : : : :- * Filter (51) - : : : : : +- * ColumnarToRow (50) - : : : : : +- Scan parquet default.store_sales (49) - : : : : +- BroadcastExchange (56) - : : : : +- * Project (55) - : : : : +- * Filter (54) - : : : : +- * ColumnarToRow (53) - : : : : +- Scan parquet default.store (52) + : : : : +- * BroadcastHashJoin Inner BuildLeft (57) + : : : : :- BroadcastExchange (53) + : : : : : +- * Project (52) + : : : : : +- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.store (49) + : : : : +- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.store_sales (54) : : : +- * Sort (65) : : : +- Exchange (64) : : : +- * Filter (63) @@ -327,97 +327,97 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (88) -(49) Scan parquet default.store_sales -Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(50) ColumnarToRow [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] - -(51) Filter [codegen id : 2] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(52) Scan parquet default.store +(49) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(53) ColumnarToRow [codegen id : 1] +(50) ColumnarToRow [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(54) Filter [codegen id : 1] +(51) Filter [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Condition : (((isnotnull(s_market_id#21) AND (s_market_id#21 = 8)) AND isnotnull(s_store_sk#19)) AND isnotnull(s_zip#23)) -(55) Project [codegen id : 1] +(52) Project [codegen id : 1] Output [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(56) BroadcastExchange +(53) BroadcastExchange Input [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] +(54) Scan parquet default.store_sales +Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(55) ColumnarToRow +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] + +(56) Filter +Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) + (57) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_store_sk#3] -Right keys [1]: [s_store_sk#19] +Left keys [1]: [s_store_sk#19] +Right keys [1]: [ss_store_sk#10] Join condition: None (58) Project [codegen id : 2] -Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] +Output [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Input [9]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] (59) Exchange -Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Arguments: hashpartitioning(ss_item_sk#1, 5), true, [id=#49] +Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#49] (60) Sort [codegen id : 3] -Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] -Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 +Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 (61) Scan parquet default.item -Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (62) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] (63) Filter [codegen id : 4] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Condition : isnotnull(i_item_sk#6) +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Condition : isnotnull(i_item_sk#1) (64) Exchange -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#50] +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#50] (65) Sort [codegen id : 5] -Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 +Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 (66) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ss_item_sk#8] +Right keys [1]: [i_item_sk#1] Join condition: None (67) Project [codegen id : 6] -Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Output [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Input [13]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] (68) Exchange -Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#51] +Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#51] (69) Sort [codegen id : 7] -Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 (70) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -442,20 +442,20 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (75) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#9] Right keys [1]: [c_customer_sk#14] Join condition: None (76) Project [codegen id : 10] -Output [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [16]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [16]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (77) Exchange -Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: hashpartitioning(c_birth_country#17, s_zip#23, 5), true, [id=#53] (78) Sort [codegen id : 11] -Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: [c_birth_country#17 ASC NULLS FIRST, s_zip#23 ASC NULLS FIRST], false, 0 (79) Scan parquet default.customer_address @@ -486,16 +486,16 @@ Right keys [2]: [upper(ca_country#27), ca_zip#26] Join condition: None (85) Project [codegen id : 14] -Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [17]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] +Output [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [17]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] (86) Exchange -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#55] +Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#55] (87) Sort [codegen id : 15] -Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 (88) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -520,31 +520,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (93) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] +Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (94) Project [codegen id : 18] -Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (95) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] (96) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#59] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#59] (97) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] -Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#60] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#60,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] +Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#60] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#60,17,2) AS netpaid#37] (98) HashAggregate [codegen id : 19] Input [1]: [netpaid#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt index 10f874f8f5543..8311b07f7525a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (14) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + Project [s_store_name,s_state,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (11) @@ -29,7 +29,7 @@ WholeStageCodegen (14) InputAdapter Exchange [c_birth_country,s_zip] #13 WholeStageCodegen (10) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (7) @@ -37,7 +37,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #14 WholeStageCodegen (6) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (3) @@ -45,12 +45,8 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_item_sk] #15 WholeStageCodegen (2) - Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [s_store_sk,ss_store_sk] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -59,6 +55,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] @@ -117,9 +117,9 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #3 WholeStageCodegen (8) - Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,s_store_name,s_state,ca_state] BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] - Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (3) @@ -127,12 +127,8 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #4 WholeStageCodegen (2) - Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -140,6 +136,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt index 2a366c86fb264..92c983ff55f71 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (34) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.customer_demographics (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer_demographics (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (25) -(1) Scan parquet default.catalog_sales -Output [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] - -(3) Filter [codegen id : 5] -Input [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Condition : (((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_promo_sk#4)) - -(4) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(1) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] -(6) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = M)) AND (cd_marital_status#11 = S)) AND (cd_education_status#12 = College)) AND isnotnull(cd_demo_sk#9)) +(3) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = M)) AND (cd_marital_status#3 = S)) AND (cd_education_status#4 = College)) AND isnotnull(cd_demo_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [cd_demo_sk#1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] + +(5) BroadcastExchange +Input [1]: [cd_demo_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.catalog_sales +Output [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [cd_demo_sk#9] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(7) ColumnarToRow +Input [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -(8) BroadcastExchange -Input [1]: [cd_demo_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(8) Filter +Input [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Condition : (((isnotnull(cs_bill_cdemo_sk#7) AND isnotnull(cs_sold_date_sk#6)) AND isnotnull(cs_item_sk#8)) AND isnotnull(cs_promo_sk#9)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_bill_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#9] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [cs_bill_cdemo_sk#7] Join condition: None (10) Project [codegen id : 5] -Output [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Input [9]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cd_demo_sk#9] +Output [7]: [cs_sold_date_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Input [9]: [cd_demo_sk#1, cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] (11) Scan parquet default.promotion Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] @@ -103,13 +103,13 @@ Input [1]: [p_promo_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_promo_sk#4] +Left keys [1]: [cs_promo_sk#9] Right keys [1]: [p_promo_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Input [8]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, p_promo_sk#14] +Output [6]: [cs_sold_date_sk#6, cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Input [8]: [cs_sold_date_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, p_promo_sk#14] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#18, d_year#19] @@ -134,13 +134,13 @@ Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#6] Right keys [1]: [d_date_sk#18] Join condition: None (24) Project [codegen id : 5] -Output [5]: [cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Input [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, d_date_sk#18] +Output [5]: [cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Input [7]: [cs_sold_date_sk#6, cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, d_date_sk#18] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] @@ -161,18 +161,18 @@ Input [2]: [i_item_sk#21, i_item_id#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] (29) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_item_sk#3] +Left keys [1]: [cs_item_sk#8] Right keys [1]: [i_item_sk#21] Join condition: None (30) Project [codegen id : 5] -Output [5]: [cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_id#22] -Input [7]: [cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_sk#21, i_item_id#22] +Output [5]: [cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_id#22] +Input [7]: [cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_sk#21, i_item_id#22] (31) HashAggregate [codegen id : 5] -Input [5]: [cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_id#22] +Input [5]: [cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_id#22] Keys [1]: [i_item_id#22] -Functions [4]: [partial_avg(cast(cs_quantity#5 as bigint)), partial_avg(UnscaledValue(cs_list_price#6)), partial_avg(UnscaledValue(cs_coupon_amt#8)), partial_avg(UnscaledValue(cs_sales_price#7))] +Functions [4]: [partial_avg(cast(cs_quantity#10 as bigint)), partial_avg(UnscaledValue(cs_list_price#11)), partial_avg(UnscaledValue(cs_coupon_amt#13)), partial_avg(UnscaledValue(cs_sales_price#12))] Aggregate Attributes [8]: [sum#24, count#25, sum#26, count#27, sum#28, count#29, sum#30, count#31] Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] @@ -183,9 +183,9 @@ Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] Keys [1]: [i_item_id#22] -Functions [4]: [avg(cast(cs_quantity#5 as bigint)), avg(UnscaledValue(cs_list_price#6)), avg(UnscaledValue(cs_coupon_amt#8)), avg(UnscaledValue(cs_sales_price#7))] -Aggregate Attributes [4]: [avg(cast(cs_quantity#5 as bigint))#41, avg(UnscaledValue(cs_list_price#6))#42, avg(UnscaledValue(cs_coupon_amt#8))#43, avg(UnscaledValue(cs_sales_price#7))#44] -Results [5]: [i_item_id#22, avg(cast(cs_quantity#5 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(cs_list_price#6))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(cs_coupon_amt#8))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(cs_sales_price#7))#44 / 100.0) as decimal(11,6)) AS agg4#48] +Functions [4]: [avg(cast(cs_quantity#10 as bigint)), avg(UnscaledValue(cs_list_price#11)), avg(UnscaledValue(cs_coupon_amt#13)), avg(UnscaledValue(cs_sales_price#12))] +Aggregate Attributes [4]: [avg(cast(cs_quantity#10 as bigint))#41, avg(UnscaledValue(cs_list_price#11))#42, avg(UnscaledValue(cs_coupon_amt#13))#43, avg(UnscaledValue(cs_sales_price#12))#44] +Results [5]: [i_item_id#22, avg(cast(cs_quantity#10 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(cs_list_price#11))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(cs_coupon_amt#13))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(cs_sales_price#12))#44 / 100.0) as decimal(11,6)) AS agg4#48] (34) TakeOrderedAndProject Input [5]: [i_item_id#22, agg1#45, agg2#46, agg3#47, agg4#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt index d4ae376d5b425..1c1c3de006e36 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt @@ -12,11 +12,7 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] BroadcastHashJoin [cs_promo_sk,p_promo_sk] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] - BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] - Filter [cs_bill_cdemo_sk,cs_sold_date_sk,cs_item_sk,cs_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] + BroadcastHashJoin [cd_demo_sk,cs_bill_cdemo_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -25,6 +21,10 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + Filter [cs_bill_cdemo_sk,cs_sold_date_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt index a949b93f3bcb0..17afa02653c31 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt @@ -51,15 +51,15 @@ TakeOrderedAndProject (61) +- * Sort (55) +- Exchange (54) +- * Project (53) - +- * BroadcastHashJoin Inner BuildRight (52) - :- * Filter (46) - : +- * ColumnarToRow (45) - : +- Scan parquet default.catalog_sales (44) - +- BroadcastExchange (51) - +- * Project (50) - +- * Filter (49) - +- * ColumnarToRow (48) - +- Scan parquet default.date_dim (47) + +- * BroadcastHashJoin Inner BuildLeft (52) + :- BroadcastExchange (48) + : +- * Project (47) + : +- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.date_dim (44) + +- * Filter (51) + +- * ColumnarToRow (50) + +- Scan parquet default.catalog_sales (49) (1) Scan parquet default.store_sales @@ -251,72 +251,72 @@ Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, 5), true, [id=#31] Input [8]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25] Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST], false, 0 -(44) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct - -(45) ColumnarToRow [codegen id : 15] -Input [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] - -(46) Filter [codegen id : 15] -Input [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -Condition : ((isnotnull(cs_bill_customer_sk#33) AND isnotnull(cs_item_sk#34)) AND isnotnull(cs_sold_date_sk#32)) - -(47) Scan parquet default.date_dim -Output [2]: [d_date_sk#36, d_year#37] +(44) Scan parquet default.date_dim +Output [2]: [d_date_sk#32, d_year#33] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] ReadSchema: struct -(48) ColumnarToRow [codegen id : 14] -Input [2]: [d_date_sk#36, d_year#37] +(45) ColumnarToRow [codegen id : 14] +Input [2]: [d_date_sk#32, d_year#33] -(49) Filter [codegen id : 14] -Input [2]: [d_date_sk#36, d_year#37] -Condition : (d_year#37 IN (1999,2000,2001) AND isnotnull(d_date_sk#36)) +(46) Filter [codegen id : 14] +Input [2]: [d_date_sk#32, d_year#33] +Condition : (d_year#33 IN (1999,2000,2001) AND isnotnull(d_date_sk#32)) + +(47) Project [codegen id : 14] +Output [1]: [d_date_sk#32] +Input [2]: [d_date_sk#32, d_year#33] + +(48) BroadcastExchange +Input [1]: [d_date_sk#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] + +(49) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(50) Project [codegen id : 14] -Output [1]: [d_date_sk#36] -Input [2]: [d_date_sk#36, d_year#37] +(50) ColumnarToRow +Input [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -(51) BroadcastExchange -Input [1]: [d_date_sk#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] +(51) Filter +Input [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Condition : ((isnotnull(cs_bill_customer_sk#36) AND isnotnull(cs_item_sk#37)) AND isnotnull(cs_sold_date_sk#35)) (52) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [cs_sold_date_sk#32] -Right keys [1]: [d_date_sk#36] +Left keys [1]: [d_date_sk#32] +Right keys [1]: [cs_sold_date_sk#35] Join condition: None (53) Project [codegen id : 15] -Output [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -Input [5]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35, d_date_sk#36] +Output [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Input [5]: [d_date_sk#32, cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] (54) Exchange -Input [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#33 as bigint), cast(cs_item_sk#34 as bigint), 5), true, [id=#39] +Input [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Arguments: hashpartitioning(cast(cs_bill_customer_sk#36 as bigint), cast(cs_item_sk#37 as bigint), 5), true, [id=#39] (55) Sort [codegen id : 16] -Input [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -Arguments: [cast(cs_bill_customer_sk#33 as bigint) ASC NULLS FIRST, cast(cs_item_sk#34 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Arguments: [cast(cs_bill_customer_sk#36 as bigint) ASC NULLS FIRST, cast(cs_item_sk#37 as bigint) ASC NULLS FIRST], false, 0 (56) SortMergeJoin [codegen id : 17] Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] -Right keys [2]: [cast(cs_bill_customer_sk#33 as bigint), cast(cs_item_sk#34 as bigint)] +Right keys [2]: [cast(cs_bill_customer_sk#36 as bigint), cast(cs_item_sk#37 as bigint)] Join condition: None (57) Project [codegen id : 17] -Output [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#35, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] -Input [11]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] +Output [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#38, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] +Input [11]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] (58) HashAggregate [codegen id : 17] -Input [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#35, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] +Input [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#38, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] Keys [4]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13] -Functions [3]: [partial_sum(cast(ss_quantity#6 as bigint)), partial_sum(cast(sr_return_quantity#25 as bigint)), partial_sum(cast(cs_quantity#35 as bigint))] +Functions [3]: [partial_sum(cast(ss_quantity#6 as bigint)), partial_sum(cast(sr_return_quantity#25 as bigint)), partial_sum(cast(cs_quantity#38 as bigint))] Aggregate Attributes [3]: [sum#40, sum#41, sum#42] Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum#43, sum#44, sum#45] @@ -327,9 +327,9 @@ Arguments: hashpartitioning(i_item_id#17, i_item_desc#18, s_store_id#12, s_store (60) HashAggregate [codegen id : 18] Input [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum#43, sum#44, sum#45] Keys [4]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13] -Functions [3]: [sum(cast(ss_quantity#6 as bigint)), sum(cast(sr_return_quantity#25 as bigint)), sum(cast(cs_quantity#35 as bigint))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#6 as bigint))#47, sum(cast(sr_return_quantity#25 as bigint))#48, sum(cast(cs_quantity#35 as bigint))#49] -Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum(cast(ss_quantity#6 as bigint))#47 AS store_sales_quantity#50, sum(cast(sr_return_quantity#25 as bigint))#48 AS store_returns_quantity#51, sum(cast(cs_quantity#35 as bigint))#49 AS catalog_sales_quantity#52] +Functions [3]: [sum(cast(ss_quantity#6 as bigint)), sum(cast(sr_return_quantity#25 as bigint)), sum(cast(cs_quantity#38 as bigint))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#6 as bigint))#47, sum(cast(sr_return_quantity#25 as bigint))#48, sum(cast(cs_quantity#38 as bigint))#49] +Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum(cast(ss_quantity#6 as bigint))#47 AS store_sales_quantity#50, sum(cast(sr_return_quantity#25 as bigint))#48 AS store_returns_quantity#51, sum(cast(cs_quantity#38 as bigint))#49 AS catalog_sales_quantity#52] (61) TakeOrderedAndProject Input [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, store_sales_quantity#50, store_returns_quantity#51, catalog_sales_quantity#52] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt index ea91af9e8f755..fc05544f906d0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt @@ -89,11 +89,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales Exchange [cs_bill_customer_sk,cs_item_sk] #10 WholeStageCodegen (15) Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] InputAdapter BroadcastExchange #11 WholeStageCodegen (14) @@ -102,3 +98,7 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt index afe7c682b55e8..2886f8143fdf1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.item (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,128), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -Condition : ((isnotnull(i_manufact_id#7) AND (i_manufact_id#7 = 128)) AND isnotnull(i_item_sk#4)) +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +Condition : ((isnotnull(i_manufact_id#4) AND (i_manufact_id#4 = 128)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -(8) BroadcastExchange -Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] +Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum_agg#19] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] +Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS sum_agg#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, sum_agg#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt index 3412ecfeea026..95a9f0c0b7e30 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt index c338e5ce6f5d5..2f4a32b68716f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt @@ -1,333 +1,333 @@ == Physical Plan == TakeOrderedAndProject (59) +- * Project (58) - +- * BroadcastHashJoin Inner BuildRight (57) - :- * Project (45) - : +- * BroadcastHashJoin Inner BuildRight (44) - : :- * Filter (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * SortMergeJoin Inner (18) - : : :- * Sort (12) - : : : +- Exchange (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.web_returns (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- * Sort (17) - : : +- Exchange (16) - : : +- * Filter (15) - : : +- * ColumnarToRow (14) - : : +- Scan parquet default.customer_address (13) - : +- BroadcastExchange (43) - : +- * Filter (42) - : +- * HashAggregate (41) - : +- Exchange (40) - : +- * HashAggregate (39) - : +- * HashAggregate (38) - : +- Exchange (37) - : +- * HashAggregate (36) - : +- * Project (35) - : +- * SortMergeJoin Inner (34) - : :- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_returns (24) - : : +- ReusedExchange (27) - : +- * Sort (33) - : +- ReusedExchange (32) - +- BroadcastExchange (56) - +- * Project (55) - +- * BroadcastHashJoin Inner BuildRight (54) - :- * Filter (48) - : +- * ColumnarToRow (47) - : +- Scan parquet default.customer (46) - +- BroadcastExchange (53) - +- * Project (52) - +- * Filter (51) - +- * ColumnarToRow (50) - +- Scan parquet default.customer_address (49) - - -(1) Scan parquet default.web_returns -Output [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] + +- * BroadcastHashJoin Inner BuildLeft (57) + :- BroadcastExchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.customer (6) + +- * Project (56) + +- * BroadcastHashJoin Inner BuildRight (55) + :- * Filter (34) + : +- * HashAggregate (33) + : +- Exchange (32) + : +- * HashAggregate (31) + : +- * Project (30) + : +- * SortMergeJoin Inner (29) + : :- * Sort (23) + : : +- Exchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (16) + : : : +- * Project (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.date_dim (12) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.web_returns (17) + : +- * Sort (28) + : +- Exchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (54) + +- * Filter (53) + +- * HashAggregate (52) + +- Exchange (51) + +- * HashAggregate (50) + +- * HashAggregate (49) + +- Exchange (48) + +- * HashAggregate (47) + +- * Project (46) + +- * SortMergeJoin Inner (45) + :- * Sort (42) + : +- Exchange (41) + : +- * Project (40) + : +- * BroadcastHashJoin Inner BuildLeft (39) + : :- ReusedExchange (35) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.web_returns (36) + +- * Sort (44) + +- ReusedExchange (43) + + +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_state#2] -(3) Filter [codegen id : 2] -Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Condition : ((isnotnull(wr_returned_date_sk#1) AND isnotnull(wr_returning_addr_sk#3)) AND isnotnull(wr_returning_customer_sk#2)) +(3) Filter [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = GA)) AND isnotnull(ca_address_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#5, d_year#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#1] +Input [2]: [ca_address_sk#1, ca_state#2] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#5, d_year#6] +(5) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#5, d_year#6] -Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2002)) AND isnotnull(d_date_sk#5)) +(6) Scan parquet default.customer +Output [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#5] -Input [2]: [d_date_sk#5, d_year#6] +(7) ColumnarToRow +Input [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -(8) BroadcastExchange -Input [1]: [d_date_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#6)) (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [wr_returned_date_sk#1] -Right keys [1]: [cast(d_date_sk#5 as bigint)] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#6] Join condition: None (10) Project [codegen id : 2] -Output [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Input [5]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, d_date_sk#5] - -(11) Exchange -Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Arguments: hashpartitioning(wr_returning_addr_sk#3, 5), true, [id=#8] +Output [13]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +Input [15]: [ca_address_sk#1, c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -(12) Sort [codegen id : 3] -Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Arguments: [wr_returning_addr_sk#3 ASC NULLS FIRST], false, 0 +(11) BroadcastExchange +Input [13]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] -(13) Scan parquet default.customer_address -Output [2]: [ca_address_sk#9, ca_state#10] +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] -ReadSchema: struct - -(14) ColumnarToRow [codegen id : 4] -Input [2]: [ca_address_sk#9, ca_state#10] +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct -(15) Filter [codegen id : 4] -Input [2]: [ca_address_sk#9, ca_state#10] -Condition : (isnotnull(ca_address_sk#9) AND isnotnull(ca_state#10)) +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] -(16) Exchange -Input [2]: [ca_address_sk#9, ca_state#10] -Arguments: hashpartitioning(cast(ca_address_sk#9 as bigint), 5), true, [id=#11] +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2002)) AND isnotnull(d_date_sk#19)) -(17) Sort [codegen id : 5] -Input [2]: [ca_address_sk#9, ca_state#10] -Arguments: [cast(ca_address_sk#9 as bigint) ASC NULLS FIRST], false, 0 +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [wr_returning_addr_sk#3] -Right keys [1]: [cast(ca_address_sk#9 as bigint)] -Join condition: None +(16) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] -(19) Project [codegen id : 6] -Output [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] -Input [5]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, ca_address_sk#9, ca_state#10] - -(20) HashAggregate [codegen id : 6] -Input [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] -Keys [2]: [wr_returning_customer_sk#2, ca_state#10] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#4))] -Aggregate Attributes [1]: [sum#12] -Results [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] - -(21) Exchange -Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] -Arguments: hashpartitioning(wr_returning_customer_sk#2, ca_state#10, 5), true, [id=#14] - -(22) HashAggregate [codegen id : 17] -Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] -Keys [2]: [wr_returning_customer_sk#2, ca_state#10] -Functions [1]: [sum(UnscaledValue(wr_return_amt#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#4))#15] -Results [3]: [wr_returning_customer_sk#2 AS ctr_customer_sk#16, ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#4))#15,17,2) AS ctr_total_return#18] - -(23) Filter [codegen id : 17] -Input [3]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18] -Condition : isnotnull(ctr_total_return#18) - -(24) Scan parquet default.web_returns -Output [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +(17) Scan parquet default.web_returns +Output [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk)] +PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 8] -Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] - -(26) Filter [codegen id : 8] -Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Condition : (isnotnull(wr_returned_date_sk#1) AND isnotnull(wr_returning_addr_sk#3)) +(18) ColumnarToRow +Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -(27) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(19) Filter +Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Condition : ((isnotnull(wr_returned_date_sk#22) AND isnotnull(wr_returning_addr_sk#24)) AND isnotnull(wr_returning_customer_sk#23)) -(28) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [wr_returned_date_sk#1] -Right keys [1]: [cast(d_date_sk#5 as bigint)] +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cast(d_date_sk#19 as bigint)] +Right keys [1]: [wr_returned_date_sk#22] Join condition: None -(29) Project [codegen id : 8] -Output [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Input [5]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, d_date_sk#5] +(21) Project [codegen id : 4] +Output [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Input [5]: [d_date_sk#19, wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] + +(22) Exchange +Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Arguments: hashpartitioning(wr_returning_addr_sk#24, 5), true, [id=#26] + +(23) Sort [codegen id : 5] +Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Arguments: [wr_returning_addr_sk#24 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct -(30) Exchange -Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Arguments: hashpartitioning(wr_returning_addr_sk#3, 5), true, [id=#19] +(25) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#1, ca_state#2] -(31) Sort [codegen id : 9] -Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -Arguments: [wr_returning_addr_sk#3 ASC NULLS FIRST], false, 0 +(26) Filter [codegen id : 6] +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_state#2)) -(32) ReusedExchange [Reuses operator id: 16] -Output [2]: [ca_address_sk#9, ca_state#10] +(27) Exchange +Input [2]: [ca_address_sk#1, ca_state#2] +Arguments: hashpartitioning(cast(ca_address_sk#1 as bigint), 5), true, [id=#27] -(33) Sort [codegen id : 11] -Input [2]: [ca_address_sk#9, ca_state#10] -Arguments: [cast(ca_address_sk#9 as bigint) ASC NULLS FIRST], false, 0 +(28) Sort [codegen id : 7] +Input [2]: [ca_address_sk#1, ca_state#2] +Arguments: [cast(ca_address_sk#1 as bigint) ASC NULLS FIRST], false, 0 -(34) SortMergeJoin [codegen id : 12] -Left keys [1]: [wr_returning_addr_sk#3] -Right keys [1]: [cast(ca_address_sk#9 as bigint)] +(29) SortMergeJoin [codegen id : 8] +Left keys [1]: [wr_returning_addr_sk#24] +Right keys [1]: [cast(ca_address_sk#1 as bigint)] Join condition: None -(35) Project [codegen id : 12] -Output [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] -Input [5]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, ca_address_sk#9, ca_state#10] - -(36) HashAggregate [codegen id : 12] -Input [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] -Keys [2]: [wr_returning_customer_sk#2, ca_state#10] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#4))] -Aggregate Attributes [1]: [sum#20] -Results [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] - -(37) Exchange -Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] -Arguments: hashpartitioning(wr_returning_customer_sk#2, ca_state#10, 5), true, [id=#22] - -(38) HashAggregate [codegen id : 13] -Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] -Keys [2]: [wr_returning_customer_sk#2, ca_state#10] -Functions [1]: [sum(UnscaledValue(wr_return_amt#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#4))#23] -Results [2]: [ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#4))#23,17,2) AS ctr_total_return#18] - -(39) HashAggregate [codegen id : 13] -Input [2]: [ctr_state#17, ctr_total_return#18] -Keys [1]: [ctr_state#17] -Functions [1]: [partial_avg(ctr_total_return#18)] -Aggregate Attributes [2]: [sum#24, count#25] -Results [3]: [ctr_state#17, sum#26, count#27] - -(40) Exchange -Input [3]: [ctr_state#17, sum#26, count#27] -Arguments: hashpartitioning(ctr_state#17, 5), true, [id=#28] - -(41) HashAggregate [codegen id : 14] -Input [3]: [ctr_state#17, sum#26, count#27] -Keys [1]: [ctr_state#17] -Functions [1]: [avg(ctr_total_return#18)] -Aggregate Attributes [1]: [avg(ctr_total_return#18)#29] -Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#18)#29) * 1.200000), DecimalType(24,7), true) AS (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17 AS ctr_state#17#31] - -(42) Filter [codegen id : 14] -Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] -Condition : isnotnull((CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30) - -(43) BroadcastExchange -Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#32] - -(44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ctr_state#17] -Right keys [1]: [ctr_state#17#31] -Join condition: (cast(ctr_total_return#18 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30) - -(45) Project [codegen id : 17] -Output [2]: [ctr_customer_sk#16, ctr_total_return#18] -Input [5]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] - -(46) Scan parquet default.customer -Output [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +(30) Project [codegen id : 8] +Output [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] +Input [5]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25, ca_address_sk#1, ca_state#2] + +(31) HashAggregate [codegen id : 8] +Input [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] +Keys [2]: [wr_returning_customer_sk#23, ca_state#2] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#25))] +Aggregate Attributes [1]: [sum#28] +Results [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] + +(32) Exchange +Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] +Arguments: hashpartitioning(wr_returning_customer_sk#23, ca_state#2, 5), true, [id=#30] + +(33) HashAggregate +Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] +Keys [2]: [wr_returning_customer_sk#23, ca_state#2] +Functions [1]: [sum(UnscaledValue(wr_return_amt#25))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#25))#31] +Results [3]: [wr_returning_customer_sk#23 AS ctr_customer_sk#32, ca_state#2 AS ctr_state#33, MakeDecimal(sum(UnscaledValue(wr_return_amt#25))#31,17,2) AS ctr_total_return#34] + +(34) Filter +Input [3]: [ctr_customer_sk#32, ctr_state#33, ctr_total_return#34] +Condition : isnotnull(ctr_total_return#34) + +(35) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#19] + +(36) Scan parquet default.web_returns +Output [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk)] +ReadSchema: struct -(47) ColumnarToRow [codegen id : 16] -Input [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +(37) ColumnarToRow +Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -(48) Filter [codegen id : 16] -Input [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] -Condition : (isnotnull(c_customer_sk#33) AND isnotnull(c_current_addr_sk#35)) +(38) Filter +Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Condition : (isnotnull(wr_returned_date_sk#22) AND isnotnull(wr_returning_addr_sk#24)) -(49) Scan parquet default.customer_address -Output [2]: [ca_address_sk#9, ca_state#10] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] -ReadSchema: struct +(39) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cast(d_date_sk#19 as bigint)] +Right keys [1]: [wr_returned_date_sk#22] +Join condition: None -(50) ColumnarToRow [codegen id : 15] -Input [2]: [ca_address_sk#9, ca_state#10] +(40) Project [codegen id : 10] +Output [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Input [5]: [d_date_sk#19, wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -(51) Filter [codegen id : 15] -Input [2]: [ca_address_sk#9, ca_state#10] -Condition : ((isnotnull(ca_state#10) AND (ca_state#10 = GA)) AND isnotnull(ca_address_sk#9)) +(41) Exchange +Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Arguments: hashpartitioning(wr_returning_addr_sk#24, 5), true, [id=#35] -(52) Project [codegen id : 15] -Output [1]: [ca_address_sk#9] -Input [2]: [ca_address_sk#9, ca_state#10] +(42) Sort [codegen id : 11] +Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Arguments: [wr_returning_addr_sk#24 ASC NULLS FIRST], false, 0 -(53) BroadcastExchange -Input [1]: [ca_address_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#47] +(43) ReusedExchange [Reuses operator id: 27] +Output [2]: [ca_address_sk#1, ca_state#2] -(54) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#35] -Right keys [1]: [ca_address_sk#9] -Join condition: None +(44) Sort [codegen id : 13] +Input [2]: [ca_address_sk#1, ca_state#2] +Arguments: [cast(ca_address_sk#1 as bigint) ASC NULLS FIRST], false, 0 -(55) Project [codegen id : 16] -Output [13]: [c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] -Input [15]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ca_address_sk#9] +(45) SortMergeJoin [codegen id : 14] +Left keys [1]: [wr_returning_addr_sk#24] +Right keys [1]: [cast(ca_address_sk#1 as bigint)] +Join condition: None -(56) BroadcastExchange -Input [13]: [c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] +(46) Project [codegen id : 14] +Output [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] +Input [5]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25, ca_address_sk#1, ca_state#2] + +(47) HashAggregate [codegen id : 14] +Input [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] +Keys [2]: [wr_returning_customer_sk#23, ca_state#2] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#25))] +Aggregate Attributes [1]: [sum#36] +Results [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] + +(48) Exchange +Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] +Arguments: hashpartitioning(wr_returning_customer_sk#23, ca_state#2, 5), true, [id=#38] + +(49) HashAggregate [codegen id : 15] +Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] +Keys [2]: [wr_returning_customer_sk#23, ca_state#2] +Functions [1]: [sum(UnscaledValue(wr_return_amt#25))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#25))#39] +Results [2]: [ca_state#2 AS ctr_state#33, MakeDecimal(sum(UnscaledValue(wr_return_amt#25))#39,17,2) AS ctr_total_return#34] + +(50) HashAggregate [codegen id : 15] +Input [2]: [ctr_state#33, ctr_total_return#34] +Keys [1]: [ctr_state#33] +Functions [1]: [partial_avg(ctr_total_return#34)] +Aggregate Attributes [2]: [sum#40, count#41] +Results [3]: [ctr_state#33, sum#42, count#43] + +(51) Exchange +Input [3]: [ctr_state#33, sum#42, count#43] +Arguments: hashpartitioning(ctr_state#33, 5), true, [id=#44] + +(52) HashAggregate [codegen id : 16] +Input [3]: [ctr_state#33, sum#42, count#43] +Keys [1]: [ctr_state#33] +Functions [1]: [avg(ctr_total_return#34)] +Aggregate Attributes [1]: [avg(ctr_total_return#34)#45] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#34)#45) * 1.200000), DecimalType(24,7), true) AS (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33 AS ctr_state#33#47] + +(53) Filter [codegen id : 16] +Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] +Condition : isnotnull((CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46) + +(54) BroadcastExchange +Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#48] + +(55) BroadcastHashJoin +Left keys [1]: [ctr_state#33] +Right keys [1]: [ctr_state#33#47] +Join condition: (cast(ctr_total_return#34 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46) + +(56) Project +Output [2]: [ctr_customer_sk#32, ctr_total_return#34] +Input [5]: [ctr_customer_sk#32, ctr_state#33, ctr_total_return#34, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] (57) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ctr_customer_sk#16] -Right keys [1]: [cast(c_customer_sk#33 as bigint)] +Left keys [1]: [cast(c_customer_sk#4 as bigint)] +Right keys [1]: [ctr_customer_sk#32] Join condition: None (58) Project [codegen id : 17] -Output [13]: [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] -Input [15]: [ctr_customer_sk#16, ctr_total_return#18, c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +Output [13]: [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] +Input [15]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_customer_sk#32, ctr_total_return#34] (59) TakeOrderedAndProject -Input [13]: [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] -Arguments: 100, [c_customer_id#34 ASC NULLS FIRST, c_salutation#36 ASC NULLS FIRST, c_first_name#37 ASC NULLS FIRST, c_last_name#38 ASC NULLS FIRST, c_preferred_cust_flag#39 ASC NULLS FIRST, c_birth_day#40 ASC NULLS FIRST, c_birth_month#41 ASC NULLS FIRST, c_birth_year#42 ASC NULLS FIRST, c_birth_country#43 ASC NULLS FIRST, c_login#44 ASC NULLS FIRST, c_email_address#45 ASC NULLS FIRST, c_last_review_date#46 ASC NULLS FIRST, ctr_total_return#18 ASC NULLS FIRST], [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] +Input [13]: [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] +Arguments: 100, [c_customer_id#5 ASC NULLS FIRST, c_salutation#7 ASC NULLS FIRST, c_first_name#8 ASC NULLS FIRST, c_last_name#9 ASC NULLS FIRST, c_preferred_cust_flag#10 ASC NULLS FIRST, c_birth_day#11 ASC NULLS FIRST, c_birth_month#12 ASC NULLS FIRST, c_birth_year#13 ASC NULLS FIRST, c_birth_country#14 ASC NULLS FIRST, c_login#15 ASC NULLS FIRST, c_email_address#16 ASC NULLS FIRST, c_last_review_date#17 ASC NULLS FIRST, ctr_total_return#34 ASC NULLS FIRST], [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt index 4a53f2266fb26..a1aee58c44020 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt @@ -1,96 +1,96 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] WholeStageCodegen (17) Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] - BroadcastHashJoin [ctr_customer_sk,c_customer_sk] + BroadcastHashJoin [c_customer_sk,ctr_customer_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (2) + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] Project [ctr_customer_sk,ctr_total_return] BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] Filter [ctr_total_return] HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_customer_sk,ctr_state,ctr_total_return,sum] InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #1 - WholeStageCodegen (6) + Exchange [wr_returning_customer_sk,ca_state] #3 + WholeStageCodegen (8) HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] Project [wr_returning_customer_sk,wr_return_amt,ca_state] SortMergeJoin [wr_returning_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (3) + WholeStageCodegen (5) Sort [wr_returning_addr_sk] InputAdapter - Exchange [wr_returning_addr_sk] #2 - WholeStageCodegen (2) + Exchange [wr_returning_addr_sk] #4 + WholeStageCodegen (4) Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] - Filter [wr_returned_date_sk,wr_returning_addr_sk,wr_returning_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [d_date_sk,wr_returned_date_sk] InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [wr_returned_date_sk,wr_returning_addr_sk,wr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (7) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #4 - WholeStageCodegen (4) + Exchange [ca_address_sk] #6 + WholeStageCodegen (6) Filter [ca_address_sk,ca_state] ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (14) + BroadcastExchange #7 + WholeStageCodegen (16) Filter [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6))),ctr_state,sum,count] InputAdapter - Exchange [ctr_state] #6 - WholeStageCodegen (13) + Exchange [ctr_state] #8 + WholeStageCodegen (15) HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #7 - WholeStageCodegen (12) + Exchange [wr_returning_customer_sk,ca_state] #9 + WholeStageCodegen (14) HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] Project [wr_returning_customer_sk,wr_return_amt,ca_state] SortMergeJoin [wr_returning_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (11) Sort [wr_returning_addr_sk] InputAdapter - Exchange [wr_returning_addr_sk] #8 - WholeStageCodegen (8) + Exchange [wr_returning_addr_sk] #10 + WholeStageCodegen (10) Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 Filter [wr_returned_date_sk,wr_returning_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter - WholeStageCodegen (11) + WholeStageCodegen (13) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_state] #4 - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (16) - Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (15) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + ReusedExchange [ca_address_sk,ca_state] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt index 9f123c4044cc8..a861008bedd79 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt @@ -2,137 +2,137 @@ * Sort (119) +- Exchange (118) +- * Project (117) - +- * BroadcastHashJoin Inner BuildRight (116) - :- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Project (42) - : : +- * BroadcastHashJoin Inner BuildRight (41) - : : :- * HashAggregate (21) - : : : +- Exchange (20) - : : : +- * HashAggregate (19) - : : : +- * Project (18) - : : : +- * SortMergeJoin Inner (17) - : : : :- * Sort (11) - : : : : +- Exchange (10) - : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) - : : : +- * Sort (16) - : : : +- Exchange (15) - : : : +- * Filter (14) - : : : +- * ColumnarToRow (13) - : : : +- Scan parquet default.customer_address (12) - : : +- BroadcastExchange (40) - : : +- * HashAggregate (39) - : : +- Exchange (38) - : : +- * HashAggregate (37) - : : +- * Project (36) - : : +- * SortMergeJoin Inner (35) - : : :- * Sort (32) - : : : +- Exchange (31) - : : : +- * Project (30) - : : : +- * BroadcastHashJoin Inner BuildRight (29) - : : : :- * Filter (24) - : : : : +- * ColumnarToRow (23) - : : : : +- Scan parquet default.store_sales (22) - : : : +- BroadcastExchange (28) - : : : +- * Filter (27) - : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.date_dim (25) - : : +- * Sort (34) - : : +- ReusedExchange (33) - : +- BroadcastExchange (61) - : +- * HashAggregate (60) - : +- Exchange (59) - : +- * HashAggregate (58) - : +- * Project (57) - : +- * SortMergeJoin Inner (56) - : :- * Sort (53) - : : +- Exchange (52) - : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (45) - : : : +- * ColumnarToRow (44) - : : : +- Scan parquet default.store_sales (43) - : : +- BroadcastExchange (49) - : : +- * Filter (48) - : : +- * ColumnarToRow (47) - : : +- Scan parquet default.date_dim (46) - : +- * Sort (55) - : +- ReusedExchange (54) - +- BroadcastExchange (115) - +- * Project (114) - +- * BroadcastHashJoin Inner BuildRight (113) - :- * Project (96) - : +- * BroadcastHashJoin Inner BuildRight (95) - : :- * HashAggregate (78) - : : +- Exchange (77) - : : +- * HashAggregate (76) - : : +- * Project (75) - : : +- * SortMergeJoin Inner (74) - : : :- * Sort (71) - : : : +- Exchange (70) - : : : +- * Project (69) - : : : +- * BroadcastHashJoin Inner BuildRight (68) - : : : :- * Filter (66) - : : : : +- * ColumnarToRow (65) - : : : : +- Scan parquet default.web_sales (64) - : : : +- ReusedExchange (67) - : : +- * Sort (73) - : : +- ReusedExchange (72) - : +- BroadcastExchange (94) - : +- * HashAggregate (93) - : +- Exchange (92) - : +- * HashAggregate (91) - : +- * Project (90) - : +- * SortMergeJoin Inner (89) - : :- * Sort (86) - : : +- Exchange (85) - : : +- * Project (84) - : : +- * BroadcastHashJoin Inner BuildRight (83) - : : :- * Filter (81) - : : : +- * ColumnarToRow (80) - : : : +- Scan parquet default.web_sales (79) - : : +- ReusedExchange (82) - : +- * Sort (88) - : +- ReusedExchange (87) - +- BroadcastExchange (112) - +- * HashAggregate (111) - +- Exchange (110) - +- * HashAggregate (109) - +- * Project (108) - +- * SortMergeJoin Inner (107) - :- * Sort (104) - : +- Exchange (103) - : +- * Project (102) - : +- * BroadcastHashJoin Inner BuildRight (101) - : :- * Filter (99) - : : +- * ColumnarToRow (98) - : : +- Scan parquet default.web_sales (97) - : +- ReusedExchange (100) - +- * Sort (106) - +- ReusedExchange (105) - - -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] + +- * BroadcastHashJoin Inner BuildLeft (116) + :- BroadcastExchange (64) + : +- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Project (42) + : : +- * BroadcastHashJoin Inner BuildRight (41) + : : :- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer_address (12) + : : +- BroadcastExchange (40) + : : +- * HashAggregate (39) + : : +- Exchange (38) + : : +- * HashAggregate (37) + : : +- * Project (36) + : : +- * SortMergeJoin Inner (35) + : : :- * Sort (32) + : : : +- Exchange (31) + : : : +- * Project (30) + : : : +- * BroadcastHashJoin Inner BuildLeft (29) + : : : :- BroadcastExchange (25) + : : : : +- * Filter (24) + : : : : +- * ColumnarToRow (23) + : : : : +- Scan parquet default.date_dim (22) + : : : +- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.web_sales (26) + : : +- * Sort (34) + : : +- ReusedExchange (33) + : +- BroadcastExchange (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildLeft (50) + : : :- BroadcastExchange (46) + : : : +- * Filter (45) + : : : +- * ColumnarToRow (44) + : : : +- Scan parquet default.date_dim (43) + : : +- * Filter (49) + : : +- * ColumnarToRow (48) + : : +- Scan parquet default.web_sales (47) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Project (115) + +- * BroadcastHashJoin Inner BuildRight (114) + :- * Project (97) + : +- * BroadcastHashJoin Inner BuildRight (96) + : :- * HashAggregate (79) + : : +- Exchange (78) + : : +- * HashAggregate (77) + : : +- * Project (76) + : : +- * SortMergeJoin Inner (75) + : : :- * Sort (72) + : : : +- Exchange (71) + : : : +- * Project (70) + : : : +- * BroadcastHashJoin Inner BuildLeft (69) + : : : :- ReusedExchange (65) + : : : +- * Filter (68) + : : : +- * ColumnarToRow (67) + : : : +- Scan parquet default.store_sales (66) + : : +- * Sort (74) + : : +- ReusedExchange (73) + : +- BroadcastExchange (95) + : +- * HashAggregate (94) + : +- Exchange (93) + : +- * HashAggregate (92) + : +- * Project (91) + : +- * SortMergeJoin Inner (90) + : :- * Sort (87) + : : +- Exchange (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildLeft (84) + : : :- ReusedExchange (80) + : : +- * Filter (83) + : : +- * ColumnarToRow (82) + : : +- Scan parquet default.store_sales (81) + : +- * Sort (89) + : +- ReusedExchange (88) + +- BroadcastExchange (113) + +- * HashAggregate (112) + +- Exchange (111) + +- * HashAggregate (110) + +- * Project (109) + +- * SortMergeJoin Inner (108) + :- * Sort (105) + : +- Exchange (104) + : +- * Project (103) + : +- * BroadcastHashJoin Inner BuildLeft (102) + : :- ReusedExchange (98) + : +- * Filter (101) + : +- * ColumnarToRow (100) + : +- Scan parquet default.store_sales (99) + +- * Sort (107) + +- ReusedExchange (106) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] (3) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) (4) Scan parquet default.date_dim Output [3]: [d_date_sk#4, d_year#5, d_qoy#6] @@ -153,21 +153,21 @@ Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ws_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] -Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5, d_qoy#6] +Output [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] +Input [6]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3, d_date_sk#4, d_year#5, d_qoy#6] (10) Exchange -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] -Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#8] +Input [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] +Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#8] (11) Sort [codegen id : 3] -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] -Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] +Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer_address Output [2]: [ca_address_sk#9, ca_county#10] @@ -192,18 +192,18 @@ Input [2]: [ca_address_sk#9, ca_county#10] Arguments: [ca_address_sk#9 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_addr_sk#2] +Left keys [1]: [ws_bill_addr_sk#2] Right keys [1]: [ca_address_sk#9] Join condition: None (18) Project [codegen id : 6] -Output [4]: [ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] -Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_address_sk#9, ca_county#10] +Output [4]: [ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] +Input [6]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_address_sk#9, ca_county#10] (19) HashAggregate [codegen id : 6] -Input [4]: [ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] +Input [4]: [ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] Keys [3]: [ca_county#10, d_qoy#6, d_year#5] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#12] Results [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] @@ -211,61 +211,61 @@ Results [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Input [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Arguments: hashpartitioning(ca_county#10, d_qoy#6, d_year#5, 5), true, [id=#14] -(21) HashAggregate [codegen id : 42] +(21) HashAggregate [codegen id : 21] Input [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Keys [3]: [ca_county#10, d_qoy#6, d_year#5] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#15] -Results [2]: [ca_county#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#15,17,2) AS store_sales#16] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#15] +Results [2]: [ca_county#10, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#15,17,2) AS web_sales#16] -(22) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct - -(23) ColumnarToRow [codegen id : 8] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] - -(24) Filter [codegen id : 8] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) - -(25) Scan parquet default.date_dim +(22) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_year#18, d_qoy#19] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(26) ColumnarToRow [codegen id : 7] +(23) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] -(27) Filter [codegen id : 7] +(24) Filter [codegen id : 7] Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] -Condition : ((((isnotnull(d_qoy#19) AND isnotnull(d_year#18)) AND (d_qoy#19 = 3)) AND (d_year#18 = 2000)) AND isnotnull(d_date_sk#17)) +Condition : ((((isnotnull(d_qoy#19) AND isnotnull(d_year#18)) AND (d_qoy#19 = 1)) AND (d_year#18 = 2000)) AND isnotnull(d_date_sk#17)) -(28) BroadcastExchange +(25) BroadcastExchange Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(26) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(27) ColumnarToRow +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] + +(28) Filter +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) + (29) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [d_date_sk#17] +Right keys [1]: [ws_sold_date_sk#1] Join condition: None (30) Project [codegen id : 8] -Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] -Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#17, d_year#18, d_qoy#19] +Output [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Input [6]: [d_date_sk#17, d_year#18, d_qoy#19, ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] (31) Exchange -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] -Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#21] +Input [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#21] (32) Sort [codegen id : 9] -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] -Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 (33) ReusedExchange [Reuses operator id: 15] Output [2]: [ca_address_sk#22, ca_county#23] @@ -275,18 +275,18 @@ Input [2]: [ca_address_sk#22, ca_county#23] Arguments: [ca_address_sk#22 ASC NULLS FIRST], false, 0 (35) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_addr_sk#2] +Left keys [1]: [ws_bill_addr_sk#2] Right keys [1]: [ca_address_sk#22] Join condition: None (36) Project [codegen id : 12] -Output [4]: [ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] -Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_address_sk#22, ca_county#23] +Output [4]: [ws_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] +Input [6]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3, ca_address_sk#22, ca_county#23] (37) HashAggregate [codegen id : 12] -Input [4]: [ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] +Input [4]: [ws_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] Keys [3]: [ca_county#23, d_qoy#19, d_year#18] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#24] Results [4]: [ca_county#23, d_qoy#19, d_year#18, sum#25] @@ -297,71 +297,71 @@ Arguments: hashpartitioning(ca_county#23, d_qoy#19, d_year#18, 5), true, [id=#26 (39) HashAggregate [codegen id : 13] Input [4]: [ca_county#23, d_qoy#19, d_year#18, sum#25] Keys [3]: [ca_county#23, d_qoy#19, d_year#18] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#27] -Results [2]: [ca_county#23, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#27,17,2) AS store_sales#28] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#27] +Results [2]: [ca_county#23, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#27,17,2) AS web_sales#28] (40) BroadcastExchange -Input [2]: [ca_county#23, store_sales#28] +Input [2]: [ca_county#23, web_sales#28] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] -(41) BroadcastHashJoin [codegen id : 42] +(41) BroadcastHashJoin [codegen id : 21] Left keys [1]: [ca_county#10] Right keys [1]: [ca_county#23] Join condition: None -(42) Project [codegen id : 42] -Output [3]: [ca_county#10, store_sales#16, store_sales#28] -Input [4]: [ca_county#10, store_sales#16, ca_county#23, store_sales#28] +(42) Project [codegen id : 21] +Output [3]: [web_sales#16, ca_county#23, web_sales#28] +Input [4]: [ca_county#10, web_sales#16, ca_county#23, web_sales#28] -(43) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct - -(44) ColumnarToRow [codegen id : 15] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] - -(45) Filter [codegen id : 15] -Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) - -(46) Scan parquet default.date_dim +(43) Scan parquet default.date_dim Output [3]: [d_date_sk#30, d_year#31, d_qoy#32] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(47) ColumnarToRow [codegen id : 14] +(44) ColumnarToRow [codegen id : 14] Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] -(48) Filter [codegen id : 14] +(45) Filter [codegen id : 14] Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] -Condition : ((((isnotnull(d_qoy#32) AND isnotnull(d_year#31)) AND (d_qoy#32 = 1)) AND (d_year#31 = 2000)) AND isnotnull(d_date_sk#30)) +Condition : ((((isnotnull(d_qoy#32) AND isnotnull(d_year#31)) AND (d_qoy#32 = 3)) AND (d_year#31 = 2000)) AND isnotnull(d_date_sk#30)) -(49) BroadcastExchange +(46) BroadcastExchange Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] +(47) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(48) ColumnarToRow +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] + +(49) Filter +Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) + (50) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#30] +Left keys [1]: [d_date_sk#30] +Right keys [1]: [ws_sold_date_sk#1] Join condition: None (51) Project [codegen id : 15] -Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] -Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#30, d_year#31, d_qoy#32] +Output [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Input [6]: [d_date_sk#30, d_year#31, d_qoy#32, ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] (52) Exchange -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] -Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#34] +Input [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#34] (53) Sort [codegen id : 16] -Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] -Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] Output [2]: [ca_address_sk#35, ca_county#36] @@ -371,18 +371,18 @@ Input [2]: [ca_address_sk#35, ca_county#36] Arguments: [ca_address_sk#35 ASC NULLS FIRST], false, 0 (56) SortMergeJoin [codegen id : 19] -Left keys [1]: [ss_addr_sk#2] +Left keys [1]: [ws_bill_addr_sk#2] Right keys [1]: [ca_address_sk#35] Join condition: None (57) Project [codegen id : 19] -Output [4]: [ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] -Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_address_sk#35, ca_county#36] +Output [4]: [ws_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] +Input [6]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3, ca_address_sk#35, ca_county#36] (58) HashAggregate [codegen id : 19] -Input [4]: [ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] +Input [4]: [ws_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] Keys [3]: [ca_county#36, d_qoy#32, d_year#31] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#37] Results [4]: [ca_county#36, d_qoy#32, d_year#31, sum#38] @@ -393,271 +393,271 @@ Arguments: hashpartitioning(ca_county#36, d_qoy#32, d_year#31, 5), true, [id=#39 (60) HashAggregate [codegen id : 20] Input [4]: [ca_county#36, d_qoy#32, d_year#31, sum#38] Keys [3]: [ca_county#36, d_qoy#32, d_year#31] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#40] -Results [3]: [ca_county#36, d_year#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#40,17,2) AS store_sales#41] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#40] +Results [2]: [ca_county#36, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#40,17,2) AS web_sales#41] (61) BroadcastExchange -Input [3]: [ca_county#36, d_year#31, store_sales#41] +Input [2]: [ca_county#36, web_sales#41] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] -(62) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ca_county#10] +(62) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [ca_county#23] Right keys [1]: [ca_county#36] Join condition: None -(63) Project [codegen id : 42] -Output [5]: [store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41] -Input [6]: [ca_county#10, store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41] +(63) Project [codegen id : 21] +Output [4]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41] +Input [5]: [web_sales#16, ca_county#23, web_sales#28, ca_county#36, web_sales#41] -(64) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct +(64) BroadcastExchange +Input [4]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#43] -(65) ColumnarToRow [codegen id : 22] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +(65) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#44, d_year#45, d_qoy#46] -(66) Filter [codegen id : 22] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) +(66) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct -(67) ReusedExchange [Reuses operator id: 49] -Output [3]: [d_date_sk#46, d_year#47, d_qoy#48] +(67) ColumnarToRow +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(68) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_sold_date_sk#43] -Right keys [1]: [d_date_sk#46] +(68) Filter +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) + +(69) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [d_date_sk#44] +Right keys [1]: [ss_sold_date_sk#47] Join condition: None -(69) Project [codegen id : 22] -Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] -Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#46, d_year#47, d_qoy#48] +(70) Project [codegen id : 23] +Output [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] +Input [6]: [d_date_sk#44, d_year#45, d_qoy#46, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(70) Exchange -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] -Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#49] +(71) Exchange +Input [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#50] -(71) Sort [codegen id : 23] -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] -Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 +(72) Sort [codegen id : 24] +Input [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 -(72) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#50, ca_county#51] +(73) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#51, ca_county#52] -(73) Sort [codegen id : 25] -Input [2]: [ca_address_sk#50, ca_county#51] -Arguments: [ca_address_sk#50 ASC NULLS FIRST], false, 0 +(74) Sort [codegen id : 26] +Input [2]: [ca_address_sk#51, ca_county#52] +Arguments: [ca_address_sk#51 ASC NULLS FIRST], false, 0 -(74) SortMergeJoin [codegen id : 26] -Left keys [1]: [ws_bill_addr_sk#44] -Right keys [1]: [ca_address_sk#50] +(75) SortMergeJoin [codegen id : 27] +Left keys [1]: [ss_addr_sk#48] +Right keys [1]: [ca_address_sk#51] Join condition: None -(75) Project [codegen id : 26] -Output [4]: [ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_county#51] -Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_address_sk#50, ca_county#51] - -(76) HashAggregate [codegen id : 26] -Input [4]: [ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_county#51] -Keys [3]: [ca_county#51, d_qoy#48, d_year#47] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum#52] -Results [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] - -(77) Exchange -Input [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] -Arguments: hashpartitioning(ca_county#51, d_qoy#48, d_year#47, 5), true, [id=#54] - -(78) HashAggregate [codegen id : 41] -Input [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] -Keys [3]: [ca_county#51, d_qoy#48, d_year#47] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#55] -Results [2]: [ca_county#51, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#55,17,2) AS web_sales#56] - -(79) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +(76) Project [codegen id : 27] +Output [4]: [ss_ext_sales_price#49, d_year#45, d_qoy#46, ca_county#52] +Input [6]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#51, ca_county#52] + +(77) HashAggregate [codegen id : 27] +Input [4]: [ss_ext_sales_price#49, d_year#45, d_qoy#46, ca_county#52] +Keys [3]: [ca_county#52, d_qoy#46, d_year#45] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum#53] +Results [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] + +(78) Exchange +Input [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] +Arguments: hashpartitioning(ca_county#52, d_qoy#46, d_year#45, 5), true, [id=#55] + +(79) HashAggregate +Input [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] +Keys [3]: [ca_county#52, d_qoy#46, d_year#45] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#56] +Results [2]: [ca_county#52, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#56,17,2) AS store_sales#57] + +(80) ReusedExchange [Reuses operator id: 46] +Output [3]: [d_date_sk#58, d_year#59, d_qoy#60] + +(81) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct - -(80) ColumnarToRow [codegen id : 28] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct -(81) Filter [codegen id : 28] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) +(82) ColumnarToRow +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(82) ReusedExchange [Reuses operator id: 7] -Output [3]: [d_date_sk#57, d_year#58, d_qoy#59] +(83) Filter +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) -(83) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#43] -Right keys [1]: [d_date_sk#57] +(84) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [d_date_sk#58] +Right keys [1]: [ss_sold_date_sk#47] Join condition: None -(84) Project [codegen id : 28] -Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] -Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#57, d_year#58, d_qoy#59] +(85) Project [codegen id : 29] +Output [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] +Input [6]: [d_date_sk#58, d_year#59, d_qoy#60, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(85) Exchange -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] -Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#60] +(86) Exchange +Input [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#61] -(86) Sort [codegen id : 29] -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] -Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 +(87) Sort [codegen id : 30] +Input [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 -(87) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#61, ca_county#62] +(88) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#62, ca_county#63] -(88) Sort [codegen id : 31] -Input [2]: [ca_address_sk#61, ca_county#62] -Arguments: [ca_address_sk#61 ASC NULLS FIRST], false, 0 +(89) Sort [codegen id : 32] +Input [2]: [ca_address_sk#62, ca_county#63] +Arguments: [ca_address_sk#62 ASC NULLS FIRST], false, 0 -(89) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_addr_sk#44] -Right keys [1]: [ca_address_sk#61] +(90) SortMergeJoin [codegen id : 33] +Left keys [1]: [ss_addr_sk#48] +Right keys [1]: [ca_address_sk#62] Join condition: None -(90) Project [codegen id : 32] -Output [4]: [ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_county#62] -Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_address_sk#61, ca_county#62] - -(91) HashAggregate [codegen id : 32] -Input [4]: [ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_county#62] -Keys [3]: [ca_county#62, d_qoy#59, d_year#58] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum#63] -Results [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] - -(92) Exchange -Input [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] -Arguments: hashpartitioning(ca_county#62, d_qoy#59, d_year#58, 5), true, [id=#65] - -(93) HashAggregate [codegen id : 33] -Input [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] -Keys [3]: [ca_county#62, d_qoy#59, d_year#58] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#66] -Results [2]: [ca_county#62, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#66,17,2) AS web_sales#67] - -(94) BroadcastExchange -Input [2]: [ca_county#62, web_sales#67] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#68] - -(95) BroadcastHashJoin [codegen id : 41] -Left keys [1]: [ca_county#51] -Right keys [1]: [ca_county#62] +(91) Project [codegen id : 33] +Output [4]: [ss_ext_sales_price#49, d_year#59, d_qoy#60, ca_county#63] +Input [6]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#62, ca_county#63] + +(92) HashAggregate [codegen id : 33] +Input [4]: [ss_ext_sales_price#49, d_year#59, d_qoy#60, ca_county#63] +Keys [3]: [ca_county#63, d_qoy#60, d_year#59] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum#64] +Results [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] + +(93) Exchange +Input [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] +Arguments: hashpartitioning(ca_county#63, d_qoy#60, d_year#59, 5), true, [id=#66] + +(94) HashAggregate [codegen id : 34] +Input [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] +Keys [3]: [ca_county#63, d_qoy#60, d_year#59] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#67] +Results [2]: [ca_county#63, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#67,17,2) AS store_sales#68] + +(95) BroadcastExchange +Input [2]: [ca_county#63, store_sales#68] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#69] + +(96) BroadcastHashJoin +Left keys [1]: [ca_county#52] +Right keys [1]: [ca_county#63] Join condition: None -(96) Project [codegen id : 41] -Output [3]: [ca_county#51, web_sales#56, web_sales#67] -Input [4]: [ca_county#51, web_sales#56, ca_county#62, web_sales#67] +(97) Project +Output [3]: [ca_county#52, store_sales#57, store_sales#68] +Input [4]: [ca_county#52, store_sales#57, ca_county#63, store_sales#68] -(97) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct +(98) ReusedExchange [Reuses operator id: 25] +Output [3]: [d_date_sk#70, d_year#71, d_qoy#72] -(98) ColumnarToRow [codegen id : 35] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +(99) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct -(99) Filter [codegen id : 35] -Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) +(100) ColumnarToRow +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(100) ReusedExchange [Reuses operator id: 28] -Output [3]: [d_date_sk#69, d_year#70, d_qoy#71] +(101) Filter +Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) -(101) BroadcastHashJoin [codegen id : 35] -Left keys [1]: [ws_sold_date_sk#43] -Right keys [1]: [d_date_sk#69] +(102) BroadcastHashJoin [codegen id : 36] +Left keys [1]: [d_date_sk#70] +Right keys [1]: [ss_sold_date_sk#47] Join condition: None -(102) Project [codegen id : 35] -Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] -Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#69, d_year#70, d_qoy#71] +(103) Project [codegen id : 36] +Output [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] +Input [6]: [d_date_sk#70, d_year#71, d_qoy#72, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -(103) Exchange -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] -Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#72] +(104) Exchange +Input [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#73] -(104) Sort [codegen id : 36] -Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] -Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 +(105) Sort [codegen id : 37] +Input [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] +Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 -(105) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#73, ca_county#74] +(106) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#74, ca_county#75] -(106) Sort [codegen id : 38] -Input [2]: [ca_address_sk#73, ca_county#74] -Arguments: [ca_address_sk#73 ASC NULLS FIRST], false, 0 +(107) Sort [codegen id : 39] +Input [2]: [ca_address_sk#74, ca_county#75] +Arguments: [ca_address_sk#74 ASC NULLS FIRST], false, 0 -(107) SortMergeJoin [codegen id : 39] -Left keys [1]: [ws_bill_addr_sk#44] -Right keys [1]: [ca_address_sk#73] +(108) SortMergeJoin [codegen id : 40] +Left keys [1]: [ss_addr_sk#48] +Right keys [1]: [ca_address_sk#74] Join condition: None -(108) Project [codegen id : 39] -Output [4]: [ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_county#74] -Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_address_sk#73, ca_county#74] - -(109) HashAggregate [codegen id : 39] -Input [4]: [ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_county#74] -Keys [3]: [ca_county#74, d_qoy#71, d_year#70] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum#75] -Results [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] - -(110) Exchange -Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] -Arguments: hashpartitioning(ca_county#74, d_qoy#71, d_year#70, 5), true, [id=#77] - -(111) HashAggregate [codegen id : 40] -Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] -Keys [3]: [ca_county#74, d_qoy#71, d_year#70] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#78] -Results [2]: [ca_county#74, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#78,17,2) AS web_sales#79] - -(112) BroadcastExchange -Input [2]: [ca_county#74, web_sales#79] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#80] - -(113) BroadcastHashJoin [codegen id : 41] -Left keys [1]: [ca_county#51] -Right keys [1]: [ca_county#74] -Join condition: None +(109) Project [codegen id : 40] +Output [4]: [ss_ext_sales_price#49, d_year#71, d_qoy#72, ca_county#75] +Input [6]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#74, ca_county#75] + +(110) HashAggregate [codegen id : 40] +Input [4]: [ss_ext_sales_price#49, d_year#71, d_qoy#72, ca_county#75] +Keys [3]: [ca_county#75, d_qoy#72, d_year#71] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum#76] +Results [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] + +(111) Exchange +Input [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] +Arguments: hashpartitioning(ca_county#75, d_qoy#72, d_year#71, 5), true, [id=#78] + +(112) HashAggregate [codegen id : 41] +Input [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] +Keys [3]: [ca_county#75, d_qoy#72, d_year#71] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#79] +Results [3]: [ca_county#75, d_year#71, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#79,17,2) AS store_sales#80] + +(113) BroadcastExchange +Input [3]: [ca_county#75, d_year#71, store_sales#80] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#81] -(114) Project [codegen id : 41] -Output [4]: [ca_county#51, web_sales#56, web_sales#67, web_sales#79] -Input [5]: [ca_county#51, web_sales#56, web_sales#67, ca_county#74, web_sales#79] +(114) BroadcastHashJoin +Left keys [1]: [ca_county#52] +Right keys [1]: [ca_county#75] +Join condition: None -(115) BroadcastExchange -Input [4]: [ca_county#51, web_sales#56, web_sales#67, web_sales#79] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#81] +(115) Project +Output [5]: [store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] +Input [6]: [ca_county#52, store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] (116) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ca_county#36] -Right keys [1]: [ca_county#51] -Join condition: ((CASE WHEN (web_sales#56 > 0.00) THEN CheckOverflow((promote_precision(web_sales#67) / promote_precision(web_sales#56)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#41 > 0.00) THEN CheckOverflow((promote_precision(store_sales#16) / promote_precision(store_sales#41)), DecimalType(37,20), true) ELSE null END) AND (CASE WHEN (web_sales#67 > 0.00) THEN CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#67)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#16 > 0.00) THEN CheckOverflow((promote_precision(store_sales#28) / promote_precision(store_sales#16)), DecimalType(37,20), true) ELSE null END)) +Left keys [1]: [ca_county#23] +Right keys [1]: [ca_county#75] +Join condition: ((CASE WHEN (web_sales#28 > 0.00) THEN CheckOverflow((promote_precision(web_sales#16) / promote_precision(web_sales#28)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#80 > 0.00) THEN CheckOverflow((promote_precision(store_sales#57) / promote_precision(store_sales#80)), DecimalType(37,20), true) ELSE null END) AND (CASE WHEN (web_sales#16 > 0.00) THEN CheckOverflow((promote_precision(web_sales#41) / promote_precision(web_sales#16)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#57 > 0.00) THEN CheckOverflow((promote_precision(store_sales#68) / promote_precision(store_sales#57)), DecimalType(37,20), true) ELSE null END)) (117) Project [codegen id : 42] -Output [6]: [ca_county#36, d_year#31, CheckOverflow((promote_precision(web_sales#67) / promote_precision(web_sales#56)), DecimalType(37,20), true) AS web_q1_q2_increase#82, CheckOverflow((promote_precision(store_sales#16) / promote_precision(store_sales#41)), DecimalType(37,20), true) AS store_q1_q2_increase#83, CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#67)), DecimalType(37,20), true) AS web_q2_q3_increase#84, CheckOverflow((promote_precision(store_sales#28) / promote_precision(store_sales#16)), DecimalType(37,20), true) AS store_q2_q3_increase#85] -Input [9]: [store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41, ca_county#51, web_sales#56, web_sales#67, web_sales#79] +Output [6]: [ca_county#75, d_year#71, CheckOverflow((promote_precision(web_sales#16) / promote_precision(web_sales#28)), DecimalType(37,20), true) AS web_q1_q2_increase#82, CheckOverflow((promote_precision(store_sales#57) / promote_precision(store_sales#80)), DecimalType(37,20), true) AS store_q1_q2_increase#83, CheckOverflow((promote_precision(web_sales#41) / promote_precision(web_sales#16)), DecimalType(37,20), true) AS web_q2_q3_increase#84, CheckOverflow((promote_precision(store_sales#68) / promote_precision(store_sales#57)), DecimalType(37,20), true) AS store_q2_q3_increase#85] +Input [9]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41, store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] (118) Exchange -Input [6]: [ca_county#36, d_year#31, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] -Arguments: rangepartitioning(ca_county#36 ASC NULLS FIRST, 5), true, [id=#86] +Input [6]: [ca_county#75, d_year#71, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] +Arguments: rangepartitioning(ca_county#75 ASC NULLS FIRST, 5), true, [id=#86] (119) Sort [codegen id : 43] -Input [6]: [ca_county#36, d_year#31, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] -Arguments: [ca_county#36 ASC NULLS FIRST], true, 0 +Input [6]: [ca_county#75, d_year#71, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] +Arguments: [ca_county#75 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt index c7b69500ed8a6..a6c9b3d2e8f74 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt @@ -5,134 +5,26 @@ WholeStageCodegen (43) WholeStageCodegen (42) Project [ca_county,d_year,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] BroadcastHashJoin [ca_county,ca_county,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] - Project [store_sales,store_sales,ca_county,d_year,store_sales] - BroadcastHashJoin [ca_county,ca_county] - Project [ca_county,store_sales,store_sales] - BroadcastHashJoin [ca_county,ca_county] - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #2 - WholeStageCodegen (6) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #3 - WholeStageCodegen (2) - Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - InputAdapter - WholeStageCodegen (5) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #5 - WholeStageCodegen (4) - Filter [ca_address_sk,ca_county] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] - InputAdapter - BroadcastExchange #6 - WholeStageCodegen (13) - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #7 - WholeStageCodegen (12) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (9) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #8 - WholeStageCodegen (8) - Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (7) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - InputAdapter - WholeStageCodegen (11) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_county] #5 - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (20) - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #11 - WholeStageCodegen (19) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (16) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #12 - WholeStageCodegen (15) - Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #13 - WholeStageCodegen (14) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - InputAdapter - WholeStageCodegen (18) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_county] #5 InputAdapter - BroadcastExchange #14 - WholeStageCodegen (41) - Project [ca_county,web_sales,web_sales,web_sales] + BroadcastExchange #2 + WholeStageCodegen (21) + Project [web_sales,ca_county,web_sales,web_sales] BroadcastHashJoin [ca_county,ca_county] - Project [ca_county,web_sales,web_sales] + Project [web_sales,ca_county,web_sales] BroadcastHashJoin [ca_county,ca_county] HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #15 - WholeStageCodegen (26) + Exchange [ca_county,d_qoy,d_year] #3 + WholeStageCodegen (6) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (23) + WholeStageCodegen (3) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #16 - WholeStageCodegen (22) + Exchange [ws_bill_addr_sk] #4 + WholeStageCodegen (2) Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk] @@ -140,67 +32,175 @@ WholeStageCodegen (43) InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #13 + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] InputAdapter - WholeStageCodegen (25) + WholeStageCodegen (5) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_county] #5 + Exchange [ca_address_sk] #6 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_county] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] InputAdapter - BroadcastExchange #17 - WholeStageCodegen (33) + BroadcastExchange #7 + WholeStageCodegen (13) HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #18 - WholeStageCodegen (32) + Exchange [ca_county,d_qoy,d_year] #8 + WholeStageCodegen (12) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (29) + WholeStageCodegen (9) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #19 - WholeStageCodegen (28) - Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Exchange [ws_bill_addr_sk] #9 + WholeStageCodegen (8) + Project [d_year,d_qoy,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (7) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] Filter [ws_sold_date_sk,ws_bill_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #4 InputAdapter - WholeStageCodegen (31) + WholeStageCodegen (11) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_county] #5 + ReusedExchange [ca_address_sk,ca_county] #6 InputAdapter - BroadcastExchange #20 - WholeStageCodegen (40) + BroadcastExchange #11 + WholeStageCodegen (20) HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #21 - WholeStageCodegen (39) + Exchange [ca_county,d_qoy,d_year] #12 + WholeStageCodegen (19) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (36) + WholeStageCodegen (16) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #22 - WholeStageCodegen (35) - Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Exchange [ws_bill_addr_sk] #13 + WholeStageCodegen (15) + Project [d_year,d_qoy,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (14) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] Filter [ws_sold_date_sk,ws_bill_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #9 InputAdapter - WholeStageCodegen (38) + WholeStageCodegen (18) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_county] #5 + ReusedExchange [ca_address_sk,ca_county] #6 + Project [store_sales,store_sales,ca_county,d_year,store_sales] + BroadcastHashJoin [ca_county,ca_county] + Project [ca_county,store_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county] + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #15 + WholeStageCodegen (27) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (24) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #16 + WholeStageCodegen (23) + Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #5 + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + WholeStageCodegen (26) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #6 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (34) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #18 + WholeStageCodegen (33) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (30) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #19 + WholeStageCodegen (29) + Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #14 + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + WholeStageCodegen (32) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #6 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (41) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #21 + WholeStageCodegen (40) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (37) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #22 + WholeStageCodegen (36) + Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #10 + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + WholeStageCodegen (39) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt index 7affdeabd6f7f..944b4e7d1f0eb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt @@ -6,168 +6,168 @@ CollectLimit (31) : +- * BroadcastHashJoin Inner BuildLeft (26) : :- BroadcastExchange (22) : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildLeft (20) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (19) - : : +- * HashAggregate (18) - : : +- Exchange (17) - : : +- * HashAggregate (16) - : : +- * Project (15) - : : +- * BroadcastHashJoin Inner BuildRight (14) - : : :- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_sales (6) - : : +- BroadcastExchange (13) - : : +- * Project (12) - : : +- * Filter (11) - : : +- * ColumnarToRow (10) - : : +- Scan parquet default.date_dim (9) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.item (15) : +- * Filter (25) : +- * ColumnarToRow (24) : +- Scan parquet default.catalog_sales (23) +- ReusedExchange (28) -(1) Scan parquet default.item -Output [2]: [i_item_sk#1, i_manufact_id#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [i_item_sk#1, i_manufact_id#2] - -(3) Filter [codegen id : 1] -Input [2]: [i_item_sk#1, i_manufact_id#2] -Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 977)) AND isnotnull(i_item_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [i_item_sk#1] -Input [2]: [i_item_sk#1, i_manufact_id#2] - -(5) BroadcastExchange -Input [1]: [i_item_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] - -(6) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +(1) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] -(8) Filter [codegen id : 3] -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] -Condition : (isnotnull(cs_sold_date_sk#4) AND isnotnull(cs_item_sk#5)) +(3) Filter [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +Condition : (isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#2)) -(9) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_date#8] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_date#8] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(11) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_date#8] -Condition : (((isnotnull(d_date#8) AND (d_date#8 >= 10983)) AND (d_date#8 <= 11073)) AND isnotnull(d_date_sk#7)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10983)) AND (d_date#5 <= 11073)) AND isnotnull(d_date_sk#4)) -(12) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_date#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(13) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_sold_date_sk#4] -Right keys [1]: [d_date_sk#7] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(15) Project [codegen id : 3] -Output [2]: [cs_item_sk#5, cs_ext_discount_amt#6] -Input [4]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6, d_date_sk#7] +(10) Project [codegen id : 2] +Output [2]: [cs_item_sk#2, cs_ext_discount_amt#3] +Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3, d_date_sk#4] + +(11) HashAggregate [codegen id : 2] +Input [2]: [cs_item_sk#2, cs_ext_discount_amt#3] +Keys [1]: [cs_item_sk#2] +Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#3))] +Aggregate Attributes [2]: [sum#7, count#8] +Results [3]: [cs_item_sk#2, sum#9, count#10] + +(12) Exchange +Input [3]: [cs_item_sk#2, sum#9, count#10] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#11] + +(13) HashAggregate [codegen id : 4] +Input [3]: [cs_item_sk#2, sum#9, count#10] +Keys [1]: [cs_item_sk#2] +Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#3))] +Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#3))#12] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#3))#12 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2 AS cs_item_sk#2#14] + +(14) Filter [codegen id : 4] +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2#14] +Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13) + +(15) Scan parquet default.item +Output [2]: [i_item_sk#15, i_manufact_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] +ReadSchema: struct -(16) HashAggregate [codegen id : 3] -Input [2]: [cs_item_sk#5, cs_ext_discount_amt#6] -Keys [1]: [cs_item_sk#5] -Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#6))] -Aggregate Attributes [2]: [sum#10, count#11] -Results [3]: [cs_item_sk#5, sum#12, count#13] +(16) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#15, i_manufact_id#16] -(17) Exchange -Input [3]: [cs_item_sk#5, sum#12, count#13] -Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#14] +(17) Filter [codegen id : 3] +Input [2]: [i_item_sk#15, i_manufact_id#16] +Condition : ((isnotnull(i_manufact_id#16) AND (i_manufact_id#16 = 977)) AND isnotnull(i_item_sk#15)) -(18) HashAggregate -Input [3]: [cs_item_sk#5, sum#12, count#13] -Keys [1]: [cs_item_sk#5] -Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#6))] -Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#6))#15] -Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#6))#15 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5 AS cs_item_sk#5#17] +(18) Project [codegen id : 3] +Output [1]: [i_item_sk#15] +Input [2]: [i_item_sk#15, i_manufact_id#16] -(19) Filter -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5#17] -Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16) +(19) BroadcastExchange +Input [1]: [i_item_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [cs_item_sk#5#17] +Left keys [1]: [cs_item_sk#2#14] +Right keys [1]: [i_item_sk#15] Join condition: None (21) Project [codegen id : 4] -Output [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16] -Input [3]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5#17] +Output [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] +Input [3]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2#14, i_item_sk#15] (22) BroadcastExchange -Input [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#18] (23) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_ext_discount_amt), IsNotNull(cs_sold_date_sk)] ReadSchema: struct (24) ColumnarToRow -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] (25) Filter -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] -Condition : ((isnotnull(cs_item_sk#5) AND isnotnull(cs_ext_discount_amt#6)) AND isnotnull(cs_sold_date_sk#4)) +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +Condition : ((isnotnull(cs_item_sk#2) AND isnotnull(cs_ext_discount_amt#3)) AND isnotnull(cs_sold_date_sk#1)) (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [cs_item_sk#5] -Join condition: (cast(cs_ext_discount_amt#6 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16) +Left keys [1]: [i_item_sk#15] +Right keys [1]: [cs_item_sk#2] +Join condition: (cast(cs_ext_discount_amt#3 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13) (27) Project [codegen id : 6] -Output [1]: [cs_sold_date_sk#4] -Input [5]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +Output [1]: [cs_sold_date_sk#1] +Input [5]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15, cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] -(28) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(28) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#4] (29) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#4] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (30) Project [codegen id : 6] Output [1]: [1 AS excess discount amount #19] -Input [2]: [cs_sold_date_sk#4, d_date_sk#7] +Input [2]: [cs_sold_date_sk#1, d_date_sk#4] (31) CollectLimit Input [1]: [excess discount amount #19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt index 03fa18228b7c3..5ad4046dc24fc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt @@ -7,21 +7,13 @@ CollectLimit InputAdapter BroadcastExchange #1 WholeStageCodegen (4) - Project [i_item_sk,(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))] - BroadcastHashJoin [i_item_sk,cs_item_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - Project [i_item_sk] - Filter [i_manufact_id,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_manufact_id] + Project [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6))),i_item_sk] + BroadcastHashJoin [cs_item_sk,i_item_sk] Filter [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))] HashAggregate [cs_item_sk,sum,count] [avg(UnscaledValue(cs_ext_discount_amt)),(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6))),cs_item_sk,sum,count] InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (3) + Exchange [cs_item_sk] #2 + WholeStageCodegen (2) HashAggregate [cs_item_sk,cs_ext_discount_amt] [sum,count,sum,count] Project [cs_item_sk,cs_ext_discount_amt] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -30,16 +22,24 @@ CollectLimit InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_discount_amt] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (2) + BroadcastExchange #3 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_date,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] Filter [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_discount_amt] InputAdapter - ReusedExchange [d_date_sk] #4 + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt index 8185680b58670..c1f82167a806c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (67) : :- * Project (22) : : +- * BroadcastHashJoin Inner BuildRight (21) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (20) : : +- * BroadcastHashJoin LeftSemi BuildRight (19) : : :- * Filter (13) @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : :- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.catalog_sales (33) - : : : +- ReusedExchange (36) + : : : +- * BroadcastHashJoin Inner BuildLeft (37) + : : : :- ReusedExchange (33) + : : : +- * Filter (36) + : : : +- * ColumnarToRow (35) + : : : +- Scan parquet default.catalog_sales (34) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,59 +59,59 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildRight (52) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.web_sales (48) - : : +- ReusedExchange (51) + : : +- * BroadcastHashJoin Inner BuildLeft (52) + : : :- ReusedExchange (48) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.web_sales (49) : +- ReusedExchange (54) +- ReusedExchange (57) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] - -(3) Filter [codegen id : 5] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 1998)) AND (d_moy#3 = 5)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 1998)) AND (d_moy#7 = 5)) AND isnotnull(d_date_sk#5)) +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#5] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] +Condition : ((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_addr_sk#7)) AND isnotnull(ss_item_sk#6)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 5] -Output [3]: [ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4, d_date_sk#5] +Output [3]: [ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] +Input [5]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] (11) Scan parquet default.item Output [2]: [i_item_sk#9, i_manufact_id#10] @@ -159,13 +159,13 @@ Input [2]: [i_item_sk#9, i_manufact_id#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#6] Right keys [1]: [i_item_sk#9] Join condition: None (22) Project [codegen id : 5] -Output [3]: [ss_addr_sk#3, ss_ext_sales_price#4, i_manufact_id#10] -Input [5]: [ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4, i_item_sk#9, i_manufact_id#10] +Output [3]: [ss_addr_sk#7, ss_ext_sales_price#8, i_manufact_id#10] +Input [5]: [ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8, i_item_sk#9, i_manufact_id#10] (23) Scan parquet default.customer_address Output [2]: [ca_address_sk#15, ca_gmt_offset#16] @@ -190,18 +190,18 @@ Input [1]: [ca_address_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_addr_sk#3] +Left keys [1]: [ss_addr_sk#7] Right keys [1]: [ca_address_sk#15] Join condition: None (29) Project [codegen id : 5] -Output [2]: [ss_ext_sales_price#4, i_manufact_id#10] -Input [4]: [ss_addr_sk#3, ss_ext_sales_price#4, i_manufact_id#10, ca_address_sk#15] +Output [2]: [ss_ext_sales_price#8, i_manufact_id#10] +Input [4]: [ss_addr_sk#7, ss_ext_sales_price#8, i_manufact_id#10, ca_address_sk#15] (30) HashAggregate [codegen id : 5] -Input [2]: [ss_ext_sales_price#4, i_manufact_id#10] +Input [2]: [ss_ext_sales_price#8, i_manufact_id#10] Keys [1]: [i_manufact_id#10] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#4))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] Aggregate Attributes [1]: [sum#18] Results [2]: [i_manufact_id#10, sum#19] @@ -212,35 +212,35 @@ Arguments: hashpartitioning(i_manufact_id#10, 5), true, [id=#20] (32) HashAggregate [codegen id : 6] Input [2]: [i_manufact_id#10, sum#19] Keys [1]: [i_manufact_id#10] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] -Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#21] +Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#21,17,2) AS total_sales#22] -(33) Scan parquet default.catalog_sales +(33) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(34) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] +(35) ColumnarToRow Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(35) Filter [codegen id : 11] +(36) Filter Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) -(36) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_sold_date_sk#23] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#23] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] +Input [5]: [d_date_sk#1, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] (39) ReusedExchange [Reuses operator id: 20] Output [2]: [i_item_sk#9, i_manufact_id#10] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) Scan parquet default.web_sales +(48) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(49) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(49) ColumnarToRow [codegen id : 17] +(50) ColumnarToRow Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(50) Filter [codegen id : 17] +(51) Filter Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) -(51) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#32] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#32] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] +Input [5]: [d_date_sk#1, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] (54) ReusedExchange [Reuses operator id: 20] Output [2]: [i_item_sk#9, i_manufact_id#10] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt index 410def2466e1a..1a3bea00f7f84 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt @@ -18,11 +18,7 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [ss_addr_sk,ss_ext_sales_price,i_manufact_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_addr_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -31,6 +27,10 @@ TakeOrderedAndProject [total_sales,i_manufact_id] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_sold_date_sk,ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (3) @@ -66,13 +66,13 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [cs_bill_addr_sk,cs_ext_sales_price,i_manufact_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_manufact_id] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [ws_bill_addr_sk,ws_ext_sales_price,i_manufact_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_manufact_id] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt index 01f6c35a2178d..3bdcad4b34967 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt @@ -9,51 +9,51 @@ TakeOrderedAndProject (60) : +- Exchange (48) : +- * Project (47) : +- * SortMergeJoin Inner (46) - : :- * Sort (40) - : : +- Exchange (39) - : : +- * Project (38) - : : +- * Filter (37) - : : +- SortMergeJoin ExistenceJoin(exists#1) (36) - : : :- SortMergeJoin ExistenceJoin(exists#2) (27) - : : : :- SortMergeJoin LeftSemi (18) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- * Sort (17) - : : : : +- Exchange (16) - : : : : +- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.store_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- * Sort (26) - : : : +- Exchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Sort (35) - : : +- Exchange (34) - : : +- * Project (33) - : : +- * BroadcastHashJoin Inner BuildRight (32) - : : :- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.catalog_sales (28) - : : +- ReusedExchange (31) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) : +- * Sort (45) : +- Exchange (44) - : +- * Filter (43) - : +- * ColumnarToRow (42) - : +- Scan parquet default.customer_address (41) + : +- * Project (43) + : +- * Filter (42) + : +- SortMergeJoin ExistenceJoin(exists#1) (41) + : :- SortMergeJoin ExistenceJoin(exists#2) (32) + : : :- SortMergeJoin LeftSemi (23) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer (6) + : : : +- * Sort (22) + : : : +- Exchange (21) + : : : +- * Project (20) + : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : :- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store_sales (11) + : : : +- BroadcastExchange (18) + : : : +- * Project (17) + : : : +- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.date_dim (14) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.web_sales (24) + : : +- ReusedExchange (27) + : +- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.catalog_sales (33) + : +- ReusedExchange (36) +- * Sort (54) +- Exchange (53) +- * Filter (52) @@ -61,218 +61,218 @@ TakeOrderedAndProject (60) +- Scan parquet default.customer_demographics (50) -(1) Scan parquet default.customer -Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#3, ca_state#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [2]: [ca_address_sk#3, ca_state#4] (3) Filter [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) +Input [2]: [ca_address_sk#3, ca_state#4] +Condition : isnotnull(ca_address_sk#3) (4) Exchange -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] +Input [2]: [ca_address_sk#3, ca_state#4] +Arguments: hashpartitioning(ca_address_sk#3, 5), true, [id=#5] (5) Sort [codegen id : 2] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#3, ca_state#4] +Arguments: [ca_address_sk#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.customer +Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] + +(8) Filter [codegen id : 3] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) + +(9) Exchange +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] -(6) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(10) Sort [codegen id : 4] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 + +(11) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(12) ColumnarToRow [codegen id : 6] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -(8) Filter [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -Condition : isnotnull(ss_sold_date_sk#7) +(13) Filter [codegen id : 6] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +Condition : isnotnull(ss_sold_date_sk#10) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(15) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) +(16) Filter [codegen id : 5] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +Condition : ((((isnotnull(d_year#13) AND isnotnull(d_qoy#14)) AND (d_year#13 = 2002)) AND (d_qoy#14 < 4)) AND isnotnull(d_date_sk#12)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(17) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(13) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(18) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#7] -Right keys [1]: [d_date_sk#9] +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#12] Join condition: None -(15) Project [codegen id : 4] -Output [1]: [ss_customer_sk#8] -Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] +(20) Project [codegen id : 6] +Output [1]: [ss_customer_sk#11] +Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] -(16) Exchange -Input [1]: [ss_customer_sk#8] -Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] +(21) Exchange +Input [1]: [ss_customer_sk#11] +Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] -(17) Sort [codegen id : 5] -Input [1]: [ss_customer_sk#8] -Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 7] +Input [1]: [ss_customer_sk#11] +Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ss_customer_sk#8] +(23) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ss_customer_sk#11] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(24) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(25) ColumnarToRow [codegen id : 9] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -Condition : isnotnull(ws_sold_date_sk#14) +(26) Filter [codegen id : 9] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +Condition : isnotnull(ws_sold_date_sk#17) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(27) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#14] -Right keys [1]: [d_date_sk#9] +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#17] +Right keys [1]: [d_date_sk#12] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#15] -Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] +(29) Project [codegen id : 9] +Output [1]: [ws_bill_customer_sk#18] +Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] -(25) Exchange -Input [1]: [ws_bill_customer_sk#15] -Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] +(30) Exchange +Input [1]: [ws_bill_customer_sk#18] +Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] -(26) Sort [codegen id : 8] -Input [1]: [ws_bill_customer_sk#15] -Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 10] +Input [1]: [ws_bill_customer_sk#18] +Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 -(27) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ws_bill_customer_sk#15] +(32) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ws_bill_customer_sk#18] Join condition: None -(28) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(33) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(34) ColumnarToRow [codegen id : 12] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -(30) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -Condition : isnotnull(cs_sold_date_sk#17) +(35) Filter [codegen id : 12] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +Condition : isnotnull(cs_sold_date_sk#20) -(31) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(36) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#17] -Right keys [1]: [d_date_sk#9] +(37) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#12] Join condition: None -(33) Project [codegen id : 10] -Output [1]: [cs_ship_customer_sk#18] -Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] - -(34) Exchange -Input [1]: [cs_ship_customer_sk#18] -Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] - -(35) Sort [codegen id : 11] -Input [1]: [cs_ship_customer_sk#18] -Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 - -(36) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [cs_ship_customer_sk#18] -Join condition: None - -(37) Filter [codegen id : 12] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] -Condition : (exists#2 OR exists#1) - (38) Project [codegen id : 12] -Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Output [1]: [cs_ship_customer_sk#21] +Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] (39) Exchange -Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#20] +Input [1]: [cs_ship_customer_sk#21] +Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] (40) Sort [codegen id : 13] -Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 +Input [1]: [cs_ship_customer_sk#21] +Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 -(41) Scan parquet default.customer_address -Output [2]: [ca_address_sk#21, ca_state#22] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +(41) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [cs_ship_customer_sk#21] +Join condition: None -(42) ColumnarToRow [codegen id : 14] -Input [2]: [ca_address_sk#21, ca_state#22] +(42) Filter [codegen id : 14] +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +Condition : (exists#2 OR exists#1) -(43) Filter [codegen id : 14] -Input [2]: [ca_address_sk#21, ca_state#22] -Condition : isnotnull(ca_address_sk#21) +(43) Project [codegen id : 14] +Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] (44) Exchange -Input [2]: [ca_address_sk#21, ca_state#22] -Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] +Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: hashpartitioning(c_current_addr_sk#8, 5), true, [id=#23] (45) Sort [codegen id : 15] -Input [2]: [ca_address_sk#21, ca_state#22] -Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: [c_current_addr_sk#8 ASC NULLS FIRST], false, 0 (46) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#5] -Right keys [1]: [ca_address_sk#21] +Left keys [1]: [ca_address_sk#3] +Right keys [1]: [c_current_addr_sk#8] Join condition: None (47) Project [codegen id : 16] -Output [2]: [c_current_cdemo_sk#4, ca_state#22] -Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#21, ca_state#22] +Output [2]: [ca_state#4, c_current_cdemo_sk#7] +Input [4]: [ca_address_sk#3, ca_state#4, c_current_cdemo_sk#7, c_current_addr_sk#8] (48) Exchange -Input [2]: [c_current_cdemo_sk#4, ca_state#22] -Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#24] +Input [2]: [ca_state#4, c_current_cdemo_sk#7] +Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#24] (49) Sort [codegen id : 17] -Input [2]: [c_current_cdemo_sk#4, ca_state#22] -Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 +Input [2]: [ca_state#4, c_current_cdemo_sk#7] +Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 (50) Scan parquet default.customer_demographics Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] @@ -297,33 +297,33 @@ Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, Arguments: [cd_demo_sk#25 ASC NULLS FIRST], false, 0 (55) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_current_cdemo_sk#4] +Left keys [1]: [c_current_cdemo_sk#7] Right keys [1]: [cd_demo_sk#25] Join condition: None (56) Project [codegen id : 20] -Output [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Input [8]: [c_current_cdemo_sk#4, ca_state#22, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [ca_state#4, c_current_cdemo_sk#7, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (57) HashAggregate [codegen id : 20] -Input [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [partial_count(1), partial_min(cd_dep_count#28), partial_max(cd_dep_count#28), partial_avg(cast(cd_dep_count#28 as bigint)), partial_min(cd_dep_employed_count#29), partial_max(cd_dep_employed_count#29), partial_avg(cast(cd_dep_employed_count#29 as bigint)), partial_min(cd_dep_college_count#30), partial_max(cd_dep_college_count#30), partial_avg(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [13]: [count#32, min#33, max#34, sum#35, count#36, min#37, max#38, sum#39, count#40, min#41, max#42, sum#43, count#44] -Results [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Results [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] (58) Exchange -Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] -Arguments: hashpartitioning(ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] +Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Arguments: hashpartitioning(ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] (59) HashAggregate [codegen id : 21] -Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] -Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [count(1), min(cd_dep_count#28), max(cd_dep_count#28), avg(cast(cd_dep_count#28 as bigint)), min(cd_dep_employed_count#29), max(cd_dep_employed_count#29), avg(cast(cd_dep_employed_count#29 as bigint)), min(cd_dep_college_count#30), max(cd_dep_college_count#30), avg(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [10]: [count(1)#59, min(cd_dep_count#28)#60, max(cd_dep_count#28)#61, avg(cast(cd_dep_count#28 as bigint))#62, min(cd_dep_employed_count#29)#63, max(cd_dep_employed_count#29)#64, avg(cast(cd_dep_employed_count#29 as bigint))#65, min(cd_dep_college_count#30)#66, max(cd_dep_college_count#30)#67, avg(cast(cd_dep_college_count#30 as bigint))#68] -Results [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, count(1)#59 AS cnt1#69, min(cd_dep_count#28)#60 AS min(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, avg(cast(cd_dep_count#28 as bigint))#62 AS avg(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, min(cd_dep_employed_count#29)#63 AS min(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, avg(cast(cd_dep_employed_count#29 as bigint))#65 AS avg(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, min(cd_dep_college_count#30)#66 AS min(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, avg(cast(cd_dep_college_count#30 as bigint))#68 AS avg(cd_dep_college_count)#80, cd_dep_count#28 AS aggOrder#81] +Results [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, count(1)#59 AS cnt1#69, min(cd_dep_count#28)#60 AS min(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, avg(cast(cd_dep_count#28 as bigint))#62 AS avg(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, min(cd_dep_employed_count#29)#63 AS min(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, avg(cast(cd_dep_employed_count#29 as bigint))#65 AS avg(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, min(cd_dep_college_count#30)#66 AS min(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, avg(cast(cd_dep_college_count#30 as bigint))#68 AS avg(cd_dep_college_count)#80, cd_dep_count#28 AS aggOrder#81] (60) TakeOrderedAndProject -Input [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80, aggOrder#81] -Arguments: 100, [ca_state#22 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, aggOrder#81 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#22, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80] +Input [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80, aggOrder#81] +Arguments: 100, [ca_state#4 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, aggOrder#81 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#4, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt index 7c40dfcf8133a..30367d56188ce 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt @@ -13,34 +13,44 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (16) - Project [c_current_cdemo_sk,ca_state] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_state,c_current_cdemo_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter - WholeStageCodegen (13) + WholeStageCodegen (2) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #3 + WholeStageCodegen (1) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (15) Sort [c_current_addr_sk] InputAdapter - Exchange [c_current_addr_sk] #3 - WholeStageCodegen (12) + Exchange [c_current_addr_sk] #4 + WholeStageCodegen (14) Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (2) + WholeStageCodegen (4) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (1) + Exchange [c_customer_sk] #5 + WholeStageCodegen (3) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (5) + WholeStageCodegen (7) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #5 - WholeStageCodegen (4) + Exchange [ss_customer_sk] #6 + WholeStageCodegen (6) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -48,18 +58,18 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (3) + BroadcastExchange #7 + WholeStageCodegen (5) Project [d_date_sk] Filter [d_year,d_qoy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - WholeStageCodegen (8) + WholeStageCodegen (10) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #7 - WholeStageCodegen (7) + Exchange [ws_bill_customer_sk] #8 + WholeStageCodegen (9) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -67,12 +77,12 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (11) + ReusedExchange [d_date_sk] #7 + WholeStageCodegen (13) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #8 - WholeStageCodegen (10) + Exchange [cs_ship_customer_sk] #9 + WholeStageCodegen (12) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -80,17 +90,7 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - InputAdapter - WholeStageCodegen (15) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #9 - WholeStageCodegen (14) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + ReusedExchange [d_date_sk] #7 InputAdapter WholeStageCodegen (19) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt index d6dfb6e7785c1..47b1df54175b7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt @@ -156,7 +156,7 @@ Input [5]: [i_category#16, i_class#17, spark_grouping_id#18, sum#21, sum#22] Keys [3]: [i_category#16, i_class#17, spark_grouping_id#18] Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#24, sum(UnscaledValue(ss_ext_sales_price#4))#25] -Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS gross_margin#26, i_category#16, i_class#17, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS lochierarchy#27, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS _w1#28, CASE WHEN (cast(cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint) as int) = 0) THEN i_category#16 END AS _w2#29, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS _w3#30] +Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS gross_margin#26, i_category#16, i_class#17, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS lochierarchy#27, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS _w1#28, CASE WHEN (cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint) = 0) THEN i_category#16 END AS _w2#29, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS _w3#30] (28) Exchange Input [7]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, _w1#28, _w2#29, _w3#30] @@ -176,5 +176,5 @@ Input [8]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, _w1#28, (32) TakeOrderedAndProject Input [5]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] -Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#27 as int) = 0) THEN i_category#16 END ASC NULLS FIRST, rank_within_parent#32 ASC NULLS FIRST], [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] +Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (lochierarchy#27 = 0) THEN i_category#16 END ASC NULLS FIRST, rank_within_parent#32 ASC NULLS FIRST], [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt index a6b76c7618123..b1dac8c03761f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt @@ -10,16 +10,16 @@ TakeOrderedAndProject (31) : +- * Project (18) : +- * BroadcastHashJoin Inner BuildRight (17) : :- * Project (11) - : : +- * BroadcastHashJoin Inner BuildLeft (10) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Project (9) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.inventory (6) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.item (5) : +- BroadcastExchange (16) : +- * Project (15) : +- * Filter (14) @@ -32,54 +32,54 @@ TakeOrderedAndProject (31) +- Scan parquet default.catalog_sales (21) -(1) Scan parquet default.item -Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +(1) Scan parquet default.inventory +Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 68.00)) AND (cast(i_current_price#4 as decimal(12,2)) <= 98.00)) AND i_manufact_id#5 IN (677,940,694,808)) AND isnotnull(i_item_sk#1)) +(2) ColumnarToRow [codegen id : 3] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -(4) Project [codegen id : 1] -Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +(3) Filter [codegen id : 3] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +Condition : ((((isnotnull(inv_quantity_on_hand#3) AND (inv_quantity_on_hand#3 >= 100)) AND (inv_quantity_on_hand#3 <= 500)) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) -(5) BroadcastExchange -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(4) Project [codegen id : 3] +Output [2]: [inv_date_sk#1, inv_item_sk#2] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -(6) Scan parquet default.inventory -Output [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(5) Scan parquet default.item +Output [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -(7) ColumnarToRow -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(7) Filter [codegen id : 1] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +Condition : ((((isnotnull(i_current_price#7) AND (i_current_price#7 >= 68.00)) AND (cast(i_current_price#7 as decimal(12,2)) <= 98.00)) AND i_manufact_id#8 IN (677,940,694,808)) AND isnotnull(i_item_sk#4)) -(8) Filter -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] -Condition : ((((isnotnull(inv_quantity_on_hand#9) AND (inv_quantity_on_hand#9 >= 100)) AND (inv_quantity_on_hand#9 <= 500)) AND isnotnull(inv_item_sk#8)) AND isnotnull(inv_date_sk#7)) +(8) Project [codegen id : 1] +Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -(9) Project -Output [2]: [inv_date_sk#7, inv_item_sk#8] -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(9) BroadcastExchange +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (10) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [inv_item_sk#8] +Left keys [1]: [inv_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (11) Project [codegen id : 3] -Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, inv_item_sk#8] +Output [5]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [6]: [inv_date_sk#1, inv_item_sk#2, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] (12) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_date#11] @@ -104,21 +104,21 @@ Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (17) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#7] +Left keys [1]: [inv_date_sk#1] Right keys [1]: [d_date_sk#10] Join condition: None (18) Project [codegen id : 3] -Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, d_date_sk#10] +Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [6]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, d_date_sk#10] (19) Exchange -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#13] +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: hashpartitioning(i_item_sk#4, 5), true, [id=#13] (20) Sort [codegen id : 4] -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: [i_item_sk#4 ASC NULLS FIRST], false, 0 (21) Scan parquet default.catalog_sales Output [1]: [cs_item_sk#14] @@ -143,33 +143,33 @@ Input [1]: [cs_item_sk#14] Arguments: [cs_item_sk#14 ASC NULLS FIRST], false, 0 (26) SortMergeJoin [codegen id : 7] -Left keys [1]: [i_item_sk#1] +Left keys [1]: [i_item_sk#4] Right keys [1]: [cs_item_sk#14] Join condition: None (27) Project [codegen id : 7] -Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, cs_item_sk#14] +Output [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, cs_item_sk#14] (28) HashAggregate [codegen id : 7] -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] (29) Exchange -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), true, [id=#16] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: hashpartitioning(i_item_id#5, i_item_desc#6, i_current_price#7, 5), true, [id=#16] (30) HashAggregate [codegen id : 8] -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] (31) TakeOrderedAndProject -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: 100, [i_item_id#5 ASC NULLS FIRST], [i_item_id#5, i_item_desc#6, i_current_price#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt index 0fc9d748fa1b1..2b10f1c0d7bdf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt @@ -15,8 +15,13 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] WholeStageCodegen (3) Project [i_item_sk,i_item_id,i_item_desc,i_current_price] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] - BroadcastHashJoin [i_item_sk,inv_item_sk] + Project [inv_date_sk,i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_date_sk,inv_item_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -25,11 +30,6 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] - Project [inv_date_sk,inv_item_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt index 92b9c26825e51..4578dc82e436b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt @@ -43,11 +43,11 @@ CollectLimit (68) : :- * Sort (29) : : +- Exchange (28) : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildRight (26) - : : :- * Filter (24) - : : : +- * ColumnarToRow (23) - : : : +- Scan parquet default.catalog_sales (22) - : : +- ReusedExchange (25) + : : +- * BroadcastHashJoin Inner BuildLeft (26) + : : :- ReusedExchange (22) + : : +- * Filter (25) + : : +- * ColumnarToRow (24) + : : +- Scan parquet default.catalog_sales (23) : +- * Sort (31) : +- ReusedExchange (30) +- * Sort (56) @@ -60,11 +60,11 @@ CollectLimit (68) :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildRight (44) - : :- * Filter (42) - : : +- * ColumnarToRow (41) - : : +- Scan parquet default.web_sales (40) - : +- ReusedExchange (43) + : +- * BroadcastHashJoin Inner BuildLeft (44) + : :- ReusedExchange (40) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.web_sales (41) +- * Sort (49) +- ReusedExchange (48) @@ -161,39 +161,39 @@ Arguments: hashpartitioning(coalesce(c_last_name#10, ), isnull(c_last_name#10), Input [3]: [d_date#4, c_first_name#9, c_last_name#10] Arguments: [coalesce(c_last_name#10, ) ASC NULLS FIRST, isnull(c_last_name#10) ASC NULLS FIRST, coalesce(c_first_name#9, ) ASC NULLS FIRST, isnull(c_first_name#9) ASC NULLS FIRST, coalesce(d_date#4, 0) ASC NULLS FIRST, isnull(d_date#4) ASC NULLS FIRST], false, 0 -(22) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] +(22) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#13, d_date#14] + +(23) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_customer_sk)] ReadSchema: struct -(23) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] - -(24) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] -Condition : (isnotnull(cs_sold_date_sk#13) AND isnotnull(cs_bill_customer_sk#14)) +(24) ColumnarToRow +Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] -(25) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#15, d_date#16] +(25) Filter +Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_bill_customer_sk#16)) (26) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#13] -Right keys [1]: [d_date_sk#15] +Left keys [1]: [d_date_sk#13] +Right keys [1]: [cs_sold_date_sk#15] Join condition: None (27) Project [codegen id : 9] -Output [2]: [cs_bill_customer_sk#14, d_date#16] -Input [4]: [cs_sold_date_sk#13, cs_bill_customer_sk#14, d_date_sk#15, d_date#16] +Output [2]: [d_date#14, cs_bill_customer_sk#16] +Input [4]: [d_date_sk#13, d_date#14, cs_sold_date_sk#15, cs_bill_customer_sk#16] (28) Exchange -Input [2]: [cs_bill_customer_sk#14, d_date#16] -Arguments: hashpartitioning(cs_bill_customer_sk#14, 5), true, [id=#17] +Input [2]: [d_date#14, cs_bill_customer_sk#16] +Arguments: hashpartitioning(cs_bill_customer_sk#16, 5), true, [id=#17] (29) Sort [codegen id : 10] -Input [2]: [cs_bill_customer_sk#14, d_date#16] -Arguments: [cs_bill_customer_sk#14 ASC NULLS FIRST], false, 0 +Input [2]: [d_date#14, cs_bill_customer_sk#16] +Arguments: [cs_bill_customer_sk#16 ASC NULLS FIRST], false, 0 (30) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] @@ -203,78 +203,78 @@ Input [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 (32) SortMergeJoin [codegen id : 13] -Left keys [1]: [cs_bill_customer_sk#14] +Left keys [1]: [cs_bill_customer_sk#16] Right keys [1]: [c_customer_sk#18] Join condition: None (33) Project [codegen id : 13] -Output [3]: [c_last_name#20, c_first_name#19, d_date#16] -Input [5]: [cs_bill_customer_sk#14, d_date#16, c_customer_sk#18, c_first_name#19, c_last_name#20] +Output [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [5]: [d_date#14, cs_bill_customer_sk#16, c_customer_sk#18, c_first_name#19, c_last_name#20] (34) HashAggregate [codegen id : 13] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#16] +Results [3]: [c_last_name#20, c_first_name#19, d_date#14] (35) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#16, 5), true, [id=#21] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#14, 5), true, [id=#21] (36) HashAggregate [codegen id : 14] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#16] +Results [3]: [c_last_name#20, c_first_name#19, d_date#14] (37) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16), 5), true, [id=#22] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14), 5), true, [id=#22] (38) Sort [codegen id : 15] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#16, 0) ASC NULLS FIRST, isnull(d_date#16) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#14, 0) ASC NULLS FIRST, isnull(d_date#14) ASC NULLS FIRST], false, 0 (39) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16)] +Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14)] Join condition: None -(40) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] +(40) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#23, d_date#24] + +(41) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 17] -Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] - -(42) Filter [codegen id : 17] -Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] -Condition : (isnotnull(ws_sold_date_sk#23) AND isnotnull(ws_bill_customer_sk#24)) +(42) ColumnarToRow +Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] -(43) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#25, d_date#26] +(43) Filter +Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +Condition : (isnotnull(ws_sold_date_sk#25) AND isnotnull(ws_bill_customer_sk#26)) (44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#23] -Right keys [1]: [d_date_sk#25] +Left keys [1]: [d_date_sk#23] +Right keys [1]: [ws_sold_date_sk#25] Join condition: None (45) Project [codegen id : 17] -Output [2]: [ws_bill_customer_sk#24, d_date#26] -Input [4]: [ws_sold_date_sk#23, ws_bill_customer_sk#24, d_date_sk#25, d_date#26] +Output [2]: [d_date#24, ws_bill_customer_sk#26] +Input [4]: [d_date_sk#23, d_date#24, ws_sold_date_sk#25, ws_bill_customer_sk#26] (46) Exchange -Input [2]: [ws_bill_customer_sk#24, d_date#26] -Arguments: hashpartitioning(ws_bill_customer_sk#24, 5), true, [id=#27] +Input [2]: [d_date#24, ws_bill_customer_sk#26] +Arguments: hashpartitioning(ws_bill_customer_sk#26, 5), true, [id=#27] (47) Sort [codegen id : 18] -Input [2]: [ws_bill_customer_sk#24, d_date#26] -Arguments: [ws_bill_customer_sk#24 ASC NULLS FIRST], false, 0 +Input [2]: [d_date#24, ws_bill_customer_sk#26] +Arguments: [ws_bill_customer_sk#26 ASC NULLS FIRST], false, 0 (48) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] @@ -284,43 +284,43 @@ Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 21] -Left keys [1]: [ws_bill_customer_sk#24] +Left keys [1]: [ws_bill_customer_sk#26] Right keys [1]: [c_customer_sk#28] Join condition: None (51) Project [codegen id : 21] -Output [3]: [c_last_name#30, c_first_name#29, d_date#26] -Input [5]: [ws_bill_customer_sk#24, d_date#26, c_customer_sk#28, c_first_name#29, c_last_name#30] +Output [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [5]: [d_date#24, ws_bill_customer_sk#26, c_customer_sk#28, c_first_name#29, c_last_name#30] (52) HashAggregate [codegen id : 21] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#26] +Results [3]: [c_last_name#30, c_first_name#29, d_date#24] (53) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#26, 5), true, [id=#31] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#24, 5), true, [id=#31] (54) HashAggregate [codegen id : 22] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#26] +Results [3]: [c_last_name#30, c_first_name#29, d_date#24] (55) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26), 5), true, [id=#32] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24), 5), true, [id=#32] (56) Sort [codegen id : 23] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#26, 0) ASC NULLS FIRST, isnull(d_date#26) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#24, 0) ASC NULLS FIRST, isnull(d_date#24) ASC NULLS FIRST], false, 0 (57) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26)] +Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24)] Join condition: None (58) HashAggregate [codegen id : 24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt index 5bcd7dbb93022..dd8b4a458cdb5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt @@ -72,14 +72,14 @@ CollectLimit InputAdapter Exchange [cs_bill_customer_sk] #9 WholeStageCodegen (9) - Project [cs_bill_customer_sk,d_date] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [d_date,cs_bill_customer_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 Filter [cs_sold_date_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] @@ -103,14 +103,14 @@ CollectLimit InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (17) - Project [ws_bill_customer_sk,d_date] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_date,ws_bill_customer_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 Filter [ws_sold_date_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (20) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt index 3cf87e9bf2eaf..e4308f5f22fa4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.inventory (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.inventory (6) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -43,63 +43,63 @@ :- * Project (42) : +- * BroadcastHashJoin Inner BuildRight (41) : :- * Project (39) - : : +- * BroadcastHashJoin Inner BuildRight (38) - : : :- * Filter (32) - : : : +- * ColumnarToRow (31) - : : : +- Scan parquet default.inventory (30) - : : +- BroadcastExchange (37) - : : +- * Project (36) - : : +- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.date_dim (33) + : : +- * BroadcastHashJoin Inner BuildLeft (38) + : : :- BroadcastExchange (34) + : : : +- * Project (33) + : : : +- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.date_dim (30) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.inventory (35) : +- ReusedExchange (40) +- ReusedExchange (43) -(1) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] - -(3) Filter [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 2001)) AND (d_moy#7 = 1)) AND isnotnull(d_date_sk#5)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 1)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_moy#3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_moy#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.inventory +Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [d_date_sk#5, d_moy#7] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(7) ColumnarToRow +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -(8) BroadcastExchange -Input [2]: [d_date_sk#5, d_moy#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [inv_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7] -Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5, d_moy#7] +Output [4]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Input [6]: [d_date_sk#1, d_moy#3, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] (11) Scan parquet default.item Output [1]: [i_item_sk#9] @@ -120,13 +120,13 @@ Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_item_sk#2] +Left keys [1]: [inv_item_sk#6] Right keys [1]: [i_item_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] -Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] +Output [4]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] +Input [5]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#11, w_warehouse_name#12] @@ -147,121 +147,121 @@ Input [2]: [w_warehouse_sk#11, w_warehouse_name#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#3] +Left keys [1]: [inv_warehouse_sk#7] Right keys [1]: [w_warehouse_sk#11] Join condition: None (22) Project [codegen id : 4] -Output [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] -Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] +Output [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] +Input [6]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] (23) HashAggregate [codegen id : 4] -Input [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] +Input [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] Aggregate Attributes [5]: [n#14, avg#15, m2#16, sum#17, count#18] -Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] (24) Exchange -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] -Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, 5), true, [id=#24] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, 5), true, [id=#24] (25) HashAggregate [codegen id : 5] -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#25, avg(cast(inv_quantity_on_hand#4 as bigint))#26] -Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stddev_samp(cast(inv_quantity_on_hand#4 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#4 as bigint))#26 AS mean#28] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#25, avg(cast(inv_quantity_on_hand#8 as bigint))#26] +Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stddev_samp(cast(inv_quantity_on_hand#8 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#8 as bigint))#26 AS mean#28] (26) Filter [codegen id : 5] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] Condition : (CASE WHEN (mean#28 = 0.0) THEN 0.0 ELSE (stdev#27 / mean#28) END > 1.0) (27) Project [codegen id : 5] -Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] +Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] (28) Exchange -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] Arguments: hashpartitioning(i_item_sk#9, w_warehouse_sk#11, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] Arguments: [i_item_sk#9 ASC NULLS FIRST, w_warehouse_sk#11 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(31) ColumnarToRow [codegen id : 10] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] - -(32) Filter [codegen id : 10] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) - -(33) Scan parquet default.date_dim +(30) Scan parquet default.date_dim Output [3]: [d_date_sk#31, d_year#32, d_moy#33] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 7] +(31) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(35) Filter [codegen id : 7] +(32) Filter [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] Condition : ((((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2001)) AND (d_moy#33 = 2)) AND isnotnull(d_date_sk#31)) -(36) Project [codegen id : 7] +(33) Project [codegen id : 7] Output [2]: [d_date_sk#31, d_moy#33] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(37) BroadcastExchange +(34) BroadcastExchange Input [2]: [d_date_sk#31, d_moy#33] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] +(35) Scan parquet default.inventory +Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct + +(36) ColumnarToRow +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] + +(37) Filter +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) + (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#31] +Left keys [1]: [d_date_sk#31] +Right keys [1]: [inv_date_sk#5] Join condition: None (39) Project [codegen id : 10] -Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33] -Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#31, d_moy#33] +Output [4]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Input [6]: [d_date_sk#31, d_moy#33, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] (40) ReusedExchange [Reuses operator id: 14] Output [1]: [i_item_sk#35] (41) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_item_sk#2] +Left keys [1]: [inv_item_sk#6] Right keys [1]: [i_item_sk#35] Join condition: None (42) Project [codegen id : 10] -Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] -Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] +Output [4]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] +Input [5]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] (43) ReusedExchange [Reuses operator id: 20] Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_warehouse_sk#3] +Left keys [1]: [inv_warehouse_sk#7] Right keys [1]: [w_warehouse_sk#36] Join condition: None (45) Project [codegen id : 10] -Output [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] -Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] +Output [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [6]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] (46) HashAggregate [codegen id : 10] -Input [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] Aggregate Attributes [5]: [n#38, avg#39, m2#40, sum#41, count#42] Results [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] @@ -272,9 +272,9 @@ Arguments: hashpartitioning(w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35 (48) HashAggregate [codegen id : 11] Input [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#49, avg(cast(inv_quantity_on_hand#4 as bigint))#50] -Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#4 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#4 as bigint))#50 AS mean#52] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#49, avg(cast(inv_quantity_on_hand#8 as bigint))#50] +Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#8 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#8 as bigint))#50 AS mean#52] (49) Filter [codegen id : 11] Input [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stdev#51, mean#52] @@ -298,10 +298,10 @@ Right keys [2]: [i_item_sk#35, w_warehouse_sk#36] Join condition: None (54) Exchange -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] (55) Sort [codegen id : 14] -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt index c0f519d2ec83b..a8d142814a64a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt @@ -19,14 +19,10 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [d_date_sk,inv_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) @@ -64,14 +64,10 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [d_date_sk,inv_date_sk] InputAdapter BroadcastExchange #9 WholeStageCodegen (7) @@ -80,6 +76,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt index b73801a52bb37..584c982ffe0de 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.inventory (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.inventory (6) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -43,63 +43,63 @@ :- * Project (42) : +- * BroadcastHashJoin Inner BuildRight (41) : :- * Project (39) - : : +- * BroadcastHashJoin Inner BuildRight (38) - : : :- * Filter (32) - : : : +- * ColumnarToRow (31) - : : : +- Scan parquet default.inventory (30) - : : +- BroadcastExchange (37) - : : +- * Project (36) - : : +- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.date_dim (33) + : : +- * BroadcastHashJoin Inner BuildLeft (38) + : : :- BroadcastExchange (34) + : : : +- * Project (33) + : : : +- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.date_dim (30) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.inventory (35) : +- ReusedExchange (40) +- ReusedExchange (43) -(1) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] - -(3) Filter [codegen id : 4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 2001)) AND (d_moy#7 = 1)) AND isnotnull(d_date_sk#5)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 1)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_moy#3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_moy#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.inventory +Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [d_date_sk#5, d_moy#7] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(7) ColumnarToRow +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -(8) BroadcastExchange -Input [2]: [d_date_sk#5, d_moy#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [inv_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7] -Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5, d_moy#7] +Output [4]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Input [6]: [d_date_sk#1, d_moy#3, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] (11) Scan parquet default.item Output [1]: [i_item_sk#9] @@ -120,13 +120,13 @@ Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_item_sk#2] +Left keys [1]: [inv_item_sk#6] Right keys [1]: [i_item_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] -Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] +Output [4]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] +Input [5]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#11, w_warehouse_name#12] @@ -147,121 +147,121 @@ Input [2]: [w_warehouse_sk#11, w_warehouse_name#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#3] +Left keys [1]: [inv_warehouse_sk#7] Right keys [1]: [w_warehouse_sk#11] Join condition: None (22) Project [codegen id : 4] -Output [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] -Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] +Output [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] +Input [6]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] (23) HashAggregate [codegen id : 4] -Input [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] +Input [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] Aggregate Attributes [5]: [n#14, avg#15, m2#16, sum#17, count#18] -Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] (24) Exchange -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] -Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, 5), true, [id=#24] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, 5), true, [id=#24] (25) HashAggregate [codegen id : 5] -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#25, avg(cast(inv_quantity_on_hand#4 as bigint))#26] -Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stddev_samp(cast(inv_quantity_on_hand#4 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#4 as bigint))#26 AS mean#28] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#25, avg(cast(inv_quantity_on_hand#8 as bigint))#26] +Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stddev_samp(cast(inv_quantity_on_hand#8 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#8 as bigint))#26 AS mean#28] (26) Filter [codegen id : 5] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] Condition : ((CASE WHEN (mean#28 = 0.0) THEN 0.0 ELSE (stdev#27 / mean#28) END > 1.0) AND (CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END > 1.5)) (27) Project [codegen id : 5] -Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] +Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] (28) Exchange -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] Arguments: hashpartitioning(i_item_sk#9, w_warehouse_sk#11, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] Arguments: [i_item_sk#9 ASC NULLS FIRST, w_warehouse_sk#11 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(31) ColumnarToRow [codegen id : 10] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] - -(32) Filter [codegen id : 10] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) - -(33) Scan parquet default.date_dim +(30) Scan parquet default.date_dim Output [3]: [d_date_sk#31, d_year#32, d_moy#33] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 7] +(31) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(35) Filter [codegen id : 7] +(32) Filter [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] Condition : ((((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2001)) AND (d_moy#33 = 2)) AND isnotnull(d_date_sk#31)) -(36) Project [codegen id : 7] +(33) Project [codegen id : 7] Output [2]: [d_date_sk#31, d_moy#33] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(37) BroadcastExchange +(34) BroadcastExchange Input [2]: [d_date_sk#31, d_moy#33] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] +(35) Scan parquet default.inventory +Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct + +(36) ColumnarToRow +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] + +(37) Filter +Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) + (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#31] +Left keys [1]: [d_date_sk#31] +Right keys [1]: [inv_date_sk#5] Join condition: None (39) Project [codegen id : 10] -Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33] -Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#31, d_moy#33] +Output [4]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Input [6]: [d_date_sk#31, d_moy#33, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] (40) ReusedExchange [Reuses operator id: 14] Output [1]: [i_item_sk#35] (41) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_item_sk#2] +Left keys [1]: [inv_item_sk#6] Right keys [1]: [i_item_sk#35] Join condition: None (42) Project [codegen id : 10] -Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] -Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] +Output [4]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] +Input [5]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] (43) ReusedExchange [Reuses operator id: 20] Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_warehouse_sk#3] +Left keys [1]: [inv_warehouse_sk#7] Right keys [1]: [w_warehouse_sk#36] Join condition: None (45) Project [codegen id : 10] -Output [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] -Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] +Output [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [6]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] (46) HashAggregate [codegen id : 10] -Input [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] Aggregate Attributes [5]: [n#38, avg#39, m2#40, sum#41, count#42] Results [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] @@ -272,9 +272,9 @@ Arguments: hashpartitioning(w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35 (48) HashAggregate [codegen id : 11] Input [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#49, avg(cast(inv_quantity_on_hand#4 as bigint))#50] -Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#4 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#4 as bigint))#50 AS mean#52] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#49, avg(cast(inv_quantity_on_hand#8 as bigint))#50] +Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#8 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#8 as bigint))#50 AS mean#52] (49) Filter [codegen id : 11] Input [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stdev#51, mean#52] @@ -298,10 +298,10 @@ Right keys [2]: [i_item_sk#35, w_warehouse_sk#36] Join condition: None (54) Exchange -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] (55) Sort [codegen id : 14] -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt index c0f519d2ec83b..a8d142814a64a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt @@ -19,14 +19,10 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [d_date_sk,inv_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) @@ -64,14 +64,10 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [d_date_sk,inv_date_sk] InputAdapter BroadcastExchange #9 WholeStageCodegen (7) @@ -80,6 +76,10 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt index fb5e991043bf8..09e62b1343c50 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt @@ -20,14 +20,14 @@ TakeOrderedAndProject (126) : : : : : :- * Sort (11) : : : : : : +- Exchange (10) : : : : : : +- * Project (9) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : : : :- * Filter (3) - : : : : : : : +- * ColumnarToRow (2) - : : : : : : : +- Scan parquet default.store_sales (1) - : : : : : : +- BroadcastExchange (7) - : : : : : : +- * Filter (6) - : : : : : : +- * ColumnarToRow (5) - : : : : : : +- Scan parquet default.date_dim (4) + : : : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : : : :- BroadcastExchange (4) + : : : : : : : +- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.date_dim (1) + : : : : : : +- * Filter (7) + : : : : : : +- * ColumnarToRow (6) + : : : : : : +- Scan parquet default.store_sales (5) : : : : : +- * Sort (16) : : : : : +- Exchange (15) : : : : : +- * Filter (14) @@ -43,14 +43,14 @@ TakeOrderedAndProject (126) : : : : :- * Sort (35) : : : : : +- Exchange (34) : : : : : +- * Project (33) - : : : : : +- * BroadcastHashJoin Inner BuildRight (32) - : : : : : :- * Filter (27) - : : : : : : +- * ColumnarToRow (26) - : : : : : : +- Scan parquet default.store_sales (25) - : : : : : +- BroadcastExchange (31) - : : : : : +- * Filter (30) - : : : : : +- * ColumnarToRow (29) - : : : : : +- Scan parquet default.date_dim (28) + : : : : : +- * BroadcastHashJoin Inner BuildLeft (32) + : : : : : :- BroadcastExchange (28) + : : : : : : +- * Filter (27) + : : : : : : +- * ColumnarToRow (26) + : : : : : : +- Scan parquet default.date_dim (25) + : : : : : +- * Filter (31) + : : : : : +- * ColumnarToRow (30) + : : : : : +- Scan parquet default.store_sales (29) : : : : +- * Sort (37) : : : : +- ReusedExchange (36) : : : +- * Sort (64) @@ -65,11 +65,11 @@ TakeOrderedAndProject (126) : : : :- * Sort (53) : : : : +- Exchange (52) : : : : +- * Project (51) - : : : : +- * BroadcastHashJoin Inner BuildRight (50) - : : : : :- * Filter (48) - : : : : : +- * ColumnarToRow (47) - : : : : : +- Scan parquet default.catalog_sales (46) - : : : : +- ReusedExchange (49) + : : : : +- * BroadcastHashJoin Inner BuildLeft (50) + : : : : :- ReusedExchange (46) + : : : : +- * Filter (49) + : : : : +- * ColumnarToRow (48) + : : : : +- Scan parquet default.catalog_sales (47) : : : +- * Sort (55) : : : +- ReusedExchange (54) : : +- * Sort (83) @@ -101,11 +101,11 @@ TakeOrderedAndProject (126) : :- * Sort (93) : : +- Exchange (92) : : +- * Project (91) - : : +- * BroadcastHashJoin Inner BuildRight (90) - : : :- * Filter (88) - : : : +- * ColumnarToRow (87) - : : : +- Scan parquet default.web_sales (86) - : : +- ReusedExchange (89) + : : +- * BroadcastHashJoin Inner BuildLeft (90) + : : :- ReusedExchange (86) + : : +- * Filter (89) + : : +- * ColumnarToRow (88) + : : +- Scan parquet default.web_sales (87) : +- * Sort (95) : +- ReusedExchange (94) +- * Sort (123) @@ -127,54 +127,54 @@ TakeOrderedAndProject (126) +- ReusedExchange (115) -(1) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] - -(3) Filter [codegen id : 2] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_year#8] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#7, d_year#8] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#7, d_year#8] -Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) -(7) BroadcastExchange -Input [2]: [d_date_sk#7, d_year#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] +(4) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] + +(5) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] + +(7) Filter +Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8] +Output [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Input [8]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] (10) Exchange -Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#10] +Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#10] (11) Sort [codegen id : 3] -Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] @@ -199,31 +199,31 @@ Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#11] Join condition: None (18) Project [codegen id : 6] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] +Input [14]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (19) HashAggregate [codegen id : 6] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#20, isEmpty#21] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] (20) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#24] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#24] (21) HashAggregate [codegen id : 7] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25] -Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25] +Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27] (22) Filter [codegen id : 7] Input [2]: [customer_id#26, year_total#27] @@ -237,54 +237,54 @@ Arguments: hashpartitioning(customer_id#26, 5), true, [id=#28] Input [2]: [customer_id#26, year_total#27] Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(26) ColumnarToRow [codegen id : 10] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] - -(27) Filter [codegen id : 10] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(28) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_year#8] +(25) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#7, d_year#8] +(26) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#1, d_year#2] -(30) Filter [codegen id : 9] -Input [2]: [d_date_sk#7, d_year#8] -Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2002)) AND isnotnull(d_date_sk#7)) +(27) Filter [codegen id : 9] +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND isnotnull(d_date_sk#1)) -(31) BroadcastExchange -Input [2]: [d_date_sk#7, d_year#8] +(28) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] +(29) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow +Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] + +(31) Filter +Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) + (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (33) Project [codegen id : 10] -Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8] +Output [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Input [8]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] (34) Exchange -Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30] +Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#30] (35) Sort [codegen id : 11] -Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] @@ -294,31 +294,31 @@ Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#11] Join condition: None (39) Project [codegen id : 14] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] +Input [14]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (40) HashAggregate [codegen id : 14] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#31, isEmpty#32] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] (41) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#35] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#35] (42) HashAggregate [codegen id : 15] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36] -Results [8]: [c_customer_id#12 AS customer_id#37, c_first_name#13 AS customer_first_name#38, c_last_name#14 AS customer_last_name#39, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#40, c_birth_country#16 AS customer_birth_country#41, c_login#17 AS customer_login#42, c_email_address#18 AS customer_email_address#43, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36 AS year_total#44] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36] +Results [8]: [c_customer_id#12 AS customer_id#37, c_first_name#13 AS customer_first_name#38, c_last_name#14 AS customer_last_name#39, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#40, c_birth_country#16 AS customer_birth_country#41, c_login#17 AS customer_login#42, c_email_address#18 AS customer_email_address#43, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36 AS year_total#44] (43) Exchange Input [8]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44] @@ -333,38 +333,38 @@ Left keys [1]: [customer_id#26] Right keys [1]: [customer_id#37] Join condition: None -(46) Scan parquet default.catalog_sales +(46) ReusedExchange [Reuses operator id: 4] +Output [2]: [d_date_sk#1, d_year#2] + +(47) Scan parquet default.catalog_sales Output [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(47) ColumnarToRow [codegen id : 19] +(48) ColumnarToRow Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] -(48) Filter [codegen id : 19] +(49) Filter Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46)) -(49) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#7, d_year#8] - (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_sold_date_sk#46] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#46] Join condition: None (51) Project [codegen id : 19] -Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8] +Output [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] +Input [8]: [d_date_sk#1, d_year#2, cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] (52) Exchange -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#52] (53) Sort [codegen id : 20] -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -380,23 +380,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (57) Project [codegen id : 23] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Input [14]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (58) HashAggregate [codegen id : 23] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#53, isEmpty#54] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] (59) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#57] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#57] (60) HashAggregate [codegen id : 24] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58] Results [2]: [c_customer_id#12 AS customer_id#59, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58 AS year_total#60] @@ -440,24 +440,24 @@ Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46)) -(70) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#7, d_year#8] +(70) ReusedExchange [Reuses operator id: 28] +Output [2]: [d_date_sk#1, d_year#2] (71) BroadcastHashJoin [codegen id : 28] Left keys [1]: [cs_sold_date_sk#46] -Right keys [1]: [d_date_sk#7] +Right keys [1]: [d_date_sk#1] Join condition: None (72) Project [codegen id : 28] -Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8] +Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#1, d_year#2] (73) Exchange -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#64] (74) Sort [codegen id : 29] -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -473,23 +473,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (78) Project [codegen id : 32] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (79) HashAggregate [codegen id : 32] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#65, isEmpty#66] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] (80) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#69] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#69] (81) HashAggregate [codegen id : 33] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70] Results [2]: [c_customer_id#12 AS customer_id#71, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70 AS year_total#72] @@ -511,38 +511,38 @@ Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promot Output [10]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72] Input [13]: [customer_id#26, year_total#27, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44, year_total#62, customer_id#71, year_total#72] -(86) Scan parquet default.web_sales +(86) ReusedExchange [Reuses operator id: 4] +Output [2]: [d_date_sk#1, d_year#2] + +(87) Scan parquet default.web_sales Output [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(87) ColumnarToRow [codegen id : 37] +(88) ColumnarToRow Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] -(88) Filter [codegen id : 37] +(89) Filter Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74)) -(89) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#7, d_year#8] - (90) BroadcastHashJoin [codegen id : 37] -Left keys [1]: [ws_sold_date_sk#74] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#74] Join condition: None (91) Project [codegen id : 37] -Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8] +Output [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] +Input [8]: [d_date_sk#1, d_year#2, ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] (92) Exchange -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#80] (93) Sort [codegen id : 38] -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 (94) ReusedExchange [Reuses operator id: 15] @@ -558,23 +558,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (97) Project [codegen id : 41] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Input [14]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (98) HashAggregate [codegen id : 41] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#81, isEmpty#82] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] (99) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#85] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#85] (100) HashAggregate [codegen id : 42] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86] Results [2]: [c_customer_id#12 AS customer_id#87, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86 AS year_total#88] @@ -618,24 +618,24 @@ Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74)) -(110) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#7, d_year#8] +(110) ReusedExchange [Reuses operator id: 28] +Output [2]: [d_date_sk#1, d_year#2] (111) BroadcastHashJoin [codegen id : 46] Left keys [1]: [ws_sold_date_sk#74] -Right keys [1]: [d_date_sk#7] +Right keys [1]: [d_date_sk#1] Join condition: None (112) Project [codegen id : 46] -Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8] +Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#1, d_year#2] (113) Exchange -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#92] (114) Sort [codegen id : 47] -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 (115) ReusedExchange [Reuses operator id: 15] @@ -651,23 +651,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (118) Project [codegen id : 50] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (119) HashAggregate [codegen id : 50] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#93, isEmpty#94] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] (120) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#97] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#97] (121) HashAggregate [codegen id : 51] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98] Results [2]: [c_customer_id#12 AS customer_id#99, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98 AS year_total#100] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt index 1a497cb6c89c0..b15e0b75a7108 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt @@ -37,12 +37,8 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -50,6 +46,10 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -79,12 +79,8 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ss_customer_sk] #8 WholeStageCodegen (10) - Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -92,6 +88,10 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter WholeStageCodegen (13) Sort [c_customer_sk] @@ -118,14 +118,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [cs_bill_customer_sk] #12 WholeStageCodegen (19) - Project [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [d_year,cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 Filter [cs_bill_customer_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] @@ -184,14 +184,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ws_bill_customer_sk] #18 WholeStageCodegen (37) - Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (40) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt index c55f264a9d858..70a0962e16962 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (35) :- * Project (25) : +- * BroadcastHashJoin Inner BuildRight (24) : :- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) - : : :- * Project (12) - : : : +- SortMergeJoin LeftOuter (11) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_returns (6) - : : +- BroadcastExchange (17) - : : +- * Project (16) - : : +- * Filter (15) - : : +- * ColumnarToRow (14) - : : +- Scan parquet default.item (13) + : : +- * BroadcastHashJoin Inner BuildLeft (18) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Project (17) + : : +- SortMergeJoin LeftOuter (16) + : : :- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_sales (6) + : : +- * Sort (15) + : : +- Exchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.catalog_returns (11) : +- BroadcastExchange (23) : +- * Filter (22) : +- * ColumnarToRow (21) @@ -36,89 +36,89 @@ TakeOrderedAndProject (35) +- Scan parquet default.warehouse (26) -(1) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] (3) Filter [codegen id : 1] -Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] -Condition : ((isnotnull(cs_warehouse_sk#2) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_sold_date_sk#1)) +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +Condition : (((isnotnull(i_current_price#3) AND (i_current_price#3 >= 0.99)) AND (i_current_price#3 <= 1.49)) AND isnotnull(i_item_sk#1)) -(4) Exchange -Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] -Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#6] +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_item_id#2] +Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] -(5) Sort [codegen id : 2] -Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] -Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_item_id#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] -(6) Scan parquet default.catalog_returns -Output [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +(6) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +(7) ColumnarToRow [codegen id : 2] +Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] -(8) Filter [codegen id : 3] -Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] -Condition : (isnotnull(cr_order_number#8) AND isnotnull(cr_item_sk#7)) +(8) Filter [codegen id : 2] +Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] +Condition : ((isnotnull(cs_warehouse_sk#6) AND isnotnull(cs_item_sk#7)) AND isnotnull(cs_sold_date_sk#5)) (9) Exchange -Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] -Arguments: hashpartitioning(cr_order_number#8, cr_item_sk#7, 5), true, [id=#10] +Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] +Arguments: hashpartitioning(cs_order_number#8, cs_item_sk#7, 5), true, [id=#10] -(10) Sort [codegen id : 4] -Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] -Arguments: [cr_order_number#8 ASC NULLS FIRST, cr_item_sk#7 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] +Arguments: [cs_order_number#8 ASC NULLS FIRST, cs_item_sk#7 ASC NULLS FIRST], false, 0 -(11) SortMergeJoin -Left keys [2]: [cs_order_number#4, cs_item_sk#3] -Right keys [2]: [cr_order_number#8, cr_item_sk#7] -Join condition: None +(11) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct -(12) Project [codegen id : 8] -Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_sales_price#5, cr_refunded_cash#9] -Input [8]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5, cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +(12) ColumnarToRow [codegen id : 4] +Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] -(13) Scan parquet default.item -Output [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] -ReadSchema: struct +(13) Filter [codegen id : 4] +Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +Condition : (isnotnull(cr_order_number#12) AND isnotnull(cr_item_sk#11)) -(14) ColumnarToRow [codegen id : 5] -Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] +(14) Exchange +Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +Arguments: hashpartitioning(cr_order_number#12, cr_item_sk#11, 5), true, [id=#14] -(15) Filter [codegen id : 5] -Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] -Condition : (((isnotnull(i_current_price#13) AND (i_current_price#13 >= 0.99)) AND (i_current_price#13 <= 1.49)) AND isnotnull(i_item_sk#11)) +(15) Sort [codegen id : 5] +Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +Arguments: [cr_order_number#12 ASC NULLS FIRST, cr_item_sk#11 ASC NULLS FIRST], false, 0 -(16) Project [codegen id : 5] -Output [2]: [i_item_sk#11, i_item_id#12] -Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] +(16) SortMergeJoin +Left keys [2]: [cs_order_number#8, cs_item_sk#7] +Right keys [2]: [cr_order_number#12, cr_item_sk#11] +Join condition: None -(17) BroadcastExchange -Input [2]: [i_item_sk#11, i_item_id#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Project +Output [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_sales_price#9, cr_refunded_cash#13] +Input [8]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9, cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] (18) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_item_sk#3] -Right keys [1]: [i_item_sk#11] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#7] Join condition: None (19) Project [codegen id : 8] -Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12] -Input [7]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_sales_price#5, cr_refunded_cash#9, i_item_sk#11, i_item_id#12] +Output [5]: [i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13] +Input [7]: [i_item_sk#1, i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_sales_price#9, cr_refunded_cash#13] (20) Scan parquet default.date_dim Output [2]: [d_date_sk#15, d_date#16] @@ -139,13 +139,13 @@ Input [2]: [d_date_sk#15, d_date#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (24) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#5] Right keys [1]: [d_date_sk#15] Join condition: None (25) Project [codegen id : 8] -Output [5]: [cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date#16] -Input [7]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date_sk#15, d_date#16] +Output [5]: [i_item_id#2, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date#16] +Input [7]: [i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date_sk#15, d_date#16] (26) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#18, w_state#19] @@ -166,33 +166,33 @@ Input [2]: [w_warehouse_sk#18, w_state#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] (30) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_warehouse_sk#2] +Left keys [1]: [cs_warehouse_sk#6] Right keys [1]: [w_warehouse_sk#18] Join condition: None (31) Project [codegen id : 8] -Output [5]: [cs_sales_price#5, cr_refunded_cash#9, w_state#19, i_item_id#12, d_date#16] -Input [7]: [cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date#16, w_warehouse_sk#18, w_state#19] +Output [5]: [cs_sales_price#9, cr_refunded_cash#13, w_state#19, i_item_id#2, d_date#16] +Input [7]: [i_item_id#2, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date#16, w_warehouse_sk#18, w_state#19] (32) HashAggregate [codegen id : 8] -Input [5]: [cs_sales_price#5, cr_refunded_cash#9, w_state#19, i_item_id#12, d_date#16] -Keys [2]: [w_state#19, i_item_id#12] -Functions [2]: [partial_sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Input [5]: [cs_sales_price#9, cr_refunded_cash#13, w_state#19, i_item_id#2, d_date#16] +Keys [2]: [w_state#19, i_item_id#2] +Functions [2]: [partial_sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] Aggregate Attributes [4]: [sum#21, isEmpty#22, sum#23, isEmpty#24] -Results [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] +Results [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] (33) Exchange -Input [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] -Arguments: hashpartitioning(w_state#19, i_item_id#12, 5), true, [id=#29] +Input [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] +Arguments: hashpartitioning(w_state#19, i_item_id#2, 5), true, [id=#29] (34) HashAggregate [codegen id : 9] -Input [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] -Keys [2]: [w_state#19, i_item_id#12] -Functions [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] -Aggregate Attributes [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31] -Results [4]: [w_state#19, i_item_id#12, sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30 AS sales_before#32, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31 AS sales_after#33] +Input [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] +Keys [2]: [w_state#19, i_item_id#2] +Functions [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31] +Results [4]: [w_state#19, i_item_id#2, sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30 AS sales_before#32, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31 AS sales_after#33] (35) TakeOrderedAndProject -Input [4]: [w_state#19, i_item_id#12, sales_before#32, sales_after#33] -Arguments: 100, [w_state#19 ASC NULLS FIRST, i_item_id#12 ASC NULLS FIRST], [w_state#19, i_item_id#12, sales_before#32, sales_after#33] +Input [4]: [w_state#19, i_item_id#2, sales_before#32, sales_after#33] +Arguments: 100, [w_state#19 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST], [w_state#19, i_item_id#2, sales_before#32, sales_after#33] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt index 6e976ada38863..09fa8a15c8a33 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt @@ -7,39 +7,39 @@ TakeOrderedAndProject [w_state,i_item_id,sales_before,sales_after] HashAggregate [w_state,i_item_id,d_date,cs_sales_price,cr_refunded_cash] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Project [cs_sales_price,cr_refunded_cash,w_state,i_item_id,d_date] BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] - Project [cs_warehouse_sk,cs_sales_price,cr_refunded_cash,i_item_id,d_date] + Project [i_item_id,cs_warehouse_sk,cs_sales_price,cr_refunded_cash,d_date] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_warehouse_sk,cs_sales_price,cr_refunded_cash,i_item_id] - BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [i_item_id,cs_sold_date_sk,cs_warehouse_sk,cs_sales_price,cr_refunded_cash] + BroadcastHashJoin [i_item_sk,cs_item_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] Project [cs_sold_date_sk,cs_warehouse_sk,cs_item_sk,cs_sales_price,cr_refunded_cash] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #2 - WholeStageCodegen (1) + Exchange [cs_order_number,cs_item_sk] #3 + WholeStageCodegen (2) Filter [cs_warehouse_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_warehouse_sk,cs_item_sk,cs_order_number,cs_sales_price] - WholeStageCodegen (4) + WholeStageCodegen (5) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #3 - WholeStageCodegen (3) + Exchange [cr_order_number,cr_item_sk] #4 + WholeStageCodegen (4) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (5) - Project [i_item_sk,i_item_id] - Filter [i_current_price,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_current_price] InputAdapter BroadcastExchange #5 WholeStageCodegen (6) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt index dfd840a823327..e96072f2a05cb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.item (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] -Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 1)) AND isnotnull(i_item_sk#4)) +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] +Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_category_id#2, i_category#3] +Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_category_id#2, i_category#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [3]: [i_item_sk#4, i_category_id#5, i_category#6] -Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -(8) BroadcastExchange -Input [3]: [i_item_sk#4, i_category_id#5, i_category#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_category_id#5, i_category#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_category_id#5, i_category#6] +Output [4]: [i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_ext_sales_price#8] +Input [6]: [i_item_sk#1, i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,33 +90,33 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#3, i_category_id#5, i_category#6] -Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_category_id#5, i_category#6, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#8, i_category_id#2, i_category#3] +Input [6]: [i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#3, i_category_id#5, i_category#6] -Keys [3]: [d_year#10, i_category_id#5, i_category#6] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [4]: [d_year#10, ss_ext_sales_price#8, i_category_id#2, i_category#3] +Keys [3]: [d_year#10, i_category_id#2, i_category#3] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] +Results [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] (19) Exchange -Input [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] -Arguments: hashpartitioning(d_year#10, i_category_id#5, i_category#6, 5), true, [id=#15] +Input [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] +Arguments: hashpartitioning(d_year#10, i_category_id#2, i_category#3, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] -Keys [3]: [d_year#10, i_category_id#5, i_category#6] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [4]: [d_year#10, i_category_id#5, i_category#6, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum(ss_ext_sales_price)#17] +Input [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] +Keys [3]: [d_year#10, i_category_id#2, i_category#3] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] +Results [4]: [d_year#10, i_category_id#2, i_category#3, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS sum(ss_ext_sales_price)#17] (21) TakeOrderedAndProject -Input [4]: [d_year#10, i_category_id#5, i_category#6, sum(ss_ext_sales_price)#17] -Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#10 ASC NULLS FIRST, i_category_id#5 ASC NULLS FIRST, i_category#6 ASC NULLS FIRST], [d_year#10, i_category_id#5, i_category#6, sum(ss_ext_sales_price)#17] +Input [4]: [d_year#10, i_category_id#2, i_category#3, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#10 ASC NULLS FIRST, i_category_id#2 ASC NULLS FIRST, i_category#3 ASC NULLS FIRST], [d_year#10, i_category_id#2, i_category#3, sum(ss_ext_sales_price)#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt index 1ad7df6bb984a..5ed955903554f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_category_id,i_category] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_category_id,i_category] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [i_category_id,i_category,ss_sold_date_sk,ss_ext_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt index 952873e60626e..fb925640dc42e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.store (11) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) -(4) Project [codegen id : 1] -Output [2]: [d_date_sk#1, d_day_name#3] -Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_year#5, d_day_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [d_date_sk#1, d_day_name#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] +Condition : ((isnotnull(d_year#5) AND (d_year#5 = 2000)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_day_name#6] +Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] -(8) Filter -Input [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] -Condition : (isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#6)) +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_day_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [3]: [d_day_name#3, ss_store_sk#6, ss_sales_price#7] -Input [5]: [d_date_sk#1, d_day_name#3, ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] +Output [3]: [ss_store_sk#2, ss_sales_price#3, d_day_name#6] +Input [5]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3, d_date_sk#4, d_day_name#6] (11) Scan parquet default.store Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] @@ -90,18 +90,18 @@ Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#6] +Left keys [1]: [ss_store_sk#2] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_day_name#3, ss_sales_price#7, s_store_id#9, s_store_name#10] -Input [6]: [d_day_name#3, ss_store_sk#6, ss_sales_price#7, s_store_sk#8, s_store_id#9, s_store_name#10] +Output [4]: [d_day_name#6, ss_sales_price#3, s_store_id#9, s_store_name#10] +Input [6]: [ss_store_sk#2, ss_sales_price#3, d_day_name#6, s_store_sk#8, s_store_id#9, s_store_name#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_day_name#3, ss_sales_price#7, s_store_id#9, s_store_name#10] +Input [4]: [d_day_name#6, ss_sales_price#3, s_store_id#9, s_store_name#10] Keys [2]: [s_store_name#10, s_store_id#9] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))] Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] Results [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] @@ -112,9 +112,9 @@ Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), true, [id=#27] (20) HashAggregate [codegen id : 4] Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] Keys [2]: [s_store_name#10, s_store_id#9] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))#34] -Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))#34,17,2) AS sat_sales#41] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))#34] +Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))#34,17,2) AS sat_sales#41] (21) TakeOrderedAndProject Input [9]: [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt index a366ea3d4696a..f921628d04e13 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] Project [d_day_name,ss_sales_price,s_store_id,s_store_name] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [d_day_name,ss_store_sk,ss_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_store_sk,ss_sales_price,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt index 54e117e6cac10..525cfbd65b66c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (46) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.web_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.web_sales (6) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -34,12 +34,12 @@ TakeOrderedAndProject (46) : : +- Exchange (22) : : +- * Filter (21) : : +- * ColumnarToRow (20) - : : +- Scan parquet default.customer (19) + : : +- Scan parquet default.customer_address (19) : +- * Sort (28) : +- Exchange (27) : +- * Filter (26) : +- * ColumnarToRow (25) - : +- Scan parquet default.customer_address (24) + : +- Scan parquet default.customer (24) +- BroadcastExchange (39) +- * Project (38) +- * Filter (37) @@ -47,50 +47,50 @@ TakeOrderedAndProject (46) +- Scan parquet default.item (35) -(1) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] - -(3) Filter [codegen id : 3] -Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] -Condition : ((isnotnull(ws_bill_customer_sk#4) AND isnotnull(ws_sold_date_sk#2)) AND isnotnull(ws_item_sk#3)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#6, d_year#7, d_qoy#8] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#2, d_year#3, d_qoy#4] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] -Condition : ((((isnotnull(d_qoy#8) AND isnotnull(d_year#7)) AND (d_qoy#8 = 2)) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] +Condition : ((((isnotnull(d_qoy#4) AND isnotnull(d_year#3)) AND (d_qoy#4 = 2)) AND (d_year#3 = 2001)) AND isnotnull(d_date_sk#2)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#2] +Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] + +(5) BroadcastExchange +Input [1]: [d_date_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] +(7) ColumnarToRow +Input [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) Filter +Input [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] +Condition : ((isnotnull(ws_bill_customer_sk#8) AND isnotnull(ws_sold_date_sk#6)) AND isnotnull(ws_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ws_sold_date_sk#2] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#2] +Right keys [1]: [ws_sold_date_sk#6] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] -Input [5]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, d_date_sk#6] +Output [3]: [ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] +Input [5]: [d_date_sk#2, ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] (11) Scan parquet default.item Output [2]: [i_item_sk#10, i_item_id#11] @@ -111,91 +111,91 @@ Input [2]: [i_item_sk#10, i_item_id#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ws_item_sk#3] +Left keys [1]: [ws_item_sk#7] Right keys [1]: [i_item_sk#10] Join condition: None (16) Project [codegen id : 3] -Output [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] -Input [5]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, i_item_sk#10, i_item_id#11] +Output [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] +Input [5]: [ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9, i_item_sk#10, i_item_id#11] (17) Exchange -Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] -Arguments: hashpartitioning(ws_bill_customer_sk#4, 5), true, [id=#13] +Input [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] +Arguments: hashpartitioning(ws_bill_customer_sk#8, 5), true, [id=#13] (18) Sort [codegen id : 4] -Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] -Arguments: [ws_bill_customer_sk#4 ASC NULLS FIRST], false, 0 +Input [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] +Arguments: [ws_bill_customer_sk#8 ASC NULLS FIRST], false, 0 -(19) Scan parquet default.customer -Output [2]: [c_customer_sk#14, c_current_addr_sk#15] +(19) Scan parquet default.customer_address +Output [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [2]: [c_customer_sk#14, c_current_addr_sk#15] +Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] (21) Filter [codegen id : 5] -Input [2]: [c_customer_sk#14, c_current_addr_sk#15] -Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_current_addr_sk#15)) +Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] +Condition : isnotnull(ca_address_sk#14) (22) Exchange -Input [2]: [c_customer_sk#14, c_current_addr_sk#15] -Arguments: hashpartitioning(c_current_addr_sk#15, 5), true, [id=#16] +Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] +Arguments: hashpartitioning(ca_address_sk#14, 5), true, [id=#17] (23) Sort [codegen id : 6] -Input [2]: [c_customer_sk#14, c_current_addr_sk#15] -Arguments: [c_current_addr_sk#15 ASC NULLS FIRST], false, 0 +Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] +Arguments: [ca_address_sk#14 ASC NULLS FIRST], false, 0 -(24) Scan parquet default.customer_address -Output [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] +(24) Scan parquet default.customer +Output [2]: [c_customer_sk#18, c_current_addr_sk#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (25) ColumnarToRow [codegen id : 7] -Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] +Input [2]: [c_customer_sk#18, c_current_addr_sk#19] (26) Filter [codegen id : 7] -Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] -Condition : isnotnull(ca_address_sk#17) +Input [2]: [c_customer_sk#18, c_current_addr_sk#19] +Condition : (isnotnull(c_customer_sk#18) AND isnotnull(c_current_addr_sk#19)) (27) Exchange -Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] -Arguments: hashpartitioning(ca_address_sk#17, 5), true, [id=#20] +Input [2]: [c_customer_sk#18, c_current_addr_sk#19] +Arguments: hashpartitioning(c_current_addr_sk#19, 5), true, [id=#20] (28) Sort [codegen id : 8] -Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] -Arguments: [ca_address_sk#17 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#18, c_current_addr_sk#19] +Arguments: [c_current_addr_sk#19 ASC NULLS FIRST], false, 0 (29) SortMergeJoin [codegen id : 9] -Left keys [1]: [c_current_addr_sk#15] -Right keys [1]: [ca_address_sk#17] +Left keys [1]: [ca_address_sk#14] +Right keys [1]: [c_current_addr_sk#19] Join condition: None (30) Project [codegen id : 9] -Output [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] -Input [5]: [c_customer_sk#14, c_current_addr_sk#15, ca_address_sk#17, ca_city#18, ca_zip#19] +Output [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] +Input [5]: [ca_address_sk#14, ca_city#15, ca_zip#16, c_customer_sk#18, c_current_addr_sk#19] (31) Exchange -Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] -Arguments: hashpartitioning(c_customer_sk#14, 5), true, [id=#21] +Input [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] +Arguments: hashpartitioning(c_customer_sk#18, 5), true, [id=#21] (32) Sort [codegen id : 10] -Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] -Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 +Input [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] +Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 (33) SortMergeJoin [codegen id : 12] -Left keys [1]: [ws_bill_customer_sk#4] -Right keys [1]: [c_customer_sk#14] +Left keys [1]: [ws_bill_customer_sk#8] +Right keys [1]: [c_customer_sk#18] Join condition: None (34) Project [codegen id : 12] -Output [4]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11] -Input [6]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11, c_customer_sk#14, ca_city#18, ca_zip#19] +Output [4]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11] +Input [6]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11, ca_city#15, ca_zip#16, c_customer_sk#18] (35) Scan parquet default.item Output [2]: [i_item_sk#10, i_item_id#11] @@ -225,32 +225,32 @@ Right keys [1]: [i_item_id#11#22] Join condition: None (41) Filter [codegen id : 12] -Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1] -Condition : (substr(ca_zip#19, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) +Input [5]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11, exists#1] +Condition : (substr(ca_zip#16, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) (42) Project [codegen id : 12] -Output [3]: [ws_sales_price#5, ca_city#18, ca_zip#19] -Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1] +Output [3]: [ws_sales_price#9, ca_city#15, ca_zip#16] +Input [5]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11, exists#1] (43) HashAggregate [codegen id : 12] -Input [3]: [ws_sales_price#5, ca_city#18, ca_zip#19] -Keys [2]: [ca_zip#19, ca_city#18] -Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#5))] +Input [3]: [ws_sales_price#9, ca_city#15, ca_zip#16] +Keys [2]: [ca_zip#16, ca_city#15] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#9))] Aggregate Attributes [1]: [sum#24] -Results [3]: [ca_zip#19, ca_city#18, sum#25] +Results [3]: [ca_zip#16, ca_city#15, sum#25] (44) Exchange -Input [3]: [ca_zip#19, ca_city#18, sum#25] -Arguments: hashpartitioning(ca_zip#19, ca_city#18, 5), true, [id=#26] +Input [3]: [ca_zip#16, ca_city#15, sum#25] +Arguments: hashpartitioning(ca_zip#16, ca_city#15, 5), true, [id=#26] (45) HashAggregate [codegen id : 13] -Input [3]: [ca_zip#19, ca_city#18, sum#25] -Keys [2]: [ca_zip#19, ca_city#18] -Functions [1]: [sum(UnscaledValue(ws_sales_price#5))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#5))#27] -Results [3]: [ca_zip#19, ca_city#18, MakeDecimal(sum(UnscaledValue(ws_sales_price#5))#27,17,2) AS sum(ws_sales_price)#28] +Input [3]: [ca_zip#16, ca_city#15, sum#25] +Keys [2]: [ca_zip#16, ca_city#15] +Functions [1]: [sum(UnscaledValue(ws_sales_price#9))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#9))#27] +Results [3]: [ca_zip#16, ca_city#15, MakeDecimal(sum(UnscaledValue(ws_sales_price#9))#27,17,2) AS sum(ws_sales_price)#28] (46) TakeOrderedAndProject -Input [3]: [ca_zip#19, ca_city#18, sum(ws_sales_price)#28] -Arguments: 100, [ca_zip#19 ASC NULLS FIRST, ca_city#18 ASC NULLS FIRST], [ca_zip#19, ca_city#18, sum(ws_sales_price)#28] +Input [3]: [ca_zip#16, ca_city#15, sum(ws_sales_price)#28] +Arguments: 100, [ca_zip#16 ASC NULLS FIRST, ca_city#15 ASC NULLS FIRST], [ca_zip#16, ca_city#15, sum(ws_sales_price)#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt index 0e9662bb6aca5..b2ab550915e7b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt @@ -19,11 +19,7 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] Project [ws_bill_customer_sk,ws_sales_price,i_item_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_bill_customer_sk,ws_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_bill_customer_sk,ws_sold_date_sk,ws_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_sales_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -32,6 +28,10 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Filter [ws_bill_customer_sk,ws_sold_date_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -45,28 +45,28 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] InputAdapter Exchange [c_customer_sk] #5 WholeStageCodegen (9) - Project [c_customer_sk,ca_city,ca_zip] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_city,ca_zip,c_customer_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (6) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #6 + Exchange [ca_address_sk] #6 WholeStageCodegen (5) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] InputAdapter WholeStageCodegen (8) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #7 + Exchange [c_current_addr_sk] #7 WholeStageCodegen (7) - Filter [ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] InputAdapter BroadcastExchange #8 WholeStageCodegen (11) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt index d4c3d754860b1..7c4cc7c030a93 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt @@ -10,12 +10,12 @@ TakeOrderedAndProject (51) : : +- Exchange (4) : : +- * Filter (3) : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer (1) + : : +- Scan parquet default.customer_address (1) : +- * Sort (10) : +- Exchange (9) : +- * Filter (8) : +- * ColumnarToRow (7) - : +- Scan parquet default.customer_address (6) + : +- Scan parquet default.customer (6) +- * Sort (48) +- Exchange (47) +- * HashAggregate (46) @@ -52,66 +52,66 @@ TakeOrderedAndProject (51) +- ReusedExchange (41) -(1) Scan parquet default.customer -Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_city#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Input [2]: [ca_address_sk#1, ca_city#2] (3) Filter [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) +Input [2]: [ca_address_sk#1, ca_city#2] +Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_city#2)) (4) Exchange -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#5] +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#3] (5) Sort [codegen id : 2] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.customer_address -Output [2]: [ca_address_sk#6, ca_city#7] +(6) Scan parquet default.customer +Output [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [ca_address_sk#6, ca_city#7] +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] (8) Filter [codegen id : 3] -Input [2]: [ca_address_sk#6, ca_city#7] -Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5)) (9) Exchange -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: hashpartitioning(ca_address_sk#6, 5), true, [id=#8] +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#8] (10) Sort [codegen id : 4] -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 (11) SortMergeJoin [codegen id : 5] -Left keys [1]: [c_current_addr_sk#2] -Right keys [1]: [ca_address_sk#6] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#5] Join condition: None (12) Project [codegen id : 5] -Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] +Output [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Input [6]: [ca_address_sk#1, ca_city#2, c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] (13) Exchange -Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#9] +Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#9] (14) Sort [codegen id : 6] -Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 +Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 (15) Scan parquet default.store_sales Output [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] @@ -228,35 +228,35 @@ Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#29] Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 -(41) ReusedExchange [Reuses operator id: 9] -Output [2]: [ca_address_sk#6, ca_city#7] +(41) ReusedExchange [Reuses operator id: 4] +Output [2]: [ca_address_sk#1, ca_city#2] (42) Sort [codegen id : 13] -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_addr_sk#13] -Right keys [1]: [ca_address_sk#6] +Right keys [1]: [ca_address_sk#1] Join condition: None (44) Project [codegen id : 14] -Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#7] -Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#6, ca_city#7] +Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#2] +Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#1, ca_city#2] (45) HashAggregate [codegen id : 14] -Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#7] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] +Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#2] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2] Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#16)), partial_sum(UnscaledValue(ss_net_profit#17))] Aggregate Attributes [2]: [sum#30, sum#31] -Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#32, sum#33] +Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2, sum#32, sum#33] (46) HashAggregate [codegen id : 14] -Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#32, sum#33] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] +Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2, sum#32, sum#33] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2] Functions [2]: [sum(UnscaledValue(ss_coupon_amt#16)), sum(UnscaledValue(ss_net_profit#17))] Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#16))#34, sum(UnscaledValue(ss_net_profit#17))#35] -Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#7 AS bought_city#36, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#34,17,2) AS amt#37, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#35,17,2) AS profit#38] +Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#2 AS bought_city#36, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#34,17,2) AS amt#37, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#35,17,2) AS profit#38] (47) Exchange Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] @@ -267,15 +267,15 @@ Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, prof Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_customer_sk#1] +Left keys [1]: [c_customer_sk#4] Right keys [1]: [ss_customer_sk#11] -Join condition: NOT (ca_city#7 = bought_city#36) +Join condition: NOT (ca_city#2 = bought_city#36) (50) Project [codegen id : 16] -Output [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] -Input [9]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] +Output [7]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Input [9]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] (51) TakeOrderedAndProject -Input [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] -Arguments: 100, [c_last_name#4 ASC NULLS FIRST, c_first_name#3 ASC NULLS FIRST, ca_city#7 ASC NULLS FIRST, bought_city#36 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Input [7]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Arguments: 100, [c_last_name#7 ASC NULLS FIRST, c_first_name#6 ASC NULLS FIRST, ca_city#2 ASC NULLS FIRST, bought_city#36 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt index 5eef8b789842c..3180c9af5fd7f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt @@ -8,28 +8,28 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (5) - Project [c_customer_sk,c_first_name,c_last_name,ca_city] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_city,c_customer_sk,c_first_name,c_last_name] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (2) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #2 + Exchange [ca_address_sk] #2 WholeStageCodegen (1) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + Scan parquet default.customer_address [ca_address_sk,ca_city] InputAdapter WholeStageCodegen (4) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #3 + Exchange [c_current_addr_sk] #3 WholeStageCodegen (3) - Filter [ca_address_sk,ca_city] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (15) Sort [ss_customer_sk] @@ -84,4 +84,4 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu WholeStageCodegen (13) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #3 + ReusedExchange [ca_address_sk,ca_city] #2 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt index 741ee50f800ec..3eaf2b725858d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt @@ -10,14 +10,14 @@ TakeOrderedAndProject (35) : +- * Project (15) : +- * BroadcastHashJoin Inner BuildRight (14) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.date_dim (4) + : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : :- BroadcastExchange (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) : +- BroadcastExchange (13) : +- * Filter (12) : +- * ColumnarToRow (11) @@ -25,57 +25,57 @@ TakeOrderedAndProject (35) +- * Sort (29) +- Exchange (28) +- * Project (27) - +- * BroadcastHashJoin Inner BuildRight (26) - :- * Filter (20) - : +- * ColumnarToRow (19) - : +- Scan parquet default.store_returns (18) - +- BroadcastExchange (25) - +- * Project (24) - +- * Filter (23) - +- * ColumnarToRow (22) - +- Scan parquet default.date_dim (21) - - -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] - -(3) Filter [codegen id : 3] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] -Condition : ((((isnotnull(ss_ticket_number#5) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [1]: [d_date_sk#6] + +- * BroadcastHashJoin Inner BuildLeft (26) + :- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.date_dim (18) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.store_returns (23) + + +(1) Scan parquet default.date_dim +Output [1]: [d_date_sk#1] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [1]: [d_date_sk#6] +(2) ColumnarToRow [codegen id : 1] +Input [1]: [d_date_sk#1] + +(3) Filter [codegen id : 1] +Input [1]: [d_date_sk#1] +Condition : isnotnull(d_date_sk#1) + +(4) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#2] + +(5) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [1]: [d_date_sk#6] -Condition : isnotnull(d_date_sk#6) +(6) ColumnarToRow +Input [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] -(7) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] +(7) Filter +Input [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +Condition : ((((isnotnull(ss_ticket_number#7) AND isnotnull(ss_item_sk#4)) AND isnotnull(ss_customer_sk#5)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_sold_date_sk#3)) (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#3] Join condition: None (9) Project [codegen id : 3] -Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] +Output [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +Input [6]: [d_date_sk#1, ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] (10) Scan parquet default.store Output [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] @@ -96,88 +96,88 @@ Input [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#6] Right keys [1]: [s_store_sk#8] Join condition: None (15) Project [codegen id : 3] -Output [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [16]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Output [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [16]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7, s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] (16) Exchange -Input [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: hashpartitioning(cast(ss_ticket_number#5 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_customer_sk#3 as bigint), 5), true, [id=#20] +Input [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Arguments: hashpartitioning(cast(ss_ticket_number#7 as bigint), cast(ss_item_sk#4 as bigint), cast(ss_customer_sk#5 as bigint), 5), true, [id=#20] (17) Sort [codegen id : 4] -Input [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: [cast(ss_ticket_number#5 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST, cast(ss_customer_sk#3 as bigint) ASC NULLS FIRST], false, 0 +Input [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Arguments: [cast(ss_ticket_number#7 as bigint) ASC NULLS FIRST, cast(ss_item_sk#4 as bigint) ASC NULLS FIRST, cast(ss_customer_sk#5 as bigint) ASC NULLS FIRST], false, 0 -(18) Scan parquet default.store_returns -Output [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct - -(19) ColumnarToRow [codegen id : 6] -Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] - -(20) Filter [codegen id : 6] -Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -Condition : (((isnotnull(sr_ticket_number#24) AND isnotnull(sr_item_sk#22)) AND isnotnull(sr_customer_sk#23)) AND isnotnull(sr_returned_date_sk#21)) - -(21) Scan parquet default.date_dim -Output [3]: [d_date_sk#25, d_year#26, d_moy#27] +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#21, d_year#22, d_moy#23] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +(19) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] -(23) Filter [codegen id : 5] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] -Condition : ((((isnotnull(d_year#26) AND isnotnull(d_moy#27)) AND (d_year#26 = 2001)) AND (d_moy#27 = 8)) AND isnotnull(d_date_sk#25)) +(20) Filter [codegen id : 5] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +Condition : ((((isnotnull(d_year#22) AND isnotnull(d_moy#23)) AND (d_year#22 = 2001)) AND (d_moy#23 = 8)) AND isnotnull(d_date_sk#21)) + +(21) Project [codegen id : 5] +Output [1]: [d_date_sk#21] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] + +(22) BroadcastExchange +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(23) Scan parquet default.store_returns +Output [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct -(24) Project [codegen id : 5] -Output [1]: [d_date_sk#25] -Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +(24) ColumnarToRow +Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -(25) BroadcastExchange -Input [1]: [d_date_sk#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] +(25) Filter +Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Condition : (((isnotnull(sr_ticket_number#28) AND isnotnull(sr_item_sk#26)) AND isnotnull(sr_customer_sk#27)) AND isnotnull(sr_returned_date_sk#25)) (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#21] -Right keys [1]: [cast(d_date_sk#25 as bigint)] +Left keys [1]: [cast(d_date_sk#21 as bigint)] +Right keys [1]: [sr_returned_date_sk#25] Join condition: None (27) Project [codegen id : 6] -Output [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -Input [5]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, d_date_sk#25] +Output [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Input [5]: [d_date_sk#21, sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] (28) Exchange -Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -Arguments: hashpartitioning(sr_ticket_number#24, sr_item_sk#22, sr_customer_sk#23, 5), true, [id=#29] +Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Arguments: hashpartitioning(sr_ticket_number#28, sr_item_sk#26, sr_customer_sk#27, 5), true, [id=#29] (29) Sort [codegen id : 7] -Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -Arguments: [sr_ticket_number#24 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_customer_sk#23 ASC NULLS FIRST], false, 0 +Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Arguments: [sr_ticket_number#28 ASC NULLS FIRST, sr_item_sk#26 ASC NULLS FIRST, sr_customer_sk#27 ASC NULLS FIRST], false, 0 (30) SortMergeJoin [codegen id : 8] -Left keys [3]: [cast(ss_ticket_number#5 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_customer_sk#3 as bigint)] -Right keys [3]: [sr_ticket_number#24, sr_item_sk#22, sr_customer_sk#23] +Left keys [3]: [cast(ss_ticket_number#7 as bigint), cast(ss_item_sk#4 as bigint), cast(ss_customer_sk#5 as bigint)] +Right keys [3]: [sr_ticket_number#28, sr_item_sk#26, sr_customer_sk#27] Join condition: None (31) Project [codegen id : 8] -Output [12]: [ss_sold_date_sk#1, sr_returned_date_sk#21, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [18]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] +Output [12]: [ss_sold_date_sk#3, sr_returned_date_sk#25, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [18]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] (32) HashAggregate [codegen id : 8] -Input [12]: [ss_sold_date_sk#1, sr_returned_date_sk#21, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [12]: [ss_sold_date_sk#3, sr_returned_date_sk#25, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [partial_sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] +Functions [5]: [partial_sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] Aggregate Attributes [5]: [sum#30, sum#31, sum#32, sum#33, sum#34] Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#35, sum#36, sum#37, sum#38, sum#39] @@ -188,9 +188,9 @@ Arguments: hashpartitioning(s_store_name#9, s_company_id#10, s_street_number#11, (34) HashAggregate [codegen id : 9] Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#35, sum#36, sum#37, sum#38, sum#39] Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] -Aggregate Attributes [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45] -Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41 AS 30 days #46, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42 AS 31 - 60 days #47, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43 AS 61 - 90 days #48, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44 AS 91 - 120 days #49, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45 AS >120 days #50] +Functions [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] +Aggregate Attributes [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45] +Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41 AS 30 days #46, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42 AS 31 - 60 days #47, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43 AS 61 - 90 days #48, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44 AS 91 - 120 days #49, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45 AS >120 days #50] (35) TakeOrderedAndProject Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, 30 days #46, 31 - 60 days #47, 61 - 90 days #48, 91 - 120 days #49, >120 days #50] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt index be11a69176810..c2a83cc988752 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt @@ -16,11 +16,7 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,6 +24,10 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk] + Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -42,11 +42,7 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s Exchange [sr_ticket_number,sr_item_sk,sr_customer_sk] #5 WholeStageCodegen (6) Project [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Filter [sr_ticket_number,sr_item_sk,sr_customer_sk,sr_returned_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] + BroadcastHashJoin [d_date_sk,sr_returned_date_sk] InputAdapter BroadcastExchange #6 WholeStageCodegen (5) @@ -55,3 +51,7 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [sr_ticket_number,sr_item_sk,sr_customer_sk,sr_returned_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt index d7a8c103285cb..4d30585e76aa1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.item (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 1)) AND isnotnull(i_item_sk#4)) +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -(8) BroadcastExchange -Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] +Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] -Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] +Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] +Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt index 8ed500d84390c..0237860edb955 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt index f8a6d7de0c4ea..a59cb55a4436c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.store_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.item -Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -(3) Filter [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] -Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,reference,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) -(4) Project [codegen id : 1] -Output [2]: [i_item_sk#1, i_manufact_id#5] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +(4) Scan parquet default.item +Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [i_item_sk#1, i_manufact_id#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(5) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] +Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,reference,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) -(7) ColumnarToRow -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +(7) Project [codegen id : 1] +Output [2]: [i_item_sk#5, i_manufact_id#9] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] -(8) Filter -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Condition : ((isnotnull(ss_item_sk#12) AND isnotnull(ss_sold_date_sk#11)) AND isnotnull(ss_store_sk#13)) +(8) BroadcastExchange +Input [2]: [i_item_sk#5, i_manufact_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#12] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [i_manufact_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] -Input [6]: [i_item_sk#1, i_manufact_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manufact_id#9] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manufact_id#9] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#13] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [i_manufact_id#5, ss_sold_date_sk#11, ss_sales_price#14] -Input [5]: [i_manufact_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] +Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manufact_id#9] +Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manufact_id#9, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_qoy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_qoy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#11] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manufact_id#5, ss_sales_price#14, d_qoy#19] -Input [5]: [i_manufact_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_qoy#19] +Output [3]: [i_manufact_id#9, ss_sales_price#4, d_qoy#19] +Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manufact_id#9, d_date_sk#17, d_qoy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manufact_id#5, ss_sales_price#14, d_qoy#19] -Keys [2]: [i_manufact_id#5, d_qoy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] +Input [3]: [i_manufact_id#9, ss_sales_price#4, d_qoy#19] +Keys [2]: [i_manufact_id#9, d_qoy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manufact_id#5, d_qoy#19, sum#22] +Results [3]: [i_manufact_id#9, d_qoy#19, sum#22] (25) Exchange -Input [3]: [i_manufact_id#5, d_qoy#19, sum#22] -Arguments: hashpartitioning(i_manufact_id#5, d_qoy#19, 5), true, [id=#23] +Input [3]: [i_manufact_id#9, d_qoy#19, sum#22] +Arguments: hashpartitioning(i_manufact_id#9, d_qoy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manufact_id#5, d_qoy#19, sum#22] -Keys [2]: [i_manufact_id#5, d_qoy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] -Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] +Input [3]: [i_manufact_id#9, d_qoy#19, sum#22] +Keys [2]: [i_manufact_id#9, d_qoy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] +Results [3]: [i_manufact_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manufact_id#5, 5), true, [id=#27] +Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manufact_id#9, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] -Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 +Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] +Arguments: [i_manufact_id#9 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#28], [i_manufact_id#5] +Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manufact_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#28], [i_manufact_id#9] (30) Filter [codegen id : 7] -Input [4]: [i_manufact_id#5, sum_sales#25, _w0#26, avg_quarterly_sales#28] +Input [4]: [i_manufact_id#9, sum_sales#25, _w0#26, avg_quarterly_sales#28] Condition : (CASE WHEN (avg_quarterly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_quarterly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] -Input [4]: [i_manufact_id#5, sum_sales#25, _w0#26, avg_quarterly_sales#28] +Output [3]: [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] +Input [4]: [i_manufact_id#9, sum_sales#25, _w0#26, avg_quarterly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] -Arguments: 100, [avg_quarterly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] +Input [3]: [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] +Arguments: 100, [avg_quarterly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST, i_manufact_id#9 ASC NULLS FIRST], [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt index ca187424ad900..d5025aba81f39 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt @@ -16,10 +16,14 @@ TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] Project [i_manufact_id,ss_sales_price,d_qoy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_manufact_id,ss_sold_date_sk,ss_sales_price] + Project [ss_sold_date_sk,ss_sales_price,i_manufact_id] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [i_manufact_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,10 +32,6 @@ TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt index a1257cd292e48..9ad695c84ff3c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.item (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,28), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 28)) AND isnotnull(i_item_sk#4)) +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 28)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -(8) BroadcastExchange -Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] +Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [1]: [d_date_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Input [5]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9] +Output [3]: [ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Input [5]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9] (18) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#3, i_brand_id#5, i_brand#6] -Keys [2]: [i_brand#6, i_brand_id#5] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [3]: [ss_ext_sales_price#8, i_brand_id#2, i_brand#3] +Keys [2]: [i_brand#3, i_brand_id#2] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] Aggregate Attributes [1]: [sum#13] -Results [3]: [i_brand#6, i_brand_id#5, sum#14] +Results [3]: [i_brand#3, i_brand_id#2, sum#14] (19) Exchange -Input [3]: [i_brand#6, i_brand_id#5, sum#14] -Arguments: hashpartitioning(i_brand#6, i_brand_id#5, 5), true, [id=#15] +Input [3]: [i_brand#3, i_brand_id#2, sum#14] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [3]: [i_brand#6, i_brand_id#5, sum#14] -Keys [2]: [i_brand#6, i_brand_id#5] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [3]: [i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] +Input [3]: [i_brand#3, i_brand_id#2, sum#14] +Keys [2]: [i_brand#3, i_brand_id#2] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] +Results [3]: [i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [3]: [brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt index b0d0e0d809441..1258d6a6ba680 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [ext_price,brand_id,brand] HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt index d0d64721100c3..478aec51a91ae 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : :- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.catalog_sales (33) - : : : +- ReusedExchange (36) + : : : +- * BroadcastHashJoin Inner BuildLeft (37) + : : : :- ReusedExchange (33) + : : : +- * Filter (36) + : : : +- * ColumnarToRow (35) + : : : +- Scan parquet default.catalog_sales (34) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,11 +59,11 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildRight (52) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.web_sales (48) - : : +- ReusedExchange (51) + : : +- * BroadcastHashJoin Inner BuildLeft (52) + : : :- ReusedExchange (48) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.web_sales (49) : +- ReusedExchange (54) +- ReusedExchange (57) @@ -216,31 +216,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] -(33) Scan parquet default.catalog_sales +(33) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +(34) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] +(35) ColumnarToRow Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(35) Filter [codegen id : 11] +(36) Filter Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) -(36) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_sold_date_sk#23] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#5] +Right keys [1]: [cs_sold_date_sk#23] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] +Input [5]: [d_date_sk#5, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] (39) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) Scan parquet default.web_sales +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +(49) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(49) ColumnarToRow [codegen id : 17] +(50) ColumnarToRow Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(50) Filter [codegen id : 17] +(51) Filter Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) -(51) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#32] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#5] +Right keys [1]: [ws_sold_date_sk#32] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] +Input [5]: [d_date_sk#5, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt index 5825c6f6e757a..e31ddf0e7f8e7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt @@ -66,13 +66,13 @@ TakeOrderedAndProject [total_sales,i_item_id] Project [cs_item_sk,cs_ext_sales_price] BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [total_sales,i_item_id] Project [ws_item_sk,ws_ext_sales_price] BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt index 9ed3db41b547c..7ec2dbff4bc0f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt @@ -24,14 +24,14 @@ TakeOrderedAndProject (58) : : : +- * Project (15) : : : +- * BroadcastHashJoin Inner BuildRight (14) : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.catalog_sales (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : :- BroadcastExchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.catalog_sales (5) : : : +- BroadcastExchange (13) : : : +- * Filter (12) : : : +- * ColumnarToRow (11) @@ -59,46 +59,46 @@ TakeOrderedAndProject (58) +- ReusedExchange (49) -(1) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_call_center_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] - -(3) Filter [codegen id : 3] -Input [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] -Condition : ((isnotnull(cs_item_sk#3) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_call_center_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((d_year#2 = 1999) OR ((d_year#2 = 1998) AND (d_moy#3 = 12))) OR ((d_year#2 = 2000) AND (d_moy#3 = 1))) AND isnotnull(d_date_sk#1)) + +(4) BroadcastExchange +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] + +(5) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -Condition : ((((d_year#6 = 1999) OR ((d_year#6 = 1998) AND (d_moy#7 = 12))) OR ((d_year#6 = 2000) AND (d_moy#7 = 1))) AND isnotnull(d_date_sk#5)) +(6) ColumnarToRow +Input [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] -(7) BroadcastExchange -Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] +(7) Filter +Input [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +Condition : ((isnotnull(cs_item_sk#7) AND isnotnull(cs_sold_date_sk#5)) AND isnotnull(cs_call_center_sk#6)) (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#5] Join condition: None (9) Project [codegen id : 3] -Output [5]: [cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7] -Input [7]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_date_sk#5, d_year#6, d_moy#7] +Output [5]: [d_year#2, d_moy#3, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +Input [7]: [d_date_sk#1, d_year#2, d_moy#3, cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] (10) Scan parquet default.call_center Output [2]: [cc_call_center_sk#9, cc_name#10] @@ -119,21 +119,21 @@ Input [2]: [cc_call_center_sk#9, cc_name#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_call_center_sk#2] +Left keys [1]: [cs_call_center_sk#6] Right keys [1]: [cc_call_center_sk#9] Join condition: None (15) Project [codegen id : 3] -Output [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] -Input [7]: [cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_call_center_sk#9, cc_name#10] +Output [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] +Input [7]: [d_year#2, d_moy#3, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8, cc_call_center_sk#9, cc_name#10] (16) Exchange -Input [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] -Arguments: hashpartitioning(cs_item_sk#3, 5), true, [id=#12] +Input [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] +Arguments: hashpartitioning(cs_item_sk#7, 5), true, [id=#12] (17) Sort [codegen id : 4] -Input [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] -Arguments: [cs_item_sk#3 ASC NULLS FIRST], false, 0 +Input [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] +Arguments: [cs_item_sk#7 ASC NULLS FIRST], false, 0 (18) Scan parquet default.item Output [3]: [i_item_sk#13, i_brand#14, i_category#15] @@ -158,70 +158,70 @@ Input [3]: [i_item_sk#13, i_brand#14, i_category#15] Arguments: [i_item_sk#13 ASC NULLS FIRST], false, 0 (23) SortMergeJoin [codegen id : 7] -Left keys [1]: [cs_item_sk#3] +Left keys [1]: [cs_item_sk#7] Right keys [1]: [i_item_sk#13] Join condition: None (24) Project [codegen id : 7] -Output [6]: [i_brand#14, i_category#15, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] -Input [8]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10, i_item_sk#13, i_brand#14, i_category#15] +Output [6]: [i_brand#14, i_category#15, cs_sales_price#8, d_year#2, d_moy#3, cc_name#10] +Input [8]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10, i_item_sk#13, i_brand#14, i_category#15] (25) HashAggregate [codegen id : 7] -Input [6]: [i_brand#14, i_category#15, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] -Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7] -Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#4))] +Input [6]: [i_brand#14, i_category#15, cs_sales_price#8, d_year#2, d_moy#3, cc_name#10] +Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#8))] Aggregate Attributes [1]: [sum#17] -Results [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] +Results [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] (26) Exchange -Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] -Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, 5), true, [id=#19] +Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] +Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, 5), true, [id=#19] (27) HashAggregate [codegen id : 8] -Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] -Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7] -Functions [1]: [sum(UnscaledValue(cs_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#4))#20] -Results [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#20,17,2) AS _w0#22] +Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] +Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3] +Functions [1]: [sum(UnscaledValue(cs_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#8))#20] +Results [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#20,17,2) AS _w0#22] (28) Exchange -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] -Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#6, 5), true, [id=#23] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] +Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#2, 5), true, [id=#23] (29) Sort [codegen id : 9] -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] -Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST], false, 0 +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] +Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST], false, 0 (30) Window -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] -Arguments: [avg(_w0#22) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#6, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#15, i_brand#14, cc_name#10, d_year#6] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] +Arguments: [avg(_w0#22) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#2, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#15, i_brand#14, cc_name#10, d_year#2] (31) Project [codegen id : 10] -Output [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22, avg_monthly_sales#24] +Output [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22, avg_monthly_sales#24] (32) Exchange -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, 5), true, [id=#25] (33) Sort [codegen id : 11] -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] -Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST], false, 0 +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] +Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST], false, 0 (34) Window -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] -Arguments: [rank(d_year#6, d_moy#7) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#15, i_brand#14, cc_name#10], [d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] +Arguments: [rank(d_year#2, d_moy#3) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#15, i_brand#14, cc_name#10], [d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST] (35) Filter [codegen id : 12] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] -Condition : (((((isnotnull(d_year#6) AND isnotnull(avg_monthly_sales#24)) AND (d_year#6 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CASE WHEN (avg_monthly_sales#24 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000)) AND isnotnull(rn#26)) +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] +Condition : (((((isnotnull(d_year#2) AND isnotnull(avg_monthly_sales#24)) AND (d_year#2 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CASE WHEN (avg_monthly_sales#24 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000)) AND isnotnull(rn#26)) (36) Exchange -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, rn#26, 5), true, [id=#27] (37) Sort [codegen id : 13] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, rn#26 ASC NULLS FIRST], false, 0 (38) ReusedExchange [Reuses operator id: 26] @@ -230,9 +230,9 @@ Output [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum#33] (39) HashAggregate [codegen id : 21] Input [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum#33] Keys [5]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32] -Functions [1]: [sum(UnscaledValue(cs_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#4))#34] -Results [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#34,17,2) AS sum_sales#35] +Functions [1]: [sum(UnscaledValue(cs_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#8))#34] +Results [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#34,17,2) AS sum_sales#35] (40) Exchange Input [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum_sales#35] @@ -268,8 +268,8 @@ Right keys [4]: [i_category#28, i_brand#29, cc_name#30, (rn#37 + 1)] Join condition: None (48) Project [codegen id : 25] -Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] -Input [13]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#28, i_brand#29, cc_name#30, sum_sales#35, rn#37] +Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] +Input [13]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#28, i_brand#29, cc_name#30, sum_sales#35, rn#37] (49) ReusedExchange [Reuses operator id: 40] Output [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] @@ -304,10 +304,10 @@ Right keys [4]: [i_category#39, i_brand#40, cc_name#41, (rn#45 - 1)] Join condition: None (57) Project [codegen id : 37] -Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] -Input [14]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] +Input [14]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] (58) TakeOrderedAndProject -Input [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] -Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST], [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Input [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST], [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt index 852e1b085054d..c8ef671fcf865 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt @@ -41,14 +41,10 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_ InputAdapter Exchange [cs_item_sk] #5 WholeStageCodegen (3) - Project [cs_item_sk,cs_sales_price,d_year,d_moy,cc_name] + Project [d_year,d_moy,cs_item_sk,cs_sales_price,cc_name] BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] - Project [cs_call_center_sk,cs_item_sk,cs_sales_price,d_year,d_moy] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_item_sk,cs_sold_date_sk,cs_call_center_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_call_center_sk,cs_item_sk,cs_sales_price] + Project [d_year,d_moy,cs_call_center_sk,cs_item_sk,cs_sales_price] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] InputAdapter BroadcastExchange #6 WholeStageCodegen (1) @@ -56,6 +52,10 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [cs_item_sk,cs_sold_date_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_call_center_sk,cs_item_sk,cs_sales_price] InputAdapter BroadcastExchange #7 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt index 675cff99ad729..9cfbea65c847b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt @@ -43,12 +43,12 @@ TakeOrderedAndProject (50) : +- Exchange (32) : +- * Filter (31) : +- * ColumnarToRow (30) - : +- Scan parquet default.customer_address (29) + : +- Scan parquet default.customer (29) +- * Sort (38) +- Exchange (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.customer (34) + +- Scan parquet default.customer_address (34) (1) Scan parquet default.store_sales @@ -180,93 +180,93 @@ Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#22] Input [1]: [ss_customer_sk#3] Arguments: [ss_customer_sk#3 ASC NULLS FIRST], false, 0 -(29) Scan parquet default.customer_address -Output [2]: [ca_address_sk#23, ca_state#24] +(29) Scan parquet default.customer +Output [2]: [c_customer_sk#23, c_current_addr_sk#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct (30) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#23, ca_state#24] +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] (31) Filter [codegen id : 7] -Input [2]: [ca_address_sk#23, ca_state#24] -Condition : isnotnull(ca_address_sk#23) +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] +Condition : (isnotnull(c_current_addr_sk#24) AND isnotnull(c_customer_sk#23)) (32) Exchange -Input [2]: [ca_address_sk#23, ca_state#24] -Arguments: hashpartitioning(ca_address_sk#23, 5), true, [id=#25] +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] +Arguments: hashpartitioning(c_current_addr_sk#24, 5), true, [id=#25] (33) Sort [codegen id : 8] -Input [2]: [ca_address_sk#23, ca_state#24] -Arguments: [ca_address_sk#23 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] +Arguments: [c_current_addr_sk#24 ASC NULLS FIRST], false, 0 -(34) Scan parquet default.customer -Output [2]: [c_customer_sk#26, c_current_addr_sk#27] +(34) Scan parquet default.customer_address +Output [2]: [ca_address_sk#26, ca_state#27] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (35) ColumnarToRow [codegen id : 9] -Input [2]: [c_customer_sk#26, c_current_addr_sk#27] +Input [2]: [ca_address_sk#26, ca_state#27] (36) Filter [codegen id : 9] -Input [2]: [c_customer_sk#26, c_current_addr_sk#27] -Condition : (isnotnull(c_current_addr_sk#27) AND isnotnull(c_customer_sk#26)) +Input [2]: [ca_address_sk#26, ca_state#27] +Condition : isnotnull(ca_address_sk#26) (37) Exchange -Input [2]: [c_customer_sk#26, c_current_addr_sk#27] -Arguments: hashpartitioning(c_current_addr_sk#27, 5), true, [id=#28] +Input [2]: [ca_address_sk#26, ca_state#27] +Arguments: hashpartitioning(ca_address_sk#26, 5), true, [id=#28] (38) Sort [codegen id : 10] -Input [2]: [c_customer_sk#26, c_current_addr_sk#27] -Arguments: [c_current_addr_sk#27 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#26, ca_state#27] +Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 11] -Left keys [1]: [ca_address_sk#23] -Right keys [1]: [c_current_addr_sk#27] +Left keys [1]: [c_current_addr_sk#24] +Right keys [1]: [ca_address_sk#26] Join condition: None (40) Project [codegen id : 11] -Output [2]: [ca_state#24, c_customer_sk#26] -Input [4]: [ca_address_sk#23, ca_state#24, c_customer_sk#26, c_current_addr_sk#27] +Output [2]: [c_customer_sk#23, ca_state#27] +Input [4]: [c_customer_sk#23, c_current_addr_sk#24, ca_address_sk#26, ca_state#27] (41) Exchange -Input [2]: [ca_state#24, c_customer_sk#26] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#29] +Input [2]: [c_customer_sk#23, ca_state#27] +Arguments: hashpartitioning(c_customer_sk#23, 5), true, [id=#29] (42) Sort [codegen id : 12] -Input [2]: [ca_state#24, c_customer_sk#26] -Arguments: [c_customer_sk#26 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#23, ca_state#27] +Arguments: [c_customer_sk#23 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 13] Left keys [1]: [ss_customer_sk#3] -Right keys [1]: [c_customer_sk#26] +Right keys [1]: [c_customer_sk#23] Join condition: None (44) Project [codegen id : 13] -Output [1]: [ca_state#24] -Input [3]: [ss_customer_sk#3, ca_state#24, c_customer_sk#26] +Output [1]: [ca_state#27] +Input [3]: [ss_customer_sk#3, c_customer_sk#23, ca_state#27] (45) HashAggregate [codegen id : 13] -Input [1]: [ca_state#24] -Keys [1]: [ca_state#24] +Input [1]: [ca_state#27] +Keys [1]: [ca_state#27] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#30] -Results [2]: [ca_state#24, count#31] +Results [2]: [ca_state#27, count#31] (46) Exchange -Input [2]: [ca_state#24, count#31] -Arguments: hashpartitioning(ca_state#24, 5), true, [id=#32] +Input [2]: [ca_state#27, count#31] +Arguments: hashpartitioning(ca_state#27, 5), true, [id=#32] (47) HashAggregate [codegen id : 14] -Input [2]: [ca_state#24, count#31] -Keys [1]: [ca_state#24] +Input [2]: [ca_state#27, count#31] +Keys [1]: [ca_state#27] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#33] -Results [3]: [ca_state#24 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36] +Results [3]: [ca_state#27 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36] (48) Filter [codegen id : 14] Input [3]: [state#34, cnt#35, count(1)#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt index 73d42163240f0..4422c8de3ff9d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt @@ -71,25 +71,25 @@ TakeOrderedAndProject [cnt,state] InputAdapter Exchange [c_customer_sk] #8 WholeStageCodegen (11) - Project [ca_state,c_customer_sk] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_customer_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter WholeStageCodegen (8) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #9 + Exchange [c_current_addr_sk] #9 WholeStageCodegen (7) - Filter [ca_address_sk] + Filter [c_current_addr_sk,c_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (10) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #10 + Exchange [ca_address_sk] #10 WholeStageCodegen (9) - Filter [c_current_addr_sk,c_customer_sk] + Filter [ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + Scan parquet default.customer_address [ca_address_sk,ca_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt index f838f8f1a18af..41439a5679f77 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : :- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.catalog_sales (33) - : : : +- ReusedExchange (36) + : : : +- * BroadcastHashJoin Inner BuildLeft (37) + : : : :- ReusedExchange (33) + : : : +- * Filter (36) + : : : +- * ColumnarToRow (35) + : : : +- Scan parquet default.catalog_sales (34) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,11 +59,11 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildRight (52) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.web_sales (48) - : : +- ReusedExchange (51) + : : +- * BroadcastHashJoin Inner BuildLeft (52) + : : :- ReusedExchange (48) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.web_sales (49) : +- ReusedExchange (54) +- ReusedExchange (57) @@ -216,31 +216,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] -(33) Scan parquet default.catalog_sales +(33) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +(34) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] +(35) ColumnarToRow Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(35) Filter [codegen id : 11] +(36) Filter Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) -(36) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_sold_date_sk#23] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#5] +Right keys [1]: [cs_sold_date_sk#23] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] +Input [5]: [d_date_sk#5, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] (39) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) Scan parquet default.web_sales +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +(49) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(49) ColumnarToRow [codegen id : 17] +(50) ColumnarToRow Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(50) Filter [codegen id : 17] +(51) Filter Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) -(51) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#32] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#5] +Right keys [1]: [ws_sold_date_sk#32] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] +Input [5]: [d_date_sk#5, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt index fb9e4e50775dd..3ff7b49a2246a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt @@ -66,13 +66,13 @@ TakeOrderedAndProject [i_item_id,total_sales] Project [cs_item_sk,cs_ext_sales_price] BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [i_item_id,total_sales] Project [ws_item_sk,ws_ext_sales_price] BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt index 58a60763b2b57..20e9e1c3c9af7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt @@ -60,11 +60,11 @@ TakeOrderedAndProject (69) : :- * Project (56) : : +- * BroadcastHashJoin Inner BuildRight (55) : : :- * Project (53) - : : : +- * BroadcastHashJoin Inner BuildRight (52) - : : : :- * Filter (50) - : : : : +- * ColumnarToRow (49) - : : : : +- Scan parquet default.store_sales (48) - : : : +- ReusedExchange (51) + : : : +- * BroadcastHashJoin Inner BuildLeft (52) + : : : :- ReusedExchange (48) + : : : +- * Filter (51) + : : : +- * ColumnarToRow (50) + : : : +- Scan parquet default.store_sales (49) : : +- ReusedExchange (54) : +- ReusedExchange (57) +- ReusedExchange (60) @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#31] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#31,17,2) AS promotions#32] -(48) Scan parquet default.store_sales +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + +(49) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(49) ColumnarToRow [codegen id : 14] +(50) ColumnarToRow Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -(50) Filter [codegen id : 14] +(51) Filter Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_item_sk#2)) -(51) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#7] - (52) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#7] +Right keys [1]: [ss_sold_date_sk#1] Join condition: None (53) Project [codegen id : 14] Output [4]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, d_date_sk#7] +Input [6]: [d_date_sk#7, ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [i_item_sk#11] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt index 87f2b3ae03746..7d24485855de2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt @@ -86,13 +86,13 @@ TakeOrderedAndProject [promotions,total,(CAST((CAST(CAST(promotions AS DECIMAL(1 Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 Filter [ss_store_sk,ss_sold_date_sk,ss_customer_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [i_item_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt index 7de8d8780ad42..0268ebf5a5c60 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.store_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.item -Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,refernece,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -(3) Filter [codegen id : 1] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,refernece,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) -(4) Project [codegen id : 1] -Output [2]: [i_item_sk#1, i_manager_id#5] -Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +(4) Scan parquet default.item +Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,refernece,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [i_item_sk#1, i_manager_id#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(5) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,refernece,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) -(7) ColumnarToRow -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +(7) Project [codegen id : 1] +Output [2]: [i_item_sk#5, i_manager_id#9] +Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -(8) Filter -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -Condition : ((isnotnull(ss_item_sk#12) AND isnotnull(ss_sold_date_sk#11)) AND isnotnull(ss_store_sk#13)) +(8) BroadcastExchange +Input [2]: [i_item_sk#5, i_manager_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#12] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] -Input [6]: [i_item_sk#1, i_manager_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manager_id#9] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#13] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14] -Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] +Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9] +Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_moy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_moy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#11] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] -Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_moy#19] +Output [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] +Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9, d_date_sk#17, d_moy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] -Keys [2]: [i_manager_id#5, d_moy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] +Input [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] +Keys [2]: [i_manager_id#9, d_moy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manager_id#5, d_moy#19, sum#22] +Results [3]: [i_manager_id#9, d_moy#19, sum#22] (25) Exchange -Input [3]: [i_manager_id#5, d_moy#19, sum#22] -Arguments: hashpartitioning(i_manager_id#5, d_moy#19, 5), true, [id=#23] +Input [3]: [i_manager_id#9, d_moy#19, sum#22] +Arguments: hashpartitioning(i_manager_id#9, d_moy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manager_id#5, d_moy#19, sum#22] -Keys [2]: [i_manager_id#5, d_moy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] -Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] +Input [3]: [i_manager_id#9, d_moy#19, sum#22] +Keys [2]: [i_manager_id#9, d_moy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] +Results [3]: [i_manager_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manager_id#5, 5), true, [id=#27] +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manager_id#9, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: [i_manager_id#9 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#5] +Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#9] (30) Filter [codegen id : 7] -Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] +Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] Condition : (CASE WHEN (avg_monthly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] -Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] +Output [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] -Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Input [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Arguments: 100, [i_manager_id#9 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt index 9ae026f0f750d..16010fe2f5ac3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt @@ -16,10 +16,14 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] Project [i_manager_id,ss_sales_price,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_manager_id,ss_sold_date_sk,ss_sales_price] + Project [ss_sold_date_sk,ss_sales_price,i_manager_id] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [i_manager_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,10 +32,6 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt index 24a142c70d774..23ddb3de42ae5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt @@ -7,34 +7,34 @@ TakeOrderedAndProject (45) : +- * Project (35) : +- * BroadcastHashJoin Inner BuildRight (34) : :- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- BroadcastExchange (27) + : : +- * BroadcastHashJoin Inner BuildLeft (28) + : : :- BroadcastExchange (17) + : : : +- * HashAggregate (16) + : : : +- Exchange (15) + : : : +- * HashAggregate (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Filter (27) : : +- * HashAggregate (26) : : +- Exchange (25) : : +- * HashAggregate (24) - : : +- * HashAggregate (23) - : : +- Exchange (22) - : : +- * HashAggregate (21) - : : +- * Project (20) - : : +- * BroadcastHashJoin Inner BuildRight (19) - : : :- * Filter (17) - : : : +- * ColumnarToRow (16) - : : : +- Scan parquet default.store_sales (15) - : : +- ReusedExchange (18) + : : +- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.store_sales (18) + : : +- ReusedExchange (21) : +- BroadcastExchange (33) : +- * Filter (32) : +- * ColumnarToRow (31) @@ -50,7 +50,7 @@ TakeOrderedAndProject (45) Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 2] @@ -58,7 +58,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] (3) Filter [codegen id : 2] Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#5, d_month_seq#6] @@ -102,91 +102,91 @@ Results [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Arguments: hashpartitioning(ss_store_sk#3, ss_item_sk#2, 5), true, [id=#10] -(13) HashAggregate [codegen id : 8] +(13) HashAggregate [codegen id : 3] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Keys [2]: [ss_store_sk#3, ss_item_sk#2] Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#11] -Results [3]: [ss_store_sk#3, ss_item_sk#2, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] - -(14) Filter [codegen id : 8] -Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] -Condition : isnotnull(revenue#12) - -(15) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Results [2]: [ss_store_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] + +(14) HashAggregate [codegen id : 3] +Input [2]: [ss_store_sk#3, revenue#12] +Keys [1]: [ss_store_sk#3] +Functions [1]: [partial_avg(revenue#12)] +Aggregate Attributes [2]: [sum#13, count#14] +Results [3]: [ss_store_sk#3, sum#15, count#16] + +(15) Exchange +Input [3]: [ss_store_sk#3, sum#15, count#16] +Arguments: hashpartitioning(ss_store_sk#3, 5), true, [id=#17] + +(16) HashAggregate [codegen id : 4] +Input [3]: [ss_store_sk#3, sum#15, count#16] +Keys [1]: [ss_store_sk#3] +Functions [1]: [avg(revenue#12)] +Aggregate Attributes [1]: [avg(revenue#12)#18] +Results [2]: [ss_store_sk#3, avg(revenue#12)#18 AS ave#19] + +(17) BroadcastExchange +Input [2]: [ss_store_sk#3, ave#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(18) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(16) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +(19) ColumnarToRow [codegen id : 6] +Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -(17) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Condition : (isnotnull(ss_sold_date_sk#13) AND isnotnull(ss_store_sk#15)) +(20) Filter [codegen id : 6] +Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Condition : ((isnotnull(ss_sold_date_sk#21) AND isnotnull(ss_store_sk#23)) AND isnotnull(ss_item_sk#22)) -(18) ReusedExchange [Reuses operator id: 8] +(21) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#5] -(19) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#13] +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#21] Right keys [1]: [d_date_sk#5] Join condition: None -(20) Project [codegen id : 4] -Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Input [5]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, d_date_sk#5] - -(21) HashAggregate [codegen id : 4] -Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -Keys [2]: [ss_store_sk#15, ss_item_sk#14] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] -Aggregate Attributes [1]: [sum#17] -Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] - -(22) Exchange -Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] -Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), true, [id=#19] - -(23) HashAggregate [codegen id : 5] -Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] -Keys [2]: [ss_store_sk#15, ss_item_sk#14] -Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#20] -Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#20,17,2) AS revenue#21] - -(24) HashAggregate [codegen id : 5] -Input [2]: [ss_store_sk#15, revenue#21] -Keys [1]: [ss_store_sk#15] -Functions [1]: [partial_avg(revenue#21)] -Aggregate Attributes [2]: [sum#22, count#23] -Results [3]: [ss_store_sk#15, sum#24, count#25] +(23) Project [codegen id : 6] +Output [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Input [5]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24, d_date_sk#5] + +(24) HashAggregate [codegen id : 6] +Input [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Keys [2]: [ss_store_sk#23, ss_item_sk#22] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#24))] +Aggregate Attributes [1]: [sum#25] +Results [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] (25) Exchange -Input [3]: [ss_store_sk#15, sum#24, count#25] -Arguments: hashpartitioning(ss_store_sk#15, 5), true, [id=#26] +Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +Arguments: hashpartitioning(ss_store_sk#23, ss_item_sk#22, 5), true, [id=#27] -(26) HashAggregate [codegen id : 6] -Input [3]: [ss_store_sk#15, sum#24, count#25] -Keys [1]: [ss_store_sk#15] -Functions [1]: [avg(revenue#21)] -Aggregate Attributes [1]: [avg(revenue#21)#27] -Results [2]: [ss_store_sk#15, avg(revenue#21)#27 AS ave#28] +(26) HashAggregate +Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +Keys [2]: [ss_store_sk#23, ss_item_sk#22] +Functions [1]: [sum(UnscaledValue(ss_sales_price#24))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#24))#28] +Results [3]: [ss_store_sk#23, ss_item_sk#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#24))#28,17,2) AS revenue#29] -(27) BroadcastExchange -Input [2]: [ss_store_sk#15, ave#28] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +(27) Filter +Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] +Condition : isnotnull(revenue#29) (28) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [ss_store_sk#15] -Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true)) +Right keys [1]: [ss_store_sk#23] +Join condition: (cast(revenue#29 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#19)), DecimalType(23,7), true)) (29) Project [codegen id : 8] -Output [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] -Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, ss_store_sk#15, ave#28] +Output [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] +Input [5]: [ss_store_sk#3, ave#19, ss_store_sk#23, ss_item_sk#22, revenue#29] (30) Scan parquet default.store Output [2]: [s_store_sk#30, s_store_name#31] @@ -207,21 +207,21 @@ Input [2]: [s_store_sk#30, s_store_name#31] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (34) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#23] Right keys [1]: [s_store_sk#30] Join condition: None (35) Project [codegen id : 8] -Output [3]: [ss_item_sk#2, revenue#12, s_store_name#31] -Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, s_store_sk#30, s_store_name#31] +Output [3]: [ss_item_sk#22, revenue#29, s_store_name#31] +Input [5]: [ss_store_sk#23, ss_item_sk#22, revenue#29, s_store_sk#30, s_store_name#31] (36) Exchange -Input [3]: [ss_item_sk#2, revenue#12, s_store_name#31] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#33] +Input [3]: [ss_item_sk#22, revenue#29, s_store_name#31] +Arguments: hashpartitioning(ss_item_sk#22, 5), true, [id=#33] (37) Sort [codegen id : 9] -Input [3]: [ss_item_sk#2, revenue#12, s_store_name#31] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [ss_item_sk#22, revenue#29, s_store_name#31] +Arguments: [ss_item_sk#22 ASC NULLS FIRST], false, 0 (38) Scan parquet default.item Output [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] @@ -246,15 +246,15 @@ Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#3 Arguments: [i_item_sk#34 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#22] Right keys [1]: [i_item_sk#34] Join condition: None (44) Project [codegen id : 12] -Output [6]: [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Input [8]: [ss_item_sk#2, revenue#12, s_store_name#31, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Output [6]: [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [8]: [ss_item_sk#22, revenue#29, s_store_name#31, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] (45) TakeOrderedAndProject -Input [6]: [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Arguments: 100, [s_store_name#31 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [6]: [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Arguments: 100, [s_store_name#31 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt index 9fc7b97cf6240..8131f63d8b98e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt @@ -12,38 +12,18 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_item_sk,revenue] BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] - Filter [revenue] - HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] - InputAdapter - Exchange [ss_store_sk,ss_item_sk] #2 - WholeStageCodegen (2) - HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] - Project [ss_item_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (6) + BroadcastExchange #2 + WholeStageCodegen (4) HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] InputAdapter - Exchange [ss_store_sk] #5 - WholeStageCodegen (5) + Exchange [ss_store_sk] #3 + WholeStageCodegen (3) HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] InputAdapter - Exchange [ss_store_sk,ss_item_sk] #6 - WholeStageCodegen (4) + Exchange [ss_store_sk,ss_item_sk] #4 + WholeStageCodegen (2) HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] Project [ss_item_sk,ss_store_sk,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -52,7 +32,27 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #6 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #5 InputAdapter BroadcastExchange #7 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt index 0ba0d4c16f75a..beef51bc58bbc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt @@ -15,15 +15,15 @@ TakeOrderedAndProject (34) : +- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.date_dim (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (19) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] - -(3) Filter [codegen id : 3] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] +(1) Scan parquet default.date_dim +Output [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] -(6) Filter [codegen id : 1] -Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] -Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] +Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [4]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5] +Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] + +(5) BroadcastExchange +Input [4]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [4]: [d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] -Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] -(8) BroadcastExchange -Input [4]: [d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] +(8) Filter +Input [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] +Condition : ((isnotnull(ss_sold_date_sk#7) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#8)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [7]: [ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] +Output [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] +Input [9]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5, ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] (11) Scan parquet default.store Output [2]: [s_store_sk#12, s_store_id#13] @@ -99,21 +99,21 @@ Input [2]: [s_store_sk#12, s_store_id#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#9] Right keys [1]: [s_store_sk#12] Join condition: None (16) Project [codegen id : 3] -Output [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] -Input [9]: [ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_sk#12, s_store_id#13] +Output [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] +Input [9]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11, s_store_sk#12, s_store_id#13] (17) Exchange -Input [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#15] +Input [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] +Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#15] (18) Sort [codegen id : 4] -Input [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +Input [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] @@ -138,22 +138,22 @@ Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name# Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#8] Right keys [1]: [i_item_sk#16] Join condition: None (25) Project [codegen id : 7] -Output [10]: [ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13] -Input [12]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Output [10]: [ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13] +Input [12]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] (26) Expand [codegen id : 7] -Input [10]: [ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13] -Arguments: [List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, 0), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, null, 1), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, null, null, 3), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, null, null, null, 7), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, null, null, null, null, 15), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, null, null, null, null, null, 31), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, null, null, null, null, null, null, 63), List(ss_quantity#4, ss_sales_price#5, i_category#19, null, null, null, null, null, null, null, 127), List(ss_quantity#4, ss_sales_price#5, null, null, null, null, null, null, null, null, 255)], [ss_quantity#4, ss_sales_price#5, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Input [10]: [ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13] +Arguments: [List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13, 0), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, null, 1), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, null, null, 3), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, null, null, null, 7), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, null, null, null, null, 15), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, null, null, null, null, null, 31), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, null, null, null, null, null, null, 63), List(ss_quantity#10, ss_sales_price#11, i_category#19, null, null, null, null, null, null, null, 127), List(ss_quantity#10, ss_sales_price#11, null, null, null, null, null, null, null, null, 255)], [ss_quantity#10, ss_sales_price#11, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] (27) HashAggregate [codegen id : 7] -Input [11]: [ss_quantity#4, ss_sales_price#5, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Input [11]: [ss_quantity#10, ss_sales_price#11, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] -Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] Aggregate Attributes [2]: [sum#31, isEmpty#32] Results [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] @@ -164,9 +164,9 @@ Arguments: hashpartitioning(i_category#22, i_class#23, i_brand#24, i_product_nam (29) HashAggregate [codegen id : 8] Input [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] -Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] -Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36] -Results [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36 AS sumsales#37] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36] +Results [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36 AS sumsales#37] (30) Exchange Input [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt index 185701fbc38df..607b55c2dac09 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt @@ -22,14 +22,10 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ InputAdapter Exchange [ss_item_sk] #3 WholeStageCodegen (3) - Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] + Project [d_year,d_moy,d_qoy,ss_item_sk,ss_quantity,ss_sales_price,s_store_id] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] + Project [d_year,d_moy,d_qoy,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -38,6 +34,10 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt index b3dc146e26e38..46516ec86f9bf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt @@ -10,12 +10,12 @@ TakeOrderedAndProject (51) : : +- Exchange (4) : : +- * Filter (3) : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer (1) + : : +- Scan parquet default.customer_address (1) : +- * Sort (10) : +- Exchange (9) : +- * Filter (8) : +- * ColumnarToRow (7) - : +- Scan parquet default.customer_address (6) + : +- Scan parquet default.customer (6) +- * Sort (48) +- Exchange (47) +- * HashAggregate (46) @@ -29,15 +29,15 @@ TakeOrderedAndProject (51) : :- * Project (31) : : +- * BroadcastHashJoin Inner BuildRight (30) : : :- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (17) - : : : : +- * ColumnarToRow (16) - : : : : +- Scan parquet default.store_sales (15) - : : : +- BroadcastExchange (22) - : : : +- * Project (21) - : : : +- * Filter (20) - : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.date_dim (18) + : : : +- * BroadcastHashJoin Inner BuildLeft (23) + : : : :- BroadcastExchange (19) + : : : : +- * Project (18) + : : : : +- * Filter (17) + : : : : +- * ColumnarToRow (16) + : : : : +- Scan parquet default.date_dim (15) + : : : +- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.store_sales (20) : : +- BroadcastExchange (29) : : +- * Project (28) : : +- * Filter (27) @@ -52,111 +52,111 @@ TakeOrderedAndProject (51) +- ReusedExchange (41) -(1) Scan parquet default.customer -Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_city#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Input [2]: [ca_address_sk#1, ca_city#2] (3) Filter [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) +Input [2]: [ca_address_sk#1, ca_city#2] +Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_city#2)) (4) Exchange -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#5] +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#3] (5) Sort [codegen id : 2] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.customer_address -Output [2]: [ca_address_sk#6, ca_city#7] +(6) Scan parquet default.customer +Output [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [ca_address_sk#6, ca_city#7] +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] (8) Filter [codegen id : 3] -Input [2]: [ca_address_sk#6, ca_city#7] -Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5)) (9) Exchange -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: hashpartitioning(ca_address_sk#6, 5), true, [id=#8] +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#8] (10) Sort [codegen id : 4] -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 (11) SortMergeJoin [codegen id : 5] -Left keys [1]: [c_current_addr_sk#2] -Right keys [1]: [ca_address_sk#6] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#5] Join condition: None (12) Project [codegen id : 5] -Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] +Output [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Input [6]: [ca_address_sk#1, ca_city#2, c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] (13) Exchange -Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#9] +Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#9] (14) Sort [codegen id : 6] -Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 - -(15) Scan parquet default.store_sales -Output [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] +Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 -(16) ColumnarToRow [codegen id : 10] -Input [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] - -(17) Filter [codegen id : 10] -Input [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Condition : ((((isnotnull(ss_sold_date_sk#10) AND isnotnull(ss_store_sk#14)) AND isnotnull(ss_hdemo_sk#12)) AND isnotnull(ss_addr_sk#13)) AND isnotnull(ss_customer_sk#11)) - -(18) Scan parquet default.date_dim -Output [3]: [d_date_sk#19, d_year#20, d_dom#21] +(15) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dom#12] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 7] -Input [3]: [d_date_sk#19, d_year#20, d_dom#21] +(16) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] + +(17) Filter [codegen id : 7] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +Condition : ((((isnotnull(d_dom#12) AND (d_dom#12 >= 1)) AND (d_dom#12 <= 2)) AND d_year#11 IN (1999,2000,2001)) AND isnotnull(d_date_sk#10)) -(20) Filter [codegen id : 7] -Input [3]: [d_date_sk#19, d_year#20, d_dom#21] -Condition : ((((isnotnull(d_dom#21) AND (d_dom#21 >= 1)) AND (d_dom#21 <= 2)) AND d_year#20 IN (1999,2000,2001)) AND isnotnull(d_date_sk#19)) +(18) Project [codegen id : 7] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] + +(19) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(20) Scan parquet default.store_sales +Output [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(21) Project [codegen id : 7] -Output [1]: [d_date_sk#19] -Input [3]: [d_date_sk#19, d_year#20, d_dom#21] +(21) ColumnarToRow +Input [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -(22) BroadcastExchange -Input [1]: [d_date_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(22) Filter +Input [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Condition : ((((isnotnull(ss_sold_date_sk#14) AND isnotnull(ss_store_sk#18)) AND isnotnull(ss_hdemo_sk#16)) AND isnotnull(ss_addr_sk#17)) AND isnotnull(ss_customer_sk#15)) (23) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#10] -Right keys [1]: [d_date_sk#19] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [ss_sold_date_sk#14] Join condition: None (24) Project [codegen id : 10] -Output [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Input [10]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, d_date_sk#19] +Output [8]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Input [10]: [d_date_sk#10, ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] (25) Scan parquet default.store Output [2]: [s_store_sk#23, s_city#24] @@ -181,13 +181,13 @@ Input [1]: [s_store_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (30) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_store_sk#14] +Left keys [1]: [ss_store_sk#18] Right keys [1]: [s_store_sk#23] Join condition: None (31) Project [codegen id : 10] -Output [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Input [9]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, s_store_sk#23] +Output [7]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Input [9]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, s_store_sk#23] (32) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] @@ -212,70 +212,70 @@ Input [1]: [hd_demo_sk#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (37) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_hdemo_sk#12] +Left keys [1]: [ss_hdemo_sk#16] Right keys [1]: [hd_demo_sk#26] Join condition: None (38) Project [codegen id : 10] -Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Input [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, hd_demo_sk#26] +Output [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Input [8]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, hd_demo_sk#26] (39) Exchange -Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#30] +Input [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Arguments: hashpartitioning(ss_addr_sk#17, 5), true, [id=#30] (40) Sort [codegen id : 11] -Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 +Input [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Arguments: [ss_addr_sk#17 ASC NULLS FIRST], false, 0 -(41) ReusedExchange [Reuses operator id: 9] -Output [2]: [ca_address_sk#6, ca_city#7] +(41) ReusedExchange [Reuses operator id: 4] +Output [2]: [ca_address_sk#1, ca_city#2] (42) Sort [codegen id : 13] -Input [2]: [ca_address_sk#6, ca_city#7] -Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_city#2] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_addr_sk#13] -Right keys [1]: [ca_address_sk#6] +Left keys [1]: [ss_addr_sk#17] +Right keys [1]: [ca_address_sk#1] Join condition: None (44) Project [codegen id : 14] -Output [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_city#7] -Input [8]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_address_sk#6, ca_city#7] +Output [7]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_city#2] +Input [8]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_address_sk#1, ca_city#2] (45) HashAggregate [codegen id : 14] -Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_city#7] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] -Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#16)), partial_sum(UnscaledValue(ss_ext_list_price#17)), partial_sum(UnscaledValue(ss_ext_tax#18))] +Input [7]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_city#2] +Keys [4]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#20)), partial_sum(UnscaledValue(ss_ext_list_price#21)), partial_sum(UnscaledValue(ss_ext_tax#22))] Aggregate Attributes [3]: [sum#31, sum#32, sum#33] -Results [7]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#34, sum#35, sum#36] +Results [7]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2, sum#34, sum#35, sum#36] (46) HashAggregate [codegen id : 14] -Input [7]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#34, sum#35, sum#36] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] -Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#16)), sum(UnscaledValue(ss_ext_list_price#17)), sum(UnscaledValue(ss_ext_tax#18))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#16))#37, sum(UnscaledValue(ss_ext_list_price#17))#38, sum(UnscaledValue(ss_ext_tax#18))#39] -Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#7 AS bought_city#40, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#16))#37,17,2) AS extended_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#17))#38,17,2) AS list_price#42, MakeDecimal(sum(UnscaledValue(ss_ext_tax#18))#39,17,2) AS extended_tax#43] +Input [7]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2, sum#34, sum#35, sum#36] +Keys [4]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#20)), sum(UnscaledValue(ss_ext_list_price#21)), sum(UnscaledValue(ss_ext_tax#22))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#20))#37, sum(UnscaledValue(ss_ext_list_price#21))#38, sum(UnscaledValue(ss_ext_tax#22))#39] +Results [6]: [ss_ticket_number#19, ss_customer_sk#15, ca_city#2 AS bought_city#40, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#20))#37,17,2) AS extended_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#21))#38,17,2) AS list_price#42, MakeDecimal(sum(UnscaledValue(ss_ext_tax#22))#39,17,2) AS extended_tax#43] (47) Exchange -Input [6]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] -Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#44] +Input [6]: [ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Arguments: hashpartitioning(ss_customer_sk#15, 5), true, [id=#44] (48) Sort [codegen id : 15] -Input [6]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] -Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 +Input [6]: [ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Arguments: [ss_customer_sk#15 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ss_customer_sk#11] -Join condition: NOT (ca_city#7 = bought_city#40) +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [ss_customer_sk#15] +Join condition: NOT (ca_city#2 = bought_city#40) (50) Project [codegen id : 16] -Output [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] -Input [10]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Output [8]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] +Input [10]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7, ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] (51) TakeOrderedAndProject -Input [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] -Arguments: 100, [c_last_name#4 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] +Input [8]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] +Arguments: 100, [c_last_name#7 ASC NULLS FIRST, ss_ticket_number#19 ASC NULLS FIRST], [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt index 64672d38be957..c4d3c5ab96d48 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt @@ -8,28 +8,28 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (5) - Project [c_customer_sk,c_first_name,c_last_name,ca_city] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_city,c_customer_sk,c_first_name,c_last_name] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (2) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #2 + Exchange [ca_address_sk] #2 WholeStageCodegen (1) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + Scan parquet default.customer_address [ca_address_sk,ca_city] InputAdapter WholeStageCodegen (4) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #3 + Exchange [c_current_addr_sk] #3 WholeStageCodegen (3) - Filter [ca_address_sk,ca_city] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (15) Sort [ss_customer_sk] @@ -51,11 +51,7 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #6 WholeStageCodegen (7) @@ -64,6 +60,10 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] InputAdapter BroadcastExchange #7 WholeStageCodegen (8) @@ -84,4 +84,4 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ WholeStageCodegen (13) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #3 + ReusedExchange [ca_address_sk,ca_city] #2 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt index 10867c980b22a..c6cd40fe3341e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt @@ -7,249 +7,249 @@ TakeOrderedAndProject (54) +- * BroadcastHashJoin Inner BuildLeft (49) :- BroadcastExchange (45) : +- * Project (44) - : +- * BroadcastHashJoin Inner BuildRight (43) - : :- * Project (37) - : : +- SortMergeJoin LeftAnti (36) - : : :- SortMergeJoin LeftAnti (27) - : : : :- SortMergeJoin LeftSemi (18) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- * Sort (17) - : : : : +- Exchange (16) - : : : : +- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.store_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- * Sort (26) - : : : +- Exchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Sort (35) - : : +- Exchange (34) - : : +- * Project (33) - : : +- * BroadcastHashJoin Inner BuildRight (32) - : : :- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.catalog_sales (28) - : : +- ReusedExchange (31) - : +- BroadcastExchange (42) - : +- * Project (41) - : +- * Filter (40) - : +- * ColumnarToRow (39) - : +- Scan parquet default.customer_address (38) + : +- * BroadcastHashJoin Inner BuildLeft (43) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) + : +- * Project (42) + : +- SortMergeJoin LeftAnti (41) + : :- SortMergeJoin LeftAnti (32) + : : :- SortMergeJoin LeftSemi (23) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer (6) + : : : +- * Sort (22) + : : : +- Exchange (21) + : : : +- * Project (20) + : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : :- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store_sales (11) + : : : +- BroadcastExchange (18) + : : : +- * Project (17) + : : : +- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.date_dim (14) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.web_sales (24) + : : +- ReusedExchange (27) + : +- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.catalog_sales (33) + : +- ReusedExchange (36) +- * Filter (48) +- * ColumnarToRow (47) +- Scan parquet default.customer_demographics (46) -(1) Scan parquet default.customer -Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_state#2] + +(3) Filter [codegen id : 1] +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : (ca_state#2 IN (KY,GA,NM) AND isnotnull(ca_address_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#1] +Input [2]: [ca_address_sk#1, ca_state#2] + +(5) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.customer +Output [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +(7) ColumnarToRow [codegen id : 2] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -(3) Filter [codegen id : 1] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) +(8) Filter [codegen id : 2] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Condition : (isnotnull(c_current_addr_sk#6) AND isnotnull(c_current_cdemo_sk#5)) -(4) Exchange -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#4] +(9) Exchange +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#7] -(5) Sort [codegen id : 2] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#5, ss_customer_sk#6] +(11) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#8, ss_customer_sk#9] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6] +(12) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#8, ss_customer_sk#9] -(8) Filter [codegen id : 4] -Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6] -Condition : isnotnull(ss_sold_date_sk#5) +(13) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#8, ss_customer_sk#9] +Condition : isnotnull(ss_sold_date_sk#8) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#7, d_year#8, d_moy#9] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(15) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 6)) AND isnotnull(d_date_sk#7)) +(16) Filter [codegen id : 4] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#12)) AND (d_year#11 = 2001)) AND (d_moy#12 >= 4)) AND (d_moy#12 <= 6)) AND isnotnull(d_date_sk#10)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#7] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(17) Project [codegen id : 4] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -(13) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(18) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#5] -Right keys [1]: [d_date_sk#7] +(19) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] Join condition: None -(15) Project [codegen id : 4] -Output [1]: [ss_customer_sk#6] -Input [3]: [ss_sold_date_sk#5, ss_customer_sk#6, d_date_sk#7] +(20) Project [codegen id : 5] +Output [1]: [ss_customer_sk#9] +Input [3]: [ss_sold_date_sk#8, ss_customer_sk#9, d_date_sk#10] -(16) Exchange -Input [1]: [ss_customer_sk#6] -Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#11] +(21) Exchange +Input [1]: [ss_customer_sk#9] +Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#14] -(17) Sort [codegen id : 5] -Input [1]: [ss_customer_sk#6] -Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 6] +Input [1]: [ss_customer_sk#9] +Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ss_customer_sk#6] +(23) SortMergeJoin +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [ss_customer_sk#9] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(24) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(25) ColumnarToRow [codegen id : 8] +Input [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -Condition : isnotnull(ws_sold_date_sk#12) +(26) Filter [codegen id : 8] +Input [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] +Condition : isnotnull(ws_sold_date_sk#15) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(27) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#10] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#12] -Right keys [1]: [d_date_sk#7] +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#15] +Right keys [1]: [d_date_sk#10] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#13] -Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] +(29) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#16] +Input [3]: [ws_sold_date_sk#15, ws_bill_customer_sk#16, d_date_sk#10] -(25) Exchange -Input [1]: [ws_bill_customer_sk#13] -Arguments: hashpartitioning(ws_bill_customer_sk#13, 5), true, [id=#14] +(30) Exchange +Input [1]: [ws_bill_customer_sk#16] +Arguments: hashpartitioning(ws_bill_customer_sk#16, 5), true, [id=#17] -(26) Sort [codegen id : 8] -Input [1]: [ws_bill_customer_sk#13] -Arguments: [ws_bill_customer_sk#13 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#16] +Arguments: [ws_bill_customer_sk#16 ASC NULLS FIRST], false, 0 -(27) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#13] +(32) SortMergeJoin +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [ws_bill_customer_sk#16] Join condition: None -(28) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(33) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(34) ColumnarToRow [codegen id : 11] +Input [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] -(30) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -Condition : isnotnull(cs_sold_date_sk#15) +(35) Filter [codegen id : 11] +Input [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] +Condition : isnotnull(cs_sold_date_sk#18) -(31) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(36) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#10] -(32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#15] -Right keys [1]: [d_date_sk#7] +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None -(33) Project [codegen id : 10] -Output [1]: [cs_ship_customer_sk#16] -Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#7] +(38) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#19] +Input [3]: [cs_sold_date_sk#18, cs_ship_customer_sk#19, d_date_sk#10] -(34) Exchange -Input [1]: [cs_ship_customer_sk#16] -Arguments: hashpartitioning(cs_ship_customer_sk#16, 5), true, [id=#17] +(39) Exchange +Input [1]: [cs_ship_customer_sk#19] +Arguments: hashpartitioning(cs_ship_customer_sk#19, 5), true, [id=#20] -(35) Sort [codegen id : 11] -Input [1]: [cs_ship_customer_sk#16] -Arguments: [cs_ship_customer_sk#16 ASC NULLS FIRST], false, 0 +(40) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#19] +Arguments: [cs_ship_customer_sk#19 ASC NULLS FIRST], false, 0 -(36) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cs_ship_customer_sk#16] +(41) SortMergeJoin +Left keys [1]: [c_customer_sk#4] +Right keys [1]: [cs_ship_customer_sk#19] Join condition: None -(37) Project [codegen id : 13] -Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] - -(38) Scan parquet default.customer_address -Output [2]: [ca_address_sk#18, ca_state#19] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(39) ColumnarToRow [codegen id : 12] -Input [2]: [ca_address_sk#18, ca_state#19] - -(40) Filter [codegen id : 12] -Input [2]: [ca_address_sk#18, ca_state#19] -Condition : (ca_state#19 IN (KY,GA,NM) AND isnotnull(ca_address_sk#18)) - -(41) Project [codegen id : 12] -Output [1]: [ca_address_sk#18] -Input [2]: [ca_address_sk#18, ca_state#19] - -(42) BroadcastExchange -Input [1]: [ca_address_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(42) Project +Output [2]: [c_current_cdemo_sk#5, c_current_addr_sk#6] +Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] (43) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#18] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#6] Join condition: None (44) Project [codegen id : 13] -Output [1]: [c_current_cdemo_sk#2] -Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18] +Output [1]: [c_current_cdemo_sk#5] +Input [3]: [ca_address_sk#1, c_current_cdemo_sk#5, c_current_addr_sk#6] (45) BroadcastExchange -Input [1]: [c_current_cdemo_sk#2] +Input [1]: [c_current_cdemo_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (46) Scan parquet default.customer_demographics @@ -267,13 +267,13 @@ Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_stat Condition : isnotnull(cd_demo_sk#22) (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [c_current_cdemo_sk#2] +Left keys [1]: [c_current_cdemo_sk#5] Right keys [1]: [cd_demo_sk#22] Join condition: None (50) Project [codegen id : 14] Output [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] -Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] +Input [7]: [c_current_cdemo_sk#5, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] (51) HashAggregate [codegen id : 14] Input [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt index beca1370f3716..d1e125dcbbca2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt @@ -11,26 +11,34 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha BroadcastExchange #2 WholeStageCodegen (13) Project [c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] Project [c_current_cdemo_sk,c_current_addr_sk] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #3 - WholeStageCodegen (1) + Exchange [c_customer_sk] #4 + WholeStageCodegen (2) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (5) + WholeStageCodegen (6) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #4 - WholeStageCodegen (4) + Exchange [ss_customer_sk] #5 + WholeStageCodegen (5) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -38,18 +46,18 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) + BroadcastExchange #6 + WholeStageCodegen (4) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (8) + WholeStageCodegen (9) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #6 - WholeStageCodegen (7) + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (8) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -57,12 +65,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - WholeStageCodegen (11) + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (12) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #7 - WholeStageCodegen (10) + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (11) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -70,15 +78,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #5 - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (12) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + ReusedExchange [d_date_sk] #6 Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt index 38576c0adde4b..1347c207cb6f7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (34) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.customer_demographics (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer_demographics (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (25) -(1) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(3) Filter [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_promo_sk#4)) - -(4) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(1) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] -(6) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = M)) AND (cd_marital_status#11 = S)) AND (cd_education_status#12 = College)) AND isnotnull(cd_demo_sk#9)) +(3) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = M)) AND (cd_marital_status#3 = S)) AND (cd_education_status#4 = College)) AND isnotnull(cd_demo_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [cd_demo_sk#1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] + +(5) BroadcastExchange +Input [1]: [cd_demo_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [cd_demo_sk#9] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(7) ColumnarToRow +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -(8) BroadcastExchange -Input [1]: [cd_demo_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(8) Filter +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_item_sk#7)) AND isnotnull(ss_promo_sk#9)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#9] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [ss_cdemo_sk#8] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] +Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] (11) Scan parquet default.promotion Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] @@ -103,13 +103,13 @@ Input [1]: [p_promo_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_promo_sk#4] +Left keys [1]: [ss_promo_sk#9] Right keys [1]: [p_promo_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, p_promo_sk#14] +Output [6]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, p_promo_sk#14] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#18, d_year#19] @@ -134,13 +134,13 @@ Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#18] Join condition: None (24) Project [codegen id : 5] -Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#18] +Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#18] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] @@ -161,18 +161,18 @@ Input [2]: [i_item_sk#21, i_item_id#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] (29) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#7] Right keys [1]: [i_item_sk#21] Join condition: None (30) Project [codegen id : 5] -Output [5]: [ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_id#22] -Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#21, i_item_id#22] +Output [5]: [ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_id#22] +Input [7]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#21, i_item_id#22] (31) HashAggregate [codegen id : 5] -Input [5]: [ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_id#22] +Input [5]: [ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_id#22] Keys [1]: [i_item_id#22] -Functions [4]: [partial_avg(cast(ss_quantity#5 as bigint)), partial_avg(UnscaledValue(ss_list_price#6)), partial_avg(UnscaledValue(ss_coupon_amt#8)), partial_avg(UnscaledValue(ss_sales_price#7))] +Functions [4]: [partial_avg(cast(ss_quantity#10 as bigint)), partial_avg(UnscaledValue(ss_list_price#11)), partial_avg(UnscaledValue(ss_coupon_amt#13)), partial_avg(UnscaledValue(ss_sales_price#12))] Aggregate Attributes [8]: [sum#24, count#25, sum#26, count#27, sum#28, count#29, sum#30, count#31] Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] @@ -183,9 +183,9 @@ Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] Keys [1]: [i_item_id#22] -Functions [4]: [avg(cast(ss_quantity#5 as bigint)), avg(UnscaledValue(ss_list_price#6)), avg(UnscaledValue(ss_coupon_amt#8)), avg(UnscaledValue(ss_sales_price#7))] -Aggregate Attributes [4]: [avg(cast(ss_quantity#5 as bigint))#41, avg(UnscaledValue(ss_list_price#6))#42, avg(UnscaledValue(ss_coupon_amt#8))#43, avg(UnscaledValue(ss_sales_price#7))#44] -Results [5]: [i_item_id#22, avg(cast(ss_quantity#5 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(ss_list_price#6))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(ss_coupon_amt#8))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(ss_sales_price#7))#44 / 100.0) as decimal(11,6)) AS agg4#48] +Functions [4]: [avg(cast(ss_quantity#10 as bigint)), avg(UnscaledValue(ss_list_price#11)), avg(UnscaledValue(ss_coupon_amt#13)), avg(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [4]: [avg(cast(ss_quantity#10 as bigint))#41, avg(UnscaledValue(ss_list_price#11))#42, avg(UnscaledValue(ss_coupon_amt#13))#43, avg(UnscaledValue(ss_sales_price#12))#44] +Results [5]: [i_item_id#22, avg(cast(ss_quantity#10 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(ss_list_price#11))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(ss_coupon_amt#13))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(ss_sales_price#12))#44 / 100.0) as decimal(11,6)) AS agg4#48] (34) TakeOrderedAndProject Input [5]: [i_item_id#22, agg1#45, agg2#46, agg3#47, agg4#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt index d78afa9979777..0c5aab87ff745 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt @@ -12,11 +12,7 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_promo_sk,p_promo_sk] Project [ss_sold_date_sk,ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] - Filter [ss_cdemo_sk,ss_sold_date_sk,ss_item_sk,ss_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -25,6 +21,10 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + Filter [ss_cdemo_sk,ss_sold_date_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt index 00f691230ff69..853ec4daef5cb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (47) +- * Project (38) +- * BroadcastHashJoin Inner BuildRight (37) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (36) +- * BroadcastHashJoin LeftSemi BuildRight (35) :- * Filter (13) @@ -37,61 +37,61 @@ TakeOrderedAndProject (47) +- * Project (25) +- * BroadcastHashJoin Inner BuildRight (24) :- * Project (19) - : +- * BroadcastHashJoin Inner BuildRight (18) - : :- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.store_sales (14) - : +- ReusedExchange (17) + : +- * BroadcastHashJoin Inner BuildLeft (18) + : :- ReusedExchange (14) + : +- * Filter (17) + : +- * ColumnarToRow (16) + : +- Scan parquet default.store_sales (15) +- BroadcastExchange (23) +- * Filter (22) +- * ColumnarToRow (21) +- Scan parquet default.store (20) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 9] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] - -(3) Filter [codegen id : 9] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_month_seq#5] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_month_seq#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_month_seq#5] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] + +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] +Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_month_seq#5] -Condition : (((isnotnull(d_month_seq#5) AND (d_month_seq#5 >= 1200)) AND (d_month_seq#5 <= 1211)) AND isnotnull(d_date_sk#4)) +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_month_seq#2] -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_month_seq#5] +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] + +(8) Filter +Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +Condition : (isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_store_sk#5)) (9) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 9] -Output [2]: [ss_store_sk#2, ss_net_profit#3] -Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3, d_date_sk#4] +Output [2]: [ss_store_sk#5, ss_net_profit#6] +Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] (11) Scan parquet default.store Output [3]: [s_store_sk#7, s_county#8, s_state#9] @@ -107,31 +107,31 @@ Input [3]: [s_store_sk#7, s_county#8, s_state#9] Input [3]: [s_store_sk#7, s_county#8, s_state#9] Condition : isnotnull(s_store_sk#7) -(14) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] +(14) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(15) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 4] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] - -(16) Filter [codegen id : 4] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] -Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(16) ColumnarToRow +Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] -(17) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#4] +(17) Filter +Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +Condition : (isnotnull(ss_store_sk#5) AND isnotnull(ss_sold_date_sk#4)) (18) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (19) Project [codegen id : 4] -Output [2]: [ss_store_sk#2, ss_net_profit#3] -Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3, d_date_sk#4] +Output [2]: [ss_store_sk#5, ss_net_profit#6] +Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] (20) Scan parquet default.store Output [2]: [s_store_sk#7, s_state#9] @@ -152,18 +152,18 @@ Input [2]: [s_store_sk#7, s_state#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (24) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#2] +Left keys [1]: [ss_store_sk#5] Right keys [1]: [s_store_sk#7] Join condition: None (25) Project [codegen id : 4] -Output [2]: [ss_net_profit#3, s_state#9] -Input [4]: [ss_store_sk#2, ss_net_profit#3, s_store_sk#7, s_state#9] +Output [2]: [ss_net_profit#6, s_state#9] +Input [4]: [ss_store_sk#5, ss_net_profit#6, s_store_sk#7, s_state#9] (26) HashAggregate [codegen id : 4] -Input [2]: [ss_net_profit#3, s_state#9] +Input [2]: [ss_net_profit#6, s_state#9] Keys [1]: [s_state#9] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#6))] Aggregate Attributes [1]: [sum#11] Results [2]: [s_state#9, sum#12] @@ -174,9 +174,9 @@ Arguments: hashpartitioning(s_state#9, 5), true, [id=#13] (28) HashAggregate [codegen id : 5] Input [2]: [s_state#9, sum#12] Keys [1]: [s_state#9] -Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#14] -Results [3]: [s_state#9 AS s_state#15, s_state#9, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#14,17,2) AS _w2#16] +Functions [1]: [sum(UnscaledValue(ss_net_profit#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#6))#14] +Results [3]: [s_state#9 AS s_state#15, s_state#9, MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#14,17,2) AS _w2#16] (29) Exchange Input [3]: [s_state#15, s_state#9, _w2#16] @@ -212,22 +212,22 @@ Input [3]: [s_store_sk#7, s_county#8, s_state#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] (37) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_store_sk#2] +Left keys [1]: [ss_store_sk#5] Right keys [1]: [s_store_sk#7] Join condition: None (38) Project [codegen id : 9] -Output [3]: [ss_net_profit#3, s_state#9, s_county#8] -Input [5]: [ss_store_sk#2, ss_net_profit#3, s_store_sk#7, s_county#8, s_state#9] +Output [3]: [ss_net_profit#6, s_state#9, s_county#8] +Input [5]: [ss_store_sk#5, ss_net_profit#6, s_store_sk#7, s_county#8, s_state#9] (39) Expand [codegen id : 9] -Input [3]: [ss_net_profit#3, s_state#9, s_county#8] -Arguments: [List(ss_net_profit#3, s_state#9, s_county#8, 0), List(ss_net_profit#3, s_state#9, null, 1), List(ss_net_profit#3, null, null, 3)], [ss_net_profit#3, s_state#21, s_county#22, spark_grouping_id#23] +Input [3]: [ss_net_profit#6, s_state#9, s_county#8] +Arguments: [List(ss_net_profit#6, s_state#9, s_county#8, 0), List(ss_net_profit#6, s_state#9, null, 1), List(ss_net_profit#6, null, null, 3)], [ss_net_profit#6, s_state#21, s_county#22, spark_grouping_id#23] (40) HashAggregate [codegen id : 9] -Input [4]: [ss_net_profit#3, s_state#21, s_county#22, spark_grouping_id#23] +Input [4]: [ss_net_profit#6, s_state#21, s_county#22, spark_grouping_id#23] Keys [3]: [s_state#21, s_county#22, spark_grouping_id#23] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#6))] Aggregate Attributes [1]: [sum#24] Results [4]: [s_state#21, s_county#22, spark_grouping_id#23, sum#25] @@ -238,9 +238,9 @@ Arguments: hashpartitioning(s_state#21, s_county#22, spark_grouping_id#23, 5), t (42) HashAggregate [codegen id : 10] Input [4]: [s_state#21, s_county#22, spark_grouping_id#23, sum#25] Keys [3]: [s_state#21, s_county#22, spark_grouping_id#23] -Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#27] -Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS total_sum#28, s_state#21, s_county#22, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS lochierarchy#29, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS _w1#30, CASE WHEN (cast(cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) as int) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS _w3#32] +Functions [1]: [sum(UnscaledValue(ss_net_profit#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#6))#27] +Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#27,17,2) AS total_sum#28, s_state#21, s_county#22, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS lochierarchy#29, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS _w1#30, CASE WHEN (cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#27,17,2) AS _w3#32] (43) Exchange Input [7]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, _w1#30, _w2#31, _w3#32] @@ -260,5 +260,5 @@ Input [8]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, _w1#30, _w2# (47) TakeOrderedAndProject Input [5]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] -Arguments: 100, [lochierarchy#29 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#29 as int) = 0) THEN s_state#21 END ASC NULLS FIRST, rank_within_parent#34 ASC NULLS FIRST], [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] +Arguments: 100, [lochierarchy#29 DESC NULLS LAST, CASE WHEN (lochierarchy#29 = 0) THEN s_state#21 END ASC NULLS FIRST, rank_within_parent#34 ASC NULLS FIRST], [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt index ae76771689231..4eea3f30cde01 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt @@ -17,11 +17,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count Project [ss_net_profit,s_state,s_county] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -30,6 +26,10 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (8) @@ -58,13 +58,13 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count Project [ss_net_profit,s_state] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 Filter [ss_store_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] - InputAdapter - ReusedExchange [d_date_sk] #3 InputAdapter BroadcastExchange #8 WholeStageCodegen (3) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt index 3f8106c96379a..2ea6d93e428c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt @@ -49,26 +49,26 @@ TakeOrderedAndProject (79) : : : : +- Scan parquet default.item (26) : : : +- BroadcastExchange (43) : : : +- * Project (42) - : : : +- * BroadcastHashJoin Inner BuildLeft (41) - : : : :- BroadcastExchange (37) - : : : : +- * Project (36) - : : : : +- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.date_dim (33) - : : : +- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.date_dim (38) + : : : +- * BroadcastHashJoin Inner BuildRight (41) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- BroadcastExchange (40) + : : : +- * Project (39) + : : : +- * Filter (38) + : : : +- * ColumnarToRow (37) + : : : +- Scan parquet default.date_dim (36) : : +- * Sort (58) : : +- Exchange (57) : : +- * Project (56) - : : +- * BroadcastHashJoin Inner BuildRight (55) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.inventory (48) - : : +- BroadcastExchange (54) - : : +- * Filter (53) - : : +- * ColumnarToRow (52) - : : +- Scan parquet default.warehouse (51) + : : +- * BroadcastHashJoin Inner BuildLeft (55) + : : :- BroadcastExchange (51) + : : : +- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.warehouse (48) + : : +- * Filter (54) + : : +- * ColumnarToRow (53) + : : +- Scan parquet default.inventory (52) : +- BroadcastExchange (64) : +- * Filter (63) : +- * ColumnarToRow (62) @@ -223,128 +223,128 @@ Output [7]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, Input [8]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_sk#19, i_item_desc#20] (33) Scan parquet default.date_dim -Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +Output [2]: [d_date_sk#22, d_week_seq#23] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] -ReadSchema: struct - -(34) ColumnarToRow [codegen id : 8] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] - -(35) Filter [codegen id : 8] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 1999)) AND isnotnull(d_date_sk#22)) AND isnotnull(d_week_seq#24)) AND isnotnull(d_date#23)) +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(36) Project [codegen id : 8] -Output [3]: [d_date_sk#22, d_date#23, d_week_seq#24] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +(34) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#22, d_week_seq#23] -(37) BroadcastExchange -Input [3]: [d_date_sk#22, d_date#23, d_week_seq#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#26] +(35) Filter [codegen id : 9] +Input [2]: [d_date_sk#22, d_week_seq#23] +Condition : (isnotnull(d_week_seq#23) AND isnotnull(d_date_sk#22)) -(38) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_week_seq#28] +(36) Scan parquet default.date_dim +Output [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct -(39) ColumnarToRow -Input [2]: [d_date_sk#27, d_week_seq#28] +(37) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -(40) Filter -Input [2]: [d_date_sk#27, d_week_seq#28] -Condition : (isnotnull(d_week_seq#28) AND isnotnull(d_date_sk#27)) +(38) Filter [codegen id : 8] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +Condition : ((((isnotnull(d_year#27) AND (d_year#27 = 1999)) AND isnotnull(d_date_sk#24)) AND isnotnull(d_week_seq#26)) AND isnotnull(d_date#25)) + +(39) Project [codegen id : 8] +Output [3]: [d_date_sk#24, d_date#25, d_week_seq#26] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] + +(40) BroadcastExchange +Input [3]: [d_date_sk#24, d_date#25, d_week_seq#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#28] (41) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_week_seq#24] -Right keys [1]: [d_week_seq#28] +Left keys [1]: [d_week_seq#23] +Right keys [1]: [d_week_seq#26] Join condition: None (42) Project [codegen id : 9] -Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] -Input [5]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27, d_week_seq#28] +Output [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Input [5]: [d_date_sk#22, d_week_seq#23, d_date_sk#24, d_date#25, d_week_seq#26] (43) BroadcastExchange -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#29] (44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#22] -Join condition: (d_date#16 > d_date#23 + 5 days) +Right keys [1]: [d_date_sk#24] +Join condition: (d_date#16 > d_date#25 + 5 days) (45) Project [codegen id : 10] -Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] (46) Exchange -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#27, 5), true, [id=#30] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#22, 5), true, [id=#30] (47) Sort [codegen id : 11] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#27 ASC NULLS FIRST], false, 0 - -(48) Scan parquet default.inventory -Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#22 ASC NULLS FIRST], false, 0 -(49) ColumnarToRow [codegen id : 13] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] - -(50) Filter [codegen id : 13] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -Condition : (((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) AND isnotnull(inv_date_sk#31)) - -(51) Scan parquet default.warehouse -Output [2]: [w_warehouse_sk#35, w_warehouse_name#36] +(48) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#31, w_warehouse_name#32] Batched: true Location [not included in comparison]/{warehouse_dir}/warehouse] PushedFilters: [IsNotNull(w_warehouse_sk)] ReadSchema: struct -(52) ColumnarToRow [codegen id : 12] -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +(49) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] + +(50) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Condition : isnotnull(w_warehouse_sk#31) + +(51) BroadcastExchange +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(52) Scan parquet default.inventory +Output [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(53) Filter [codegen id : 12] -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -Condition : isnotnull(w_warehouse_sk#35) +(53) ColumnarToRow +Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] -(54) BroadcastExchange -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] +(54) Filter +Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Condition : (((isnotnull(inv_quantity_on_hand#37) AND isnotnull(inv_item_sk#35)) AND isnotnull(inv_warehouse_sk#36)) AND isnotnull(inv_date_sk#34)) (55) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [inv_warehouse_sk#33] -Right keys [1]: [w_warehouse_sk#35] +Left keys [1]: [w_warehouse_sk#31] +Right keys [1]: [inv_warehouse_sk#36] Join condition: None (56) Project [codegen id : 13] -Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Input [6]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, w_warehouse_sk#35, w_warehouse_name#36] +Output [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Input [6]: [w_warehouse_sk#31, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] (57) Exchange -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#31, 5), true, [id=#38] +Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Arguments: hashpartitioning(inv_item_sk#35, inv_date_sk#34, 5), true, [id=#38] (58) Sort [codegen id : 14] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#31 ASC NULLS FIRST], false, 0 +Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Arguments: [inv_item_sk#35 ASC NULLS FIRST, inv_date_sk#34 ASC NULLS FIRST], false, 0 (59) SortMergeJoin [codegen id : 16] -Left keys [2]: [cs_item_sk#5, d_date_sk#27] -Right keys [2]: [inv_item_sk#32, inv_date_sk#31] -Join condition: (inv_quantity_on_hand#34 < cs_quantity#8) +Left keys [2]: [cs_item_sk#5, d_date_sk#22] +Right keys [2]: [inv_item_sk#35, inv_date_sk#34] +Join condition: (inv_quantity_on_hand#37 < cs_quantity#8) (60) Project [codegen id : 16] -Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27, inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] (61) Scan parquet default.promotion Output [1]: [p_promo_sk#39] @@ -370,15 +370,15 @@ Right keys [1]: [p_promo_sk#39] Join condition: None (66) Project [codegen id : 16] -Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, p_promo_sk#39] +Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, p_promo_sk#39] (67) Exchange -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] Arguments: hashpartitioning(cs_item_sk#5, cs_order_number#7, 5), true, [id=#41] (68) Sort [codegen id : 17] -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] Arguments: [cs_item_sk#5 ASC NULLS FIRST, cs_order_number#7 ASC NULLS FIRST], false, 0 (69) Scan parquet default.catalog_returns @@ -409,28 +409,28 @@ Right keys [2]: [cr_item_sk#42, cr_order_number#43] Join condition: None (75) Project [codegen id : 20] -Output [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, cr_item_sk#42, cr_order_number#43] +Output [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, cr_item_sk#42, cr_order_number#43] (76) HashAggregate [codegen id : 20] -Input [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] +Input [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#45] -Results [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Results [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] (77) Exchange -Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] -Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#36, d_week_seq#24, 5), true, [id=#47] +Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#32, d_week_seq#26, 5), true, [id=#47] (78) HashAggregate [codegen id : 21] -Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] -Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] +Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#48] -Results [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] +Results [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] (79) TakeOrderedAndProject -Input [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] -Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#36 ASC NULLS FIRST, d_week_seq#24 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] +Input [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#32 ASC NULLS FIRST, d_week_seq#26 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt index 918508787c4b0..0737895f81551 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt @@ -23,7 +23,7 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter Exchange [cs_item_sk,d_date_sk] #3 WholeStageCodegen (10) - Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_date_sk,d_week_seq] BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,d_date,i_item_desc] SortMergeJoin [cs_item_sk,i_item_sk] @@ -79,8 +79,12 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter BroadcastExchange #9 WholeStageCodegen (9) - Project [d_date_sk,d_date,d_week_seq,d_date_sk] + Project [d_date_sk,d_date_sk,d_date,d_week_seq] BroadcastHashJoin [d_week_seq,d_week_seq] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -89,22 +93,14 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] - Filter [d_week_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter WholeStageCodegen (14) Sort [inv_item_sk,inv_date_sk] InputAdapter Exchange [inv_item_sk,inv_date_sk] #11 WholeStageCodegen (13) - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand,w_warehouse_name] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [w_warehouse_name,inv_date_sk,inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [w_warehouse_sk,inv_warehouse_sk] InputAdapter BroadcastExchange #12 WholeStageCodegen (12) @@ -112,6 +108,10 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #13 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt index 4af604ca3f65f..c7ed017ee3634 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] - -(3) Filter [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_dom#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -Condition : ((((isnotnull(d_dom#8) AND (d_dom#8 >= 1)) AND (d_dom#8 <= 2)) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +Condition : ((((isnotnull(d_dom#3) AND (d_dom#3 >= 1)) AND (d_dom#3 <= 2)) AND d_year#2 IN (1999,2000,2001)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) Filter +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Condition : (((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] +Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#8] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] -Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] +Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] +Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] +Left keys [1]: [ss_hdemo_sk#7] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#2, ss_ticket_number#5] -Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] +Output [2]: [ss_customer_sk#6, ss_ticket_number#9] +Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#2, ss_ticket_number#5] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [2]: [ss_customer_sk#6, ss_ticket_number#9] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] (26) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] Condition : ((cnt#22 >= 1) AND (cnt#22 <= 5)) (29) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#6] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] -Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] Arguments: rangepartitioning(cnt#22 DESC NULLS LAST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] Arguments: [cnt#22 DESC NULLS LAST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt index af8527f155c8e..1bbf07c5f1ae7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt @@ -22,11 +22,7 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt index 7b55fa470c616..3017e69904f99 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt @@ -61,11 +61,11 @@ TakeOrderedAndProject (86) : :- * Sort (53) : : +- Exchange (52) : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (48) - : : : +- * ColumnarToRow (47) - : : : +- Scan parquet default.web_sales (46) - : : +- ReusedExchange (49) + : : +- * BroadcastHashJoin Inner BuildLeft (50) + : : :- ReusedExchange (46) + : : +- * Filter (49) + : : +- * ColumnarToRow (48) + : : +- Scan parquet default.web_sales (47) : +- * Sort (55) : +- ReusedExchange (54) +- * Sort (83) @@ -78,11 +78,11 @@ TakeOrderedAndProject (86) :- * Sort (74) : +- Exchange (73) : +- * Project (72) - : +- * BroadcastHashJoin Inner BuildRight (71) - : :- * Filter (69) - : : +- * ColumnarToRow (68) - : : +- Scan parquet default.web_sales (67) - : +- ReusedExchange (70) + : +- * BroadcastHashJoin Inner BuildLeft (71) + : :- ReusedExchange (67) + : +- * Filter (70) + : +- * ColumnarToRow (69) + : +- Scan parquet default.web_sales (68) +- * Sort (76) +- ReusedExchange (75) @@ -293,38 +293,38 @@ Left keys [1]: [customer_id#17] Right keys [1]: [customer_id#26] Join condition: None -(46) Scan parquet default.web_sales +(46) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#4, d_year#5] + +(47) Scan parquet default.web_sales Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(47) ColumnarToRow [codegen id : 19] +(48) ColumnarToRow Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(48) Filter [codegen id : 19] +(49) Filter Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(49) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#4, d_year#5] - (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#4] +Right keys [1]: [ws_sold_date_sk#31] Join condition: None (51) Project [codegen id : 19] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] +Output [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [5]: [d_date_sk#4, d_year#5, ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] (52) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#34] (53) Sort [codegen id : 20] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -341,7 +341,7 @@ Join condition: None (57) Project [codegen id : 23] Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Input [7]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (58) HashAggregate [codegen id : 23] Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] @@ -386,38 +386,38 @@ Join condition: None Output [7]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42] Input [8]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, customer_id#41, year_total#42] -(67) Scan parquet default.web_sales +(67) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#4, d_year#5] + +(68) Scan parquet default.web_sales Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(68) ColumnarToRow [codegen id : 28] +(69) ColumnarToRow Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(69) Filter [codegen id : 28] +(70) Filter Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(70) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#4, d_year#5] - (71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#4] +Right keys [1]: [ws_sold_date_sk#31] Join condition: None (72) Project [codegen id : 28] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] +Output [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [5]: [d_date_sk#4, d_year#5, ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] (73) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#44] (74) Sort [codegen id : 29] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -434,7 +434,7 @@ Join condition: None (78) Project [codegen id : 32] Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Input [7]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (79) HashAggregate [codegen id : 32] Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt index c8cfa693e88ba..362a14659d67e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt @@ -110,14 +110,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [ws_bill_customer_sk,ws_net_paid,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,ws_bill_customer_sk,ws_net_paid] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_net_paid] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] @@ -142,14 +142,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [ws_bill_customer_sk] #15 WholeStageCodegen (28) - Project [ws_bill_customer_sk,ws_net_paid,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,ws_bill_customer_sk,ws_net_paid] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_net_paid] - InputAdapter - ReusedExchange [d_date_sk,d_year] #9 InputAdapter WholeStageCodegen (31) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt index 10e9cbba93b13..50f65d7896b57 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt @@ -7,14 +7,14 @@ TakeOrderedAndProject (44) :- * Project (15) : +- * BroadcastHashJoin Inner BuildRight (14) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.date_dim (4) + : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : :- BroadcastExchange (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) : +- BroadcastExchange (13) : +- * Filter (12) : +- * ColumnarToRow (11) @@ -23,68 +23,68 @@ TakeOrderedAndProject (44) : +- * BroadcastHashJoin Inner BuildLeft (29) : :- BroadcastExchange (25) : : +- * Project (24) - : : +- * BroadcastHashJoin Inner BuildLeft (23) - : : :- BroadcastExchange (19) - : : : +- * Filter (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.web_sales (16) - : : +- * Filter (22) - : : +- * ColumnarToRow (21) - : : +- Scan parquet default.date_dim (20) + : : +- * BroadcastHashJoin Inner BuildRight (23) + : : :- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.date_dim (16) + : : +- BroadcastExchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.web_sales (19) : +- * Filter (28) : +- * ColumnarToRow (27) : +- Scan parquet default.item (26) +- * Project (39) +- * BroadcastHashJoin Inner BuildRight (38) :- * Project (36) - : +- * BroadcastHashJoin Inner BuildRight (35) - : :- * Filter (33) - : : +- * ColumnarToRow (32) - : : +- Scan parquet default.catalog_sales (31) - : +- ReusedExchange (34) + : +- * BroadcastHashJoin Inner BuildLeft (35) + : :- ReusedExchange (31) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.catalog_sales (32) +- ReusedExchange (37) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] - -(3) Filter [codegen id : 3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] -Condition : ((isnull(ss_store_sk#3) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] -Condition : isnotnull(d_date_sk#5) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Condition : isnotnull(d_date_sk#1) -(7) BroadcastExchange -Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] +(4) BroadcastExchange +Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] + +(5) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] + +(7) Filter +Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Condition : ((isnull(ss_store_sk#7) AND isnotnull(ss_item_sk#6)) AND isnotnull(ss_sold_date_sk#5)) (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (9) Project [codegen id : 3] -Output [5]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_year#6, d_qoy#7] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_date_sk#5, d_year#6, d_qoy#7] +Output [5]: [d_year#2, d_qoy#3, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] (10) Scan parquet default.item Output [2]: [i_item_sk#9, i_category#10] @@ -105,58 +105,58 @@ Input [2]: [i_item_sk#9, i_category#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#6] Right keys [1]: [i_item_sk#9] Join condition: None (15) Project [codegen id : 3] -Output [6]: [store AS channel#12, ss_store_sk#3 AS col_name#13, d_year#6, d_qoy#7, i_category#10, ss_ext_sales_price#4 AS ext_sales_price#14] -Input [7]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] +Output [6]: [store AS channel#12, ss_store_sk#7 AS col_name#13, d_year#2, d_qoy#3, i_category#10, ss_ext_sales_price#8 AS ext_sales_price#14] +Input [7]: [d_year#2, d_qoy#3, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8, i_item_sk#9, i_category#10] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct -(16) Scan parquet default.web_sales +(17) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] + +(18) Filter [codegen id : 5] +Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Condition : isnotnull(d_date_sk#1) + +(19) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNull(ws_ship_customer_sk), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(17) ColumnarToRow [codegen id : 4] +(20) ColumnarToRow [codegen id : 4] Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] -(18) Filter [codegen id : 4] +(21) Filter [codegen id : 4] Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Condition : ((isnull(ws_ship_customer_sk#17) AND isnotnull(ws_item_sk#16)) AND isnotnull(ws_sold_date_sk#15)) -(19) BroadcastExchange +(22) BroadcastExchange Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] -(20) Scan parquet default.date_dim -Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk)] -ReadSchema: struct - -(21) ColumnarToRow -Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] - -(22) Filter -Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] -Condition : isnotnull(d_date_sk#5) - (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ws_sold_date_sk#15] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#15] Join condition: None (24) Project [codegen id : 5] -Output [5]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7] -Input [7]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_date_sk#5, d_year#6, d_qoy#7] +Output [5]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] +Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] (25) BroadcastExchange -Input [5]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +Input [5]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#20] (26) Scan parquet default.item Output [2]: [i_item_sk#9, i_category#10] @@ -178,34 +178,34 @@ Right keys [1]: [i_item_sk#9] Join condition: None (30) Project [codegen id : 6] -Output [6]: [web AS channel#21, ws_ship_customer_sk#17 AS col_name#22, d_year#6, d_qoy#7, i_category#10, ws_ext_sales_price#18 AS ext_sales_price#23] -Input [7]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] +Output [6]: [web AS channel#21, ws_ship_customer_sk#17 AS col_name#22, d_year#2, d_qoy#3, i_category#10, ws_ext_sales_price#18 AS ext_sales_price#23] +Input [7]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, i_item_sk#9, i_category#10] + +(31) ReusedExchange [Reuses operator id: 4] +Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] -(31) Scan parquet default.catalog_sales +(32) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNull(cs_ship_addr_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(32) ColumnarToRow [codegen id : 9] +(33) ColumnarToRow Input [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] -(33) Filter [codegen id : 9] +(34) Filter Input [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] Condition : ((isnull(cs_ship_addr_sk#25) AND isnotnull(cs_item_sk#26)) AND isnotnull(cs_sold_date_sk#24)) -(34) ReusedExchange [Reuses operator id: 7] -Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] - (35) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#24] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#24] Join condition: None (36) Project [codegen id : 9] -Output [5]: [cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_year#6, d_qoy#7] -Input [7]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_date_sk#5, d_year#6, d_qoy#7] +Output [5]: [d_year#2, d_qoy#3, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] +Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] (37) ReusedExchange [Reuses operator id: 13] Output [2]: [i_item_sk#9, i_category#10] @@ -216,30 +216,30 @@ Right keys [1]: [i_item_sk#9] Join condition: None (39) Project [codegen id : 9] -Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#6, d_qoy#7, i_category#10, cs_ext_sales_price#27 AS ext_sales_price#30] -Input [7]: [cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] +Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#2, d_qoy#3, i_category#10, cs_ext_sales_price#27 AS ext_sales_price#30] +Input [7]: [d_year#2, d_qoy#3, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, i_item_sk#9, i_category#10] (40) Union (41) HashAggregate [codegen id : 10] -Input [6]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, ext_sales_price#14] -Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] +Input [6]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, ext_sales_price#14] +Keys [5]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10] Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] Aggregate Attributes [2]: [count#31, sum#32] -Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] +Results [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] (42) Exchange -Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] -Arguments: hashpartitioning(channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, 5), true, [id=#35] +Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] +Arguments: hashpartitioning(channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, 5), true, [id=#35] (43) HashAggregate [codegen id : 11] -Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] -Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] +Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] +Keys [5]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10] Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] Aggregate Attributes [2]: [count(1)#36, sum(UnscaledValue(ext_sales_price#14))#37] -Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count(1)#36 AS sales_cnt#38, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#37,17,2) AS sales_amt#39] +Results [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count(1)#36 AS sales_cnt#38, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#37,17,2) AS sales_amt#39] (44) TakeOrderedAndProject -Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#38, sales_amt#39] -Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_qoy#7 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#38, sales_amt#39] +Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, sales_cnt#38, sales_amt#39] +Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST, d_qoy#3 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, sales_cnt#38, sales_amt#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt index 2da0d94f91e7c..26fdfadec3718 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt @@ -10,12 +10,8 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_store_sk,ss_item_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price] + Project [d_year,d_qoy,ss_item_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -23,6 +19,10 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Filter [ss_store_sk,ss_item_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -36,8 +36,12 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ InputAdapter BroadcastExchange #4 WholeStageCodegen (5) - Project [ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,d_qoy,ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] InputAdapter BroadcastExchange #5 WholeStageCodegen (4) @@ -45,10 +49,6 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price] - Filter [d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] Filter [i_item_sk] ColumnarToRow InputAdapter @@ -56,13 +56,13 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (9) Project [cs_ship_addr_sk,d_year,d_qoy,i_category,cs_ext_sales_price] BroadcastHashJoin [cs_item_sk,i_item_sk] - Project [cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price,d_year,d_qoy] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [d_year,d_qoy,cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #2 Filter [cs_ship_addr_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #2 InputAdapter ReusedExchange [i_item_sk,i_category] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt index e6b88348e4d68..653499f9e5cc2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (91) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -33,11 +33,11 @@ TakeOrderedAndProject (91) : +- * Project (28) : +- * BroadcastHashJoin Inner BuildRight (27) : :- * Project (25) - : : +- * BroadcastHashJoin Inner BuildRight (24) - : : :- * Filter (22) - : : : +- * ColumnarToRow (21) - : : : +- Scan parquet default.store_returns (20) - : : +- ReusedExchange (23) + : : +- * BroadcastHashJoin Inner BuildLeft (24) + : : :- ReusedExchange (20) + : : +- * Filter (23) + : : +- * ColumnarToRow (22) + : : +- Scan parquet default.store_returns (21) : +- ReusedExchange (26) :- * Project (55) : +- BroadcastNestedLoopJoin Inner BuildRight (54) @@ -92,50 +92,50 @@ TakeOrderedAndProject (91) +- ReusedExchange (77) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] - -(3) Filter [codegen id : 3] -Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#5, d_date#6] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_date#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-03), LessThanOrEqual(d_date,2000-09-02), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#5, d_date#6] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] + +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] +Condition : (((isnotnull(d_date#2) AND (d_date#2 >= 11172)) AND (d_date#2 <= 11202)) AND isnotnull(d_date_sk#1)) -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#5, d_date#6] -Condition : (((isnotnull(d_date#6) AND (d_date#6 >= 11172)) AND (d_date#6 <= 11202)) AND isnotnull(d_date_sk#5)) +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_date#2] -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#5] -Input [2]: [d_date_sk#5, d_date#6] +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(8) BroadcastExchange -Input [1]: [d_date_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] + +(8) Filter +Input [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] +Condition : (isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_store_sk#5)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] -Input [5]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, d_date_sk#5] +Output [3]: [ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] +Input [5]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] (11) Scan parquet default.store Output [1]: [s_store_sk#8] @@ -156,18 +156,18 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#2] +Left keys [1]: [ss_store_sk#5] Right keys [1]: [s_store_sk#8] Join condition: None (16) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] -Input [4]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] +Output [3]: [ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] +Input [4]: [ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] (17) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] +Input [3]: [ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] Keys [1]: [s_store_sk#8] -Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#3)), partial_sum(UnscaledValue(ss_net_profit#4))] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_net_profit#7))] Aggregate Attributes [2]: [sum#10, sum#11] Results [3]: [s_store_sk#8, sum#12, sum#13] @@ -178,78 +178,78 @@ Arguments: hashpartitioning(s_store_sk#8, 5), true, [id=#14] (19) HashAggregate [codegen id : 8] Input [3]: [s_store_sk#8, sum#12, sum#13] Keys [1]: [s_store_sk#8] -Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#3)), sum(UnscaledValue(ss_net_profit#4))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#3))#15, sum(UnscaledValue(ss_net_profit#4))#16] -Results [3]: [s_store_sk#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#15,17,2) AS sales#17, MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#16,17,2) AS profit#18] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#6))#15, sum(UnscaledValue(ss_net_profit#7))#16] +Results [3]: [s_store_sk#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#15,17,2) AS sales#17, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#16,17,2) AS profit#18] -(20) Scan parquet default.store_returns -Output [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +(20) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#19] + +(21) Scan parquet default.store_returns +Output [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_returned_date_sk), IsNotNull(sr_store_sk)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] -Input [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] - -(22) Filter [codegen id : 6] -Input [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] -Condition : (isnotnull(sr_returned_date_sk#19) AND isnotnull(sr_store_sk#20)) +(22) ColumnarToRow +Input [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] -(23) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#23] +(23) Filter +Input [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] +Condition : (isnotnull(sr_returned_date_sk#20) AND isnotnull(sr_store_sk#21)) (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_store_sk#20] -Right keys [1]: [cast(s_store_sk#23 as bigint)] +Left keys [1]: [cast(s_store_sk#19 as bigint)] +Right keys [1]: [sr_store_sk#21] Join condition: None (25) Project [codegen id : 6] -Output [4]: [sr_returned_date_sk#19, sr_return_amt#21, sr_net_loss#22, s_store_sk#23] -Input [5]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#23] +Output [4]: [s_store_sk#19, sr_returned_date_sk#20, sr_return_amt#22, sr_net_loss#23] +Input [5]: [s_store_sk#19, sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] -(26) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(26) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#19] -Right keys [1]: [cast(d_date_sk#5 as bigint)] +Left keys [1]: [sr_returned_date_sk#20] +Right keys [1]: [cast(d_date_sk#1 as bigint)] Join condition: None (28) Project [codegen id : 6] -Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#23] -Input [5]: [sr_returned_date_sk#19, sr_return_amt#21, sr_net_loss#22, s_store_sk#23, d_date_sk#5] +Output [3]: [sr_return_amt#22, sr_net_loss#23, s_store_sk#19] +Input [5]: [s_store_sk#19, sr_returned_date_sk#20, sr_return_amt#22, sr_net_loss#23, d_date_sk#1] (29) HashAggregate [codegen id : 6] -Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#23] -Keys [1]: [s_store_sk#23] -Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] +Input [3]: [sr_return_amt#22, sr_net_loss#23, s_store_sk#19] +Keys [1]: [s_store_sk#19] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#22)), partial_sum(UnscaledValue(sr_net_loss#23))] Aggregate Attributes [2]: [sum#24, sum#25] -Results [3]: [s_store_sk#23, sum#26, sum#27] +Results [3]: [s_store_sk#19, sum#26, sum#27] (30) Exchange -Input [3]: [s_store_sk#23, sum#26, sum#27] -Arguments: hashpartitioning(s_store_sk#23, 5), true, [id=#28] +Input [3]: [s_store_sk#19, sum#26, sum#27] +Arguments: hashpartitioning(s_store_sk#19, 5), true, [id=#28] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#23, sum#26, sum#27] -Keys [1]: [s_store_sk#23] -Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#29, sum(UnscaledValue(sr_net_loss#22))#30] -Results [3]: [s_store_sk#23, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#29,17,2) AS returns#31, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#30,17,2) AS profit_loss#32] +Input [3]: [s_store_sk#19, sum#26, sum#27] +Keys [1]: [s_store_sk#19] +Functions [2]: [sum(UnscaledValue(sr_return_amt#22)), sum(UnscaledValue(sr_net_loss#23))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#22))#29, sum(UnscaledValue(sr_net_loss#23))#30] +Results [3]: [s_store_sk#19, MakeDecimal(sum(UnscaledValue(sr_return_amt#22))#29,17,2) AS returns#31, MakeDecimal(sum(UnscaledValue(sr_net_loss#23))#30,17,2) AS profit_loss#32] (32) BroadcastExchange -Input [3]: [s_store_sk#23, returns#31, profit_loss#32] +Input [3]: [s_store_sk#19, returns#31, profit_loss#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#8] -Right keys [1]: [s_store_sk#23] +Right keys [1]: [s_store_sk#19] Join condition: None (34) Project [codegen id : 8] Output [5]: [sales#17, coalesce(returns#31, 0.00) AS returns#34, CheckOverflow((promote_precision(cast(profit#18 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#32, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#35, store channel AS channel#36, s_store_sk#8 AS id#37] -Input [6]: [s_store_sk#8, sales#17, profit#18, s_store_sk#23, returns#31, profit_loss#32] +Input [6]: [s_store_sk#8, sales#17, profit#18, s_store_sk#19, returns#31, profit_loss#32] (35) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] @@ -265,17 +265,17 @@ Input [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_ Input [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] Condition : isnotnull(cs_sold_date_sk#38) -(38) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(38) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] (39) BroadcastHashJoin [codegen id : 10] Left keys [1]: [cs_sold_date_sk#38] -Right keys [1]: [d_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None (40) Project [codegen id : 10] Output [3]: [cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] -Input [5]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41, d_date_sk#5] +Input [5]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41, d_date_sk#1] (41) HashAggregate [codegen id : 10] Input [3]: [cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] @@ -309,17 +309,17 @@ Input [3]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53] Input [3]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53] Condition : isnotnull(cr_returned_date_sk#51) -(47) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(47) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] (48) BroadcastHashJoin [codegen id : 13] Left keys [1]: [cr_returned_date_sk#51] -Right keys [1]: [d_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None (49) Project [codegen id : 13] Output [2]: [cr_return_amount#52, cr_net_loss#53] -Input [4]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53, d_date_sk#5] +Input [4]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53, d_date_sk#1] (50) HashAggregate [codegen id : 13] Input [2]: [cr_return_amount#52, cr_net_loss#53] @@ -364,17 +364,17 @@ Input [4]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net Input [4]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70] Condition : (isnotnull(ws_sold_date_sk#67) AND isnotnull(ws_web_page_sk#68)) -(59) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(59) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] (60) BroadcastHashJoin [codegen id : 18] Left keys [1]: [ws_sold_date_sk#67] -Right keys [1]: [d_date_sk#5] +Right keys [1]: [d_date_sk#1] Join condition: None (61) Project [codegen id : 18] Output [3]: [ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70] -Input [5]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70, d_date_sk#5] +Input [5]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70, d_date_sk#1] (62) Scan parquet default.web_page Output [1]: [wp_web_page_sk#71] @@ -447,17 +447,17 @@ Join condition: None Output [4]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] Input [5]: [wr_returned_date_sk#82, wr_web_page_sk#83, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] -(77) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] +(77) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] (78) BroadcastHashJoin [codegen id : 21] Left keys [1]: [wr_returned_date_sk#82] -Right keys [1]: [cast(d_date_sk#5 as bigint)] +Right keys [1]: [cast(d_date_sk#1 as bigint)] Join condition: None (79) Project [codegen id : 21] Output [3]: [wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] -Input [5]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86, d_date_sk#5] +Input [5]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86, d_date_sk#1] (80) HashAggregate [codegen id : 21] Input [3]: [wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt index 6840f4367260f..f61f8aa5456a4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt @@ -19,11 +19,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ss_ext_sales_price,ss_net_profit,s_store_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -32,6 +28,10 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -49,14 +49,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] Project [sr_return_amt,sr_net_loss,s_store_sk] BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Project [sr_returned_date_sk,sr_return_amt,sr_net_loss,s_store_sk] - BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [s_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [s_store_sk,sr_store_sk] + InputAdapter + ReusedExchange [s_store_sk] #4 Filter [sr_returned_date_sk,sr_store_sk] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_returned_date_sk,sr_store_sk,sr_return_amt,sr_net_loss] - InputAdapter - ReusedExchange [s_store_sk] #4 InputAdapter ReusedExchange [d_date_sk] #3 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt index 05cf4c2490b7b..d938ba85e762c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt @@ -4,50 +4,50 @@ TakeOrderedAndProject (70) +- * SortMergeJoin Inner (68) :- * Project (46) : +- * SortMergeJoin Inner (45) - : :- * Sort (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) - : : :- * Project (13) - : : : +- * Filter (12) - : : : +- SortMergeJoin LeftOuter (11) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_returns (6) - : : +- BroadcastExchange (17) - : : +- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.date_dim (14) + : :- * Sort (24) + : : +- * Filter (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (13) + : : : +- * Filter (12) + : : : +- SortMergeJoin LeftOuter (11) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_returns (6) + : : +- BroadcastExchange (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.date_dim (14) : +- * Sort (44) - : +- * Filter (43) - : +- * HashAggregate (42) - : +- Exchange (41) - : +- * HashAggregate (40) - : +- * Project (39) - : +- * BroadcastHashJoin Inner BuildRight (38) - : :- * Project (36) - : : +- * Filter (35) - : : +- SortMergeJoin LeftOuter (34) - : : :- * Sort (28) - : : : +- Exchange (27) - : : : +- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.catalog_sales (24) - : : +- * Sort (33) - : : +- Exchange (32) - : : +- * Filter (31) - : : +- * ColumnarToRow (30) - : : +- Scan parquet default.catalog_returns (29) - : +- ReusedExchange (37) + : +- * HashAggregate (43) + : +- Exchange (42) + : +- * HashAggregate (41) + : +- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * Project (37) + : : +- * Filter (36) + : : +- SortMergeJoin LeftOuter (35) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.store_sales (25) + : : +- * Sort (34) + : : +- Exchange (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.store_returns (30) + : +- ReusedExchange (38) +- * Sort (67) +- * Filter (66) +- * HashAggregate (65) @@ -71,68 +71,68 @@ TakeOrderedAndProject (70) +- ReusedExchange (60) -(1) Scan parquet default.store_sales -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +(1) Scan parquet default.catalog_sales +Output [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] (3) Filter [codegen id : 1] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Condition : ((isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_bill_customer_sk#2)) (4) Exchange -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint), 5), true, [id=#8] +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#8] (5) Sort [codegen id : 2] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.store_returns -Output [2]: [sr_item_sk#9, sr_ticket_number#10] +(6) Scan parquet default.catalog_returns +Output [2]: [cr_item_sk#9, cr_order_number#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Input [2]: [cr_item_sk#9, cr_order_number#10] (8) Filter [codegen id : 3] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9)) +Input [2]: [cr_item_sk#9, cr_order_number#10] +Condition : (isnotnull(cr_order_number#10) AND isnotnull(cr_item_sk#9)) (9) Exchange -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Arguments: hashpartitioning(sr_ticket_number#10, sr_item_sk#9, 5), true, [id=#11] +Input [2]: [cr_item_sk#9, cr_order_number#10] +Arguments: hashpartitioning(cr_order_number#10, cr_item_sk#9, 5), true, [id=#11] (10) Sort [codegen id : 4] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Arguments: [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST], false, 0 +Input [2]: [cr_item_sk#9, cr_order_number#10] +Arguments: [cr_order_number#10 ASC NULLS FIRST, cr_item_sk#9 ASC NULLS FIRST], false, 0 (11) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint)] -Right keys [2]: [sr_ticket_number#10, sr_item_sk#9] +Left keys [2]: [cs_order_number#4, cs_item_sk#3] +Right keys [2]: [cr_order_number#10, cr_item_sk#9] Join condition: None (12) Filter [codegen id : 6] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] -Condition : isnull(sr_ticket_number#10) +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] +Condition : isnull(cr_order_number#10) (13) Project [codegen id : 6] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] +Output [6]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] (14) Scan parquet default.date_dim Output [2]: [d_date_sk#12, d_year#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_date_sk), EqualTo(d_year,2000), IsNotNull(d_year)] ReadSchema: struct (15) ColumnarToRow [codegen id : 5] @@ -140,146 +140,146 @@ Input [2]: [d_date_sk#12, d_year#13] (16) Filter [codegen id : 5] Input [2]: [d_date_sk#12, d_year#13] -Condition : ((isnotnull(d_year#13) AND (d_year#13 = 2000)) AND isnotnull(d_date_sk#12)) +Condition : ((isnotnull(d_date_sk#12) AND (d_year#13 = 2000)) AND isnotnull(d_year#13)) (17) BroadcastExchange Input [2]: [d_date_sk#12, d_year#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_date_sk#12, d_year#13] +Output [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] +Input [8]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_date_sk#12, d_year#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] -Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] -Functions [3]: [partial_sum(cast(ss_quantity#5 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#6)), partial_sum(UnscaledValue(ss_sales_price#7))] +Input [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] +Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] +Functions [3]: [partial_sum(cast(cs_quantity#5 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#6)), partial_sum(UnscaledValue(cs_sales_price#7))] Aggregate Attributes [3]: [sum#15, sum#16, sum#17] -Results [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Results [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] (21) Exchange -Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] -Arguments: hashpartitioning(d_year#13, ss_item_sk#2, ss_customer_sk#3, 5), true, [id=#21] +Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Arguments: hashpartitioning(d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, 5), true, [id=#21] (22) HashAggregate [codegen id : 7] -Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] -Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] -Functions [3]: [sum(cast(ss_quantity#5 as bigint)), sum(UnscaledValue(ss_wholesale_cost#6)), sum(UnscaledValue(ss_sales_price#7))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#5 as bigint))#22, sum(UnscaledValue(ss_wholesale_cost#6))#23, sum(UnscaledValue(ss_sales_price#7))#24] -Results [6]: [d_year#13 AS ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, sum(cast(ss_quantity#5 as bigint))#22 AS ss_qty#26, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#6))#23,17,2) AS ss_wc#27, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#24,17,2) AS ss_sp#28] - -(23) Sort [codegen id : 7] -Input [6]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] -Arguments: [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST], false, 0 - -(24) Scan parquet default.catalog_sales -Output [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] +Functions [3]: [sum(cast(cs_quantity#5 as bigint)), sum(UnscaledValue(cs_wholesale_cost#6)), sum(UnscaledValue(cs_sales_price#7))] +Aggregate Attributes [3]: [sum(cast(cs_quantity#5 as bigint))#22, sum(UnscaledValue(cs_wholesale_cost#6))#23, sum(UnscaledValue(cs_sales_price#7))#24] +Results [6]: [d_year#13 AS cs_sold_year#25, cs_item_sk#3, cs_bill_customer_sk#2 AS cs_customer_sk#26, sum(cast(cs_quantity#5 as bigint))#22 AS cs_qty#27, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#6))#23,17,2) AS cs_wc#28, MakeDecimal(sum(UnscaledValue(cs_sales_price#7))#24,17,2) AS cs_sp#29] + +(23) Filter [codegen id : 7] +Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] +Condition : (coalesce(cs_qty#27, 0) > 0) + +(24) Sort [codegen id : 7] +Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] +Arguments: [cs_sold_year#25 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST, cs_customer_sk#26 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(25) ColumnarToRow [codegen id : 8] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -(26) Filter [codegen id : 8] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Condition : ((isnotnull(cs_sold_date_sk#29) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_bill_customer_sk#30)) +(27) Filter [codegen id : 8] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Condition : ((isnotnull(ss_sold_date_sk#30) AND isnotnull(ss_item_sk#31)) AND isnotnull(ss_customer_sk#32)) -(27) Exchange -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Arguments: hashpartitioning(cs_order_number#32, cs_item_sk#31, 5), true, [id=#36] +(28) Exchange +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Arguments: hashpartitioning(cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint), 5), true, [id=#37] -(28) Sort [codegen id : 9] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Arguments: [cs_order_number#32 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST], false, 0 +(29) Sort [codegen id : 9] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Arguments: [cast(ss_ticket_number#33 as bigint) ASC NULLS FIRST, cast(ss_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 -(29) Scan parquet default.catalog_returns -Output [2]: [cr_item_sk#37, cr_order_number#38] +(30) Scan parquet default.store_returns +Output [2]: [sr_item_sk#38, sr_ticket_number#39] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct -(30) ColumnarToRow [codegen id : 10] -Input [2]: [cr_item_sk#37, cr_order_number#38] +(31) ColumnarToRow [codegen id : 10] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] -(31) Filter [codegen id : 10] -Input [2]: [cr_item_sk#37, cr_order_number#38] -Condition : (isnotnull(cr_order_number#38) AND isnotnull(cr_item_sk#37)) +(32) Filter [codegen id : 10] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Condition : (isnotnull(sr_ticket_number#39) AND isnotnull(sr_item_sk#38)) -(32) Exchange -Input [2]: [cr_item_sk#37, cr_order_number#38] -Arguments: hashpartitioning(cr_order_number#38, cr_item_sk#37, 5), true, [id=#39] +(33) Exchange +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Arguments: hashpartitioning(sr_ticket_number#39, sr_item_sk#38, 5), true, [id=#40] -(33) Sort [codegen id : 11] -Input [2]: [cr_item_sk#37, cr_order_number#38] -Arguments: [cr_order_number#38 ASC NULLS FIRST, cr_item_sk#37 ASC NULLS FIRST], false, 0 +(34) Sort [codegen id : 11] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Arguments: [sr_ticket_number#39 ASC NULLS FIRST, sr_item_sk#38 ASC NULLS FIRST], false, 0 -(34) SortMergeJoin -Left keys [2]: [cs_order_number#32, cs_item_sk#31] -Right keys [2]: [cr_order_number#38, cr_item_sk#37] +(35) SortMergeJoin +Left keys [2]: [cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint)] +Right keys [2]: [sr_ticket_number#39, sr_item_sk#38] Join condition: None -(35) Filter [codegen id : 13] -Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] -Condition : isnull(cr_order_number#38) +(36) Filter [codegen id : 13] +Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] +Condition : isnull(sr_ticket_number#39) -(36) Project [codegen id : 13] -Output [6]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] +(37) Project [codegen id : 13] +Output [6]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] -(37) ReusedExchange [Reuses operator id: 17] +(38) ReusedExchange [Reuses operator id: 17] Output [2]: [d_date_sk#12, d_year#13] -(38) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cs_sold_date_sk#29] +(39) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#30] Right keys [1]: [d_date_sk#12] Join condition: None -(39) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] -Input [8]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_date_sk#12, d_year#13] - -(40) HashAggregate [codegen id : 13] -Input [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] -Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] -Functions [3]: [partial_sum(cast(cs_quantity#33 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#34)), partial_sum(UnscaledValue(cs_sales_price#35))] -Aggregate Attributes [3]: [sum#40, sum#41, sum#42] -Results [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +(40) Project [codegen id : 13] +Output [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] +Input [8]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_date_sk#12, d_year#13] -(41) Exchange -Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -Arguments: hashpartitioning(d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, 5), true, [id=#46] +(41) HashAggregate [codegen id : 13] +Input [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] +Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] +Functions [3]: [partial_sum(cast(ss_quantity#34 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#35)), partial_sum(UnscaledValue(ss_sales_price#36))] +Aggregate Attributes [3]: [sum#41, sum#42, sum#43] +Results [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -(42) HashAggregate [codegen id : 14] -Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] -Functions [3]: [sum(cast(cs_quantity#33 as bigint)), sum(UnscaledValue(cs_wholesale_cost#34)), sum(UnscaledValue(cs_sales_price#35))] -Aggregate Attributes [3]: [sum(cast(cs_quantity#33 as bigint))#47, sum(UnscaledValue(cs_wholesale_cost#34))#48, sum(UnscaledValue(cs_sales_price#35))#49] -Results [6]: [d_year#13 AS cs_sold_year#50, cs_item_sk#31, cs_bill_customer_sk#30 AS cs_customer_sk#51, sum(cast(cs_quantity#33 as bigint))#47 AS cs_qty#52, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#34))#48,17,2) AS cs_wc#53, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#49,17,2) AS cs_sp#54] +(42) Exchange +Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +Arguments: hashpartitioning(d_year#13, ss_item_sk#31, ss_customer_sk#32, 5), true, [id=#47] -(43) Filter [codegen id : 14] -Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] -Condition : (coalesce(cs_qty#52, 0) > 0) +(43) HashAggregate [codegen id : 14] +Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] +Functions [3]: [sum(cast(ss_quantity#34 as bigint)), sum(UnscaledValue(ss_wholesale_cost#35)), sum(UnscaledValue(ss_sales_price#36))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#34 as bigint))#48, sum(UnscaledValue(ss_wholesale_cost#35))#49, sum(UnscaledValue(ss_sales_price#36))#50] +Results [6]: [d_year#13 AS ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, sum(cast(ss_quantity#34 as bigint))#48 AS ss_qty#52, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#35))#49,17,2) AS ss_wc#53, MakeDecimal(sum(UnscaledValue(ss_sales_price#36))#50,17,2) AS ss_sp#54] (44) Sort [codegen id : 14] -Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] -Arguments: [cs_sold_year#50 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST, cs_customer_sk#51 ASC NULLS FIRST], false, 0 +Input [6]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Arguments: [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST], false, 0 (45) SortMergeJoin [codegen id : 15] -Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] -Right keys [3]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51] +Left keys [3]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26] +Right keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] Join condition: None (46) Project [codegen id : 15] -Output [9]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54] -Input [12]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Output [9]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Input [12]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] (47) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61] @@ -377,15 +377,15 @@ Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc# Arguments: [ws_sold_year#76 ASC NULLS FIRST, ws_item_sk#56 ASC NULLS FIRST, ws_customer_sk#77 ASC NULLS FIRST], false, 0 (68) SortMergeJoin [codegen id : 23] -Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] +Left keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] Right keys [3]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77] Join condition: None (69) Project [codegen id : 23] -Output [12]: [round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) AS ratio#81, ss_qty#26 AS store_qty#82, ss_wc#27 AS store_wholesale_cost#83, ss_sp#28 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#52, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#53, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#54, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_qty#26, ss_wc#27, ss_sp#28, ws_qty#78, cs_qty#52] -Input [15]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] +Output [12]: [round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) AS ratio#81, ss_qty#52 AS store_qty#82, ss_wc#53 AS store_wholesale_cost#83, ss_sp#54 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#27, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#28, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#29, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_qty#52, ss_wc#53, ss_sp#54, ws_qty#78, cs_qty#27] +Input [15]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] (70) TakeOrderedAndProject -Input [12]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_qty#26, ss_wc#27, ss_sp#28, ws_qty#78, cs_qty#52] -Arguments: 100, [ratio#81 ASC NULLS FIRST, ss_qty#26 DESC NULLS LAST, ss_wc#27 DESC NULLS LAST, ss_sp#28 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] +Input [12]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_qty#52, ss_wc#53, ss_sp#54, ws_qty#78, cs_qty#27] +Arguments: 100, [ratio#81 ASC NULLS FIRST, ss_qty#52 DESC NULLS LAST, ss_wc#53 DESC NULLS LAST, ss_sp#54 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt index b46178cb8f473..80581ddbdfaa8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt @@ -4,55 +4,16 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholes SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (15) - Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + Project [cs_qty,cs_wc,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp] + SortMergeJoin [cs_sold_year,cs_item_sk,cs_customer_sk,ss_sold_year,ss_item_sk,ss_customer_sk] InputAdapter WholeStageCodegen (7) - Sort [ss_sold_year,ss_item_sk,ss_customer_sk] - HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] - InputAdapter - Exchange [d_year,ss_item_sk,ss_customer_sk] #1 - WholeStageCodegen (6) - HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] - Filter [sr_ticket_number] - InputAdapter - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - WholeStageCodegen (2) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #2 - WholeStageCodegen (1) - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] - WholeStageCodegen (4) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #3 - WholeStageCodegen (3) - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (5) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (14) Sort [cs_sold_year,cs_item_sk,cs_customer_sk] Filter [cs_qty] HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cast(cs_quantity as bigint)),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 - WholeStageCodegen (13) + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #1 + WholeStageCodegen (6) HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -60,26 +21,65 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholes Filter [cr_order_number] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (9) + WholeStageCodegen (2) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #6 - WholeStageCodegen (8) + Exchange [cs_order_number,cs_item_sk] #2 + WholeStageCodegen (1) Filter [cs_sold_date_sk,cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price] - WholeStageCodegen (11) + WholeStageCodegen (4) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #7 - WholeStageCodegen (10) + Exchange [cr_order_number,cr_item_sk] #3 + WholeStageCodegen (3) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number] InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + BroadcastExchange #4 + WholeStageCodegen (5) + Filter [d_date_sk,d_year] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] + Filter [sr_ticket_number] + InputAdapter + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + WholeStageCodegen (9) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #6 + WholeStageCodegen (8) + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] + WholeStageCodegen (11) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (10) + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [ws_sold_year,ws_item_sk,ws_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt index 9ac081b356c94..e1d004d37deb2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -87,20 +87,20 @@ TakeOrderedAndProject (108) : :- * Project (90) : : +- * BroadcastHashJoin Inner BuildRight (89) : : :- * Project (87) - : : : +- * BroadcastHashJoin Inner BuildRight (86) - : : : :- * Project (84) - : : : : +- SortMergeJoin LeftOuter (83) - : : : : :- * Sort (77) - : : : : : +- Exchange (76) - : : : : : +- * Filter (75) - : : : : : +- * ColumnarToRow (74) - : : : : : +- Scan parquet default.web_sales (73) - : : : : +- * Sort (82) - : : : : +- Exchange (81) - : : : : +- * Filter (80) - : : : : +- * ColumnarToRow (79) - : : : : +- Scan parquet default.web_returns (78) - : : : +- ReusedExchange (85) + : : : +- * BroadcastHashJoin Inner BuildLeft (86) + : : : :- ReusedExchange (73) + : : : +- * Project (85) + : : : +- SortMergeJoin LeftOuter (84) + : : : :- * Sort (78) + : : : : +- Exchange (77) + : : : : +- * Filter (76) + : : : : +- * ColumnarToRow (75) + : : : : +- Scan parquet default.web_sales (74) + : : : +- * Sort (83) + : : : +- Exchange (82) + : : : +- * Filter (81) + : : : +- * ColumnarToRow (80) + : : : +- Scan parquet default.web_returns (79) : : +- ReusedExchange (88) : +- ReusedExchange (91) +- BroadcastExchange (97) @@ -434,70 +434,70 @@ Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#50)), sum(coalesce(cast(cr_ Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#50))#72, sum(coalesce(cast(cr_return_amount#55 as decimal(12,2)), 0.00))#73, sum(CheckOverflow((promote_precision(cast(cs_net_profit#51 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#56 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#74] Results [5]: [MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#50))#72,17,2) AS sales#75, sum(coalesce(cast(cr_return_amount#55 as decimal(12,2)), 0.00))#73 AS returns#76, sum(CheckOverflow((promote_precision(cast(cs_net_profit#51 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#56 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#74 AS profit#77, catalog channel AS channel#78, concat(catalog_page, cp_catalog_page_id#59) AS id#79] -(73) Scan parquet default.web_sales +(73) ReusedExchange [Reuses operator id: 17] +Output [1]: [i_item_sk#14] + +(74) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] ReadSchema: struct -(74) ColumnarToRow [codegen id : 21] +(75) ColumnarToRow [codegen id : 22] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] -(75) Filter [codegen id : 21] +(76) Filter [codegen id : 22] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Condition : (((isnotnull(ws_sold_date_sk#80) AND isnotnull(ws_web_site_sk#82)) AND isnotnull(ws_item_sk#81)) AND isnotnull(ws_promo_sk#83)) -(76) Exchange +(77) Exchange Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Arguments: hashpartitioning(cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint), 5), true, [id=#87] -(77) Sort [codegen id : 22] +(78) Sort [codegen id : 23] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Arguments: [cast(ws_item_sk#81 as bigint) ASC NULLS FIRST, cast(ws_order_number#84 as bigint) ASC NULLS FIRST], false, 0 -(78) Scan parquet default.web_returns +(79) Scan parquet default.web_returns Output [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] ReadSchema: struct -(79) ColumnarToRow [codegen id : 23] +(80) ColumnarToRow [codegen id : 24] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] -(80) Filter [codegen id : 23] +(81) Filter [codegen id : 24] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Condition : (isnotnull(wr_item_sk#88) AND isnotnull(wr_order_number#89)) -(81) Exchange +(82) Exchange Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Arguments: hashpartitioning(wr_item_sk#88, wr_order_number#89, 5), true, [id=#92] -(82) Sort [codegen id : 24] +(83) Sort [codegen id : 25] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Arguments: [wr_item_sk#88 ASC NULLS FIRST, wr_order_number#89 ASC NULLS FIRST], false, 0 -(83) SortMergeJoin +(84) SortMergeJoin Left keys [2]: [cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint)] Right keys [2]: [wr_item_sk#88, wr_order_number#89] Join condition: None -(84) Project [codegen id : 29] +(85) Project Output [8]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] Input [11]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86, wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] -(85) ReusedExchange [Reuses operator id: 17] -Output [1]: [i_item_sk#14] - (86) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ws_item_sk#81] -Right keys [1]: [i_item_sk#14] +Left keys [1]: [i_item_sk#14] +Right keys [1]: [ws_item_sk#81] Join condition: None (87) Project [codegen id : 29] Output [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [9]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, i_item_sk#14] +Input [9]: [i_item_sk#14, ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] (88) ReusedExchange [Reuses operator id: 24] Output [1]: [p_promo_sk#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt index ec00b49e71989..54f19c3fb0d09 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt @@ -135,30 +135,30 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ws_sold_date_sk,ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] BroadcastHashJoin [ws_promo_sk,p_promo_sk] Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_item_sk,i_item_sk] + BroadcastHashJoin [i_item_sk,ws_item_sk] + InputAdapter + ReusedExchange [i_item_sk] #5 Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] InputAdapter SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] - WholeStageCodegen (22) + WholeStageCodegen (23) Sort [ws_item_sk,ws_order_number] InputAdapter Exchange [ws_item_sk,ws_order_number] #14 - WholeStageCodegen (21) + WholeStageCodegen (22) Filter [ws_sold_date_sk,ws_web_site_sk,ws_item_sk,ws_promo_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit] - WholeStageCodegen (24) + WholeStageCodegen (25) Sort [wr_item_sk,wr_order_number] InputAdapter Exchange [wr_item_sk,wr_order_number] #15 - WholeStageCodegen (23) + WholeStageCodegen (24) Filter [wr_item_sk,wr_order_number] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] - InputAdapter - ReusedExchange [i_item_sk] #5 InputAdapter ReusedExchange [p_promo_sk] #6 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt index 6e757528a3e68..94df2644152f2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt @@ -7,14 +7,14 @@ TakeOrderedAndProject (61) : :- * Sort (11) : : +- Exchange (10) : : +- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.customer (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.customer_address (4) + : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : :- BroadcastExchange (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer_address (1) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.customer (5) : +- * Sort (36) : +- Exchange (35) : +- * Filter (34) @@ -53,63 +53,63 @@ TakeOrderedAndProject (61) :- * Sort (46) : +- Exchange (45) : +- * Project (44) - : +- * BroadcastHashJoin Inner BuildRight (43) - : :- * Filter (41) - : : +- * ColumnarToRow (40) - : : +- Scan parquet default.catalog_returns (39) - : +- ReusedExchange (42) + : +- * BroadcastHashJoin Inner BuildLeft (43) + : :- ReusedExchange (39) + : +- * Filter (42) + : +- * ColumnarToRow (41) + : +- Scan parquet default.catalog_returns (40) +- * Sort (48) +- ReusedExchange (47) -(1) Scan parquet default.customer -Output [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] - -(3) Filter [codegen id : 2] -Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] -Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) - -(4) Scan parquet default.customer_address -Output [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +(1) Scan parquet default.customer_address +Output [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +(2) ColumnarToRow [codegen id : 1] +Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] -(6) Filter [codegen id : 1] -Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -Condition : ((isnotnull(ca_state#14) AND (ca_state#14 = GA)) AND isnotnull(ca_address_sk#7)) +(3) Filter [codegen id : 1] +Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] +Condition : ((isnotnull(ca_state#8) AND (ca_state#8 = GA)) AND isnotnull(ca_address_sk#1)) -(7) BroadcastExchange -Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] +(4) BroadcastExchange +Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(5) Scan parquet default.customer +Output [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] + +(7) Filter +Input [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] +Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_current_addr_sk#16)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#7] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#16] Join condition: None (9) Project [codegen id : 2] -Output [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -Input [18]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Output [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] +Input [18]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] (10) Exchange -Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#20] +Input [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] +Arguments: hashpartitioning(c_customer_sk#14, 5), true, [id=#20] (11) Sort [codegen id : 3] -Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 +Input [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] +Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (12) Scan parquet default.catalog_returns Output [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] @@ -165,53 +165,53 @@ Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_ Arguments: [cr_returning_addr_sk#23 ASC NULLS FIRST], false, 0 (24) Scan parquet default.customer_address -Output [2]: [ca_address_sk#7, ca_state#14] +Output [2]: [ca_address_sk#1, ca_state#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] ReadSchema: struct (25) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#7, ca_state#14] +Input [2]: [ca_address_sk#1, ca_state#8] (26) Filter [codegen id : 7] -Input [2]: [ca_address_sk#7, ca_state#14] -Condition : (isnotnull(ca_address_sk#7) AND isnotnull(ca_state#14)) +Input [2]: [ca_address_sk#1, ca_state#8] +Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_state#8)) (27) Exchange -Input [2]: [ca_address_sk#7, ca_state#14] -Arguments: hashpartitioning(ca_address_sk#7, 5), true, [id=#29] +Input [2]: [ca_address_sk#1, ca_state#8] +Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#29] (28) Sort [codegen id : 8] -Input [2]: [ca_address_sk#7, ca_state#14] -Arguments: [ca_address_sk#7 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_state#8] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 (29) SortMergeJoin [codegen id : 9] Left keys [1]: [cr_returning_addr_sk#23] -Right keys [1]: [ca_address_sk#7] +Right keys [1]: [ca_address_sk#1] Join condition: None (30) Project [codegen id : 9] -Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] -Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#7, ca_state#14] +Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] +Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#1, ca_state#8] (31) HashAggregate [codegen id : 9] -Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] -Keys [2]: [cr_returning_customer_sk#22, ca_state#14] +Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] +Keys [2]: [cr_returning_customer_sk#22, ca_state#8] Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum#30] -Results [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] +Results [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] (32) Exchange -Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] -Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#14, 5), true, [id=#32] +Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] +Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#8, 5), true, [id=#32] (33) HashAggregate [codegen id : 10] -Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] -Keys [2]: [cr_returning_customer_sk#22, ca_state#14] +Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] +Keys [2]: [cr_returning_customer_sk#22, ca_state#8] Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))#33] -Results [3]: [cr_returning_customer_sk#22 AS ctr_customer_sk#34, ca_state#14 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#33,17,2) AS ctr_total_return#36] +Results [3]: [cr_returning_customer_sk#22 AS ctr_customer_sk#34, ca_state#8 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#33,17,2) AS ctr_total_return#36] (34) Filter [codegen id : 10] Input [3]: [ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] @@ -226,39 +226,39 @@ Input [3]: [ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] Arguments: [ctr_customer_sk#34 ASC NULLS FIRST], false, 0 (37) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_customer_sk#1] +Left keys [1]: [c_customer_sk#14] Right keys [1]: [ctr_customer_sk#34] Join condition: None (38) Project [codegen id : 20] -Output [17]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#35, ctr_total_return#36] -Input [19]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] +Output [17]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_state#35, ctr_total_return#36] +Input [19]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] + +(39) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#25] -(39) Scan parquet default.catalog_returns +(40) Scan parquet default.catalog_returns Output [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_addr_sk)] ReadSchema: struct -(40) ColumnarToRow [codegen id : 13] +(41) ColumnarToRow Input [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] -(41) Filter [codegen id : 13] +(42) Filter Input [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] Condition : (isnotnull(cr_returned_date_sk#21) AND isnotnull(cr_returning_addr_sk#23)) -(42) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#25] - (43) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cr_returned_date_sk#21] -Right keys [1]: [d_date_sk#25] +Left keys [1]: [d_date_sk#25] +Right keys [1]: [cr_returned_date_sk#21] Join condition: None (44) Project [codegen id : 13] Output [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] -Input [5]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, d_date_sk#25] +Input [5]: [d_date_sk#25, cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] (45) Exchange Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] @@ -269,38 +269,38 @@ Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_ Arguments: [cr_returning_addr_sk#23 ASC NULLS FIRST], false, 0 (47) ReusedExchange [Reuses operator id: 27] -Output [2]: [ca_address_sk#7, ca_state#14] +Output [2]: [ca_address_sk#1, ca_state#8] (48) Sort [codegen id : 16] -Input [2]: [ca_address_sk#7, ca_state#14] -Arguments: [ca_address_sk#7 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#1, ca_state#8] +Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 17] Left keys [1]: [cr_returning_addr_sk#23] -Right keys [1]: [ca_address_sk#7] +Right keys [1]: [ca_address_sk#1] Join condition: None (50) Project [codegen id : 17] -Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] -Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#7, ca_state#14] +Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] +Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#1, ca_state#8] (51) HashAggregate [codegen id : 17] -Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] -Keys [2]: [cr_returning_customer_sk#22, ca_state#14] +Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] +Keys [2]: [cr_returning_customer_sk#22, ca_state#8] Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum#39] -Results [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] +Results [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] (52) Exchange -Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] -Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#14, 5), true, [id=#41] +Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] +Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#8, 5), true, [id=#41] (53) HashAggregate [codegen id : 18] -Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] -Keys [2]: [cr_returning_customer_sk#22, ca_state#14] +Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] +Keys [2]: [cr_returning_customer_sk#22, ca_state#8] Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))#42] -Results [2]: [ca_state#14 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#42,17,2) AS ctr_total_return#36] +Results [2]: [ca_state#8 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#42,17,2) AS ctr_total_return#36] (54) HashAggregate [codegen id : 18] Input [2]: [ctr_state#35, ctr_total_return#36] @@ -334,10 +334,10 @@ Right keys [1]: [ctr_state#35#50] Join condition: (cast(ctr_total_return#36 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49) (60) Project [codegen id : 20] -Output [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] -Input [19]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#35, ctr_total_return#36, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49, ctr_state#35#50] +Output [16]: [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] +Input [19]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_state#35, ctr_total_return#36, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49, ctr_state#35#50] (61) TakeOrderedAndProject -Input [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] -Arguments: 100, [c_customer_id#2 ASC NULLS FIRST, c_salutation#4 ASC NULLS FIRST, c_first_name#5 ASC NULLS FIRST, c_last_name#6 ASC NULLS FIRST, ca_street_number#8 ASC NULLS FIRST, ca_street_name#9 ASC NULLS FIRST, ca_street_type#10 ASC NULLS FIRST, ca_suite_number#11 ASC NULLS FIRST, ca_city#12 ASC NULLS FIRST, ca_county#13 ASC NULLS FIRST, ca_state#14 ASC NULLS FIRST, ca_zip#15 ASC NULLS FIRST, ca_country#16 ASC NULLS FIRST, ca_gmt_offset#17 ASC NULLS FIRST, ca_location_type#18 ASC NULLS FIRST, ctr_total_return#36 ASC NULLS FIRST], [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] +Input [16]: [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] +Arguments: 100, [c_customer_id#15 ASC NULLS FIRST, c_salutation#17 ASC NULLS FIRST, c_first_name#18 ASC NULLS FIRST, c_last_name#19 ASC NULLS FIRST, ca_street_number#2 ASC NULLS FIRST, ca_street_name#3 ASC NULLS FIRST, ca_street_type#4 ASC NULLS FIRST, ca_suite_number#5 ASC NULLS FIRST, ca_city#6 ASC NULLS FIRST, ca_county#7 ASC NULLS FIRST, ca_state#8 ASC NULLS FIRST, ca_zip#9 ASC NULLS FIRST, ca_country#10 ASC NULLS FIRST, ca_gmt_offset#11 ASC NULLS FIRST, ca_location_type#12 ASC NULLS FIRST, ctr_total_return#36 ASC NULLS FIRST], [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt index c603ab5194286..dba67335b3a48 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt @@ -2,7 +2,7 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st WholeStageCodegen (20) Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] - Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_state,ctr_total_return] + Project [ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,c_customer_id,c_salutation,c_first_name,c_last_name,ctr_state,ctr_total_return] SortMergeJoin [c_customer_sk,ctr_customer_sk] InputAdapter WholeStageCodegen (3) @@ -10,12 +10,8 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (2) - Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] + Project [ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -23,6 +19,10 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] InputAdapter WholeStageCodegen (11) Sort [ctr_customer_sk] @@ -90,13 +90,13 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st Exchange [cr_returning_addr_sk] #11 WholeStageCodegen (13) Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] - BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 Filter [cr_returned_date_sk,cr_returning_addr_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] - InputAdapter - ReusedExchange [d_date_sk] #6 InputAdapter WholeStageCodegen (16) Sort [ca_address_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt index 4f1a4a4a8a127..f7d8f7946be86 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt @@ -10,16 +10,16 @@ TakeOrderedAndProject (31) : +- * Project (18) : +- * BroadcastHashJoin Inner BuildRight (17) : :- * Project (11) - : : +- * BroadcastHashJoin Inner BuildLeft (10) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Project (9) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.inventory (6) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.item (5) : +- BroadcastExchange (16) : +- * Project (15) : +- * Filter (14) @@ -32,54 +32,54 @@ TakeOrderedAndProject (31) +- Scan parquet default.store_sales (21) -(1) Scan parquet default.item -Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +(1) Scan parquet default.inventory +Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 62.00)) AND (cast(i_current_price#4 as decimal(12,2)) <= 92.00)) AND i_manufact_id#5 IN (129,270,821,423)) AND isnotnull(i_item_sk#1)) +(2) ColumnarToRow [codegen id : 3] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -(4) Project [codegen id : 1] -Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +(3) Filter [codegen id : 3] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +Condition : ((((isnotnull(inv_quantity_on_hand#3) AND (inv_quantity_on_hand#3 >= 100)) AND (inv_quantity_on_hand#3 <= 500)) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) -(5) BroadcastExchange -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(4) Project [codegen id : 3] +Output [2]: [inv_date_sk#1, inv_item_sk#2] +Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -(6) Scan parquet default.inventory -Output [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(5) Scan parquet default.item +Output [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -(7) ColumnarToRow -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(7) Filter [codegen id : 1] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +Condition : ((((isnotnull(i_current_price#7) AND (i_current_price#7 >= 62.00)) AND (cast(i_current_price#7 as decimal(12,2)) <= 92.00)) AND i_manufact_id#8 IN (129,270,821,423)) AND isnotnull(i_item_sk#4)) -(8) Filter -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] -Condition : ((((isnotnull(inv_quantity_on_hand#9) AND (inv_quantity_on_hand#9 >= 100)) AND (inv_quantity_on_hand#9 <= 500)) AND isnotnull(inv_item_sk#8)) AND isnotnull(inv_date_sk#7)) +(8) Project [codegen id : 1] +Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -(9) Project -Output [2]: [inv_date_sk#7, inv_item_sk#8] -Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +(9) BroadcastExchange +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (10) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [inv_item_sk#8] +Left keys [1]: [inv_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (11) Project [codegen id : 3] -Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, inv_item_sk#8] +Output [5]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [6]: [inv_date_sk#1, inv_item_sk#2, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] (12) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_date#11] @@ -104,21 +104,21 @@ Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (17) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#7] +Left keys [1]: [inv_date_sk#1] Right keys [1]: [d_date_sk#10] Join condition: None (18) Project [codegen id : 3] -Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, d_date_sk#10] +Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Input [6]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, d_date_sk#10] (19) Exchange -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#13] +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: hashpartitioning(i_item_sk#4, 5), true, [id=#13] (20) Sort [codegen id : 4] -Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: [i_item_sk#4 ASC NULLS FIRST], false, 0 (21) Scan parquet default.store_sales Output [1]: [ss_item_sk#14] @@ -143,33 +143,33 @@ Input [1]: [ss_item_sk#14] Arguments: [ss_item_sk#14 ASC NULLS FIRST], false, 0 (26) SortMergeJoin [codegen id : 7] -Left keys [1]: [i_item_sk#1] +Left keys [1]: [i_item_sk#4] Right keys [1]: [ss_item_sk#14] Join condition: None (27) Project [codegen id : 7] -Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, ss_item_sk#14] +Output [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, ss_item_sk#14] (28) HashAggregate [codegen id : 7] -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] (29) Exchange -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), true, [id=#16] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: hashpartitioning(i_item_id#5, i_item_desc#6, i_current_price#7, 5), true, [id=#16] (30) HashAggregate [codegen id : 8] -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] (31) TakeOrderedAndProject -Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] -Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Arguments: 100, [i_item_id#5 ASC NULLS FIRST], [i_item_id#5, i_item_desc#6, i_current_price#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt index 520fdde428200..97c0c52263bb4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt @@ -15,8 +15,13 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] WholeStageCodegen (3) Project [i_item_sk,i_item_id,i_item_desc,i_current_price] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] - BroadcastHashJoin [i_item_sk,inv_item_sk] + Project [inv_date_sk,i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_date_sk,inv_item_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -25,11 +30,6 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] - Project [inv_date_sk,inv_item_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt index c41efb82d904c..82290bdffd2f1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject (61) : : : +- * BroadcastHashJoin Inner BuildRight (20) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_returns (1) + : : : : +- Scan parquet default.catalog_returns (1) : : : +- BroadcastExchange (19) : : : +- * Project (18) : : : +- * BroadcastHashJoin LeftSemi BuildRight (17) @@ -41,11 +41,11 @@ TakeOrderedAndProject (61) : +- * Project (39) : +- * BroadcastHashJoin Inner BuildRight (38) : :- * Project (36) - : : +- * BroadcastHashJoin Inner BuildRight (35) - : : :- * Filter (33) - : : : +- * ColumnarToRow (32) - : : : +- Scan parquet default.catalog_returns (31) - : : +- ReusedExchange (34) + : : +- * BroadcastHashJoin Inner BuildLeft (35) + : : :- ReusedExchange (31) + : : +- * Filter (34) + : : +- * ColumnarToRow (33) + : : +- Scan parquet default.store_returns (32) : +- ReusedExchange (37) +- BroadcastExchange (58) +- * HashAggregate (57) @@ -54,27 +54,27 @@ TakeOrderedAndProject (61) +- * Project (54) +- * BroadcastHashJoin Inner BuildRight (53) :- * Project (51) - : +- * BroadcastHashJoin Inner BuildRight (50) - : :- * Filter (48) - : : +- * ColumnarToRow (47) - : : +- Scan parquet default.web_returns (46) - : +- ReusedExchange (49) + : +- * BroadcastHashJoin Inner BuildLeft (50) + : :- ReusedExchange (46) + : +- * Filter (49) + : +- * ColumnarToRow (48) + : +- Scan parquet default.web_returns (47) +- ReusedExchange (52) -(1) Scan parquet default.store_returns -Output [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] +(1) Scan parquet default.catalog_returns +Output [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_returned_date_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 5] -Input [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] +Input [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] (3) Filter [codegen id : 5] -Input [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] -Condition : (isnotnull(sr_item_sk#2) AND isnotnull(sr_returned_date_sk#1)) +Input [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] +Condition : (isnotnull(cr_item_sk#2) AND isnotnull(cr_returned_date_sk#1)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#4, d_date#5] @@ -147,13 +147,13 @@ Input [1]: [d_date_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (20) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [sr_returned_date_sk#1] -Right keys [1]: [cast(d_date_sk#4 as bigint)] +Left keys [1]: [cr_returned_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (21) Project [codegen id : 5] -Output [2]: [sr_item_sk#2, sr_return_quantity#3] -Input [4]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3, d_date_sk#4] +Output [2]: [cr_item_sk#2, cr_return_quantity#3] +Input [4]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3, d_date_sk#4] (22) Scan parquet default.item Output [2]: [i_item_sk#12, i_item_id#13] @@ -174,18 +174,18 @@ Input [2]: [i_item_sk#12, i_item_id#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (26) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [sr_item_sk#2] -Right keys [1]: [cast(i_item_sk#12 as bigint)] +Left keys [1]: [cr_item_sk#2] +Right keys [1]: [i_item_sk#12] Join condition: None (27) Project [codegen id : 5] -Output [2]: [sr_return_quantity#3, i_item_id#13] -Input [4]: [sr_item_sk#2, sr_return_quantity#3, i_item_sk#12, i_item_id#13] +Output [2]: [cr_return_quantity#3, i_item_id#13] +Input [4]: [cr_item_sk#2, cr_return_quantity#3, i_item_sk#12, i_item_id#13] (28) HashAggregate [codegen id : 5] -Input [2]: [sr_return_quantity#3, i_item_id#13] +Input [2]: [cr_return_quantity#3, i_item_id#13] Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(cast(sr_return_quantity#3 as bigint))] +Functions [1]: [partial_sum(cast(cr_return_quantity#3 as bigint))] Aggregate Attributes [1]: [sum#15] Results [2]: [i_item_id#13, sum#16] @@ -196,52 +196,52 @@ Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#17] (30) HashAggregate [codegen id : 18] Input [2]: [i_item_id#13, sum#16] Keys [1]: [i_item_id#13] -Functions [1]: [sum(cast(sr_return_quantity#3 as bigint))] -Aggregate Attributes [1]: [sum(cast(sr_return_quantity#3 as bigint))#18] -Results [2]: [i_item_id#13 AS item_id#19, sum(cast(sr_return_quantity#3 as bigint))#18 AS sr_item_qty#20] +Functions [1]: [sum(cast(cr_return_quantity#3 as bigint))] +Aggregate Attributes [1]: [sum(cast(cr_return_quantity#3 as bigint))#18] +Results [2]: [i_item_id#13 AS item_id#19, sum(cast(cr_return_quantity#3 as bigint))#18 AS cr_item_qty#20] -(31) Scan parquet default.catalog_returns -Output [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_returned_date_sk)] -ReadSchema: struct +(31) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#4] -(32) ColumnarToRow [codegen id : 10] -Input [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] +(32) Scan parquet default.store_returns +Output [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct -(33) Filter [codegen id : 10] -Input [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] -Condition : (isnotnull(cr_item_sk#22) AND isnotnull(cr_returned_date_sk#21)) +(33) ColumnarToRow +Input [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] -(34) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#4] +(34) Filter +Input [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] +Condition : (isnotnull(sr_item_sk#22) AND isnotnull(sr_returned_date_sk#21)) (35) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cr_returned_date_sk#21] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [cast(d_date_sk#4 as bigint)] +Right keys [1]: [sr_returned_date_sk#21] Join condition: None (36) Project [codegen id : 10] -Output [2]: [cr_item_sk#22, cr_return_quantity#23] -Input [4]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23, d_date_sk#4] +Output [2]: [sr_item_sk#22, sr_return_quantity#23] +Input [4]: [d_date_sk#4, sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] (37) ReusedExchange [Reuses operator id: 25] Output [2]: [i_item_sk#12, i_item_id#13] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cr_item_sk#22] -Right keys [1]: [i_item_sk#12] +Left keys [1]: [sr_item_sk#22] +Right keys [1]: [cast(i_item_sk#12 as bigint)] Join condition: None (39) Project [codegen id : 10] -Output [2]: [cr_return_quantity#23, i_item_id#13] -Input [4]: [cr_item_sk#22, cr_return_quantity#23, i_item_sk#12, i_item_id#13] +Output [2]: [sr_return_quantity#23, i_item_id#13] +Input [4]: [sr_item_sk#22, sr_return_quantity#23, i_item_sk#12, i_item_id#13] (40) HashAggregate [codegen id : 10] -Input [2]: [cr_return_quantity#23, i_item_id#13] +Input [2]: [sr_return_quantity#23, i_item_id#13] Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(cast(cr_return_quantity#23 as bigint))] +Functions [1]: [partial_sum(cast(sr_return_quantity#23 as bigint))] Aggregate Attributes [1]: [sum#24] Results [2]: [i_item_id#13, sum#25] @@ -252,12 +252,12 @@ Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#26] (42) HashAggregate [codegen id : 11] Input [2]: [i_item_id#13, sum#25] Keys [1]: [i_item_id#13] -Functions [1]: [sum(cast(cr_return_quantity#23 as bigint))] -Aggregate Attributes [1]: [sum(cast(cr_return_quantity#23 as bigint))#27] -Results [2]: [i_item_id#13 AS item_id#28, sum(cast(cr_return_quantity#23 as bigint))#27 AS cr_item_qty#29] +Functions [1]: [sum(cast(sr_return_quantity#23 as bigint))] +Aggregate Attributes [1]: [sum(cast(sr_return_quantity#23 as bigint))#27] +Results [2]: [i_item_id#13 AS item_id#28, sum(cast(sr_return_quantity#23 as bigint))#27 AS sr_item_qty#29] (43) BroadcastExchange -Input [2]: [item_id#28, cr_item_qty#29] +Input [2]: [item_id#28, sr_item_qty#29] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#30] (44) BroadcastHashJoin [codegen id : 18] @@ -266,34 +266,34 @@ Right keys [1]: [item_id#28] Join condition: None (45) Project [codegen id : 18] -Output [3]: [item_id#19, sr_item_qty#20, cr_item_qty#29] -Input [4]: [item_id#19, sr_item_qty#20, item_id#28, cr_item_qty#29] +Output [3]: [cr_item_qty#20, item_id#28, sr_item_qty#29] +Input [4]: [item_id#19, cr_item_qty#20, item_id#28, sr_item_qty#29] + +(46) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#4] -(46) Scan parquet default.web_returns +(47) Scan parquet default.web_returns Output [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_returned_date_sk)] ReadSchema: struct -(47) ColumnarToRow [codegen id : 16] +(48) ColumnarToRow Input [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] -(48) Filter [codegen id : 16] +(49) Filter Input [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] Condition : (isnotnull(wr_item_sk#32) AND isnotnull(wr_returned_date_sk#31)) -(49) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#4] - (50) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [wr_returned_date_sk#31] -Right keys [1]: [cast(d_date_sk#4 as bigint)] +Left keys [1]: [cast(d_date_sk#4 as bigint)] +Right keys [1]: [wr_returned_date_sk#31] Join condition: None (51) Project [codegen id : 16] Output [2]: [wr_item_sk#32, wr_return_quantity#33] -Input [4]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33, d_date_sk#4] +Input [4]: [d_date_sk#4, wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] (52) ReusedExchange [Reuses operator id: 25] Output [2]: [i_item_sk#12, i_item_id#13] @@ -330,15 +330,15 @@ Input [2]: [item_id#38, wr_item_qty#39] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] (59) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [item_id#19] +Left keys [1]: [item_id#28] Right keys [1]: [item_id#38] Join condition: None (60) Project [codegen id : 18] -Output [8]: [item_id#19, sr_item_qty#20, (((cast(sr_item_qty#20 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS sr_dev#41, cr_item_qty#29, (((cast(cr_item_qty#29 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS cr_dev#42, wr_item_qty#39, (((cast(wr_item_qty#39 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS wr_dev#43, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#44] -Input [5]: [item_id#19, sr_item_qty#20, cr_item_qty#29, item_id#38, wr_item_qty#39] +Output [8]: [item_id#28, sr_item_qty#29, (((cast(sr_item_qty#29 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS sr_dev#41, cr_item_qty#20, (((cast(cr_item_qty#20 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS cr_dev#42, wr_item_qty#39, (((cast(wr_item_qty#39 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS wr_dev#43, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#44] +Input [5]: [cr_item_qty#20, item_id#28, sr_item_qty#29, item_id#38, wr_item_qty#39] (61) TakeOrderedAndProject -Input [8]: [item_id#19, sr_item_qty#20, sr_dev#41, cr_item_qty#29, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] -Arguments: 100, [item_id#19 ASC NULLS FIRST, sr_item_qty#20 ASC NULLS FIRST], [item_id#19, sr_item_qty#20, sr_dev#41, cr_item_qty#29, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] +Input [8]: [item_id#28, sr_item_qty#29, sr_dev#41, cr_item_qty#20, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] +Arguments: 100, [item_id#28 ASC NULLS FIRST, sr_item_qty#29 ASC NULLS FIRST], [item_id#28, sr_item_qty#29, sr_dev#41, cr_item_qty#20, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt index 7d93f4458f95e..25789d42f3edc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt @@ -2,21 +2,21 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty WholeStageCodegen (18) Project [item_id,sr_item_qty,cr_item_qty,wr_item_qty] BroadcastHashJoin [item_id,item_id] - Project [item_id,sr_item_qty,cr_item_qty] + Project [cr_item_qty,item_id,sr_item_qty] BroadcastHashJoin [item_id,item_id] - HashAggregate [i_item_id,sum] [sum(cast(sr_return_quantity as bigint)),item_id,sr_item_qty,sum] + HashAggregate [i_item_id,sum] [sum(cast(cr_return_quantity as bigint)),item_id,cr_item_qty,sum] InputAdapter Exchange [i_item_id] #1 WholeStageCodegen (5) - HashAggregate [i_item_id,sr_return_quantity] [sum,sum] - Project [sr_return_quantity,i_item_id] - BroadcastHashJoin [sr_item_sk,i_item_sk] - Project [sr_item_sk,sr_return_quantity] - BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Filter [sr_item_sk,sr_returned_date_sk] + HashAggregate [i_item_id,cr_return_quantity] [sum,sum] + Project [cr_return_quantity,i_item_id] + BroadcastHashJoin [cr_item_sk,i_item_sk] + Project [cr_item_sk,cr_return_quantity] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_item_sk,cr_returned_date_sk] ColumnarToRow InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_return_quantity] + Scan parquet default.catalog_returns [cr_returned_date_sk,cr_item_sk,cr_return_quantity] InputAdapter BroadcastExchange #2 WholeStageCodegen (3) @@ -52,21 +52,21 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty InputAdapter BroadcastExchange #6 WholeStageCodegen (11) - HashAggregate [i_item_id,sum] [sum(cast(cr_return_quantity as bigint)),item_id,cr_item_qty,sum] + HashAggregate [i_item_id,sum] [sum(cast(sr_return_quantity as bigint)),item_id,sr_item_qty,sum] InputAdapter Exchange [i_item_id] #7 WholeStageCodegen (10) - HashAggregate [i_item_id,cr_return_quantity] [sum,sum] - Project [cr_return_quantity,i_item_id] - BroadcastHashJoin [cr_item_sk,i_item_sk] - Project [cr_item_sk,cr_return_quantity] - BroadcastHashJoin [cr_returned_date_sk,d_date_sk] - Filter [cr_item_sk,cr_returned_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_returns [cr_returned_date_sk,cr_item_sk,cr_return_quantity] + HashAggregate [i_item_id,sr_return_quantity] [sum,sum] + Project [sr_return_quantity,i_item_id] + BroadcastHashJoin [sr_item_sk,i_item_sk] + Project [sr_item_sk,sr_return_quantity] + BroadcastHashJoin [d_date_sk,sr_returned_date_sk] InputAdapter ReusedExchange [d_date_sk] #2 + Filter [sr_item_sk,sr_returned_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_return_quantity] InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 InputAdapter @@ -80,12 +80,12 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty Project [wr_return_quantity,i_item_id] BroadcastHashJoin [wr_item_sk,i_item_sk] Project [wr_item_sk,wr_return_quantity] - BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 Filter [wr_item_sk,wr_returned_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_returned_date_sk,wr_item_sk,wr_return_quantity] - InputAdapter - ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt index 83ec6391d7736..3af319491085c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt @@ -7,28 +7,28 @@ TakeOrderedAndProject (36) : +- * BroadcastHashJoin Inner BuildLeft (28) : :- BroadcastExchange (24) : : +- * Project (23) - : : +- * BroadcastHashJoin Inner BuildRight (22) - : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.customer (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.customer_address (4) - : : +- BroadcastExchange (21) - : : +- * Project (20) - : : +- * BroadcastHashJoin Inner BuildRight (19) - : : :- * Filter (13) - : : : +- * ColumnarToRow (12) - : : : +- Scan parquet default.household_demographics (11) - : : +- BroadcastExchange (18) - : : +- * Project (17) - : : +- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.income_band (14) + : : +- * BroadcastHashJoin Inner BuildLeft (22) + : : :- BroadcastExchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.income_band (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.household_demographics (6) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (16) + : : : +- * Project (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer_address (12) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.customer (17) : +- * Filter (27) : +- * ColumnarToRow (26) : +- Scan parquet default.customer_demographics (25) @@ -37,111 +37,111 @@ TakeOrderedAndProject (36) +- Scan parquet default.store_returns (31) -(1) Scan parquet default.customer -Output [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +(1) Scan parquet default.income_band +Output [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] -(3) Filter [codegen id : 4] -Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] -Condition : ((isnotnull(c_current_addr_sk#4) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) +(3) Filter [codegen id : 1] +Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] +Condition : ((((isnotnull(ib_lower_bound#2) AND isnotnull(ib_upper_bound#3)) AND (ib_lower_bound#2 >= 38128)) AND (ib_upper_bound#3 <= 88128)) AND isnotnull(ib_income_band_sk#1)) -(4) Scan parquet default.customer_address -Output [2]: [ca_address_sk#7, ca_city#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [1]: [ib_income_band_sk#1] +Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#7, ca_city#8] +(5) BroadcastExchange +Input [1]: [ib_income_band_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] -(6) Filter [codegen id : 1] -Input [2]: [ca_address_sk#7, ca_city#8] -Condition : ((isnotnull(ca_city#8) AND (ca_city#8 = Edgewood)) AND isnotnull(ca_address_sk#7)) +(6) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#5, hd_income_band_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [ca_address_sk#7] -Input [2]: [ca_address_sk#7, ca_city#8] +(7) ColumnarToRow +Input [2]: [hd_demo_sk#5, hd_income_band_sk#6] -(8) BroadcastExchange -Input [1]: [ca_address_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) Filter +Input [2]: [hd_demo_sk#5, hd_income_band_sk#6] +Condition : (isnotnull(hd_demo_sk#5) AND isnotnull(hd_income_band_sk#6)) -(9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [c_current_addr_sk#4] -Right keys [1]: [ca_address_sk#7] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ib_income_band_sk#1] +Right keys [1]: [hd_income_band_sk#6] Join condition: None -(10) Project [codegen id : 4] -Output [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6] -Input [7]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6, ca_address_sk#7] +(10) Project [codegen id : 2] +Output [1]: [hd_demo_sk#5] +Input [3]: [ib_income_band_sk#1, hd_demo_sk#5, hd_income_band_sk#6] + +(11) BroadcastExchange +Input [1]: [hd_demo_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] -(11) Scan parquet default.household_demographics -Output [2]: [hd_demo_sk#10, hd_income_band_sk#11] +(12) Scan parquet default.customer_address +Output [2]: [ca_address_sk#8, ca_city#9] Batched: true -Location [not included in comparison]/{warehouse_dir}/household_demographics] -PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] +ReadSchema: struct -(12) ColumnarToRow [codegen id : 3] -Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] +(13) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#8, ca_city#9] -(13) Filter [codegen id : 3] -Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] -Condition : (isnotnull(hd_demo_sk#10) AND isnotnull(hd_income_band_sk#11)) +(14) Filter [codegen id : 3] +Input [2]: [ca_address_sk#8, ca_city#9] +Condition : ((isnotnull(ca_city#9) AND (ca_city#9 = Edgewood)) AND isnotnull(ca_address_sk#8)) -(14) Scan parquet default.income_band -Output [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] -Batched: true -Location [not included in comparison]/{warehouse_dir}/income_band] -PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] -ReadSchema: struct +(15) Project [codegen id : 3] +Output [1]: [ca_address_sk#8] +Input [2]: [ca_address_sk#8, ca_city#9] -(15) ColumnarToRow [codegen id : 2] -Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +(16) BroadcastExchange +Input [1]: [ca_address_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(16) Filter [codegen id : 2] -Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] -Condition : ((((isnotnull(ib_lower_bound#13) AND isnotnull(ib_upper_bound#14)) AND (ib_lower_bound#13 >= 38128)) AND (ib_upper_bound#14 <= 88128)) AND isnotnull(ib_income_band_sk#12)) +(17) Scan parquet default.customer +Output [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct -(17) Project [codegen id : 2] -Output [1]: [ib_income_band_sk#12] -Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +(18) ColumnarToRow +Input [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] -(18) BroadcastExchange -Input [1]: [ib_income_band_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(19) Filter +Input [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] +Condition : ((isnotnull(c_current_addr_sk#14) AND isnotnull(c_current_cdemo_sk#12)) AND isnotnull(c_current_hdemo_sk#13)) -(19) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [hd_income_band_sk#11] -Right keys [1]: [ib_income_band_sk#12] +(20) BroadcastHashJoin +Left keys [1]: [ca_address_sk#8] +Right keys [1]: [c_current_addr_sk#14] Join condition: None -(20) Project [codegen id : 3] -Output [1]: [hd_demo_sk#10] -Input [3]: [hd_demo_sk#10, hd_income_band_sk#11, ib_income_band_sk#12] - -(21) BroadcastExchange -Input [1]: [hd_demo_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +(21) Project +Output [5]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_first_name#15, c_last_name#16] +Input [7]: [ca_address_sk#8, c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [c_current_hdemo_sk#3] -Right keys [1]: [hd_demo_sk#10] +Left keys [1]: [hd_demo_sk#5] +Right keys [1]: [c_current_hdemo_sk#13] Join condition: None (23) Project [codegen id : 4] -Output [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] -Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, hd_demo_sk#10] +Output [4]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16] +Input [6]: [hd_demo_sk#5, c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_first_name#15, c_last_name#16] (24) BroadcastExchange -Input [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] +Input [4]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16] Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#17] (25) Scan parquet default.customer_demographics @@ -159,16 +159,16 @@ Input [1]: [cd_demo_sk#18] Condition : isnotnull(cd_demo_sk#18) (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_cdemo_sk#2] +Left keys [1]: [c_current_cdemo_sk#12] Right keys [1]: [cd_demo_sk#18] Join condition: None (29) Project [codegen id : 5] -Output [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] -Input [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6, cd_demo_sk#18] +Output [4]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18] +Input [5]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16, cd_demo_sk#18] (30) BroadcastExchange -Input [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] +Input [4]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19] (31) Scan parquet default.store_returns @@ -191,10 +191,10 @@ Right keys [1]: [sr_cdemo_sk#20] Join condition: None (35) Project [codegen id : 6] -Output [3]: [c_customer_id#1 AS customer_id#21, concat(c_last_name#6, , , c_first_name#5) AS customername#22, c_customer_id#1] -Input [5]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18, sr_cdemo_sk#20] +Output [3]: [c_customer_id#11 AS customer_id#21, concat(c_last_name#16, , , c_first_name#15) AS customername#22, c_customer_id#11] +Input [5]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18, sr_cdemo_sk#20] (36) TakeOrderedAndProject -Input [3]: [customer_id#21, customername#22, c_customer_id#1] -Arguments: 100, [c_customer_id#1 ASC NULLS FIRST], [customer_id#21, customername#22] +Input [3]: [customer_id#21, customername#22, c_customer_id#11] +Arguments: 100, [c_customer_id#11 ASC NULLS FIRST], [customer_id#21, customername#22] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt index 16087526bc130..17bc7e4c1c4e4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt @@ -11,38 +11,38 @@ TakeOrderedAndProject [c_customer_id,customer_id,customername] BroadcastExchange #2 WholeStageCodegen (4) Project [c_customer_id,c_current_cdemo_sk,c_first_name,c_last_name] - BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] - Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_city,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] + BroadcastHashJoin [hd_demo_sk,c_current_hdemo_sk] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (3) + BroadcastExchange #3 + WholeStageCodegen (2) Project [hd_demo_sk] - BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] - Filter [hd_demo_sk,hd_income_band_sk] - ColumnarToRow - InputAdapter - Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + BroadcastHashJoin [ib_income_band_sk,hd_income_band_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (2) + BroadcastExchange #4 + WholeStageCodegen (1) Project [ib_income_band_sk] Filter [ib_lower_bound,ib_upper_bound,ib_income_band_sk] ColumnarToRow InputAdapter Scan parquet default.income_band [ib_income_band_sk,ib_lower_bound,ib_upper_bound] + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [ca_address_sk] + Filter [ca_city,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt index 7c3f00d33f24e..60e90d4d809cd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt @@ -18,14 +18,14 @@ TakeOrderedAndProject (57) : : : : :- * Sort (11) : : : : : +- Exchange (10) : : : : : +- * Project (9) - : : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : : :- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.web_sales (1) - : : : : : +- BroadcastExchange (7) - : : : : : +- * Filter (6) - : : : : : +- * ColumnarToRow (5) - : : : : : +- Scan parquet default.web_page (4) + : : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : : :- BroadcastExchange (4) + : : : : : : +- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.web_page (1) + : : : : : +- * Filter (7) + : : : : : +- * ColumnarToRow (6) + : : : : : +- Scan parquet default.web_sales (5) : : : : +- * Sort (16) : : : : +- Exchange (15) : : : : +- * Filter (14) @@ -58,54 +58,54 @@ TakeOrderedAndProject (57) +- Scan parquet default.customer_demographics (45) -(1) Scan parquet default.web_sales -Output [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), IsNotNull(ws_sold_date_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] - -(3) Filter [codegen id : 2] -Input [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -Condition : (((((isnotnull(ws_item_sk#2) AND isnotnull(ws_order_number#4)) AND isnotnull(ws_web_page_sk#3)) AND isnotnull(ws_sold_date_sk#1)) AND ((((ws_sales_price#6 >= 100.00) AND (ws_sales_price#6 <= 150.00)) OR ((ws_sales_price#6 >= 50.00) AND (ws_sales_price#6 <= 100.00))) OR ((ws_sales_price#6 >= 150.00) AND (ws_sales_price#6 <= 200.00)))) AND ((((ws_net_profit#7 >= 100.00) AND (ws_net_profit#7 <= 200.00)) OR ((ws_net_profit#7 >= 150.00) AND (ws_net_profit#7 <= 300.00))) OR ((ws_net_profit#7 >= 50.00) AND (ws_net_profit#7 <= 250.00)))) - -(4) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#8] +(1) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#1] Batched: true Location [not included in comparison]/{warehouse_dir}/web_page] PushedFilters: [IsNotNull(wp_web_page_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [1]: [wp_web_page_sk#8] +(2) ColumnarToRow [codegen id : 1] +Input [1]: [wp_web_page_sk#1] + +(3) Filter [codegen id : 1] +Input [1]: [wp_web_page_sk#1] +Condition : isnotnull(wp_web_page_sk#1) + +(4) BroadcastExchange +Input [1]: [wp_web_page_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#2] + +(5) Scan parquet default.web_sales +Output [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), IsNotNull(ws_sold_date_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [1]: [wp_web_page_sk#8] -Condition : isnotnull(wp_web_page_sk#8) +(6) ColumnarToRow +Input [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] -(7) BroadcastExchange -Input [1]: [wp_web_page_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] +(7) Filter +Input [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Condition : (((((isnotnull(ws_item_sk#4) AND isnotnull(ws_order_number#6)) AND isnotnull(ws_web_page_sk#5)) AND isnotnull(ws_sold_date_sk#3)) AND ((((ws_sales_price#8 >= 100.00) AND (ws_sales_price#8 <= 150.00)) OR ((ws_sales_price#8 >= 50.00) AND (ws_sales_price#8 <= 100.00))) OR ((ws_sales_price#8 >= 150.00) AND (ws_sales_price#8 <= 200.00)))) AND ((((ws_net_profit#9 >= 100.00) AND (ws_net_profit#9 <= 200.00)) OR ((ws_net_profit#9 >= 150.00) AND (ws_net_profit#9 <= 300.00))) OR ((ws_net_profit#9 >= 50.00) AND (ws_net_profit#9 <= 250.00)))) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_web_page_sk#3] -Right keys [1]: [wp_web_page_sk#8] +Left keys [1]: [wp_web_page_sk#1] +Right keys [1]: [ws_web_page_sk#5] Join condition: None (9) Project [codegen id : 2] -Output [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -Input [8]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wp_web_page_sk#8] +Output [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Input [8]: [wp_web_page_sk#1, ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] (10) Exchange -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -Arguments: hashpartitioning(cast(ws_item_sk#2 as bigint), cast(ws_order_number#4 as bigint), 5), true, [id=#10] +Input [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Arguments: hashpartitioning(cast(ws_item_sk#4 as bigint), cast(ws_order_number#6 as bigint), 5), true, [id=#10] (11) Sort [codegen id : 3] -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -Arguments: [cast(ws_item_sk#2 as bigint) ASC NULLS FIRST, cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 +Input [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Arguments: [cast(ws_item_sk#4 as bigint) ASC NULLS FIRST, cast(ws_order_number#6 as bigint) ASC NULLS FIRST], false, 0 (12) Scan parquet default.web_returns Output [8]: [wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] @@ -130,13 +130,13 @@ Input [8]: [wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_r Arguments: [wr_item_sk#11 ASC NULLS FIRST, wr_order_number#16 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ws_item_sk#2 as bigint), cast(ws_order_number#4 as bigint)] +Left keys [2]: [cast(ws_item_sk#4 as bigint), cast(ws_order_number#6 as bigint)] Right keys [2]: [wr_item_sk#11, wr_order_number#16] Join condition: None (18) Project [codegen id : 9] -Output [10]: [ws_sold_date_sk#1, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] -Input [14]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] +Output [10]: [ws_sold_date_sk#3, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] +Input [14]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] (19) Scan parquet default.date_dim Output [2]: [d_date_sk#20, d_year#21] @@ -161,13 +161,13 @@ Input [1]: [d_date_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (24) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ws_sold_date_sk#1] +Left keys [1]: [ws_sold_date_sk#3] Right keys [1]: [d_date_sk#20] Join condition: None (25) Project [codegen id : 9] -Output [9]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] -Input [11]: [ws_sold_date_sk#1, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, d_date_sk#20] +Output [9]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] +Input [11]: [ws_sold_date_sk#3, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, d_date_sk#20] (26) Scan parquet default.reason Output [2]: [r_reason_sk#23, r_reason_desc#24] @@ -193,8 +193,8 @@ Right keys [1]: [cast(r_reason_sk#23 as bigint)] Join condition: None (31) Project [codegen id : 9] -Output [9]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, r_reason_sk#23, r_reason_desc#24] +Output [9]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, r_reason_sk#23, r_reason_desc#24] (32) Scan parquet default.customer_address Output [3]: [ca_address_sk#26, ca_state#27, ca_country#28] @@ -221,18 +221,18 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (37) BroadcastHashJoin [codegen id : 9] Left keys [1]: [wr_refunded_addr_sk#13] Right keys [1]: [cast(ca_address_sk#26 as bigint)] -Join condition: ((((ca_state#27 IN (IN,OH,NJ) AND (ws_net_profit#7 >= 100.00)) AND (ws_net_profit#7 <= 200.00)) OR ((ca_state#27 IN (WI,CT,KY) AND (ws_net_profit#7 >= 150.00)) AND (ws_net_profit#7 <= 300.00))) OR ((ca_state#27 IN (LA,IA,AR) AND (ws_net_profit#7 >= 50.00)) AND (ws_net_profit#7 <= 250.00))) +Join condition: ((((ca_state#27 IN (IN,OH,NJ) AND (ws_net_profit#9 >= 100.00)) AND (ws_net_profit#9 <= 200.00)) OR ((ca_state#27 IN (WI,CT,KY) AND (ws_net_profit#9 >= 150.00)) AND (ws_net_profit#9 <= 300.00))) OR ((ca_state#27 IN (LA,IA,AR) AND (ws_net_profit#9 >= 50.00)) AND (ws_net_profit#9 <= 250.00))) (38) Project [codegen id : 9] -Output [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, ca_address_sk#26, ca_state#27] +Output [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, ca_address_sk#26, ca_state#27] (39) Exchange -Input [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Arguments: hashpartitioning(wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, 5), true, [id=#30] (40) Sort [codegen id : 10] -Input [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Arguments: [wr_refunded_cdemo_sk#12 ASC NULLS FIRST, wr_returning_cdemo_sk#14 ASC NULLS FIRST], false, 0 (41) Scan parquet default.customer_demographics @@ -287,16 +287,16 @@ Arguments: [cast(cd_demo_sk#31 as bigint) ASC NULLS FIRST, cast(cd_demo_sk#35 as (52) SortMergeJoin [codegen id : 14] Left keys [2]: [wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14] Right keys [2]: [cast(cd_demo_sk#31 as bigint), cast(cd_demo_sk#35 as bigint)] -Join condition: ((((((cd_marital_status#32 = M) AND (cd_education_status#33 = Advanced Degree)) AND (ws_sales_price#6 >= 100.00)) AND (ws_sales_price#6 <= 150.00)) OR ((((cd_marital_status#32 = S) AND (cd_education_status#33 = College)) AND (ws_sales_price#6 >= 50.00)) AND (ws_sales_price#6 <= 100.00))) OR ((((cd_marital_status#32 = W) AND (cd_education_status#33 = 2 yr Degree)) AND (ws_sales_price#6 >= 150.00)) AND (ws_sales_price#6 <= 200.00))) +Join condition: ((((((cd_marital_status#32 = M) AND (cd_education_status#33 = Advanced Degree)) AND (ws_sales_price#8 >= 100.00)) AND (ws_sales_price#8 <= 150.00)) OR ((((cd_marital_status#32 = S) AND (cd_education_status#33 = College)) AND (ws_sales_price#8 >= 50.00)) AND (ws_sales_price#8 <= 100.00))) OR ((((cd_marital_status#32 = W) AND (cd_education_status#33 = 2 yr Degree)) AND (ws_sales_price#8 >= 150.00)) AND (ws_sales_price#8 <= 200.00))) (53) Project [codegen id : 14] -Output [4]: [ws_quantity#5, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, cd_demo_sk#31, cd_marital_status#32, cd_education_status#33, cd_demo_sk#35] +Output [4]: [ws_quantity#7, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, cd_demo_sk#31, cd_marital_status#32, cd_education_status#33, cd_demo_sk#35] (54) HashAggregate [codegen id : 14] -Input [4]: [ws_quantity#5, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [4]: [ws_quantity#7, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Keys [1]: [r_reason_desc#24] -Functions [3]: [partial_avg(cast(ws_quantity#5 as bigint)), partial_avg(UnscaledValue(wr_refunded_cash#18)), partial_avg(UnscaledValue(wr_fee#17))] +Functions [3]: [partial_avg(cast(ws_quantity#7 as bigint)), partial_avg(UnscaledValue(wr_refunded_cash#18)), partial_avg(UnscaledValue(wr_fee#17))] Aggregate Attributes [6]: [sum#39, count#40, sum#41, count#42, sum#43, count#44] Results [7]: [r_reason_desc#24, sum#45, count#46, sum#47, count#48, sum#49, count#50] @@ -307,9 +307,9 @@ Arguments: hashpartitioning(r_reason_desc#24, 5), true, [id=#51] (56) HashAggregate [codegen id : 15] Input [7]: [r_reason_desc#24, sum#45, count#46, sum#47, count#48, sum#49, count#50] Keys [1]: [r_reason_desc#24] -Functions [3]: [avg(cast(ws_quantity#5 as bigint)), avg(UnscaledValue(wr_refunded_cash#18)), avg(UnscaledValue(wr_fee#17))] -Aggregate Attributes [3]: [avg(cast(ws_quantity#5 as bigint))#52, avg(UnscaledValue(wr_refunded_cash#18))#53, avg(UnscaledValue(wr_fee#17))#54] -Results [5]: [substr(r_reason_desc#24, 1, 20) AS substr(r_reason_desc, 1, 20)#55, avg(cast(ws_quantity#5 as bigint))#52 AS avg(ws_quantity)#56, cast((avg(UnscaledValue(wr_refunded_cash#18))#53 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#57, cast((avg(UnscaledValue(wr_fee#17))#54 / 100.0) as decimal(11,6)) AS avg(wr_fee)#58, avg(cast(ws_quantity#5 as bigint))#52 AS aggOrder#59] +Functions [3]: [avg(cast(ws_quantity#7 as bigint)), avg(UnscaledValue(wr_refunded_cash#18)), avg(UnscaledValue(wr_fee#17))] +Aggregate Attributes [3]: [avg(cast(ws_quantity#7 as bigint))#52, avg(UnscaledValue(wr_refunded_cash#18))#53, avg(UnscaledValue(wr_fee#17))#54] +Results [5]: [substr(r_reason_desc#24, 1, 20) AS substr(r_reason_desc, 1, 20)#55, avg(cast(ws_quantity#7 as bigint))#52 AS avg(ws_quantity)#56, cast((avg(UnscaledValue(wr_refunded_cash#18))#53 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#57, cast((avg(UnscaledValue(wr_fee#17))#54 / 100.0) as decimal(11,6)) AS avg(wr_fee)#58, avg(cast(ws_quantity#7 as bigint))#52 AS aggOrder#59] (57) TakeOrderedAndProject Input [5]: [substr(r_reason_desc, 1, 20)#55, avg(ws_quantity)#56, avg(wr_refunded_cash)#57, avg(wr_fee)#58, aggOrder#59] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt index 3fa7d84f55966..ffb4f10098d4f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt @@ -28,11 +28,7 @@ TakeOrderedAndProject [substr(r_reason_desc, 1, 20),aggOrder,avg(wr_refunded_cas Exchange [ws_item_sk,ws_order_number] #3 WholeStageCodegen (2) Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] - BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] - Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sold_date_sk,ws_sales_price,ws_net_profit] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] + BroadcastHashJoin [wp_web_page_sk,ws_web_page_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -40,6 +36,10 @@ TakeOrderedAndProject [substr(r_reason_desc, 1, 20),aggOrder,avg(wr_refunded_cas ColumnarToRow InputAdapter Scan parquet default.web_page [wp_web_page_sk] + Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sold_date_sk,ws_sales_price,ws_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] InputAdapter WholeStageCodegen (5) Sort [wr_item_sk,wr_order_number] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt index 20ae4d244dcd8..20beeb9d31d89 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt @@ -118,7 +118,7 @@ Input [4]: [i_category#11, i_class#12, spark_grouping_id#13, sum#15] Keys [3]: [i_category#11, i_class#12, spark_grouping_id#13] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#17] -Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS total_sum#18, i_category#11, i_class#12, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS lochierarchy#19, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS _w1#20, CASE WHEN (cast(cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint) as int) = 0) THEN i_category#11 END AS _w2#21, MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS _w3#22] +Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS total_sum#18, i_category#11, i_class#12, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS lochierarchy#19, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS _w1#20, CASE WHEN (cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint) = 0) THEN i_category#11 END AS _w2#21, MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS _w3#22] (21) Exchange Input [7]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, _w1#20, _w2#21, _w3#22] @@ -138,5 +138,5 @@ Input [8]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, _w1#20, _w (25) TakeOrderedAndProject Input [5]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] -Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#19 as int) = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#24 ASC NULLS FIRST], [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] +Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (lochierarchy#19 = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#24 ASC NULLS FIRST], [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt index 377bd36f520eb..4ffbfb45a4623 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt @@ -42,11 +42,11 @@ : :- * Sort (29) : : +- Exchange (28) : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildRight (26) - : : :- * Filter (24) - : : : +- * ColumnarToRow (23) - : : : +- Scan parquet default.catalog_sales (22) - : : +- ReusedExchange (25) + : : +- * BroadcastHashJoin Inner BuildLeft (26) + : : :- ReusedExchange (22) + : : +- * Filter (25) + : : +- * ColumnarToRow (24) + : : +- Scan parquet default.catalog_sales (23) : +- * Sort (31) : +- ReusedExchange (30) +- * Sort (56) @@ -59,11 +59,11 @@ :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildRight (44) - : :- * Filter (42) - : : +- * ColumnarToRow (41) - : : +- Scan parquet default.web_sales (40) - : +- ReusedExchange (43) + : +- * BroadcastHashJoin Inner BuildLeft (44) + : :- ReusedExchange (40) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.web_sales (41) +- * Sort (49) +- ReusedExchange (48) @@ -160,39 +160,39 @@ Arguments: hashpartitioning(coalesce(c_last_name#10, ), isnull(c_last_name#10), Input [3]: [d_date#4, c_first_name#9, c_last_name#10] Arguments: [coalesce(c_last_name#10, ) ASC NULLS FIRST, isnull(c_last_name#10) ASC NULLS FIRST, coalesce(c_first_name#9, ) ASC NULLS FIRST, isnull(c_first_name#9) ASC NULLS FIRST, coalesce(d_date#4, 0) ASC NULLS FIRST, isnull(d_date#4) ASC NULLS FIRST], false, 0 -(22) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] +(22) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#13, d_date#14] + +(23) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_customer_sk)] ReadSchema: struct -(23) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] - -(24) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] -Condition : (isnotnull(cs_sold_date_sk#13) AND isnotnull(cs_bill_customer_sk#14)) +(24) ColumnarToRow +Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] -(25) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#15, d_date#16] +(25) Filter +Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_bill_customer_sk#16)) (26) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#13] -Right keys [1]: [d_date_sk#15] +Left keys [1]: [d_date_sk#13] +Right keys [1]: [cs_sold_date_sk#15] Join condition: None (27) Project [codegen id : 9] -Output [2]: [cs_bill_customer_sk#14, d_date#16] -Input [4]: [cs_sold_date_sk#13, cs_bill_customer_sk#14, d_date_sk#15, d_date#16] +Output [2]: [d_date#14, cs_bill_customer_sk#16] +Input [4]: [d_date_sk#13, d_date#14, cs_sold_date_sk#15, cs_bill_customer_sk#16] (28) Exchange -Input [2]: [cs_bill_customer_sk#14, d_date#16] -Arguments: hashpartitioning(cs_bill_customer_sk#14, 5), true, [id=#17] +Input [2]: [d_date#14, cs_bill_customer_sk#16] +Arguments: hashpartitioning(cs_bill_customer_sk#16, 5), true, [id=#17] (29) Sort [codegen id : 10] -Input [2]: [cs_bill_customer_sk#14, d_date#16] -Arguments: [cs_bill_customer_sk#14 ASC NULLS FIRST], false, 0 +Input [2]: [d_date#14, cs_bill_customer_sk#16] +Arguments: [cs_bill_customer_sk#16 ASC NULLS FIRST], false, 0 (30) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] @@ -202,78 +202,78 @@ Input [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 (32) SortMergeJoin [codegen id : 13] -Left keys [1]: [cs_bill_customer_sk#14] +Left keys [1]: [cs_bill_customer_sk#16] Right keys [1]: [c_customer_sk#18] Join condition: None (33) Project [codegen id : 13] -Output [3]: [c_last_name#20, c_first_name#19, d_date#16] -Input [5]: [cs_bill_customer_sk#14, d_date#16, c_customer_sk#18, c_first_name#19, c_last_name#20] +Output [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [5]: [d_date#14, cs_bill_customer_sk#16, c_customer_sk#18, c_first_name#19, c_last_name#20] (34) HashAggregate [codegen id : 13] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#16] +Results [3]: [c_last_name#20, c_first_name#19, d_date#14] (35) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#16, 5), true, [id=#21] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#14, 5), true, [id=#21] (36) HashAggregate [codegen id : 14] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#16] +Results [3]: [c_last_name#20, c_first_name#19, d_date#14] (37) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16), 5), true, [id=#22] +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14), 5), true, [id=#22] (38) Sort [codegen id : 15] -Input [3]: [c_last_name#20, c_first_name#19, d_date#16] -Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#16, 0) ASC NULLS FIRST, isnull(d_date#16) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#20, c_first_name#19, d_date#14] +Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#14, 0) ASC NULLS FIRST, isnull(d_date#14) ASC NULLS FIRST], false, 0 (39) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16)] +Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14)] Join condition: None -(40) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] +(40) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#23, d_date#24] + +(41) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 17] -Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] - -(42) Filter [codegen id : 17] -Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] -Condition : (isnotnull(ws_sold_date_sk#23) AND isnotnull(ws_bill_customer_sk#24)) +(42) ColumnarToRow +Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] -(43) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#25, d_date#26] +(43) Filter +Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +Condition : (isnotnull(ws_sold_date_sk#25) AND isnotnull(ws_bill_customer_sk#26)) (44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ws_sold_date_sk#23] -Right keys [1]: [d_date_sk#25] +Left keys [1]: [d_date_sk#23] +Right keys [1]: [ws_sold_date_sk#25] Join condition: None (45) Project [codegen id : 17] -Output [2]: [ws_bill_customer_sk#24, d_date#26] -Input [4]: [ws_sold_date_sk#23, ws_bill_customer_sk#24, d_date_sk#25, d_date#26] +Output [2]: [d_date#24, ws_bill_customer_sk#26] +Input [4]: [d_date_sk#23, d_date#24, ws_sold_date_sk#25, ws_bill_customer_sk#26] (46) Exchange -Input [2]: [ws_bill_customer_sk#24, d_date#26] -Arguments: hashpartitioning(ws_bill_customer_sk#24, 5), true, [id=#27] +Input [2]: [d_date#24, ws_bill_customer_sk#26] +Arguments: hashpartitioning(ws_bill_customer_sk#26, 5), true, [id=#27] (47) Sort [codegen id : 18] -Input [2]: [ws_bill_customer_sk#24, d_date#26] -Arguments: [ws_bill_customer_sk#24 ASC NULLS FIRST], false, 0 +Input [2]: [d_date#24, ws_bill_customer_sk#26] +Arguments: [ws_bill_customer_sk#26 ASC NULLS FIRST], false, 0 (48) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] @@ -283,43 +283,43 @@ Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 21] -Left keys [1]: [ws_bill_customer_sk#24] +Left keys [1]: [ws_bill_customer_sk#26] Right keys [1]: [c_customer_sk#28] Join condition: None (51) Project [codegen id : 21] -Output [3]: [c_last_name#30, c_first_name#29, d_date#26] -Input [5]: [ws_bill_customer_sk#24, d_date#26, c_customer_sk#28, c_first_name#29, c_last_name#30] +Output [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [5]: [d_date#24, ws_bill_customer_sk#26, c_customer_sk#28, c_first_name#29, c_last_name#30] (52) HashAggregate [codegen id : 21] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#26] +Results [3]: [c_last_name#30, c_first_name#29, d_date#24] (53) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#26, 5), true, [id=#31] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#24, 5), true, [id=#31] (54) HashAggregate [codegen id : 22] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#26] +Results [3]: [c_last_name#30, c_first_name#29, d_date#24] (55) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26), 5), true, [id=#32] +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24), 5), true, [id=#32] (56) Sort [codegen id : 23] -Input [3]: [c_last_name#30, c_first_name#29, d_date#26] -Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#26, 0) ASC NULLS FIRST, isnull(d_date#26) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#30, c_first_name#29, d_date#24] +Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#24, 0) ASC NULLS FIRST, isnull(d_date#24) ASC NULLS FIRST], false, 0 (57) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26)] +Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24)] Join condition: None (58) HashAggregate [codegen id : 24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt index 8dd59340cf069..310a89fcb642c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt @@ -71,14 +71,14 @@ WholeStageCodegen (26) InputAdapter Exchange [cs_bill_customer_sk] #9 WholeStageCodegen (9) - Project [cs_bill_customer_sk,d_date] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [d_date,cs_bill_customer_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 Filter [cs_sold_date_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] @@ -102,14 +102,14 @@ WholeStageCodegen (26) InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (17) - Project [ws_bill_customer_sk,d_date] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_date,ws_bill_customer_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 Filter [ws_sold_date_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (20) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt index 562f73c509ee7..bf70b8f5840a4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt @@ -14,15 +14,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : : : : : :- * Project (17) : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : : : : : : :- * Project (10) -: : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) -: : : : : : : : : :- * Filter (3) -: : : : : : : : : : +- * ColumnarToRow (2) -: : : : : : : : : : +- Scan parquet default.store_sales (1) -: : : : : : : : : +- BroadcastExchange (8) -: : : : : : : : : +- * Project (7) -: : : : : : : : : +- * Filter (6) -: : : : : : : : : +- * ColumnarToRow (5) -: : : : : : : : : +- Scan parquet default.time_dim (4) +: : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) +: : : : : : : : : :- BroadcastExchange (5) +: : : : : : : : : : +- * Project (4) +: : : : : : : : : : +- * Filter (3) +: : : : : : : : : : +- * ColumnarToRow (2) +: : : : : : : : : : +- Scan parquet default.time_dim (1) +: : : : : : : : : +- * Filter (8) +: : : : : : : : : +- * ColumnarToRow (7) +: : : : : : : : : +- Scan parquet default.store_sales (6) : : : : : : : : +- BroadcastExchange (15) : : : : : : : : +- * Project (14) : : : : : : : : +- * Filter (13) @@ -42,15 +42,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : : : : :- * Project (40) : : : : : : : +- * BroadcastHashJoin Inner BuildRight (39) : : : : : : : :- * Project (37) -: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (36) -: : : : : : : : :- * Filter (30) -: : : : : : : : : +- * ColumnarToRow (29) -: : : : : : : : : +- Scan parquet default.store_sales (28) -: : : : : : : : +- BroadcastExchange (35) -: : : : : : : : +- * Project (34) -: : : : : : : : +- * Filter (33) -: : : : : : : : +- * ColumnarToRow (32) -: : : : : : : : +- Scan parquet default.time_dim (31) +: : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (36) +: : : : : : : : :- BroadcastExchange (32) +: : : : : : : : : +- * Project (31) +: : : : : : : : : +- * Filter (30) +: : : : : : : : : +- * ColumnarToRow (29) +: : : : : : : : : +- Scan parquet default.time_dim (28) +: : : : : : : : +- * Filter (35) +: : : : : : : : +- * ColumnarToRow (34) +: : : : : : : : +- Scan parquet default.store_sales (33) : : : : : : : +- ReusedExchange (38) : : : : : : +- ReusedExchange (41) : : : : : +- BroadcastExchange (68) @@ -102,15 +102,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : :- * Project (103) : : : : +- * BroadcastHashJoin Inner BuildRight (102) : : : : :- * Project (100) -: : : : : +- * BroadcastHashJoin Inner BuildRight (99) -: : : : : :- * Filter (93) -: : : : : : +- * ColumnarToRow (92) -: : : : : : +- Scan parquet default.store_sales (91) -: : : : : +- BroadcastExchange (98) -: : : : : +- * Project (97) -: : : : : +- * Filter (96) -: : : : : +- * ColumnarToRow (95) -: : : : : +- Scan parquet default.time_dim (94) +: : : : : +- * BroadcastHashJoin Inner BuildLeft (99) +: : : : : :- BroadcastExchange (95) +: : : : : : +- * Project (94) +: : : : : : +- * Filter (93) +: : : : : : +- * ColumnarToRow (92) +: : : : : : +- Scan parquet default.time_dim (91) +: : : : : +- * Filter (98) +: : : : : +- * ColumnarToRow (97) +: : : : : +- Scan parquet default.store_sales (96) : : : : +- ReusedExchange (101) : : : +- ReusedExchange (104) : : +- BroadcastExchange (131) @@ -175,50 +175,50 @@ BroadcastNestedLoopJoin Inner BuildRight (174) +- ReusedExchange (167) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] - -(3) Filter [codegen id : 4] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) - -(4) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(1) Scan parquet default.time_dim +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,8), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(6) Filter [codegen id : 1] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 8)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 8)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) -(7) Project [codegen id : 1] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(4) Project [codegen id : 1] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(8) BroadcastExchange -Input [1]: [t_time_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(5) BroadcastExchange +Input [1]: [t_time_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] + +(8) Filter +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [t_time_sk#1] +Right keys [1]: [ss_sold_time_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (11) Scan parquet default.store Output [2]: [s_store_sk#8, s_store_name#9] @@ -243,13 +243,13 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 4] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (18) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#11, hd_dep_count#12, hd_vehicle_count#13] @@ -274,13 +274,13 @@ Input [1]: [hd_demo_sk#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (24) Project [codegen id : 4] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (25) HashAggregate [codegen id : 4] Input: [] @@ -300,74 +300,74 @@ Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#18] Results [1]: [count(1)#18 AS h8_30_to_9#19] -(28) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(29) ColumnarToRow [codegen id : 9] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] - -(30) Filter [codegen id : 9] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) - -(31) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(28) Scan parquet default.time_dim +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(32) ColumnarToRow [codegen id : 6] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(29) ColumnarToRow [codegen id : 6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(33) Filter [codegen id : 6] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 9)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) +(30) Filter [codegen id : 6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 9)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) -(34) Project [codegen id : 6] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(31) Project [codegen id : 6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(35) BroadcastExchange -Input [1]: [t_time_sk#4] +(32) BroadcastExchange +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(33) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(34) ColumnarToRow +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] + +(35) Filter +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) + (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [t_time_sk#1] +Right keys [1]: [ss_sold_time_sk#5] Join condition: None (37) Project [codegen id : 9] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (38) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (39) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (40) Project [codegen id : 9] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (41) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (42) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (43) Project [codegen id : 9] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (44) HashAggregate [codegen id : 9] Input: [] @@ -395,73 +395,73 @@ Arguments: IdentityBroadcastMode, [id=#26] Join condition: None (49) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (50) ColumnarToRow [codegen id : 14] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (51) Filter [codegen id : 14] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (52) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (53) ColumnarToRow [codegen id : 11] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (54) Filter [codegen id : 11] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 9)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 9)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) (55) Project [codegen id : 11] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (56) BroadcastExchange -Input [1]: [t_time_sk#4] +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] (57) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [ss_sold_time_sk#5] +Right keys [1]: [t_time_sk#1] Join condition: None (58) Project [codegen id : 14] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] (59) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (60) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (61) Project [codegen id : 14] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (62) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (63) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (64) Project [codegen id : 14] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (65) HashAggregate [codegen id : 14] Input: [] @@ -489,73 +489,73 @@ Arguments: IdentityBroadcastMode, [id=#33] Join condition: None (70) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (71) ColumnarToRow [codegen id : 19] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (72) Filter [codegen id : 19] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (73) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (74) ColumnarToRow [codegen id : 16] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (75) Filter [codegen id : 16] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 10)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 10)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) (76) Project [codegen id : 16] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (77) BroadcastExchange -Input [1]: [t_time_sk#4] +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] (78) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [ss_sold_time_sk#5] +Right keys [1]: [t_time_sk#1] Join condition: None (79) Project [codegen id : 19] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] (80) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (81) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (82) Project [codegen id : 19] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (83) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (84) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (85) Project [codegen id : 19] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (86) HashAggregate [codegen id : 19] Input: [] @@ -582,74 +582,74 @@ Arguments: IdentityBroadcastMode, [id=#40] (90) BroadcastNestedLoopJoin Join condition: None -(91) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(92) ColumnarToRow [codegen id : 24] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] - -(93) Filter [codegen id : 24] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) - -(94) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(91) Scan parquet default.time_dim +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(95) ColumnarToRow [codegen id : 21] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(92) ColumnarToRow [codegen id : 21] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(96) Filter [codegen id : 21] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 10)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) +(93) Filter [codegen id : 21] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 10)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) -(97) Project [codegen id : 21] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(94) Project [codegen id : 21] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(98) BroadcastExchange -Input [1]: [t_time_sk#4] +(95) BroadcastExchange +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#41] +(96) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(97) ColumnarToRow +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] + +(98) Filter +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) + (99) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [t_time_sk#1] +Right keys [1]: [ss_sold_time_sk#5] Join condition: None (100) Project [codegen id : 24] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (101) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (102) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (103) Project [codegen id : 24] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (104) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (105) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (106) Project [codegen id : 24] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (107) HashAggregate [codegen id : 24] Input: [] @@ -677,73 +677,73 @@ Arguments: IdentityBroadcastMode, [id=#47] Join condition: None (112) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 29] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (114) Filter [codegen id : 29] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (115) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (116) ColumnarToRow [codegen id : 26] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (117) Filter [codegen id : 26] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 11)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 11)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) (118) Project [codegen id : 26] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (119) BroadcastExchange -Input [1]: [t_time_sk#4] +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] (120) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [ss_sold_time_sk#5] +Right keys [1]: [t_time_sk#1] Join condition: None (121) Project [codegen id : 29] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] (122) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (123) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (124) Project [codegen id : 29] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (125) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (126) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (127) Project [codegen id : 29] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (128) HashAggregate [codegen id : 29] Input: [] @@ -771,73 +771,73 @@ Arguments: IdentityBroadcastMode, [id=#54] Join condition: None (133) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (134) ColumnarToRow [codegen id : 34] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (135) Filter [codegen id : 34] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (136) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (137) ColumnarToRow [codegen id : 31] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (138) Filter [codegen id : 31] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 11)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 11)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) (139) Project [codegen id : 31] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (140) BroadcastExchange -Input [1]: [t_time_sk#4] +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#55] (141) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [ss_sold_time_sk#5] +Right keys [1]: [t_time_sk#1] Join condition: None (142) Project [codegen id : 34] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] (143) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (144) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (145) Project [codegen id : 34] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (146) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (147) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (148) Project [codegen id : 34] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (149) HashAggregate [codegen id : 34] Input: [] @@ -865,73 +865,73 @@ Arguments: IdentityBroadcastMode, [id=#61] Join condition: None (154) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (155) ColumnarToRow [codegen id : 39] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (156) Filter [codegen id : 39] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (157) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,12), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (158) ColumnarToRow [codegen id : 36] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (159) Filter [codegen id : 36] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 12)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 12)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) (160) Project [codegen id : 36] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] (161) BroadcastExchange -Input [1]: [t_time_sk#4] +Input [1]: [t_time_sk#1] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#62] (162) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [ss_sold_time_sk#5] +Right keys [1]: [t_time_sk#1] Join condition: None (163) Project [codegen id : 39] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] (164) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (165) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (166) Project [codegen id : 39] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (167) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (168) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (169) Project [codegen id : 39] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (170) HashAggregate [codegen id : 39] Input: [] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt index 99ca86aadc661..f212ebf34b839 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt @@ -16,11 +16,7 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [ss_sold_time_sk,t_time_sk] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [t_time_sk,ss_sold_time_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -29,6 +25,10 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -57,11 +57,7 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [ss_sold_time_sk,t_time_sk] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [t_time_sk,ss_sold_time_sk] InputAdapter BroadcastExchange #7 WholeStageCodegen (6) @@ -70,6 +66,10 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter ReusedExchange [s_store_sk] #3 InputAdapter @@ -144,11 +144,7 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [ss_sold_time_sk,t_time_sk] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [t_time_sk,ss_sold_time_sk] InputAdapter BroadcastExchange #16 WholeStageCodegen (21) @@ -157,6 +153,10 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter ReusedExchange [s_store_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt index 0d47735a1138d..124f3c58c8919 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt @@ -13,14 +13,14 @@ TakeOrderedAndProject (31) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : :- BroadcastExchange (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.store_sales (5) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) : +- BroadcastExchange (14) : +- * Project (13) : +- * Filter (12) @@ -32,46 +32,46 @@ TakeOrderedAndProject (31) +- Scan parquet default.store (17) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(In(i_category, [Books,Electronics,Sports]),In(i_class, [computers,stereo,football])),And(In(i_category, [Men,Jewelry,Women]),In(i_class, [shirts,birdal,dresses]))), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] -Condition : (((i_category#4 IN (Books,Electronics,Sports) AND i_class#3 IN (computers,stereo,football)) OR (i_category#4 IN (Men,Jewelry,Women) AND i_class#3 IN (shirts,birdal,dresses))) AND isnotnull(i_item_sk#1)) +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -(4) BroadcastExchange -Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#5] +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) -(5) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(In(i_category, [Books,Electronics,Sports]),In(i_class, [computers,stereo,football])),And(In(i_category, [Men,Jewelry,Women]),In(i_class, [shirts,birdal,dresses]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] -(6) ColumnarToRow -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] +Condition : (((i_category#8 IN (Books,Electronics,Sports) AND i_class#7 IN (computers,stereo,football)) OR (i_category#8 IN (Men,Jewelry,Women) AND i_class#7 IN (shirts,birdal,dresses))) AND isnotnull(i_item_sk#5)) -(7) Filter -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] -Condition : ((isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#8)) +(7) BroadcastExchange +Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (8) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] Join condition: None (9) Project [codegen id : 4] -Output [6]: [i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_store_sk#8, ss_sales_price#9] -Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] +Output [6]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_brand#6, i_class#7, i_category#8] (10) Scan parquet default.date_dim Output [3]: [d_date_sk#10, d_year#11, d_moy#12] @@ -96,13 +96,13 @@ Input [2]: [d_date_sk#10, d_moy#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#10] Join condition: None (16) Project [codegen id : 4] -Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#8, ss_sales_price#9, d_moy#12] -Input [8]: [i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_store_sk#8, ss_sales_price#9, d_date_sk#10, d_moy#12] +Output [6]: [ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_moy#12] +Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_date_sk#10, d_moy#12] (17) Scan parquet default.store Output [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] @@ -123,53 +123,53 @@ Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#8] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#14] Join condition: None (22) Project [codegen id : 4] -Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#9, d_moy#12, s_store_name#15, s_company_name#16] -Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#8, ss_sales_price#9, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] +Output [7]: [i_brand#6, i_class#7, i_category#8, ss_sales_price#4, d_moy#12, s_store_name#15, s_company_name#16] +Input [9]: [ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] (23) HashAggregate [codegen id : 4] -Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#9, d_moy#12, s_store_name#15, s_company_name#16] -Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#9))] +Input [7]: [i_brand#6, i_class#7, i_category#8, ss_sales_price#4, d_moy#12, s_store_name#15, s_company_name#16] +Keys [6]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum#18] -Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Results [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] (24) Exchange -Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] -Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, 5), true, [id=#20] +Input [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Arguments: hashpartitioning(i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, 5), true, [id=#20] (25) HashAggregate [codegen id : 5] -Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] -Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12] -Functions [1]: [sum(UnscaledValue(ss_sales_price#9))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#9))#21] -Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#9))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#9))#21,17,2) AS _w0#23] +Input [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Keys [6]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12] +Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#21] +Results [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#21,17,2) AS _w0#23] (26) Exchange -Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#15, s_company_name#16, 5), true, [id=#24] +Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#8, i_brand#6, s_store_name#15, s_company_name#16, 5), true, [id=#24] (27) Sort [codegen id : 6] -Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST], false, 0 +Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: [i_category#8 ASC NULLS FIRST, i_brand#6 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST], false, 0 (28) Window -Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: [avg(_w0#23) windowspecdefinition(i_category#4, i_brand#2, s_store_name#15, s_company_name#16, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#4, i_brand#2, s_store_name#15, s_company_name#16] +Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#8, i_brand#6, s_store_name#15, s_company_name#16, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#8, i_brand#6, s_store_name#15, s_company_name#16] (29) Filter [codegen id : 7] -Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] +Input [9]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] Condition : (CASE WHEN NOT (avg_monthly_sales#25 = 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (30) Project [codegen id : 7] -Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] -Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] +Output [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [9]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] (31) TakeOrderedAndProject -Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] -Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST], [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt index 0d41c4559139a..2a02ca009a3e0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt @@ -16,10 +16,14 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_cla HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,d_moy] + Project [ss_store_sk,ss_sales_price,i_brand,i_class,i_category,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand,i_class,i_category,ss_sold_date_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_brand,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -27,10 +31,6 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_cla ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt index 4e85516b594f7..69b02557c4750 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt @@ -13,14 +13,14 @@ : : :- * Project (16) : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.customer_demographics (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : :- BroadcastExchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer_demographics (1) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.customer (5) : : : +- BroadcastExchange (14) : : : +- * Project (13) : : : +- * Filter (12) @@ -33,61 +33,61 @@ : : +- Scan parquet default.customer_address (17) : +- BroadcastExchange (34) : +- * Project (33) - : +- * BroadcastHashJoin Inner BuildRight (32) - : :- * Filter (26) - : : +- * ColumnarToRow (25) - : : +- Scan parquet default.catalog_returns (24) - : +- BroadcastExchange (31) - : +- * Project (30) - : +- * Filter (29) - : +- * ColumnarToRow (28) - : +- Scan parquet default.date_dim (27) + : +- * BroadcastHashJoin Inner BuildLeft (32) + : :- BroadcastExchange (28) + : : +- * Project (27) + : : +- * Filter (26) + : : +- * ColumnarToRow (25) + : : +- Scan parquet default.date_dim (24) + : +- * Filter (31) + : +- * ColumnarToRow (30) + : +- Scan parquet default.catalog_returns (29) +- BroadcastExchange (40) +- * Filter (39) +- * ColumnarToRow (38) +- Scan parquet default.call_center (37) -(1) Scan parquet default.customer -Output [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 7] -Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] - -(3) Filter [codegen id : 7] -Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] -Condition : (((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#4)) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) - -(4) Scan parquet default.customer_demographics -Output [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +(1) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Unknown)),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,Advanced Degree))), IsNotNull(cd_demo_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] + +(3) Filter [codegen id : 1] +Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] +Condition : ((((cd_marital_status#2 = M) AND (cd_education_status#3 = Unknown)) OR ((cd_marital_status#2 = W) AND (cd_education_status#3 = Advanced Degree))) AND isnotnull(cd_demo_sk#1)) + +(4) BroadcastExchange +Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] + +(5) Scan parquet default.customer +Output [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] -Condition : ((((cd_marital_status#6 = M) AND (cd_education_status#7 = Unknown)) OR ((cd_marital_status#6 = W) AND (cd_education_status#7 = Advanced Degree))) AND isnotnull(cd_demo_sk#5)) +(6) ColumnarToRow +Input [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] -(7) BroadcastExchange -Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] +(7) Filter +Input [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] +Condition : (((isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#8)) AND isnotnull(c_current_cdemo_sk#6)) AND isnotnull(c_current_hdemo_sk#7)) (8) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#5] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [c_current_cdemo_sk#6] Join condition: None (9) Project [codegen id : 7] -Output [5]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] -Input [7]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Output [5]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_hdemo_sk#7, c_current_addr_sk#8] +Input [7]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] (10) Scan parquet default.household_demographics Output [2]: [hd_demo_sk#9, hd_buy_potential#10] @@ -112,13 +112,13 @@ Input [1]: [hd_demo_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_hdemo_sk#3] +Left keys [1]: [c_current_hdemo_sk#7] Right keys [1]: [hd_demo_sk#9] Join condition: None (16) Project [codegen id : 7] -Output [4]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] -Input [6]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, hd_demo_sk#9] +Output [4]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_addr_sk#8] +Input [6]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_hdemo_sk#7, c_current_addr_sk#8, hd_demo_sk#9] (17) Scan parquet default.customer_address Output [2]: [ca_address_sk#12, ca_gmt_offset#13] @@ -143,71 +143,71 @@ Input [1]: [ca_address_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (22) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_addr_sk#4] +Left keys [1]: [c_current_addr_sk#8] Right keys [1]: [ca_address_sk#12] Join condition: None (23) Project [codegen id : 7] -Output [3]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7] -Input [5]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, ca_address_sk#12] +Output [3]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5] +Input [5]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_addr_sk#8, ca_address_sk#12] -(24) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_customer_sk)] -ReadSchema: struct - -(25) ColumnarToRow [codegen id : 5] -Input [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] - -(26) Filter [codegen id : 5] -Input [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] -Condition : ((isnotnull(cr_call_center_sk#17) AND isnotnull(cr_returned_date_sk#15)) AND isnotnull(cr_returning_customer_sk#16)) - -(27) Scan parquet default.date_dim -Output [3]: [d_date_sk#19, d_year#20, d_moy#21] +(24) Scan parquet default.date_dim +Output [3]: [d_date_sk#15, d_year#16, d_moy#17] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#19, d_year#20, d_moy#21] +(25) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] -(29) Filter [codegen id : 4] -Input [3]: [d_date_sk#19, d_year#20, d_moy#21] -Condition : ((((isnotnull(d_year#20) AND isnotnull(d_moy#21)) AND (d_year#20 = 1998)) AND (d_moy#21 = 11)) AND isnotnull(d_date_sk#19)) +(26) Filter [codegen id : 4] +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] +Condition : ((((isnotnull(d_year#16) AND isnotnull(d_moy#17)) AND (d_year#16 = 1998)) AND (d_moy#17 = 11)) AND isnotnull(d_date_sk#15)) + +(27) Project [codegen id : 4] +Output [1]: [d_date_sk#15] +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] + +(28) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(29) Scan parquet default.catalog_returns +Output [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct -(30) Project [codegen id : 4] -Output [1]: [d_date_sk#19] -Input [3]: [d_date_sk#19, d_year#20, d_moy#21] +(30) ColumnarToRow +Input [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] -(31) BroadcastExchange -Input [1]: [d_date_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(31) Filter +Input [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Condition : ((isnotnull(cr_call_center_sk#21) AND isnotnull(cr_returned_date_sk#19)) AND isnotnull(cr_returning_customer_sk#20)) (32) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cr_returned_date_sk#15] -Right keys [1]: [d_date_sk#19] +Left keys [1]: [d_date_sk#15] +Right keys [1]: [cr_returned_date_sk#19] Join condition: None (33) Project [codegen id : 5] -Output [3]: [cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] -Input [5]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18, d_date_sk#19] +Output [3]: [cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Input [5]: [d_date_sk#15, cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] (34) BroadcastExchange -Input [3]: [cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] +Input [3]: [cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (35) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cr_returning_customer_sk#16] +Left keys [1]: [c_customer_sk#5] +Right keys [1]: [cr_returning_customer_sk#20] Join condition: None (36) Project [codegen id : 7] -Output [4]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#17, cr_net_loss#18] -Input [6]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] +Output [4]: [cd_marital_status#2, cd_education_status#3, cr_call_center_sk#21, cr_net_loss#22] +Input [6]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] (37) Scan parquet default.call_center Output [4]: [cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] @@ -228,31 +228,31 @@ Input [4]: [cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#2 Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] (41) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [cr_call_center_sk#17] +Left keys [1]: [cr_call_center_sk#21] Right keys [1]: [cc_call_center_sk#24] Join condition: None (42) Project [codegen id : 7] -Output [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#18, cd_marital_status#6, cd_education_status#7] -Input [8]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#17, cr_net_loss#18, cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] +Output [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#22, cd_marital_status#2, cd_education_status#3] +Input [8]: [cd_marital_status#2, cd_education_status#3, cr_call_center_sk#21, cr_net_loss#22, cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] (43) HashAggregate [codegen id : 7] -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#18, cd_marital_status#6, cd_education_status#7] -Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7] -Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#18))] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#22, cd_marital_status#2, cd_education_status#3] +Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3] +Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#22))] Aggregate Attributes [1]: [sum#29] -Results [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] +Results [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] (44) Exchange -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] -Arguments: hashpartitioning(cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, 5), true, [id=#31] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] +Arguments: hashpartitioning(cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, 5), true, [id=#31] (45) HashAggregate [codegen id : 8] -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] -Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7] -Functions [1]: [sum(UnscaledValue(cr_net_loss#18))] -Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#18))#32] -Results [4]: [cc_call_center_id#25 AS Call_Center#33, cc_name#26 AS Call_Center_Name#34, cc_manager#27 AS Manager#35, MakeDecimal(sum(UnscaledValue(cr_net_loss#18))#32,17,2) AS Returns_Loss#36] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] +Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3] +Functions [1]: [sum(UnscaledValue(cr_net_loss#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#22))#32] +Results [4]: [cc_call_center_id#25 AS Call_Center#33, cc_name#26 AS Call_Center_Name#34, cc_manager#27 AS Manager#35, MakeDecimal(sum(UnscaledValue(cr_net_loss#22))#32,17,2) AS Returns_Loss#36] (46) Exchange Input [4]: [Call_Center#33, Call_Center_Name#34, Manager#35, Returns_Loss#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt index 87beb3b565cc1..f64791821893d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt @@ -12,16 +12,12 @@ WholeStageCodegen (9) BroadcastHashJoin [cr_call_center_sk,cc_call_center_sk] Project [cd_marital_status,cd_education_status,cr_call_center_sk,cr_net_loss] BroadcastHashJoin [c_customer_sk,cr_returning_customer_sk] - Project [c_customer_sk,cd_marital_status,cd_education_status] + Project [cd_marital_status,cd_education_status,c_customer_sk] BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Project [c_customer_sk,c_current_addr_sk,cd_marital_status,cd_education_status] + Project [cd_marital_status,cd_education_status,c_customer_sk,c_current_addr_sk] BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] - Project [c_customer_sk,c_current_hdemo_sk,c_current_addr_sk,cd_marital_status,cd_education_status] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + Project [cd_marital_status,cd_education_status,c_customer_sk,c_current_hdemo_sk,c_current_addr_sk] + BroadcastHashJoin [cd_demo_sk,c_current_cdemo_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -29,6 +25,10 @@ WholeStageCodegen (9) ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -49,11 +49,7 @@ WholeStageCodegen (9) BroadcastExchange #6 WholeStageCodegen (5) Project [cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] - BroadcastHashJoin [cr_returned_date_sk,d_date_sk] - Filter [cr_call_center_sk,cr_returned_date_sk,cr_returning_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] + BroadcastHashJoin [d_date_sk,cr_returned_date_sk] InputAdapter BroadcastExchange #7 WholeStageCodegen (4) @@ -62,6 +58,10 @@ WholeStageCodegen (9) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [cr_call_center_sk,cr_returned_date_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] InputAdapter BroadcastExchange #8 WholeStageCodegen (6) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt index dc4665185b014..7c479d6e41b84 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt @@ -9,173 +9,173 @@ TakeOrderedAndProject (34) : +- * BroadcastHashJoin Inner BuildLeft (26) : :- BroadcastExchange (22) : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildLeft (20) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (19) - : : +- * HashAggregate (18) - : : +- Exchange (17) - : : +- * HashAggregate (16) - : : +- * Project (15) - : : +- * BroadcastHashJoin Inner BuildRight (14) - : : :- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.web_sales (6) - : : +- BroadcastExchange (13) - : : +- * Project (12) - : : +- * Filter (11) - : : +- * ColumnarToRow (10) - : : +- Scan parquet default.date_dim (9) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.item (15) : +- * Filter (25) : +- * ColumnarToRow (24) : +- Scan parquet default.web_sales (23) +- ReusedExchange (28) -(1) Scan parquet default.item -Output [2]: [i_item_sk#1, i_manufact_id#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [i_item_sk#1, i_manufact_id#2] - -(3) Filter [codegen id : 1] -Input [2]: [i_item_sk#1, i_manufact_id#2] -Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 350)) AND isnotnull(i_item_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [i_item_sk#1] -Input [2]: [i_item_sk#1, i_manufact_id#2] - -(5) BroadcastExchange -Input [1]: [i_item_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] - -(6) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +(1) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] -(8) Filter [codegen id : 3] -Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] -Condition : (isnotnull(ws_sold_date_sk#4) AND isnotnull(ws_item_sk#5)) +(3) Filter [codegen id : 2] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_item_sk#2)) -(9) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_date#8] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_date#8] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(11) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_date#8] -Condition : (((isnotnull(d_date#8) AND (d_date#8 >= 10983)) AND (d_date#8 <= 11073)) AND isnotnull(d_date_sk#7)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10983)) AND (d_date#5 <= 11073)) AND isnotnull(d_date_sk#4)) -(12) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_date#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(13) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ws_sold_date_sk#4] -Right keys [1]: [d_date_sk#7] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(15) Project [codegen id : 3] -Output [2]: [ws_item_sk#5, ws_ext_discount_amt#6] -Input [4]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6, d_date_sk#7] +(10) Project [codegen id : 2] +Output [2]: [ws_item_sk#2, ws_ext_discount_amt#3] +Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3, d_date_sk#4] + +(11) HashAggregate [codegen id : 2] +Input [2]: [ws_item_sk#2, ws_ext_discount_amt#3] +Keys [1]: [ws_item_sk#2] +Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#3))] +Aggregate Attributes [2]: [sum#7, count#8] +Results [3]: [ws_item_sk#2, sum#9, count#10] + +(12) Exchange +Input [3]: [ws_item_sk#2, sum#9, count#10] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#11] + +(13) HashAggregate [codegen id : 4] +Input [3]: [ws_item_sk#2, sum#9, count#10] +Keys [1]: [ws_item_sk#2] +Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#3))] +Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#3))#12] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#3))#12 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2 AS ws_item_sk#2#14] + +(14) Filter [codegen id : 4] +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2#14] +Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13) + +(15) Scan parquet default.item +Output [2]: [i_item_sk#15, i_manufact_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] +ReadSchema: struct -(16) HashAggregate [codegen id : 3] -Input [2]: [ws_item_sk#5, ws_ext_discount_amt#6] -Keys [1]: [ws_item_sk#5] -Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#6))] -Aggregate Attributes [2]: [sum#10, count#11] -Results [3]: [ws_item_sk#5, sum#12, count#13] +(16) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#15, i_manufact_id#16] -(17) Exchange -Input [3]: [ws_item_sk#5, sum#12, count#13] -Arguments: hashpartitioning(ws_item_sk#5, 5), true, [id=#14] +(17) Filter [codegen id : 3] +Input [2]: [i_item_sk#15, i_manufact_id#16] +Condition : ((isnotnull(i_manufact_id#16) AND (i_manufact_id#16 = 350)) AND isnotnull(i_item_sk#15)) -(18) HashAggregate -Input [3]: [ws_item_sk#5, sum#12, count#13] -Keys [1]: [ws_item_sk#5] -Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#6))] -Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#6))#15] -Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#6))#15 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5 AS ws_item_sk#5#17] +(18) Project [codegen id : 3] +Output [1]: [i_item_sk#15] +Input [2]: [i_item_sk#15, i_manufact_id#16] -(19) Filter -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5#17] -Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16) +(19) BroadcastExchange +Input [1]: [i_item_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ws_item_sk#5#17] +Left keys [1]: [ws_item_sk#2#14] +Right keys [1]: [i_item_sk#15] Join condition: None (21) Project [codegen id : 4] -Output [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16] -Input [3]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5#17] +Output [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] +Input [3]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2#14, i_item_sk#15] (22) BroadcastExchange -Input [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#18] (23) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (24) ColumnarToRow -Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] (25) Filter -Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] -Condition : ((isnotnull(ws_item_sk#5) AND isnotnull(ws_ext_discount_amt#6)) AND isnotnull(ws_sold_date_sk#4)) +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +Condition : ((isnotnull(ws_item_sk#2) AND isnotnull(ws_ext_discount_amt#3)) AND isnotnull(ws_sold_date_sk#1)) (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ws_item_sk#5] -Join condition: (cast(ws_ext_discount_amt#6 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16) +Left keys [1]: [i_item_sk#15] +Right keys [1]: [ws_item_sk#2] +Join condition: (cast(ws_ext_discount_amt#3 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13) (27) Project [codegen id : 6] -Output [2]: [ws_sold_date_sk#4, ws_ext_discount_amt#6] -Input [5]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +Output [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3] +Input [5]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15, ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] -(28) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(28) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#4] (29) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#4] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (30) Project [codegen id : 6] -Output [1]: [ws_ext_discount_amt#6] -Input [3]: [ws_sold_date_sk#4, ws_ext_discount_amt#6, d_date_sk#7] +Output [1]: [ws_ext_discount_amt#3] +Input [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, d_date_sk#4] (31) HashAggregate [codegen id : 6] -Input [1]: [ws_ext_discount_amt#6] +Input [1]: [ws_ext_discount_amt#3] Keys: [] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#6))] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#3))] Aggregate Attributes [1]: [sum#19] Results [1]: [sum#20] @@ -186,9 +186,9 @@ Arguments: SinglePartition, true, [id=#21] (33) HashAggregate [codegen id : 7] Input [1]: [sum#20] Keys: [] -Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#6))#22] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#6))#22,17,2) AS Excess Discount Amount #23] +Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#22] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#3))#22,17,2) AS Excess Discount Amount #23] (34) TakeOrderedAndProject Input [1]: [Excess Discount Amount #23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt index 7fd1cd3637a09..75aa17c4a22c1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt @@ -12,21 +12,13 @@ TakeOrderedAndProject [Excess Discount Amount ] InputAdapter BroadcastExchange #2 WholeStageCodegen (4) - Project [i_item_sk,(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))] - BroadcastHashJoin [i_item_sk,ws_item_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [i_item_sk] - Filter [i_manufact_id,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_manufact_id] + Project [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6))),i_item_sk] + BroadcastHashJoin [ws_item_sk,i_item_sk] Filter [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))] HashAggregate [ws_item_sk,sum,count] [avg(UnscaledValue(ws_ext_discount_amt)),(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6))),ws_item_sk,sum,count] InputAdapter - Exchange [ws_item_sk] #4 - WholeStageCodegen (3) + Exchange [ws_item_sk] #3 + WholeStageCodegen (2) HashAggregate [ws_item_sk,ws_ext_discount_amt] [sum,count,sum,count] Project [ws_item_sk,ws_ext_discount_amt] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] @@ -35,16 +27,24 @@ TakeOrderedAndProject [Excess Discount Amount ] InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_discount_amt] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (2) + BroadcastExchange #4 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_date,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] Filter [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_discount_amt] InputAdapter - ReusedExchange [d_date_sk] #5 + ReusedExchange [d_date_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 7720d9dee4170..9a97932d6d4e5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -11,241 +11,241 @@ TakeOrderedAndProject (47) :- * Project (33) : +- * BroadcastHashJoin Inner BuildRight (32) : :- * Project (26) - : : +- * BroadcastHashJoin Inner BuildRight (25) - : : :- SortMergeJoin LeftAnti (19) - : : : :- * Sort (14) - : : : : +- Exchange (13) - : : : : +- * Project (12) - : : : : +- SortMergeJoin LeftSemi (11) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Project (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.web_sales (6) - : : : +- * Sort (18) - : : : +- Exchange (17) - : : : +- * ColumnarToRow (16) - : : : +- Scan parquet default.web_returns (15) - : : +- BroadcastExchange (24) - : : +- * Project (23) - : : +- * Filter (22) + : : +- * BroadcastHashJoin Inner BuildLeft (25) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer_address (1) + : : +- SortMergeJoin LeftAnti (24) + : : :- * Sort (19) + : : : +- Exchange (18) + : : : +- * Project (17) + : : : +- SortMergeJoin LeftSemi (16) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.web_sales (6) + : : : +- * Sort (15) + : : : +- Exchange (14) + : : : +- * Project (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.web_sales (11) + : : +- * Sort (23) + : : +- Exchange (22) : : +- * ColumnarToRow (21) - : : +- Scan parquet default.customer_address (20) + : : +- Scan parquet default.web_returns (20) : +- BroadcastExchange (31) : +- * Project (30) : +- * Filter (29) : +- * ColumnarToRow (28) - : +- Scan parquet default.web_site (27) + : +- Scan parquet default.date_dim (27) +- BroadcastExchange (38) +- * Project (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.date_dim (34) + +- Scan parquet default.web_site (34) -(1) Scan parquet default.web_sales -Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [2]: [ca_address_sk#1, ca_state#2] (3) Filter [codegen id : 1] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = IL)) AND isnotnull(ca_address_sk#1)) -(4) Exchange -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#8] +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#1] +Input [2]: [ca_address_sk#1, ca_state#2] -(5) Sort [codegen id : 2] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: [ws_order_number#5 ASC NULLS FIRST], false, 0 +(5) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] (6) Scan parquet default.web_sales -Output [2]: [ws_warehouse_sk#4, ws_order_number#5] +Output [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] -ReadSchema: struct +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [2]: [ws_warehouse_sk#4, ws_order_number#5] +(7) ColumnarToRow [codegen id : 2] +Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -(8) Project [codegen id : 3] -Output [2]: [ws_warehouse_sk#4 AS ws_warehouse_sk#4#9, ws_order_number#5 AS ws_order_number#5#10] -Input [2]: [ws_warehouse_sk#4, ws_order_number#5] +(8) Filter [codegen id : 2] +Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Condition : ((isnotnull(ws_ship_date_sk#4) AND isnotnull(ws_ship_addr_sk#5)) AND isnotnull(ws_web_site_sk#6)) (9) Exchange -Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] -Arguments: hashpartitioning(ws_order_number#5#10, 5), true, [id=#11] +Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Arguments: hashpartitioning(ws_order_number#8, 5), true, [id=#11] -(10) Sort [codegen id : 4] -Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] -Arguments: [ws_order_number#5#10 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 3] +Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Arguments: [ws_order_number#8 ASC NULLS FIRST], false, 0 -(11) SortMergeJoin -Left keys [1]: [ws_order_number#5] -Right keys [1]: [ws_order_number#5#10] -Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#4#9) +(11) Scan parquet default.web_sales +Output [2]: [ws_warehouse_sk#7, ws_order_number#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +ReadSchema: struct -(12) Project [codegen id : 5] -Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +(12) ColumnarToRow [codegen id : 4] +Input [2]: [ws_warehouse_sk#7, ws_order_number#8] -(13) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), true, [id=#12] +(13) Project [codegen id : 4] +Output [2]: [ws_warehouse_sk#7 AS ws_warehouse_sk#7#12, ws_order_number#8 AS ws_order_number#8#13] +Input [2]: [ws_warehouse_sk#7, ws_order_number#8] -(14) Sort [codegen id : 6] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: [cast(ws_order_number#5 as bigint) ASC NULLS FIRST], false, 0 +(14) Exchange +Input [2]: [ws_warehouse_sk#7#12, ws_order_number#8#13] +Arguments: hashpartitioning(ws_order_number#8#13, 5), true, [id=#14] -(15) Scan parquet default.web_returns -Output [1]: [wr_order_number#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -ReadSchema: struct +(15) Sort [codegen id : 5] +Input [2]: [ws_warehouse_sk#7#12, ws_order_number#8#13] +Arguments: [ws_order_number#8#13 ASC NULLS FIRST], false, 0 -(16) ColumnarToRow [codegen id : 7] -Input [1]: [wr_order_number#13] +(16) SortMergeJoin +Left keys [1]: [ws_order_number#8] +Right keys [1]: [ws_order_number#8#13] +Join condition: NOT (ws_warehouse_sk#7 = ws_warehouse_sk#7#12) -(17) Exchange -Input [1]: [wr_order_number#13] -Arguments: hashpartitioning(wr_order_number#13, 5), true, [id=#14] +(17) Project [codegen id : 6] +Output [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -(18) Sort [codegen id : 8] -Input [1]: [wr_order_number#13] -Arguments: [wr_order_number#13 ASC NULLS FIRST], false, 0 +(18) Exchange +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Arguments: hashpartitioning(cast(ws_order_number#8 as bigint), 5), true, [id=#15] -(19) SortMergeJoin -Left keys [1]: [cast(ws_order_number#5 as bigint)] -Right keys [1]: [wr_order_number#13] -Join condition: None +(19) Sort [codegen id : 7] +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Arguments: [cast(ws_order_number#8 as bigint) ASC NULLS FIRST], false, 0 -(20) Scan parquet default.customer_address -Output [2]: [ca_address_sk#15, ca_state#16] +(20) Scan parquet default.web_returns +Output [1]: [wr_order_number#16] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_returns] +ReadSchema: struct -(21) ColumnarToRow [codegen id : 9] -Input [2]: [ca_address_sk#15, ca_state#16] +(21) ColumnarToRow [codegen id : 8] +Input [1]: [wr_order_number#16] -(22) Filter [codegen id : 9] -Input [2]: [ca_address_sk#15, ca_state#16] -Condition : ((isnotnull(ca_state#16) AND (ca_state#16 = IL)) AND isnotnull(ca_address_sk#15)) +(22) Exchange +Input [1]: [wr_order_number#16] +Arguments: hashpartitioning(wr_order_number#16, 5), true, [id=#17] -(23) Project [codegen id : 9] -Output [1]: [ca_address_sk#15] -Input [2]: [ca_address_sk#15, ca_state#16] +(23) Sort [codegen id : 9] +Input [1]: [wr_order_number#16] +Arguments: [wr_order_number#16 ASC NULLS FIRST], false, 0 -(24) BroadcastExchange -Input [1]: [ca_address_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +(24) SortMergeJoin +Left keys [1]: [cast(ws_order_number#8 as bigint)] +Right keys [1]: [wr_order_number#16] +Join condition: None (25) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#15] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [ws_ship_addr_sk#5] Join condition: None (26) Project [codegen id : 12] -Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#15] +Output [5]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Input [7]: [ca_address_sk#1, ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -(27) Scan parquet default.web_site -Output [2]: [web_site_sk#18, web_company_name#19] +(27) Scan parquet default.date_dim +Output [2]: [d_date_sk#18, d_date#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (28) ColumnarToRow [codegen id : 10] -Input [2]: [web_site_sk#18, web_company_name#19] +Input [2]: [d_date_sk#18, d_date#19] (29) Filter [codegen id : 10] -Input [2]: [web_site_sk#18, web_company_name#19] -Condition : ((isnotnull(web_company_name#19) AND (web_company_name#19 = pri)) AND isnotnull(web_site_sk#18)) +Input [2]: [d_date_sk#18, d_date#19] +Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 10623)) AND (d_date#19 <= 10683)) AND isnotnull(d_date_sk#18)) (30) Project [codegen id : 10] -Output [1]: [web_site_sk#18] -Input [2]: [web_site_sk#18, web_company_name#19] +Output [1]: [d_date_sk#18] +Input [2]: [d_date_sk#18, d_date#19] (31) BroadcastExchange -Input [1]: [web_site_sk#18] +Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (32) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#18] +Left keys [1]: [ws_ship_date_sk#4] +Right keys [1]: [d_date_sk#18] Join condition: None (33) Project [codegen id : 12] -Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#18] +Output [4]: [ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Input [6]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10, d_date_sk#18] -(34) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +(34) Scan parquet default.web_site +Output [2]: [web_site_sk#21, web_company_name#22] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (35) ColumnarToRow [codegen id : 11] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [web_site_sk#21, web_company_name#22] (36) Filter [codegen id : 11] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10623)) AND (d_date#22 <= 10683)) AND isnotnull(d_date_sk#21)) +Input [2]: [web_site_sk#21, web_company_name#22] +Condition : ((isnotnull(web_company_name#22) AND (web_company_name#22 = pri)) AND isnotnull(web_site_sk#21)) (37) Project [codegen id : 11] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [web_site_sk#21] +Input [2]: [web_site_sk#21, web_company_name#22] (38) BroadcastExchange -Input [1]: [d_date_sk#21] +Input [1]: [web_site_sk#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (39) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [ws_web_site_sk#6] +Right keys [1]: [web_site_sk#21] Join condition: None (40) Project [codegen id : 12] -Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#21] +Output [3]: [ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Input [5]: [ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10, web_site_sk#21] (41) HashAggregate [codegen id : 12] -Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Keys [1]: [ws_order_number#5] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25] -Results [3]: [ws_order_number#5, sum#26, sum#27] +Input [3]: [ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Keys [1]: [ws_order_number#8] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#9)), partial_sum(UnscaledValue(ws_net_profit#10))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25] +Results [3]: [ws_order_number#8, sum#26, sum#27] (42) Exchange -Input [3]: [ws_order_number#5, sum#26, sum#27] -Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#28] +Input [3]: [ws_order_number#8, sum#26, sum#27] +Arguments: hashpartitioning(ws_order_number#8, 5), true, [id=#28] (43) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#26, sum#27] -Keys [1]: [ws_order_number#5] -Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25] -Results [3]: [ws_order_number#5, sum#26, sum#27] +Input [3]: [ws_order_number#8, sum#26, sum#27] +Keys [1]: [ws_order_number#8] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#9)), merge_sum(UnscaledValue(ws_net_profit#10))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25] +Results [3]: [ws_order_number#8, sum#26, sum#27] (44) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#5, sum#26, sum#27] +Input [3]: [ws_order_number#8, sum#26, sum#27] Keys: [] -Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#9)), merge_sum(UnscaledValue(ws_net_profit#10)), partial_count(distinct ws_order_number#8)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25, count(ws_order_number#8)#29] Results [3]: [sum#26, sum#27, count#30] (45) Exchange @@ -255,9 +255,9 @@ Arguments: SinglePartition, true, [id=#31] (46) HashAggregate [codegen id : 14] Input [3]: [sum#26, sum#27, count#30] Keys: [] -Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29] -Results [3]: [count(ws_order_number#5)#29 AS order count #32, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#24,17,2) AS total shipping cost #33, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#25,17,2) AS total net profit #34] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#9)), sum(UnscaledValue(ws_net_profit#10)), count(distinct ws_order_number#8)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25, count(ws_order_number#8)#29] +Results [3]: [count(ws_order_number#8)#29 AS order count #32, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#9))#24,17,2) AS total shipping cost #33, MakeDecimal(sum(UnscaledValue(ws_net_profit#10))#25,17,2) AS total net profit #34] (47) TakeOrderedAndProject Input [3]: [order count #32, total shipping cost #33, total net profit #34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt index 128a8179ac10b..1b1fe6026ec4d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt @@ -11,68 +11,68 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (12) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + BroadcastHashJoin [ca_address_sk,ws_ship_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (6) + WholeStageCodegen (7) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #3 - WholeStageCodegen (5) + Exchange [ws_order_number] #4 + WholeStageCodegen (6) Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] InputAdapter SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) + Exchange [ws_order_number] #5 + WholeStageCodegen (2) Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - WholeStageCodegen (4) + WholeStageCodegen (5) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (3) + Exchange [ws_order_number] #6 + WholeStageCodegen (4) Project [ws_warehouse_sk,ws_order_number] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number] - WholeStageCodegen (8) + WholeStageCodegen (9) Sort [wr_order_number] InputAdapter - Exchange [wr_order_number] #6 - WholeStageCodegen (7) + Exchange [wr_order_number] #7 + WholeStageCodegen (8) ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_order_number] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (9) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter BroadcastExchange #8 WholeStageCodegen (10) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #9 WholeStageCodegen (11) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt index eae118d46245d..6add431cd5b04 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -11,323 +11,323 @@ TakeOrderedAndProject (63) :- * Project (49) : +- * BroadcastHashJoin Inner BuildRight (48) : :- * Project (42) - : : +- * BroadcastHashJoin Inner BuildRight (41) - : : :- SortMergeJoin LeftSemi (35) - : : : :- * Sort (19) - : : : : +- Exchange (18) - : : : : +- SortMergeJoin LeftSemi (17) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Sort (16) - : : : : +- Exchange (15) - : : : : +- * Project (14) - : : : : +- * SortMergeJoin Inner (13) - : : : : :- * Sort (10) - : : : : : +- Exchange (9) - : : : : : +- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.web_sales (6) - : : : : +- * Sort (12) - : : : : +- ReusedExchange (11) - : : : +- * Project (34) - : : : +- * SortMergeJoin Inner (33) - : : : :- * Sort (27) - : : : : +- Exchange (26) - : : : : +- * Project (25) - : : : : +- * SortMergeJoin Inner (24) - : : : : :- * Sort (21) - : : : : : +- ReusedExchange (20) - : : : : +- * Sort (23) - : : : : +- ReusedExchange (22) - : : : +- * Sort (32) - : : : +- Exchange (31) - : : : +- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.web_returns (28) - : : +- BroadcastExchange (40) + : : +- * BroadcastHashJoin Inner BuildLeft (41) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer_address (1) + : : +- SortMergeJoin LeftSemi (40) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- SortMergeJoin LeftSemi (22) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.web_sales (6) + : : : +- * Sort (21) + : : : +- Exchange (20) + : : : +- * Project (19) + : : : +- * SortMergeJoin Inner (18) + : : : :- * Sort (15) + : : : : +- Exchange (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.web_sales (11) + : : : +- * Sort (17) + : : : +- ReusedExchange (16) : : +- * Project (39) - : : +- * Filter (38) - : : +- * ColumnarToRow (37) - : : +- Scan parquet default.customer_address (36) + : : +- * SortMergeJoin Inner (38) + : : :- * Sort (32) + : : : +- Exchange (31) + : : : +- * Project (30) + : : : +- * SortMergeJoin Inner (29) + : : : :- * Sort (26) + : : : : +- ReusedExchange (25) + : : : +- * Sort (28) + : : : +- ReusedExchange (27) + : : +- * Sort (37) + : : +- Exchange (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.web_returns (33) : +- BroadcastExchange (47) : +- * Project (46) : +- * Filter (45) : +- * ColumnarToRow (44) - : +- Scan parquet default.web_site (43) + : +- Scan parquet default.date_dim (43) +- BroadcastExchange (54) +- * Project (53) +- * Filter (52) +- * ColumnarToRow (51) - +- Scan parquet default.date_dim (50) + +- Scan parquet default.web_site (50) -(1) Scan parquet default.web_sales -Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [2]: [ca_address_sk#1, ca_state#2] (3) Filter [codegen id : 1] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = IL)) AND isnotnull(ca_address_sk#1)) -(4) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#7] +(4) Project [codegen id : 1] +Output [1]: [ca_address_sk#1] +Input [2]: [ca_address_sk#1, ca_state#2] -(5) Sort [codegen id : 2] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 +(5) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] (6) Scan parquet default.web_sales -Output [2]: [ws_warehouse_sk#8, ws_order_number#4] +Output [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 2] +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] + +(8) Filter [codegen id : 2] +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Condition : ((isnotnull(ws_ship_date_sk#4) AND isnotnull(ws_ship_addr_sk#5)) AND isnotnull(ws_web_site_sk#6)) + +(9) Exchange +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#10] + +(10) Sort [codegen id : 3] +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 + +(11) Scan parquet default.web_sales +Output [2]: [ws_warehouse_sk#11, ws_order_number#7] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_order_number), IsNotNull(ws_warehouse_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [2]: [ws_warehouse_sk#8, ws_order_number#4] +(12) ColumnarToRow [codegen id : 4] +Input [2]: [ws_warehouse_sk#11, ws_order_number#7] -(8) Filter [codegen id : 3] -Input [2]: [ws_warehouse_sk#8, ws_order_number#4] -Condition : (isnotnull(ws_order_number#4) AND isnotnull(ws_warehouse_sk#8)) +(13) Filter [codegen id : 4] +Input [2]: [ws_warehouse_sk#11, ws_order_number#7] +Condition : (isnotnull(ws_order_number#7) AND isnotnull(ws_warehouse_sk#11)) -(9) Exchange -Input [2]: [ws_warehouse_sk#8, ws_order_number#4] -Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#9] +(14) Exchange +Input [2]: [ws_warehouse_sk#11, ws_order_number#7] +Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#12] -(10) Sort [codegen id : 4] -Input [2]: [ws_warehouse_sk#8, ws_order_number#4] -Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 +(15) Sort [codegen id : 5] +Input [2]: [ws_warehouse_sk#11, ws_order_number#7] +Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 -(11) ReusedExchange [Reuses operator id: 9] -Output [2]: [ws_warehouse_sk#10, ws_order_number#11] +(16) ReusedExchange [Reuses operator id: 14] +Output [2]: [ws_warehouse_sk#13, ws_order_number#14] -(12) Sort [codegen id : 6] -Input [2]: [ws_warehouse_sk#10, ws_order_number#11] -Arguments: [ws_order_number#11 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 7] +Input [2]: [ws_warehouse_sk#13, ws_order_number#14] +Arguments: [ws_order_number#14 ASC NULLS FIRST], false, 0 -(13) SortMergeJoin [codegen id : 7] -Left keys [1]: [ws_order_number#4] -Right keys [1]: [ws_order_number#11] -Join condition: NOT (ws_warehouse_sk#8 = ws_warehouse_sk#10) +(18) SortMergeJoin [codegen id : 8] +Left keys [1]: [ws_order_number#7] +Right keys [1]: [ws_order_number#14] +Join condition: NOT (ws_warehouse_sk#11 = ws_warehouse_sk#13) -(14) Project [codegen id : 7] -Output [1]: [ws_order_number#4 AS ws_order_number#4#12] -Input [4]: [ws_warehouse_sk#8, ws_order_number#4, ws_warehouse_sk#10, ws_order_number#11] +(19) Project [codegen id : 8] +Output [1]: [ws_order_number#7 AS ws_order_number#7#15] +Input [4]: [ws_warehouse_sk#11, ws_order_number#7, ws_warehouse_sk#13, ws_order_number#14] -(15) Exchange -Input [1]: [ws_order_number#4#12] -Arguments: hashpartitioning(ws_order_number#4#12, 5), true, [id=#13] +(20) Exchange +Input [1]: [ws_order_number#7#15] +Arguments: hashpartitioning(ws_order_number#7#15, 5), true, [id=#16] -(16) Sort [codegen id : 8] -Input [1]: [ws_order_number#4#12] -Arguments: [ws_order_number#4#12 ASC NULLS FIRST], false, 0 +(21) Sort [codegen id : 9] +Input [1]: [ws_order_number#7#15] +Arguments: [ws_order_number#7#15 ASC NULLS FIRST], false, 0 -(17) SortMergeJoin -Left keys [1]: [ws_order_number#4] -Right keys [1]: [ws_order_number#4#12] +(22) SortMergeJoin +Left keys [1]: [ws_order_number#7] +Right keys [1]: [ws_order_number#7#15] Join condition: None -(18) Exchange -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), true, [id=#14] +(23) Exchange +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), 5), true, [id=#17] -(19) Sort [codegen id : 9] -Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 10] +Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST], false, 0 -(20) ReusedExchange [Reuses operator id: 9] -Output [2]: [ws_warehouse_sk#8, ws_order_number#4] +(25) ReusedExchange [Reuses operator id: 14] +Output [2]: [ws_warehouse_sk#11, ws_order_number#7] -(21) Sort [codegen id : 11] -Input [2]: [ws_warehouse_sk#8, ws_order_number#4] -Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 12] +Input [2]: [ws_warehouse_sk#11, ws_order_number#7] +Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 -(22) ReusedExchange [Reuses operator id: 9] -Output [2]: [ws_warehouse_sk#15, ws_order_number#16] +(27) ReusedExchange [Reuses operator id: 14] +Output [2]: [ws_warehouse_sk#18, ws_order_number#19] -(23) Sort [codegen id : 13] -Input [2]: [ws_warehouse_sk#15, ws_order_number#16] -Arguments: [ws_order_number#16 ASC NULLS FIRST], false, 0 +(28) Sort [codegen id : 14] +Input [2]: [ws_warehouse_sk#18, ws_order_number#19] +Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 -(24) SortMergeJoin [codegen id : 14] -Left keys [1]: [ws_order_number#4] -Right keys [1]: [ws_order_number#16] -Join condition: NOT (ws_warehouse_sk#8 = ws_warehouse_sk#15) +(29) SortMergeJoin [codegen id : 15] +Left keys [1]: [ws_order_number#7] +Right keys [1]: [ws_order_number#19] +Join condition: NOT (ws_warehouse_sk#11 = ws_warehouse_sk#18) -(25) Project [codegen id : 14] -Output [1]: [ws_order_number#4] -Input [4]: [ws_warehouse_sk#8, ws_order_number#4, ws_warehouse_sk#15, ws_order_number#16] +(30) Project [codegen id : 15] +Output [1]: [ws_order_number#7] +Input [4]: [ws_warehouse_sk#11, ws_order_number#7, ws_warehouse_sk#18, ws_order_number#19] -(26) Exchange -Input [1]: [ws_order_number#4] -Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), true, [id=#17] +(31) Exchange +Input [1]: [ws_order_number#7] +Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), 5), true, [id=#20] -(27) Sort [codegen id : 15] -Input [1]: [ws_order_number#4] -Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 +(32) Sort [codegen id : 16] +Input [1]: [ws_order_number#7] +Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST], false, 0 -(28) Scan parquet default.web_returns -Output [1]: [wr_order_number#18] +(33) Scan parquet default.web_returns +Output [1]: [wr_order_number#21] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 16] -Input [1]: [wr_order_number#18] - -(30) Filter [codegen id : 16] -Input [1]: [wr_order_number#18] -Condition : isnotnull(wr_order_number#18) - -(31) Exchange -Input [1]: [wr_order_number#18] -Arguments: hashpartitioning(wr_order_number#18, 5), true, [id=#19] +(34) ColumnarToRow [codegen id : 17] +Input [1]: [wr_order_number#21] -(32) Sort [codegen id : 17] -Input [1]: [wr_order_number#18] -Arguments: [wr_order_number#18 ASC NULLS FIRST], false, 0 +(35) Filter [codegen id : 17] +Input [1]: [wr_order_number#21] +Condition : isnotnull(wr_order_number#21) -(33) SortMergeJoin [codegen id : 18] -Left keys [1]: [cast(ws_order_number#4 as bigint)] -Right keys [1]: [wr_order_number#18] -Join condition: None +(36) Exchange +Input [1]: [wr_order_number#21] +Arguments: hashpartitioning(wr_order_number#21, 5), true, [id=#22] -(34) Project [codegen id : 18] -Output [1]: [wr_order_number#18] -Input [2]: [ws_order_number#4, wr_order_number#18] +(37) Sort [codegen id : 18] +Input [1]: [wr_order_number#21] +Arguments: [wr_order_number#21 ASC NULLS FIRST], false, 0 -(35) SortMergeJoin -Left keys [1]: [cast(ws_order_number#4 as bigint)] -Right keys [1]: [wr_order_number#18] +(38) SortMergeJoin [codegen id : 19] +Left keys [1]: [cast(ws_order_number#7 as bigint)] +Right keys [1]: [wr_order_number#21] Join condition: None -(36) Scan parquet default.customer_address -Output [2]: [ca_address_sk#20, ca_state#21] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(37) ColumnarToRow [codegen id : 19] -Input [2]: [ca_address_sk#20, ca_state#21] - -(38) Filter [codegen id : 19] -Input [2]: [ca_address_sk#20, ca_state#21] -Condition : ((isnotnull(ca_state#21) AND (ca_state#21 = IL)) AND isnotnull(ca_address_sk#20)) - (39) Project [codegen id : 19] -Output [1]: [ca_address_sk#20] -Input [2]: [ca_address_sk#20, ca_state#21] +Output [1]: [wr_order_number#21] +Input [2]: [ws_order_number#7, wr_order_number#21] -(40) BroadcastExchange -Input [1]: [ca_address_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(40) SortMergeJoin +Left keys [1]: [cast(ws_order_number#7 as bigint)] +Right keys [1]: [wr_order_number#21] +Join condition: None (41) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_ship_addr_sk#2] -Right keys [1]: [ca_address_sk#20] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [ws_ship_addr_sk#5] Join condition: None (42) Project [codegen id : 22] -Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#20] +Output [5]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Input [7]: [ca_address_sk#1, ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -(43) Scan parquet default.web_site -Output [2]: [web_site_sk#23, web_company_name#24] +(43) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_date#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (44) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#23, web_company_name#24] +Input [2]: [d_date_sk#23, d_date#24] (45) Filter [codegen id : 20] -Input [2]: [web_site_sk#23, web_company_name#24] -Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri)) AND isnotnull(web_site_sk#23)) +Input [2]: [d_date_sk#23, d_date#24] +Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 10623)) AND (d_date#24 <= 10683)) AND isnotnull(d_date_sk#23)) (46) Project [codegen id : 20] -Output [1]: [web_site_sk#23] -Input [2]: [web_site_sk#23, web_company_name#24] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_date#24] (47) BroadcastExchange -Input [1]: [web_site_sk#23] +Input [1]: [d_date_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (48) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#23] +Left keys [1]: [ws_ship_date_sk#4] +Right keys [1]: [d_date_sk#23] Join condition: None (49) Project [codegen id : 22] -Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#23] +Output [4]: [ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Input [6]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9, d_date_sk#23] -(50) Scan parquet default.date_dim -Output [2]: [d_date_sk#26, d_date#27] +(50) Scan parquet default.web_site +Output [2]: [web_site_sk#26, web_company_name#27] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (51) ColumnarToRow [codegen id : 21] -Input [2]: [d_date_sk#26, d_date#27] +Input [2]: [web_site_sk#26, web_company_name#27] (52) Filter [codegen id : 21] -Input [2]: [d_date_sk#26, d_date#27] -Condition : (((isnotnull(d_date#27) AND (d_date#27 >= 10623)) AND (d_date#27 <= 10683)) AND isnotnull(d_date_sk#26)) +Input [2]: [web_site_sk#26, web_company_name#27] +Condition : ((isnotnull(web_company_name#27) AND (web_company_name#27 = pri)) AND isnotnull(web_site_sk#26)) (53) Project [codegen id : 21] -Output [1]: [d_date_sk#26] -Input [2]: [d_date_sk#26, d_date#27] +Output [1]: [web_site_sk#26] +Input [2]: [web_site_sk#26, web_company_name#27] (54) BroadcastExchange -Input [1]: [d_date_sk#26] +Input [1]: [web_site_sk#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] (55) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#26] +Left keys [1]: [ws_web_site_sk#6] +Right keys [1]: [web_site_sk#26] Join condition: None (56) Project [codegen id : 22] -Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#26] +Output [3]: [ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Input [5]: [ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9, web_site_sk#26] (57) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Keys [1]: [ws_order_number#4] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30] -Results [3]: [ws_order_number#4, sum#31, sum#32] +Input [3]: [ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Keys [1]: [ws_order_number#7] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#8)), partial_sum(UnscaledValue(ws_net_profit#9))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30] +Results [3]: [ws_order_number#7, sum#31, sum#32] (58) Exchange -Input [3]: [ws_order_number#4, sum#31, sum#32] -Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#33] +Input [3]: [ws_order_number#7, sum#31, sum#32] +Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#33] (59) HashAggregate [codegen id : 23] -Input [3]: [ws_order_number#4, sum#31, sum#32] -Keys [1]: [ws_order_number#4] -Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30] -Results [3]: [ws_order_number#4, sum#31, sum#32] +Input [3]: [ws_order_number#7, sum#31, sum#32] +Keys [1]: [ws_order_number#7] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#8)), merge_sum(UnscaledValue(ws_net_profit#9))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30] +Results [3]: [ws_order_number#7, sum#31, sum#32] (60) HashAggregate [codegen id : 23] -Input [3]: [ws_order_number#4, sum#31, sum#32] +Input [3]: [ws_order_number#7, sum#31, sum#32] Keys: [] -Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30, count(ws_order_number#4)#34] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#8)), merge_sum(UnscaledValue(ws_net_profit#9)), partial_count(distinct ws_order_number#7)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30, count(ws_order_number#7)#34] Results [3]: [sum#31, sum#32, count#35] (61) Exchange @@ -337,9 +337,9 @@ Arguments: SinglePartition, true, [id=#36] (62) HashAggregate [codegen id : 24] Input [3]: [sum#31, sum#32, count#35] Keys: [] -Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30, count(ws_order_number#4)#34] -Results [3]: [count(ws_order_number#4)#34 AS order count #37, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#29,17,2) AS total shipping cost #38, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#30,17,2) AS total net profit #39] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#8)), sum(UnscaledValue(ws_net_profit#9)), count(distinct ws_order_number#7)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30, count(ws_order_number#7)#34] +Results [3]: [count(ws_order_number#7)#34 AS order count #37, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#8))#29,17,2) AS total shipping cost #38, MakeDecimal(sum(UnscaledValue(ws_net_profit#9))#30,17,2) AS total net profit #39] (63) TakeOrderedAndProject Input [3]: [order count #37, total shipping cost #38, total net profit #39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt index bdcbb87b372dc..057fa5dc3441f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt @@ -11,101 +11,101 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (22) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + BroadcastHashJoin [ca_address_sk,ws_ship_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (9) + WholeStageCodegen (10) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #3 + Exchange [ws_order_number] #4 SortMergeJoin [ws_order_number,ws_order_number] - WholeStageCodegen (2) + WholeStageCodegen (3) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (1) + Exchange [ws_order_number] #5 + WholeStageCodegen (2) Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - WholeStageCodegen (8) + WholeStageCodegen (9) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (7) + Exchange [ws_order_number] #6 + WholeStageCodegen (8) Project [ws_order_number] SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] InputAdapter - WholeStageCodegen (4) + WholeStageCodegen (5) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #6 - WholeStageCodegen (3) + Exchange [ws_order_number] #7 + WholeStageCodegen (4) Filter [ws_order_number,ws_warehouse_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number] InputAdapter - WholeStageCodegen (6) + WholeStageCodegen (7) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #6 - WholeStageCodegen (18) + ReusedExchange [ws_warehouse_sk,ws_order_number] #7 + WholeStageCodegen (19) Project [wr_order_number] SortMergeJoin [ws_order_number,wr_order_number] InputAdapter - WholeStageCodegen (15) + WholeStageCodegen (16) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #7 - WholeStageCodegen (14) + Exchange [ws_order_number] #8 + WholeStageCodegen (15) Project [ws_order_number] SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] InputAdapter - WholeStageCodegen (11) + WholeStageCodegen (12) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #6 + ReusedExchange [ws_warehouse_sk,ws_order_number] #7 InputAdapter - WholeStageCodegen (13) + WholeStageCodegen (14) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #6 + ReusedExchange [ws_warehouse_sk,ws_order_number] #7 InputAdapter - WholeStageCodegen (17) + WholeStageCodegen (18) Sort [wr_order_number] InputAdapter - Exchange [wr_order_number] #8 - WholeStageCodegen (16) + Exchange [wr_order_number] #9 + WholeStageCodegen (17) Filter [wr_order_number] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_order_number] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (19) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter BroadcastExchange #10 WholeStageCodegen (20) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #11 WholeStageCodegen (21) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt index d00029f985471..a809ab1dd6644 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt @@ -8,15 +8,15 @@ TakeOrderedAndProject (28) :- * Project (17) : +- * BroadcastHashJoin Inner BuildRight (16) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.time_dim (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.time_dim (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) : +- BroadcastExchange (15) : +- * Project (14) : +- * Filter (13) @@ -29,50 +29,50 @@ TakeOrderedAndProject (28) +- Scan parquet default.household_demographics (18) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] - -(3) Filter [codegen id : 4] -Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) - -(4) Scan parquet default.time_dim -Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(1) Scan parquet default.time_dim +Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,20), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -(6) Filter [codegen id : 1] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 20)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 20)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [t_time_sk#1] +Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] + +(5) BroadcastExchange +Input [1]: [t_time_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [t_time_sk#4] -Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +(7) ColumnarToRow +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -(8) BroadcastExchange -Input [1]: [t_time_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_time_sk#1] -Right keys [1]: [t_time_sk#4] +Left keys [1]: [t_time_sk#1] +Right keys [1]: [ss_sold_time_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] -Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] +Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] +Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] (11) Scan parquet default.store Output [2]: [s_store_sk#8, s_store_name#9] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#7] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 4] -Output [1]: [ss_hdemo_sk#2] -Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] +Output [1]: [ss_hdemo_sk#6] +Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] (18) Scan parquet default.household_demographics Output [2]: [hd_demo_sk#11, hd_dep_count#12] @@ -128,13 +128,13 @@ Input [1]: [hd_demo_sk#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#2] +Left keys [1]: [ss_hdemo_sk#6] Right keys [1]: [hd_demo_sk#11] Join condition: None (24) Project [codegen id : 4] Output: [] -Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] (25) HashAggregate [codegen id : 4] Input: [] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt index 1355caffbbfe8..e4fc01bb6027b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt @@ -10,11 +10,7 @@ TakeOrderedAndProject [count(1)] Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [ss_sold_time_sk,t_time_sk] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [t_time_sk,ss_sold_time_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -23,6 +19,10 @@ TakeOrderedAndProject [count(1)] ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt index 30dabdd2d5523..7d6ff8f589693 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -10,153 +10,153 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -(3) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Condition : (i_category#6 IN (Sports,Books,Home) AND isnotnull(i_item_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#7] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +Condition : (isnotnull(ss_item_sk#9) AND isnotnull(ss_sold_date_sk#8)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +Arguments: hashpartitioning(ss_item_sk#9, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +Arguments: [ss_item_sk#9 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#9] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_ext_sales_price#10] +Input [9]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ss_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Input [8]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_ext_sales_price#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [6]: [ss_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#10))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#10))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#10))#18] +Results [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS _w1#21, i_item_id#2] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: hashpartitioning(i_class#5, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: [i_class#5 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#5] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#2] +Input [9]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2, _we0#23] (27) Exchange -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] +Arguments: rangepartitioning(i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] +Arguments: [i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 (29) Project [codegen id : 10] -Output [6]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Output [6]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt index a180ed2b060b9..e15073da7fb51 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt @@ -18,34 +18,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ss_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (2) - Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_item_id,i_item_desc,i_current_price,i_class,i_category,ss_sold_date_sk,ss_ext_sales_price] + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (3) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #6 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #6 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt index 34eba382992c3..c547e7af5d790 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (32) : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_sales (6) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.warehouse (23) -(1) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] - -(3) Filter [codegen id : 5] -Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] -Condition : (((isnotnull(cs_warehouse_sk#5) AND isnotnull(cs_ship_mode_sk#4)) AND isnotnull(cs_call_center_sk#3)) AND isnotnull(cs_ship_date_sk#2)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#6, d_month_seq#7] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_month_seq#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#6, d_month_seq#7] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#6, d_month_seq#7] -Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] +Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_month_seq#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [2]: [d_date_sk#6, d_month_seq#7] +(7) ColumnarToRow +Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] +Condition : (((isnotnull(cs_warehouse_sk#8) AND isnotnull(cs_ship_mode_sk#7)) AND isnotnull(cs_call_center_sk#6)) AND isnotnull(cs_ship_date_sk#5)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_ship_date_sk#2] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_ship_date_sk#5] Join condition: None (10) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] -Input [6]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5, d_date_sk#6] +Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] +Input [6]: [d_date_sk#1, cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] (11) Scan parquet default.ship_mode Output [2]: [sm_ship_mode_sk#9, sm_type#10] @@ -97,13 +97,13 @@ Input [2]: [sm_ship_mode_sk#9, sm_type#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_ship_mode_sk#4] +Left keys [1]: [cs_ship_mode_sk#7] Right keys [1]: [sm_ship_mode_sk#9] Join condition: None (16) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_warehouse_sk#5, sm_type#10] -Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5, sm_ship_mode_sk#9, sm_type#10] +Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_warehouse_sk#8, sm_type#10] +Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8, sm_ship_mode_sk#9, sm_type#10] (17) Scan parquet default.call_center Output [2]: [cc_call_center_sk#12, cc_name#13] @@ -124,13 +124,13 @@ Input [2]: [cc_call_center_sk#12, cc_name#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_call_center_sk#3] +Left keys [1]: [cs_call_center_sk#6] Right keys [1]: [cc_call_center_sk#12] Join condition: None (22) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_warehouse_sk#5, sm_type#10, cc_name#13] -Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_warehouse_sk#5, sm_type#10, cc_call_center_sk#12, cc_name#13] +Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_warehouse_sk#8, sm_type#10, cc_name#13] +Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_warehouse_sk#8, sm_type#10, cc_call_center_sk#12, cc_name#13] (23) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] @@ -151,18 +151,18 @@ Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (27) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_warehouse_sk#5] +Left keys [1]: [cs_warehouse_sk#8] Right keys [1]: [w_warehouse_sk#15] Join condition: None (28) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, w_warehouse_name#16, sm_type#10, cc_name#13] -Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_warehouse_sk#5, sm_type#10, cc_name#13, w_warehouse_sk#15, w_warehouse_name#16] +Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, w_warehouse_name#16, sm_type#10, cc_name#13] +Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_warehouse_sk#8, sm_type#10, cc_name#13, w_warehouse_sk#15, w_warehouse_name#16] (29) HashAggregate [codegen id : 5] -Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, w_warehouse_name#16, sm_type#10, cc_name#13] +Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, w_warehouse_name#16, sm_type#10, cc_name#13] Keys [3]: [substr(w_warehouse_name#16, 1, 20) AS substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13] -Functions [5]: [partial_sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))] +Functions [5]: [partial_sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))] Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] Results [8]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] @@ -173,9 +173,9 @@ Arguments: hashpartitioning(substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, c (31) HashAggregate [codegen id : 6] Input [8]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] Keys [3]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13] -Functions [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))] -Aggregate Attributes [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint))#30, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint))#31, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint))#32, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint))#33, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))#34] -Results [8]: [substr(w_warehouse_name#16, 1, 20)#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint))#30 AS 30 days #36, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint))#31 AS 31 - 60 days #37, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint))#32 AS 61 - 90 days #38, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint))#33 AS 91 - 120 days #39, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))#34 AS >120 days #40] +Functions [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))] +Aggregate Attributes [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint))#30, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint))#31, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint))#32, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint))#33, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))#34] +Results [8]: [substr(w_warehouse_name#16, 1, 20)#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint))#30 AS 30 days #36, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint))#31 AS 31 - 60 days #37, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint))#32 AS 61 - 90 days #38, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint))#33 AS 91 - 120 days #39, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))#34 AS >120 days #40] (32) TakeOrderedAndProject Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt index b25b16136992c..de3b1913ae25c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt @@ -12,11 +12,7 @@ TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days , Project [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_warehouse_sk,sm_type] BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] Project [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] - BroadcastHashJoin [cs_ship_date_sk,d_date_sk] - Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] + BroadcastHashJoin [d_date_sk,cs_ship_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -25,6 +21,10 @@ TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days , ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt index ab502fd0933f0..7714067c5bded 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt @@ -61,11 +61,11 @@ TakeOrderedAndProject (86) : :- * Sort (53) : : +- Exchange (52) : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (48) - : : : +- * ColumnarToRow (47) - : : : +- Scan parquet default.web_sales (46) - : : +- ReusedExchange (49) + : : +- * BroadcastHashJoin Inner BuildLeft (50) + : : :- ReusedExchange (46) + : : +- * Filter (49) + : : +- * ColumnarToRow (48) + : : +- Scan parquet default.web_sales (47) : +- * Sort (55) : +- ReusedExchange (54) +- * Sort (83) @@ -293,38 +293,38 @@ Left keys [1]: [customer_id#22] Right keys [1]: [customer_id#31] Join condition: None -(46) Scan parquet default.web_sales +(46) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#5, d_year#6] + +(47) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(47) ColumnarToRow [codegen id : 19] +(48) ColumnarToRow Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] -(48) Filter [codegen id : 19] +(49) Filter Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Condition : (isnotnull(ws_bill_customer_sk#38) AND isnotnull(ws_sold_date_sk#37)) -(49) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#5, d_year#6] - (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#37] -Right keys [1]: [d_date_sk#5] +Left keys [1]: [d_date_sk#5] +Right keys [1]: [ws_sold_date_sk#37] Join condition: None (51) Project [codegen id : 19] -Output [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] -Input [6]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_date_sk#5, d_year#6] +Output [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +Input [6]: [d_date_sk#5, d_year#6, ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] (52) Exchange -Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] +Input [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Arguments: hashpartitioning(ws_bill_customer_sk#38, 5), true, [id=#41] (53) Sort [codegen id : 20] -Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] +Input [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -341,7 +341,7 @@ Join condition: None (57) Project [codegen id : 23] Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] -Input [12]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Input [12]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (58) HashAggregate [codegen id : 23] Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt index 93d3d21e1e02f..d69e46d092c13 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt @@ -110,14 +110,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt index dad6098ce4685..1d9ac2afeaf29 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt @@ -36,15 +36,15 @@ TakeOrderedAndProject (110) : : : : : +- * Project (24) : : : : : +- * BroadcastHashJoin Inner BuildRight (23) : : : : : :- * Project (18) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) - : : : : : : :- * Filter (11) - : : : : : : : +- * ColumnarToRow (10) - : : : : : : : +- Scan parquet default.store_sales (9) - : : : : : : +- BroadcastExchange (16) - : : : : : : +- * Project (15) - : : : : : : +- * Filter (14) - : : : : : : +- * ColumnarToRow (13) - : : : : : : +- Scan parquet default.date_dim (12) + : : : : : : +- * BroadcastHashJoin Inner BuildLeft (17) + : : : : : : :- BroadcastExchange (13) + : : : : : : : +- * Project (12) + : : : : : : : +- * Filter (11) + : : : : : : : +- * ColumnarToRow (10) + : : : : : : : +- Scan parquet default.date_dim (9) + : : : : : : +- * Filter (16) + : : : : : : +- * ColumnarToRow (15) + : : : : : : +- Scan parquet default.store_sales (14) : : : : : +- BroadcastExchange (22) : : : : : +- * Filter (21) : : : : : +- * ColumnarToRow (20) @@ -54,11 +54,11 @@ TakeOrderedAndProject (110) : : : : +- * Project (38) : : : : +- * BroadcastHashJoin Inner BuildRight (37) : : : : :- * Project (32) - : : : : : +- * BroadcastHashJoin Inner BuildRight (31) - : : : : : :- * Filter (29) - : : : : : : +- * ColumnarToRow (28) - : : : : : : +- Scan parquet default.catalog_sales (27) - : : : : : +- ReusedExchange (30) + : : : : : +- * BroadcastHashJoin Inner BuildLeft (31) + : : : : : :- ReusedExchange (27) + : : : : : +- * Filter (30) + : : : : : +- * ColumnarToRow (29) + : : : : : +- Scan parquet default.catalog_sales (28) : : : : +- BroadcastExchange (36) : : : : +- * Filter (35) : : : : +- * ColumnarToRow (34) @@ -68,11 +68,11 @@ TakeOrderedAndProject (110) : : : +- * Project (50) : : : +- * BroadcastHashJoin Inner BuildRight (49) : : : :- * Project (47) - : : : : +- * BroadcastHashJoin Inner BuildRight (46) - : : : : :- * Filter (44) - : : : : : +- * ColumnarToRow (43) - : : : : : +- Scan parquet default.web_sales (42) - : : : : +- ReusedExchange (45) + : : : : +- * BroadcastHashJoin Inner BuildLeft (46) + : : : : :- ReusedExchange (42) + : : : : +- * Filter (45) + : : : : +- * ColumnarToRow (44) + : : : : +- Scan parquet default.web_sales (43) : : : +- ReusedExchange (48) : : +- BroadcastExchange (69) : : +- * Project (68) @@ -97,17 +97,17 @@ TakeOrderedAndProject (110) +- * Project (102) +- * BroadcastHashJoin Inner BuildRight (101) :- * Project (99) - : +- * BroadcastHashJoin Inner BuildRight (98) - : :- SortMergeJoin LeftSemi (92) - : : :- * Sort (89) - : : : +- ReusedExchange (88) - : : +- * Sort (91) - : : +- ReusedExchange (90) - : +- BroadcastExchange (97) - : +- * Project (96) - : +- * Filter (95) - : +- * ColumnarToRow (94) - : +- Scan parquet default.date_dim (93) + : +- * BroadcastHashJoin Inner BuildLeft (98) + : :- BroadcastExchange (92) + : : +- * Project (91) + : : +- * Filter (90) + : : +- * ColumnarToRow (89) + : : +- Scan parquet default.date_dim (88) + : +- SortMergeJoin LeftSemi (97) + : :- * Sort (94) + : : +- ReusedExchange (93) + : +- * Sort (96) + : +- ReusedExchange (95) +- ReusedExchange (100) @@ -147,50 +147,50 @@ Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(9) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(10) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] - -(11) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(12) Scan parquet default.date_dim +(9) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(13) ColumnarToRow [codegen id : 3] +(10) ColumnarToRow [codegen id : 3] Input [2]: [d_date_sk#10, d_year#11] -(14) Filter [codegen id : 3] +(11) Filter [codegen id : 3] Input [2]: [d_date_sk#10, d_year#11] Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1998)) AND (d_year#11 <= 2000)) AND isnotnull(d_date_sk#10)) -(15) Project [codegen id : 3] +(12) Project [codegen id : 3] Output [1]: [d_date_sk#10] Input [2]: [d_date_sk#10, d_year#11] -(16) BroadcastExchange +(13) BroadcastExchange Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(14) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(15) ColumnarToRow +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] + +(16) Filter +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) + (17) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [ss_sold_date_sk#1] Join condition: None (18) Project [codegen id : 5] Output [1]: [ss_item_sk#2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] +Input [3]: [d_date_sk#10, ss_sold_date_sk#1, ss_item_sk#2] (19) Scan parquet default.item Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -227,31 +227,31 @@ Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coale Input [3]: [brand_id#14, class_id#15, category_id#16] Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 -(27) Scan parquet default.catalog_sales +(27) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#10] + +(28) Scan parquet default.catalog_sales Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -(29) Filter [codegen id : 9] +(30) Filter Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) -(30) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] - (31) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [cs_sold_date_sk#18] Join condition: None (32) Project [codegen id : 9] Output [1]: [cs_item_sk#19] -Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] +Input [3]: [d_date_sk#10, cs_sold_date_sk#18, cs_item_sk#19] (33) Scan parquet default.item Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -293,31 +293,31 @@ Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(42) Scan parquet default.web_sales +(42) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#10] + +(43) Scan parquet default.web_sales Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 13] +(44) ColumnarToRow Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(44) Filter [codegen id : 13] +(45) Filter Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) -(45) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] - (46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [ws_sold_date_sk#22] Join condition: None (47) Project [codegen id : 13] Output [1]: [ws_item_sk#23] -Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] +Input [3]: [d_date_sk#10, ws_sold_date_sk#22, ws_item_sk#23] (48) ReusedExchange [Reuses operator id: 36] Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -506,55 +506,55 @@ Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantit Output [6]: [store AS channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45] Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] -(88) ReusedExchange [Reuses operator id: 4] -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] - -(89) Sort [codegen id : 40] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 - -(90) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] - -(91) Sort [codegen id : 56] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 - -(92) SortMergeJoin -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [ss_item_sk#27] -Join condition: None - -(93) Scan parquet default.date_dim +(88) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_week_seq#29] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] ReadSchema: struct -(94) ColumnarToRow [codegen id : 57] +(89) ColumnarToRow [codegen id : 39] Input [2]: [d_date_sk#10, d_week_seq#29] -(95) Filter [codegen id : 57] +(90) Filter [codegen id : 39] Input [2]: [d_date_sk#10, d_week_seq#29] Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#10)) -(96) Project [codegen id : 57] +(91) Project [codegen id : 39] Output [1]: [d_date_sk#10] Input [2]: [d_date_sk#10, d_week_seq#29] -(97) BroadcastExchange +(92) BroadcastExchange Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] +(93) ReusedExchange [Reuses operator id: 4] +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] + +(94) Sort [codegen id : 41] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 + +(95) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] + +(96) Sort [codegen id : 57] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 + +(97) SortMergeJoin +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [ss_item_sk#27] +Join condition: None + (98) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [ss_sold_date_sk#1] Join condition: None (99) Project [codegen id : 76] Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] +Input [5]: [d_date_sk#10, ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] (100) ReusedExchange [Reuses operator id: 80] Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] @@ -782,7 +782,7 @@ Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] -Subquery:4 Hosting operator id = 95 Hosting Expression = Subquery scalar-subquery#50, [id=#51] +Subquery:4 Hosting operator id = 90 Hosting Expression = Subquery scalar-subquery#50, [id=#51] * Project (144) +- * Filter (143) +- * ColumnarToRow (142) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt index d6b8ba4395d2e..fc24efc4567af 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt @@ -97,11 +97,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_item_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #7 WholeStageCodegen (3) @@ -110,6 +106,10 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_item_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter BroadcastExchange #8 WholeStageCodegen (4) @@ -125,13 +125,13 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #7 Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] - InputAdapter - ReusedExchange [d_date_sk] #7 InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -147,13 +147,13 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #7 Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] - InputAdapter - ReusedExchange [d_date_sk] #7 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10 InputAdapter @@ -201,20 +201,10 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - InputAdapter - SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (40) - Sort [ss_item_sk] - InputAdapter - ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 - WholeStageCodegen (56) - Sort [ss_item_sk] - InputAdapter - ReusedExchange [ss_item_sk] #3 + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #19 - WholeStageCodegen (57) + WholeStageCodegen (39) Project [d_date_sk] Filter [d_week_seq,d_date_sk] Subquery #3 @@ -227,5 +217,15 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + SortMergeJoin [ss_item_sk,ss_item_sk] + WholeStageCodegen (41) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 + WholeStageCodegen (57) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt index 38292528b42fc..f17901bf84a98 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt @@ -87,11 +87,11 @@ TakeOrderedAndProject (222) : : : : : : : +- * Project (50) : : : : : : : +- * BroadcastHashJoin Inner BuildRight (49) : : : : : : : :- * Project (47) - : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (46) - : : : : : : : : :- * Filter (44) - : : : : : : : : : +- * ColumnarToRow (43) - : : : : : : : : : +- Scan parquet default.web_sales (42) - : : : : : : : : +- ReusedExchange (45) + : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (46) + : : : : : : : : :- ReusedExchange (42) + : : : : : : : : +- * Filter (45) + : : : : : : : : +- * ColumnarToRow (44) + : : : : : : : : +- Scan parquet default.web_sales (43) : : : : : : : +- ReusedExchange (48) : : : : : : +- BroadcastExchange (69) : : : : : : +- * Project (68) @@ -405,31 +405,31 @@ Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(42) Scan parquet default.web_sales +(42) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] + +(43) Scan parquet default.web_sales Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 13] +(44) ColumnarToRow Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(44) Filter [codegen id : 13] +(45) Filter Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) -(45) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] - (46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ws_sold_date_sk#22] -Right keys [1]: [d_date_sk#10] +Left keys [1]: [d_date_sk#10] +Right keys [1]: [ws_sold_date_sk#22] Join condition: None (47) Project [codegen id : 13] Output [1]: [ws_item_sk#23] -Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] +Input [3]: [d_date_sk#10, ws_sold_date_sk#22, ws_item_sk#23] (48) ReusedExchange [Reuses operator id: 36] Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt index 30856e02f2b62..76a6f5c4a6048 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt @@ -192,13 +192,13 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #12 Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] - InputAdapter - ReusedExchange [d_date_sk] #12 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #15 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt index 2d76deefcaa36..09c08a0131d34 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt @@ -109,34 +109,34 @@ TakeOrderedAndProject (160) : +- * Project (134) : +- * BroadcastHashJoin Inner BuildRight (133) : :- * Project (131) - : : +- * BroadcastHashJoin Inner BuildRight (130) - : : :- * Project (111) - : : : +- * BroadcastHashJoin Inner BuildRight (110) - : : : :- * Project (108) - : : : : +- * BroadcastHashJoin Inner BuildRight (107) - : : : : :- * Filter (105) - : : : : : +- * ColumnarToRow (104) - : : : : : +- Scan parquet default.catalog_sales (103) - : : : : +- ReusedExchange (106) - : : : +- ReusedExchange (109) - : : +- BroadcastExchange (129) - : : +- * Project (128) - : : +- * BroadcastHashJoin Inner BuildLeft (127) - : : :- BroadcastExchange (123) - : : : +- * Project (122) - : : : +- * BroadcastHashJoin Inner BuildRight (121) - : : : :- * Project (115) - : : : : +- * Filter (114) - : : : : +- * ColumnarToRow (113) - : : : : +- Scan parquet default.customer (112) - : : : +- BroadcastExchange (120) - : : : +- * Project (119) - : : : +- * Filter (118) - : : : +- * ColumnarToRow (117) - : : : +- Scan parquet default.customer_address (116) - : : +- * Filter (126) - : : +- * ColumnarToRow (125) - : : +- Scan parquet default.customer_demographics (124) + : : +- * BroadcastHashJoin Inner BuildLeft (130) + : : :- BroadcastExchange (120) + : : : +- * Project (119) + : : : +- * BroadcastHashJoin Inner BuildLeft (118) + : : : :- BroadcastExchange (114) + : : : : +- * Project (113) + : : : : +- * BroadcastHashJoin Inner BuildRight (112) + : : : : :- * Project (106) + : : : : : +- * Filter (105) + : : : : : +- * ColumnarToRow (104) + : : : : : +- Scan parquet default.customer (103) + : : : : +- BroadcastExchange (111) + : : : : +- * Project (110) + : : : : +- * Filter (109) + : : : : +- * ColumnarToRow (108) + : : : : +- Scan parquet default.customer_address (107) + : : : +- * Filter (117) + : : : +- * ColumnarToRow (116) + : : : +- Scan parquet default.customer_demographics (115) + : : +- * Project (129) + : : +- * BroadcastHashJoin Inner BuildRight (128) + : : :- * Project (126) + : : : +- * BroadcastHashJoin Inner BuildRight (125) + : : : :- * Filter (123) + : : : : +- * ColumnarToRow (122) + : : : : +- Scan parquet default.catalog_sales (121) + : : : +- ReusedExchange (124) + : : +- ReusedExchange (127) : +- ReusedExchange (132) +- * HashAggregate (158) +- Exchange (157) @@ -617,132 +617,132 @@ Functions [7]: [avg(agg1#36), avg(agg2#37), avg(agg3#38), avg(agg4#39), avg(agg5 Aggregate Attributes [7]: [avg(agg1#36)#167, avg(agg2#37)#168, avg(agg3#38)#169, avg(agg4#39)#170, avg(agg5#40)#171, avg(agg6#41)#172, avg(agg7#42)#173] Results [11]: [i_item_id#19, ca_country#30, null AS ca_state#174, null AS county#175, avg(agg1#36)#167 AS agg1#176, avg(agg2#37)#168 AS agg2#177, avg(agg3#38)#169 AS agg3#178, avg(agg4#39)#170 AS agg4#179, avg(agg5#40)#171 AS agg5#180, avg(agg6#41)#172 AS agg6#181, avg(agg7#42)#173 AS agg7#182] -(103) Scan parquet default.catalog_sales -Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] -ReadSchema: struct - -(104) ColumnarToRow [codegen id : 49] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] - -(105) Filter [codegen id : 49] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] -Condition : (((isnotnull(cs_bill_cdemo_sk#3) AND isnotnull(cs_bill_customer_sk#2)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#4)) - -(106) ReusedExchange [Reuses operator id: 8] -Output [2]: [cd_demo_sk#10, cd_dep_count#13] - -(107) BroadcastHashJoin [codegen id : 49] -Left keys [1]: [cs_bill_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#10] -Join condition: None - -(108) Project [codegen id : 49] -Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] -Input [11]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_demo_sk#10, cd_dep_count#13] - -(109) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#15] - -(110) BroadcastHashJoin [codegen id : 49] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#15] -Join condition: None - -(111) Project [codegen id : 49] -Output [8]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] -Input [10]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, d_date_sk#15] - -(112) Scan parquet default.customer +(103) Scan parquet default.customer Output [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct -(113) ColumnarToRow [codegen id : 46] +(104) ColumnarToRow [codegen id : 44] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] -(114) Filter [codegen id : 46] +(105) Filter [codegen id : 44] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] Condition : (((c_birth_month#25 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#22)) AND isnotnull(c_current_cdemo_sk#23)) AND isnotnull(c_current_addr_sk#24)) -(115) Project [codegen id : 46] +(106) Project [codegen id : 44] Output [4]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_year#26] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] -(116) Scan parquet default.customer_address +(107) Scan parquet default.customer_address Output [2]: [ca_address_sk#27, ca_state#29] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] ReadSchema: struct -(117) ColumnarToRow [codegen id : 45] +(108) ColumnarToRow [codegen id : 43] Input [2]: [ca_address_sk#27, ca_state#29] -(118) Filter [codegen id : 45] +(109) Filter [codegen id : 43] Input [2]: [ca_address_sk#27, ca_state#29] Condition : (ca_state#29 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#27)) -(119) Project [codegen id : 45] +(110) Project [codegen id : 43] Output [1]: [ca_address_sk#27] Input [2]: [ca_address_sk#27, ca_state#29] -(120) BroadcastExchange +(111) BroadcastExchange Input [1]: [ca_address_sk#27] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#183] -(121) BroadcastHashJoin [codegen id : 46] +(112) BroadcastHashJoin [codegen id : 44] Left keys [1]: [c_current_addr_sk#24] Right keys [1]: [ca_address_sk#27] Join condition: None -(122) Project [codegen id : 46] +(113) Project [codegen id : 44] Output [3]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_year#26, ca_address_sk#27] -(123) BroadcastExchange +(114) BroadcastExchange Input [3]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26] Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#184] -(124) Scan parquet default.customer_demographics +(115) Scan parquet default.customer_demographics Output [1]: [cd_demo_sk#185] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct -(125) ColumnarToRow +(116) ColumnarToRow Input [1]: [cd_demo_sk#185] -(126) Filter +(117) Filter Input [1]: [cd_demo_sk#185] Condition : isnotnull(cd_demo_sk#185) -(127) BroadcastHashJoin [codegen id : 47] +(118) BroadcastHashJoin [codegen id : 45] Left keys [1]: [c_current_cdemo_sk#23] Right keys [1]: [cd_demo_sk#185] Join condition: None -(128) Project [codegen id : 47] +(119) Project [codegen id : 45] Output [2]: [c_customer_sk#22, c_birth_year#26] Input [4]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26, cd_demo_sk#185] -(129) BroadcastExchange +(120) BroadcastExchange Input [2]: [c_customer_sk#22, c_birth_year#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#186] +(121) Scan parquet default.catalog_sales +Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(122) ColumnarToRow +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] + +(123) Filter +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] +Condition : (((isnotnull(cs_bill_cdemo_sk#3) AND isnotnull(cs_bill_customer_sk#2)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#4)) + +(124) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#10, cd_dep_count#13] + +(125) BroadcastHashJoin +Left keys [1]: [cs_bill_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(126) Project +Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Input [11]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_demo_sk#10, cd_dep_count#13] + +(127) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + +(128) BroadcastHashJoin +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(129) Project +Output [8]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Input [10]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, d_date_sk#15] + (130) BroadcastHashJoin [codegen id : 49] -Left keys [1]: [cs_bill_customer_sk#2] -Right keys [1]: [c_customer_sk#22] +Left keys [1]: [c_customer_sk#22] +Right keys [1]: [cs_bill_customer_sk#2] Join condition: None (131) Project [codegen id : 49] -Output [8]: [cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_birth_year#26] -Input [10]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_customer_sk#22, c_birth_year#26] +Output [8]: [c_birth_year#26, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Input [10]: [c_customer_sk#22, c_birth_year#26, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] (132) ReusedExchange [Reuses operator id: 21] Output [2]: [i_item_sk#18, i_item_id#19] @@ -754,7 +754,7 @@ Join condition: None (134) Project [codegen id : 49] Output [8]: [i_item_id#19, cast(cs_quantity#5 as decimal(12,2)) AS agg1#36, cast(cs_list_price#6 as decimal(12,2)) AS agg2#37, cast(cs_coupon_amt#8 as decimal(12,2)) AS agg3#38, cast(cs_sales_price#7 as decimal(12,2)) AS agg4#39, cast(cs_net_profit#9 as decimal(12,2)) AS agg5#40, cast(c_birth_year#26 as decimal(12,2)) AS agg6#41, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#42] -Input [10]: [cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_birth_year#26, i_item_sk#18, i_item_id#19] +Input [10]: [c_birth_year#26, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, i_item_sk#18, i_item_id#19] (135) HashAggregate [codegen id : 49] Input [8]: [i_item_id#19, agg1#36, agg2#37, agg3#38, agg4#39, agg5#40, agg6#41, agg7#42] @@ -839,7 +839,7 @@ Join condition: None Output [7]: [cs_bill_customer_sk#2, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] Input [9]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, i_item_sk#18] -(153) ReusedExchange [Reuses operator id: 129] +(153) ReusedExchange [Reuses operator id: 120] Output [2]: [c_customer_sk#22, c_birth_year#26] (154) BroadcastHashJoin [codegen id : 57] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt index 5514e335f1b51..6030a0d04a50f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt @@ -186,28 +186,16 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag HashAggregate [i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] Project [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] BroadcastHashJoin [cs_item_sk,i_item_sk] - Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year] - BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] - BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] - Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_sold_date_sk,cs_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit] - InputAdapter - ReusedExchange [cd_demo_sk,cd_dep_count] #3 - InputAdapter - ReusedExchange [d_date_sk] #4 + Project [c_birth_year,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [c_customer_sk,cs_bill_customer_sk] InputAdapter BroadcastExchange #19 - WholeStageCodegen (47) + WholeStageCodegen (45) Project [c_customer_sk,c_birth_year] BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] InputAdapter BroadcastExchange #20 - WholeStageCodegen (46) + WholeStageCodegen (44) Project [c_customer_sk,c_current_cdemo_sk,c_birth_year] BroadcastHashJoin [c_current_addr_sk,ca_address_sk] Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] @@ -217,7 +205,7 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] InputAdapter BroadcastExchange #21 - WholeStageCodegen (45) + WholeStageCodegen (43) Project [ca_address_sk] Filter [ca_state,ca_address_sk] ColumnarToRow @@ -227,6 +215,18 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_sold_date_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit] + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [d_date_sk] #4 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 WholeStageCodegen (58) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt index 15cde1a45a99b..a22109fc2b4d7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (27) :- * Sort (12) : +- Exchange (11) : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.catalog_sales (6) +- * Sort (17) +- Exchange (16) +- * Filter (15) @@ -28,58 +28,58 @@ TakeOrderedAndProject (27) +- Scan parquet default.item (13) -(1) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] - -(3) Filter [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_date#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_date#2] +Condition : (((isnotnull(d_date#2) AND (d_date#2 >= 10644)) AND (d_date#2 <= 10674)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_date#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] +Condition : (isnotnull(cs_item_sk#5) AND isnotnull(cs_sold_date_sk#4)) (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#4] Join condition: None (10) Project [codegen id : 2] -Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] +Output [2]: [cs_item_sk#5, cs_ext_sales_price#6] +Input [4]: [d_date_sk#1, cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] (11) Exchange -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] +Input [2]: [cs_item_sk#5, cs_ext_sales_price#6] +Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#7] (12) Sort [codegen id : 3] -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 +Input [2]: [cs_item_sk#5, cs_ext_sales_price#6] +Arguments: [cs_item_sk#5 ASC NULLS FIRST], false, 0 (13) Scan parquet default.item Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -104,18 +104,18 @@ Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_clas Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 (18) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] +Left keys [1]: [cs_item_sk#5] Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [cs_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [cs_item_sk#5, cs_ext_sales_price#6, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [6]: [cs_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#6))] Aggregate Attributes [1]: [sum#15] Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -126,9 +126,9 @@ Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class# (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#6))#18] +Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS _w1#21] (23) Exchange Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt index e66efff75180a..f1568a8212b43 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt @@ -22,11 +22,7 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c Exchange [cs_item_sk] #3 WholeStageCodegen (2) Project [cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] + Filter [cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt index 0234a65ac06a5..e754e998b6c8b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt @@ -12,20 +12,20 @@ TakeOrderedAndProject (52) : : +- Exchange (17) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) - : : :- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.inventory (1) - : : : +- BroadcastExchange (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.warehouse (4) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.inventory (6) : : +- BroadcastExchange (14) - : : +- * Project (13) - : : +- * Filter (12) - : : +- * ColumnarToRow (11) - : : +- Scan parquet default.date_dim (10) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.warehouse (11) : +- * Sort (23) : +- Exchange (22) : +- * Filter (21) @@ -53,85 +53,85 @@ TakeOrderedAndProject (52) +- ReusedExchange (46) -(1) Scan parquet default.inventory -Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_month_seq#2] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_date_sk), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 3] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] -(3) Filter [codegen id : 3] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_month_seq#2] +Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1212)) AND (d_month_seq#2 <= 1223)) AND isnotnull(d_date_sk#1)) -(4) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_month_seq#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(5) ColumnarToRow [codegen id : 1] -Input [1]: [w_warehouse_sk#5] +(6) Scan parquet default.inventory +Output [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_date_sk), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [1]: [w_warehouse_sk#5] -Condition : isnotnull(w_warehouse_sk#5) +(7) ColumnarToRow +Input [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] -(7) BroadcastExchange -Input [1]: [w_warehouse_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] +(8) Filter +Input [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +Condition : ((isnotnull(inv_date_sk#4) AND isnotnull(inv_item_sk#5)) AND isnotnull(inv_warehouse_sk#6)) -(8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#3] -Right keys [1]: [w_warehouse_sk#5] +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [inv_date_sk#4] Join condition: None -(9) Project [codegen id : 3] -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] -Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] +(10) Project [codegen id : 3] +Output [3]: [inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +Input [5]: [d_date_sk#1, inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] -(10) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_month_seq#8] +(11) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] -ReadSchema: struct - -(11) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct -(12) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] -Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND isnotnull(d_date_sk#7)) +(12) ColumnarToRow [codegen id : 2] +Input [1]: [w_warehouse_sk#8] -(13) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_month_seq#8] +(13) Filter [codegen id : 2] +Input [1]: [w_warehouse_sk#8] +Condition : isnotnull(w_warehouse_sk#8) (14) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +Input [1]: [w_warehouse_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [inv_warehouse_sk#6] +Right keys [1]: [w_warehouse_sk#8] Join condition: None (16) Project [codegen id : 3] -Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] +Output [2]: [inv_item_sk#5, inv_quantity_on_hand#7] +Input [4]: [inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7, w_warehouse_sk#8] (17) Exchange -Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Arguments: hashpartitioning(inv_item_sk#2, 5), true, [id=#10] +Input [2]: [inv_item_sk#5, inv_quantity_on_hand#7] +Arguments: hashpartitioning(inv_item_sk#5, 5), true, [id=#10] (18) Sort [codegen id : 4] -Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Arguments: [inv_item_sk#2 ASC NULLS FIRST], false, 0 +Input [2]: [inv_item_sk#5, inv_quantity_on_hand#7] +Arguments: [inv_item_sk#5 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] @@ -156,18 +156,18 @@ Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name# Arguments: [i_item_sk#11 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [inv_item_sk#2] +Left keys [1]: [inv_item_sk#5] Right keys [1]: [i_item_sk#11] Join condition: None (25) Project [codegen id : 7] -Output [5]: [inv_quantity_on_hand#4, i_brand#12, i_class#13, i_category#14, i_product_name#15] -Input [7]: [inv_item_sk#2, inv_quantity_on_hand#4, i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Output [5]: [inv_quantity_on_hand#7, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Input [7]: [inv_item_sk#5, inv_quantity_on_hand#7, i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] (26) HashAggregate [codegen id : 7] -Input [5]: [inv_quantity_on_hand#4, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Input [5]: [inv_quantity_on_hand#7, i_brand#12, i_class#13, i_category#14, i_product_name#15] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [partial_avg(cast(inv_quantity_on_hand#4 as bigint))] +Functions [1]: [partial_avg(cast(inv_quantity_on_hand#7 as bigint))] Aggregate Attributes [2]: [sum#17, count#18] Results [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] @@ -178,9 +178,9 @@ Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, i_categor (28) HashAggregate [codegen id : 8] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#22] -Results [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, avg(cast(inv_quantity_on_hand#4 as bigint))#22 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#22] +Results [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, avg(cast(inv_quantity_on_hand#7 as bigint))#22 AS qoh#23] (29) HashAggregate [codegen id : 8] Input [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#23] @@ -202,9 +202,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#30, c (32) HashAggregate [codegen id : 16] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#30, count#31] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#32] -Results [4]: [i_product_name#15, i_brand#12, i_class#13, avg(cast(inv_quantity_on_hand#4 as bigint))#32 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#32] +Results [4]: [i_product_name#15, i_brand#12, i_class#13, avg(cast(inv_quantity_on_hand#7 as bigint))#32 AS qoh#23] (33) HashAggregate [codegen id : 16] Input [4]: [i_product_name#15, i_brand#12, i_class#13, qoh#23] @@ -230,9 +230,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#41, c (37) HashAggregate [codegen id : 25] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#41, count#42] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#43] -Results [3]: [i_product_name#15, i_brand#12, avg(cast(inv_quantity_on_hand#4 as bigint))#43 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#43] +Results [3]: [i_product_name#15, i_brand#12, avg(cast(inv_quantity_on_hand#7 as bigint))#43 AS qoh#23] (38) HashAggregate [codegen id : 25] Input [3]: [i_product_name#15, i_brand#12, qoh#23] @@ -258,9 +258,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#53, c (42) HashAggregate [codegen id : 34] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#53, count#54] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#55] -Results [2]: [i_product_name#15, avg(cast(inv_quantity_on_hand#4 as bigint))#55 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#55] +Results [2]: [i_product_name#15, avg(cast(inv_quantity_on_hand#7 as bigint))#55 AS qoh#23] (43) HashAggregate [codegen id : 34] Input [2]: [i_product_name#15, qoh#23] @@ -286,9 +286,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#66, c (47) HashAggregate [codegen id : 43] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#66, count#67] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#68] -Results [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#68 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#68] +Results [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#68 AS qoh#23] (48) HashAggregate [codegen id : 43] Input [1]: [qoh#23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt index c2fe3189b2d10..3cb90d4e7dda2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt @@ -17,28 +17,28 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [d_date_sk,inv_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt index 9c1273c85439f..6787138c04a3f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt @@ -22,15 +22,15 @@ : : : +- * BroadcastHashJoin Inner BuildLeft (15) : : : :- BroadcastExchange (11) : : : : +- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : :- BroadcastExchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store (1) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.customer_address (6) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer_address (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store (4) : : : +- * Filter (14) : : : +- * ColumnarToRow (13) : : : +- Scan parquet default.customer (12) @@ -48,54 +48,54 @@ +- Scan parquet default.store_returns (31) -(1) Scan parquet default.store -Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(1) Scan parquet default.customer_address +Output [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/store] -PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] -(3) Filter [codegen id : 1] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] -Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5)) +(3) Filter [codegen id : 2] +Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] +Condition : ((isnotnull(ca_address_sk#1) AND isnotnull(ca_country#4)) AND isnotnull(ca_zip#3)) -(4) Project [codegen id : 1] -Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(4) Scan parquet default.store +Output [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct -(5) BroadcastExchange -Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] -Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#6] +(5) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -(6) Scan parquet default.customer_address -Output [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +Condition : (((isnotnull(s_market_id#7) AND (s_market_id#7 = 8)) AND isnotnull(s_store_sk#5)) AND isnotnull(s_zip#9)) -(7) ColumnarToRow -Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +(7) Project [codegen id : 1] +Output [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -(8) Filter -Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] -Condition : ((isnotnull(ca_address_sk#7) AND isnotnull(ca_country#10)) AND isnotnull(ca_zip#9)) +(8) BroadcastExchange +Input [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#10] (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [s_zip#5] -Right keys [1]: [ca_zip#9] +Left keys [1]: [ca_zip#3] +Right keys [1]: [s_zip#9] Join condition: None (10) Project [codegen id : 2] -Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] -Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Output [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] +Input [8]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] (11) BroadcastExchange -Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] -Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#11] +Input [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[2, string, true])),false), [id=#11] (12) Scan parquet default.customer Output [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] @@ -112,17 +112,17 @@ Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name Condition : ((isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) AND isnotnull(c_birth_country#16)) (15) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [ca_address_sk#7, upper(ca_country#10)] +Left keys [2]: [ca_address_sk#1, upper(ca_country#4)] Right keys [2]: [c_current_addr_sk#13, c_birth_country#16] Join condition: None (16) Project [codegen id : 3] -Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Output [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Input [11]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] (17) BroadcastExchange -Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#17] +Input [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#17] (18) Scan parquet default.store_sales Output [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] @@ -139,13 +139,13 @@ Input [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#2 Condition : (((isnotnull(ss_ticket_number#21) AND isnotnull(ss_item_sk#18)) AND isnotnull(ss_store_sk#20)) AND isnotnull(ss_customer_sk#19)) (21) BroadcastHashJoin [codegen id : 5] -Left keys [2]: [s_store_sk#1, c_customer_sk#12] +Left keys [2]: [s_store_sk#5, c_customer_sk#12] Right keys [2]: [ss_store_sk#20, ss_customer_sk#19] Join condition: None (22) Project [codegen id : 5] -Output [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] -Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] +Output [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [12]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] (23) Scan parquet default.item Output [6]: [i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] @@ -171,15 +171,15 @@ Right keys [1]: [i_item_sk#23] Join condition: None (28) Project [codegen id : 5] -Output [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] -Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Output [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [14]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] (29) Exchange -Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: hashpartitioning(cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint), 5), true, [id=#30] (30) Sort [codegen id : 6] -Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: [cast(ss_ticket_number#21 as bigint) ASC NULLS FIRST, cast(ss_item_sk#18 as bigint) ASC NULLS FIRST], false, 0 (31) Scan parquet default.store_returns @@ -210,60 +210,60 @@ Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] Join condition: None (37) Project [codegen id : 9] -Output [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] -Input [15]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] +Input [15]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] (38) HashAggregate [codegen id : 9] -Input [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum#34] -Results [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Results [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] (39) Exchange -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#36] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#36] (40) HashAggregate [codegen id : 10] -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#37] -Results [4]: [c_last_name#15, c_first_name#14, s_store_name#2, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#37,17,2) AS netpaid#38] +Results [4]: [c_last_name#15, c_first_name#14, s_store_name#6, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#37,17,2) AS netpaid#38] (41) HashAggregate [codegen id : 10] -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, netpaid#38] -Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, netpaid#38] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#6] Functions [1]: [partial_sum(netpaid#38)] Aggregate Attributes [2]: [sum#39, isEmpty#40] -Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] (42) Exchange -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, 5), true, [id=#43] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, 5), true, [id=#43] (43) HashAggregate [codegen id : 11] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] -Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#6] Functions [1]: [sum(netpaid#38)] Aggregate Attributes [1]: [sum(netpaid#38)#44] -Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] (44) Filter [codegen id : 11] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45, sum(netpaid#38)#46] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45, sum(netpaid#38)#46] Condition : (isnotnull(sum(netpaid#38)#46) AND (cast(sum(netpaid#38)#46 as decimal(33,8)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(33,8)))) (45) Project [codegen id : 11] -Output [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45, sum(netpaid#38)#46] +Output [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45, sum(netpaid#38)#46] (46) Exchange -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] -Arguments: rangepartitioning(c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST, 5), true, [id=#49] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] +Arguments: rangepartitioning(c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#6 ASC NULLS FIRST, 5), true, [id=#49] (47) Sort [codegen id : 12] -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] -Arguments: [c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST], true, 0 +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] +Arguments: [c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#6 ASC NULLS FIRST], true, 0 ===== Subqueries ===== @@ -289,15 +289,15 @@ Subquery:1 Hosting operator id = 44 Hosting Expression = Subquery scalar-subquer : : : +- * BroadcastHashJoin Inner BuildLeft (62) : : : :- BroadcastExchange (58) : : : : +- * Project (57) - : : : : +- * BroadcastHashJoin Inner BuildLeft (56) - : : : : :- BroadcastExchange (52) - : : : : : +- * Project (51) - : : : : : +- * Filter (50) - : : : : : +- * ColumnarToRow (49) - : : : : : +- Scan parquet default.store (48) - : : : : +- * Filter (55) - : : : : +- * ColumnarToRow (54) - : : : : +- Scan parquet default.customer_address (53) + : : : : +- * BroadcastHashJoin Inner BuildRight (56) + : : : : :- * Filter (50) + : : : : : +- * ColumnarToRow (49) + : : : : : +- Scan parquet default.customer_address (48) + : : : : +- BroadcastExchange (55) + : : : : +- * Project (54) + : : : : +- * Filter (53) + : : : : +- * ColumnarToRow (52) + : : : : +- Scan parquet default.store (51) : : : +- * Filter (61) : : : +- * ColumnarToRow (60) : : : +- Scan parquet default.customer (59) @@ -316,54 +316,54 @@ Subquery:1 Hosting operator id = 44 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (81) -(48) Scan parquet default.store -Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(48) Scan parquet default.customer_address +Output [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 2] +Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] + +(50) Filter [codegen id : 2] +Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] +Condition : ((isnotnull(ca_address_sk#1) AND isnotnull(ca_country#4)) AND isnotnull(ca_zip#3)) + +(51) Scan parquet default.store +Output [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(49) ColumnarToRow [codegen id : 1] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(52) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -(50) Filter [codegen id : 1] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] -Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5)) +(53) Filter [codegen id : 1] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +Condition : (((isnotnull(s_market_id#7) AND (s_market_id#7 = 8)) AND isnotnull(s_store_sk#5)) AND isnotnull(s_zip#9)) -(51) Project [codegen id : 1] -Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] -Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +(54) Project [codegen id : 1] +Output [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -(52) BroadcastExchange -Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +(55) BroadcastExchange +Input [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#50] -(53) Scan parquet default.customer_address -Output [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct - -(54) ColumnarToRow -Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] - -(55) Filter -Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] -Condition : ((isnotnull(ca_address_sk#7) AND isnotnull(ca_country#10)) AND isnotnull(ca_zip#9)) - (56) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [s_zip#5] -Right keys [1]: [ca_zip#9] +Left keys [1]: [ca_zip#3] +Right keys [1]: [s_zip#9] Join condition: None (57) Project [codegen id : 2] -Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] -Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Output [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] +Input [8]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] (58) BroadcastExchange -Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] -Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#51] +Input [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[2, string, true])),false), [id=#51] (59) Scan parquet default.customer Output [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] @@ -380,17 +380,17 @@ Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name Condition : ((isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) AND isnotnull(c_birth_country#16)) (62) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [ca_address_sk#7, upper(ca_country#10)] +Left keys [2]: [ca_address_sk#1, upper(ca_country#4)] Right keys [2]: [c_current_addr_sk#13, c_birth_country#16] Join condition: None (63) Project [codegen id : 3] -Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Output [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Input [11]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] (64) BroadcastExchange -Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#52] +Input [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#52] (65) Scan parquet default.store_sales Output [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] @@ -407,20 +407,20 @@ Input [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#2 Condition : (((isnotnull(ss_ticket_number#21) AND isnotnull(ss_item_sk#18)) AND isnotnull(ss_store_sk#20)) AND isnotnull(ss_customer_sk#19)) (68) BroadcastHashJoin [codegen id : 4] -Left keys [2]: [s_store_sk#1, c_customer_sk#12] +Left keys [2]: [s_store_sk#5, c_customer_sk#12] Right keys [2]: [ss_store_sk#20, ss_customer_sk#19] Join condition: None (69) Project [codegen id : 4] -Output [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] -Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] +Output [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [12]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] (70) Exchange -Input [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] Arguments: hashpartitioning(ss_item_sk#18, 5), true, [id=#53] (71) Sort [codegen id : 5] -Input [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] Arguments: [ss_item_sk#18 ASC NULLS FIRST], false, 0 (72) Scan parquet default.item @@ -451,15 +451,15 @@ Right keys [1]: [i_item_sk#23] Join condition: None (78) Project [codegen id : 8] -Output [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] -Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Output [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [14]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] (79) Exchange -Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: hashpartitioning(cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint), 5), true, [id=#55] (80) Sort [codegen id : 9] -Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: [cast(ss_ticket_number#21 as bigint) ASC NULLS FIRST, cast(ss_item_sk#18 as bigint) ASC NULLS FIRST], false, 0 (81) Scan parquet default.store_returns @@ -490,23 +490,23 @@ Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] Join condition: None (87) Project [codegen id : 12] -Output [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] -Input [15]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] +Input [15]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] (88) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Results [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] (89) Exchange -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#59] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#59] (90) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#60] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#60,17,2) AS netpaid#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt index 7b1c03ef15b15..b15a5081c49a4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt @@ -25,7 +25,7 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (8) - Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (5) @@ -33,18 +33,22 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_item_sk] #13 WholeStageCodegen (4) - Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] InputAdapter BroadcastExchange #14 WholeStageCodegen (3) - Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] + Project [ca_state,s_store_sk,s_store_name,s_state,c_customer_sk,c_first_name,c_last_name] BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] InputAdapter BroadcastExchange #15 WholeStageCodegen (2) - Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] - BroadcastHashJoin [s_zip,ca_zip] + Project [ca_address_sk,ca_state,ca_country,s_store_sk,s_store_name,s_state] + BroadcastHashJoin [ca_zip,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -53,10 +57,6 @@ WholeStageCodegen (12) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ca_address_sk,ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] Filter [c_customer_sk,c_current_addr_sk,c_birth_country] ColumnarToRow InputAdapter @@ -103,20 +103,24 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #4 WholeStageCodegen (5) - Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (3) - Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] + Project [ca_state,s_store_sk,s_store_name,s_state,c_customer_sk,c_first_name,c_last_name] BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) - Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] - BroadcastHashJoin [s_zip,ca_zip] + Project [ca_address_sk,ca_state,ca_country,s_store_sk,s_store_name,s_state] + BroadcastHashJoin [ca_zip,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] InputAdapter BroadcastExchange #7 WholeStageCodegen (1) @@ -125,10 +129,6 @@ WholeStageCodegen (12) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ca_address_sk,ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] Filter [c_customer_sk,c_current_addr_sk,c_birth_country] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt index 86722de954ff3..d6bdfad449631 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (77) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (8) - : : : : +- * Project (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.customer_demographics (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer_demographics (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -40,20 +40,20 @@ TakeOrderedAndProject (77) : +- * BroadcastHashJoin Inner BuildRight (50) : :- * Project (48) : : +- * BroadcastHashJoin Inner BuildRight (47) - : : :- * Project (45) - : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : :- * Project (41) + : : : +- * BroadcastHashJoin Inner BuildRight (40) : : : :- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildRight (37) - : : : : :- * Filter (35) - : : : : : +- * ColumnarToRow (34) - : : : : : +- Scan parquet default.store_sales (33) - : : : : +- ReusedExchange (36) - : : : +- BroadcastExchange (43) - : : : +- * Project (42) - : : : +- * Filter (41) - : : : +- * ColumnarToRow (40) - : : : +- Scan parquet default.store (39) - : : +- ReusedExchange (46) + : : : : +- * BroadcastHashJoin Inner BuildLeft (37) + : : : : :- ReusedExchange (33) + : : : : +- * Filter (36) + : : : : +- * ColumnarToRow (35) + : : : : +- Scan parquet default.store_sales (34) + : : : +- ReusedExchange (39) + : : +- BroadcastExchange (46) + : : +- * Project (45) + : : +- * Filter (44) + : : +- * ColumnarToRow (43) + : : +- Scan parquet default.store (42) : +- ReusedExchange (49) +- * HashAggregate (75) +- Exchange (74) @@ -65,11 +65,11 @@ TakeOrderedAndProject (77) : :- * Project (63) : : +- * BroadcastHashJoin Inner BuildRight (62) : : :- * Project (60) - : : : +- * BroadcastHashJoin Inner BuildRight (59) - : : : :- * Filter (57) - : : : : +- * ColumnarToRow (56) - : : : : +- Scan parquet default.store_sales (55) - : : : +- ReusedExchange (58) + : : : +- * BroadcastHashJoin Inner BuildLeft (59) + : : : :- ReusedExchange (55) + : : : +- * Filter (58) + : : : +- * ColumnarToRow (57) + : : : +- Scan parquet default.store_sales (56) : : +- ReusedExchange (61) : +- ReusedExchange (64) +- BroadcastExchange (70) @@ -78,50 +78,50 @@ TakeOrderedAndProject (77) +- Scan parquet default.item (67) -(1) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(3) Filter [codegen id : 5] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(1) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary), IsNotNull(cd_demo_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] + +(3) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = F)) AND (cd_marital_status#3 = W)) AND (cd_education_status#4 = Primary)) AND isnotnull(cd_demo_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [cd_demo_sk#1] +Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] + +(5) BroadcastExchange +Input [1]: [cd_demo_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] -(6) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = F)) AND (cd_marital_status#11 = W)) AND (cd_education_status#12 = Primary)) AND isnotnull(cd_demo_sk#9)) +(6) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [cd_demo_sk#9] -Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +(7) ColumnarToRow +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -(8) BroadcastExchange -Input [1]: [cd_demo_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(8) Filter +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#9] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [ss_cdemo_sk#8] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] +Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] @@ -146,13 +146,13 @@ Input [1]: [d_date_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] +Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -173,13 +173,13 @@ Input [2]: [s_store_sk#17, s_state#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#9] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 5] -Output [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18] -Input [8]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17, s_state#18] +Output [6]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_state#18] +Input [8]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17, s_state#18] (24) Scan parquet default.item Output [2]: [i_item_sk#20, i_item_id#21] @@ -200,13 +200,13 @@ Input [2]: [i_item_sk#20, i_item_id#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#7] Right keys [1]: [i_item_sk#20] Join condition: None (29) Project [codegen id : 5] -Output [6]: [i_item_id#21, s_state#18, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [8]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18, i_item_sk#20, i_item_id#21] +Output [6]: [i_item_id#21, s_state#18, ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] +Input [8]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_state#18, i_item_sk#20, i_item_id#21] (30) HashAggregate [codegen id : 5] Input [6]: [i_item_id#21, s_state#18, agg1#23, agg2#24, agg3#25, agg4#26] @@ -226,86 +226,86 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#44, avg(UnscaledValue(agg2#24))#45, avg(UnscaledValue(agg3#25))#46, avg(UnscaledValue(agg4#26))#47] Results [7]: [i_item_id#21, s_state#18, 0 AS g_state#48, avg(cast(agg1#23 as bigint))#44 AS agg1#49, cast((avg(UnscaledValue(agg2#24))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(agg3#25))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(agg4#26))#47 / 100.0) as decimal(11,6)) AS agg4#52] -(33) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +(33) ReusedExchange [Reuses operator id: 5] +Output [1]: [cd_demo_sk#1] + +(34) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +(35) ColumnarToRow +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -(35) Filter [codegen id : 11] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) - -(36) ReusedExchange [Reuses operator id: 8] -Output [1]: [cd_demo_sk#9] +(36) Filter +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#9] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [ss_cdemo_sk#8] Join condition: None (38) Project [codegen id : 11] -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] +Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(41) Project [codegen id : 11] +Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] -(39) Scan parquet default.store +(42) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] ReadSchema: struct -(40) ColumnarToRow [codegen id : 8] +(43) ColumnarToRow [codegen id : 9] Input [2]: [s_store_sk#17, s_state#18] -(41) Filter [codegen id : 8] +(44) Filter [codegen id : 9] Input [2]: [s_store_sk#17, s_state#18] Condition : ((isnotnull(s_state#18) AND (s_state#18 = TN)) AND isnotnull(s_store_sk#17)) -(42) Project [codegen id : 8] +(45) Project [codegen id : 9] Output [1]: [s_store_sk#17] Input [2]: [s_store_sk#17, s_state#18] -(43) BroadcastExchange +(46) BroadcastExchange Input [1]: [s_store_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] -(44) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_store_sk#4] -Right keys [1]: [s_store_sk#17] -Join condition: None - -(45) Project [codegen id : 11] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] - -(46) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] - (47) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#14] +Left keys [1]: [ss_store_sk#9] +Right keys [1]: [s_store_sk#17] Join condition: None (48) Project [codegen id : 11] -Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] +Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [7]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17] (49) ReusedExchange [Reuses operator id: 27] Output [2]: [i_item_sk#20, i_item_id#21] (50) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#7] Right keys [1]: [i_item_sk#20] Join condition: None (51) Project [codegen id : 11] -Output [5]: [i_item_id#21, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20, i_item_id#21] +Output [5]: [i_item_id#21, ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] +Input [7]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#20, i_item_id#21] (52) HashAggregate [codegen id : 11] Input [5]: [i_item_id#21, agg1#23, agg2#24, agg3#25, agg4#26] @@ -325,55 +325,55 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#71, avg(UnscaledValue(agg2#24))#72, avg(UnscaledValue(agg3#25))#73, avg(UnscaledValue(agg4#26))#74] Results [7]: [i_item_id#21, null AS s_state#75, 1 AS g_state#76, avg(cast(agg1#23 as bigint))#71 AS agg1#77, cast((avg(UnscaledValue(agg2#24))#72 / 100.0) as decimal(11,6)) AS agg2#78, cast((avg(UnscaledValue(agg3#25))#73 / 100.0) as decimal(11,6)) AS agg3#79, cast((avg(UnscaledValue(agg4#26))#74 / 100.0) as decimal(11,6)) AS agg4#80] -(55) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +(55) ReusedExchange [Reuses operator id: 5] +Output [1]: [cd_demo_sk#1] + +(56) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(56) ColumnarToRow [codegen id : 17] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] - -(57) Filter [codegen id : 17] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) +(57) ColumnarToRow +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -(58) ReusedExchange [Reuses operator id: 8] -Output [1]: [cd_demo_sk#9] +(58) Filter +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) (59) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#9] +Left keys [1]: [cd_demo_sk#1] +Right keys [1]: [ss_cdemo_sk#8] Join condition: None (60) Project [codegen id : 17] -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] +Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -(61) ReusedExchange [Reuses operator id: 43] -Output [1]: [s_store_sk#17] +(61) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] (62) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_store_sk#4] -Right keys [1]: [s_store_sk#17] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#14] Join condition: None (63) Project [codegen id : 17] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] +Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] -(64) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] +(64) ReusedExchange [Reuses operator id: 46] +Output [1]: [s_store_sk#17] (65) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#14] +Left keys [1]: [ss_store_sk#9] +Right keys [1]: [s_store_sk#17] Join condition: None (66) Project [codegen id : 17] -Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] +Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Input [7]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17] (67) Scan parquet default.item Output [1]: [i_item_sk#20] @@ -394,13 +394,13 @@ Input [1]: [i_item_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] (71) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#7] Right keys [1]: [i_item_sk#20] Join condition: None (72) Project [codegen id : 17] -Output [4]: [ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] -Input [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20] +Output [4]: [ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] +Input [6]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#20] (73) HashAggregate [codegen id : 17] Input [4]: [agg1#23, agg2#24, agg3#25, agg4#26] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt index 61aaa22964cb7..6dcf353b87a27 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt @@ -13,11 +13,7 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] - Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -26,6 +22,10 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -57,27 +57,27 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] + InputAdapter + ReusedExchange [cd_demo_sk] #2 Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - InputAdapter - ReusedExchange [cd_demo_sk] #2 InputAdapter - BroadcastExchange #7 - WholeStageCodegen (8) - Project [s_store_sk] - Filter [s_state,s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_state] + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastExchange #7 + WholeStageCodegen (9) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 WholeStageCodegen (18) @@ -89,21 +89,21 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] + InputAdapter + ReusedExchange [cd_demo_sk] #2 Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - InputAdapter - ReusedExchange [cd_demo_sk] #2 InputAdapter - ReusedExchange [s_store_sk] #7 + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [s_store_sk] #7 InputAdapter BroadcastExchange #9 WholeStageCodegen (16) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt index c7b8685b64bea..c348509a890e9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (5) + : : : : +- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.date_dim (1) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_sales (6) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] - -(3) Filter [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_dom#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -Condition : (((((d_dom#8 >= 1) AND (d_dom#8 <= 3)) OR ((d_dom#8 >= 25) AND (d_dom#8 <= 28))) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +Condition : (((((d_dom#3 >= 1) AND (d_dom#3 <= 3)) OR ((d_dom#3 >= 25) AND (d_dom#3 <= 28))) AND d_year#2 IN (1999,2000,2001)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_dom#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) Filter +Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Condition : (((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] +Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#4] +Left keys [1]: [ss_store_sk#8] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] -Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] +Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] +Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#3] +Left keys [1]: [ss_hdemo_sk#7] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#2, ss_ticket_number#5] -Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] +Output [2]: [ss_customer_sk#6, ss_ticket_number#9] +Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#2, ss_ticket_number#5] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [2]: [ss_customer_sk#6, ss_ticket_number#9] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] (26) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] -Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] Condition : ((cnt#22 >= 15) AND (cnt#22 <= 20)) (29) Exchange -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#6] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] -Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] -Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#5 ASC NULLS FIRST, 5), true, [id=#30] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#9 ASC NULLS FIRST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] -Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#5 ASC NULLS FIRST], true, 0 +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#9 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt index 451659e2c617c..8882bc7cf00d7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt @@ -22,11 +22,7 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -35,6 +31,10 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt index d38804d4f0422..b81bade24c504 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt @@ -9,51 +9,51 @@ TakeOrderedAndProject (60) : +- Exchange (48) : +- * Project (47) : +- * SortMergeJoin Inner (46) - : :- * Sort (40) - : : +- Exchange (39) - : : +- * Project (38) - : : +- * Filter (37) - : : +- SortMergeJoin ExistenceJoin(exists#1) (36) - : : :- SortMergeJoin ExistenceJoin(exists#2) (27) - : : : :- SortMergeJoin LeftSemi (18) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- * Sort (17) - : : : : +- Exchange (16) - : : : : +- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.store_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- * Sort (26) - : : : +- Exchange (25) - : : : +- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Sort (35) - : : +- Exchange (34) - : : +- * Project (33) - : : +- * BroadcastHashJoin Inner BuildRight (32) - : : :- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.catalog_sales (28) - : : +- ReusedExchange (31) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer_address (1) : +- * Sort (45) : +- Exchange (44) - : +- * Filter (43) - : +- * ColumnarToRow (42) - : +- Scan parquet default.customer_address (41) + : +- * Project (43) + : +- * Filter (42) + : +- SortMergeJoin ExistenceJoin(exists#1) (41) + : :- SortMergeJoin ExistenceJoin(exists#2) (32) + : : :- SortMergeJoin LeftSemi (23) + : : : :- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer (6) + : : : +- * Sort (22) + : : : +- Exchange (21) + : : : +- * Project (20) + : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : :- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store_sales (11) + : : : +- BroadcastExchange (18) + : : : +- * Project (17) + : : : +- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.date_dim (14) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.web_sales (24) + : : +- ReusedExchange (27) + : +- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.catalog_sales (33) + : +- ReusedExchange (36) +- * Sort (54) +- Exchange (53) +- * Filter (52) @@ -61,218 +61,218 @@ TakeOrderedAndProject (60) +- Scan parquet default.customer_demographics (50) -(1) Scan parquet default.customer -Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#3, ca_state#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [2]: [ca_address_sk#3, ca_state#4] (3) Filter [codegen id : 1] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) +Input [2]: [ca_address_sk#3, ca_state#4] +Condition : isnotnull(ca_address_sk#3) (4) Exchange -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] +Input [2]: [ca_address_sk#3, ca_state#4] +Arguments: hashpartitioning(ca_address_sk#3, 5), true, [id=#5] (5) Sort [codegen id : 2] -Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#3, ca_state#4] +Arguments: [ca_address_sk#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.customer +Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] + +(8) Filter [codegen id : 3] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) + +(9) Exchange +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] -(6) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(10) Sort [codegen id : 4] +Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 + +(11) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +(12) ColumnarToRow [codegen id : 6] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -(8) Filter [codegen id : 4] -Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -Condition : isnotnull(ss_sold_date_sk#7) +(13) Filter [codegen id : 6] +Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +Condition : isnotnull(ss_sold_date_sk#10) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(14) Scan parquet default.date_dim +Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(15) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) +(16) Filter [codegen id : 5] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +Condition : ((((isnotnull(d_year#13) AND isnotnull(d_qoy#14)) AND (d_year#13 = 2002)) AND (d_qoy#14 < 4)) AND isnotnull(d_date_sk#12)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#9] -Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +(17) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -(13) BroadcastExchange -Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(18) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#7] -Right keys [1]: [d_date_sk#9] +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#12] Join condition: None -(15) Project [codegen id : 4] -Output [1]: [ss_customer_sk#8] -Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] +(20) Project [codegen id : 6] +Output [1]: [ss_customer_sk#11] +Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] -(16) Exchange -Input [1]: [ss_customer_sk#8] -Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] +(21) Exchange +Input [1]: [ss_customer_sk#11] +Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] -(17) Sort [codegen id : 5] -Input [1]: [ss_customer_sk#8] -Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 7] +Input [1]: [ss_customer_sk#11] +Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ss_customer_sk#8] +(23) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ss_customer_sk#11] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(24) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +(25) ColumnarToRow [codegen id : 9] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -Condition : isnotnull(ws_sold_date_sk#14) +(26) Filter [codegen id : 9] +Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +Condition : isnotnull(ws_sold_date_sk#17) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(27) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#14] -Right keys [1]: [d_date_sk#9] +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#17] +Right keys [1]: [d_date_sk#12] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#15] -Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] +(29) Project [codegen id : 9] +Output [1]: [ws_bill_customer_sk#18] +Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] -(25) Exchange -Input [1]: [ws_bill_customer_sk#15] -Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] +(30) Exchange +Input [1]: [ws_bill_customer_sk#18] +Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] -(26) Sort [codegen id : 8] -Input [1]: [ws_bill_customer_sk#15] -Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 10] +Input [1]: [ws_bill_customer_sk#18] +Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 -(27) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [ws_bill_customer_sk#15] +(32) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [ws_bill_customer_sk#18] Join condition: None -(28) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(33) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +(34) ColumnarToRow [codegen id : 12] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -(30) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -Condition : isnotnull(cs_sold_date_sk#17) +(35) Filter [codegen id : 12] +Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +Condition : isnotnull(cs_sold_date_sk#20) -(31) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#9] +(36) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#12] -(32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#17] -Right keys [1]: [d_date_sk#9] +(37) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#12] Join condition: None -(33) Project [codegen id : 10] -Output [1]: [cs_ship_customer_sk#18] -Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] - -(34) Exchange -Input [1]: [cs_ship_customer_sk#18] -Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] - -(35) Sort [codegen id : 11] -Input [1]: [cs_ship_customer_sk#18] -Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 - -(36) SortMergeJoin -Left keys [1]: [c_customer_sk#3] -Right keys [1]: [cs_ship_customer_sk#18] -Join condition: None - -(37) Filter [codegen id : 12] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] -Condition : (exists#2 OR exists#1) - (38) Project [codegen id : 12] -Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Output [1]: [cs_ship_customer_sk#21] +Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] (39) Exchange -Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#20] +Input [1]: [cs_ship_customer_sk#21] +Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] (40) Sort [codegen id : 13] -Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] -Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 +Input [1]: [cs_ship_customer_sk#21] +Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 -(41) Scan parquet default.customer_address -Output [2]: [ca_address_sk#21, ca_state#22] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +(41) SortMergeJoin +Left keys [1]: [c_customer_sk#6] +Right keys [1]: [cs_ship_customer_sk#21] +Join condition: None -(42) ColumnarToRow [codegen id : 14] -Input [2]: [ca_address_sk#21, ca_state#22] +(42) Filter [codegen id : 14] +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +Condition : (exists#2 OR exists#1) -(43) Filter [codegen id : 14] -Input [2]: [ca_address_sk#21, ca_state#22] -Condition : isnotnull(ca_address_sk#21) +(43) Project [codegen id : 14] +Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] (44) Exchange -Input [2]: [ca_address_sk#21, ca_state#22] -Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] +Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: hashpartitioning(c_current_addr_sk#8, 5), true, [id=#23] (45) Sort [codegen id : 15] -Input [2]: [ca_address_sk#21, ca_state#22] -Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] +Arguments: [c_current_addr_sk#8 ASC NULLS FIRST], false, 0 (46) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#5] -Right keys [1]: [ca_address_sk#21] +Left keys [1]: [ca_address_sk#3] +Right keys [1]: [c_current_addr_sk#8] Join condition: None (47) Project [codegen id : 16] -Output [2]: [c_current_cdemo_sk#4, ca_state#22] -Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#21, ca_state#22] +Output [2]: [ca_state#4, c_current_cdemo_sk#7] +Input [4]: [ca_address_sk#3, ca_state#4, c_current_cdemo_sk#7, c_current_addr_sk#8] (48) Exchange -Input [2]: [c_current_cdemo_sk#4, ca_state#22] -Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#24] +Input [2]: [ca_state#4, c_current_cdemo_sk#7] +Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#24] (49) Sort [codegen id : 17] -Input [2]: [c_current_cdemo_sk#4, ca_state#22] -Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 +Input [2]: [ca_state#4, c_current_cdemo_sk#7] +Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 (50) Scan parquet default.customer_demographics Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] @@ -297,33 +297,33 @@ Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, Arguments: [cd_demo_sk#25 ASC NULLS FIRST], false, 0 (55) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_current_cdemo_sk#4] +Left keys [1]: [c_current_cdemo_sk#7] Right keys [1]: [cd_demo_sk#25] Join condition: None (56) Project [codegen id : 20] -Output [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Input [8]: [c_current_cdemo_sk#4, ca_state#22, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [ca_state#4, c_current_cdemo_sk#7, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (57) HashAggregate [codegen id : 20] -Input [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#28 as bigint)), partial_max(cd_dep_count#28), partial_sum(cast(cd_dep_count#28 as bigint)), partial_avg(cast(cd_dep_employed_count#29 as bigint)), partial_max(cd_dep_employed_count#29), partial_sum(cast(cd_dep_employed_count#29 as bigint)), partial_avg(cast(cd_dep_college_count#30 as bigint)), partial_max(cd_dep_college_count#30), partial_sum(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [13]: [count#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40, sum#41, count#42, max#43, sum#44] -Results [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Results [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] (58) Exchange -Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] -Arguments: hashpartitioning(ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] +Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Arguments: hashpartitioning(ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] (59) HashAggregate [codegen id : 21] -Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] -Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [count(1), avg(cast(cd_dep_count#28 as bigint)), max(cd_dep_count#28), sum(cast(cd_dep_count#28 as bigint)), avg(cast(cd_dep_employed_count#29 as bigint)), max(cd_dep_employed_count#29), sum(cast(cd_dep_employed_count#29 as bigint)), avg(cast(cd_dep_college_count#30 as bigint)), max(cd_dep_college_count#30), sum(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [10]: [count(1)#59, avg(cast(cd_dep_count#28 as bigint))#60, max(cd_dep_count#28)#61, sum(cast(cd_dep_count#28 as bigint))#62, avg(cast(cd_dep_employed_count#29 as bigint))#63, max(cd_dep_employed_count#29)#64, sum(cast(cd_dep_employed_count#29 as bigint))#65, avg(cast(cd_dep_college_count#30 as bigint))#66, max(cd_dep_college_count#30)#67, sum(cast(cd_dep_college_count#30 as bigint))#68] -Results [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, count(1)#59 AS cnt1#69, avg(cast(cd_dep_count#28 as bigint))#60 AS avg(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, sum(cast(cd_dep_count#28 as bigint))#62 AS sum(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, avg(cast(cd_dep_employed_count#29 as bigint))#63 AS avg(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, sum(cast(cd_dep_employed_count#29 as bigint))#65 AS sum(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, avg(cast(cd_dep_college_count#30 as bigint))#66 AS avg(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, sum(cast(cd_dep_college_count#30 as bigint))#68 AS sum(cd_dep_college_count)#80] +Results [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, count(1)#59 AS cnt1#69, avg(cast(cd_dep_count#28 as bigint))#60 AS avg(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, sum(cast(cd_dep_count#28 as bigint))#62 AS sum(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, avg(cast(cd_dep_employed_count#29 as bigint))#63 AS avg(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, sum(cast(cd_dep_employed_count#29 as bigint))#65 AS sum(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, avg(cast(cd_dep_college_count#30 as bigint))#66 AS avg(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, sum(cast(cd_dep_college_count#30 as bigint))#68 AS sum(cd_dep_college_count)#80] (60) TakeOrderedAndProject -Input [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] -Arguments: 100, [ca_state#22 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] +Input [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] +Arguments: 100, [ca_state#4 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt index b1e750592d99e..90dfd27201999 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt @@ -13,34 +13,44 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (16) - Project [c_current_cdemo_sk,ca_state] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_state,c_current_cdemo_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter - WholeStageCodegen (13) + WholeStageCodegen (2) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #3 + WholeStageCodegen (1) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (15) Sort [c_current_addr_sk] InputAdapter - Exchange [c_current_addr_sk] #3 - WholeStageCodegen (12) + Exchange [c_current_addr_sk] #4 + WholeStageCodegen (14) Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (2) + WholeStageCodegen (4) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (1) + Exchange [c_customer_sk] #5 + WholeStageCodegen (3) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (5) + WholeStageCodegen (7) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #5 - WholeStageCodegen (4) + Exchange [ss_customer_sk] #6 + WholeStageCodegen (6) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -48,18 +58,18 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (3) + BroadcastExchange #7 + WholeStageCodegen (5) Project [d_date_sk] Filter [d_year,d_qoy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - WholeStageCodegen (8) + WholeStageCodegen (10) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #7 - WholeStageCodegen (7) + Exchange [ws_bill_customer_sk] #8 + WholeStageCodegen (9) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -67,12 +77,12 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (11) + ReusedExchange [d_date_sk] #7 + WholeStageCodegen (13) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #8 - WholeStageCodegen (10) + Exchange [cs_ship_customer_sk] #9 + WholeStageCodegen (12) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -80,17 +90,7 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - InputAdapter - WholeStageCodegen (15) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #9 - WholeStageCodegen (14) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + ReusedExchange [d_date_sk] #7 InputAdapter WholeStageCodegen (19) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt index 107343f091fb2..e19940ea96720 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt @@ -20,15 +20,15 @@ TakeOrderedAndProject (49) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (8) - : : : : +- * Project (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -50,50 +50,50 @@ TakeOrderedAndProject (49) +- ReusedExchange (36) -(1) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] - -(3) Filter [codegen id : 4] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_store_sk#3)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#6, d_year#7] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#6, d_year#7] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#6, d_year#7] -Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [2]: [d_date_sk#1, d_year#2] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#6] -Input [2]: [d_date_sk#6, d_year#7] +(7) ColumnarToRow +Input [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] +(8) Filter +Input [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] +Condition : ((isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_item_sk#5)) AND isnotnull(ss_store_sk#6)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5, d_date_sk#6] +Output [4]: [ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] +Input [6]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] (11) Scan parquet default.store Output [2]: [s_store_sk#9, s_state#10] @@ -118,13 +118,13 @@ Input [1]: [s_store_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#6] Right keys [1]: [s_store_sk#9] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_item_sk#2, ss_ext_sales_price#4, ss_net_profit#5] -Input [5]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5, s_store_sk#9] +Output [3]: [ss_item_sk#5, ss_ext_sales_price#7, ss_net_profit#8] +Input [5]: [ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8, s_store_sk#9] (18) Scan parquet default.item Output [3]: [i_item_sk#12, i_class#13, i_category#14] @@ -145,18 +145,18 @@ Input [3]: [i_item_sk#12, i_class#13, i_category#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#5] Right keys [1]: [i_item_sk#12] Join condition: None (23) Project [codegen id : 4] -Output [4]: [ss_ext_sales_price#4, ss_net_profit#5, i_class#13, i_category#14] -Input [6]: [ss_item_sk#2, ss_ext_sales_price#4, ss_net_profit#5, i_item_sk#12, i_class#13, i_category#14] +Output [4]: [ss_ext_sales_price#7, ss_net_profit#8, i_class#13, i_category#14] +Input [6]: [ss_item_sk#5, ss_ext_sales_price#7, ss_net_profit#8, i_item_sk#12, i_class#13, i_category#14] (24) HashAggregate [codegen id : 4] -Input [4]: [ss_ext_sales_price#4, ss_net_profit#5, i_class#13, i_category#14] +Input [4]: [ss_ext_sales_price#7, ss_net_profit#8, i_class#13, i_category#14] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(ss_ext_sales_price#4))] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#8)), partial_sum(UnscaledValue(ss_ext_sales_price#7))] Aggregate Attributes [2]: [sum#16, sum#17] Results [4]: [i_category#14, i_class#13, sum#18, sum#19] @@ -167,9 +167,9 @@ Arguments: hashpartitioning(i_category#14, i_class#13, 5), true, [id=#20] (26) HashAggregate [codegen id : 5] Input [4]: [i_category#14, i_class#13, sum#18, sum#19] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#21, sum(UnscaledValue(ss_ext_sales_price#4))#22] -Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#21,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#22,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#23, i_category#14, i_class#13, 0 AS t_category#24, 0 AS t_class#25, 0 AS lochierarchy#26] +Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#21, sum(UnscaledValue(ss_ext_sales_price#7))#22] +Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#21,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#22,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#23, i_category#14, i_class#13, 0 AS t_category#24, 0 AS t_class#25, 0 AS lochierarchy#26] (27) ReusedExchange [Reuses operator id: 25] Output [4]: [i_category#14, i_class#13, sum#27, sum#28] @@ -177,9 +177,9 @@ Output [4]: [i_category#14, i_class#13, sum#27, sum#28] (28) HashAggregate [codegen id : 10] Input [4]: [i_category#14, i_class#13, sum#27, sum#28] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#29, sum(UnscaledValue(ss_ext_sales_price#4))#30] -Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#29,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#30,17,2) AS ss_ext_sales_price#32, i_category#14] +Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#29, sum(UnscaledValue(ss_ext_sales_price#7))#30] +Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#29,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#30,17,2) AS ss_ext_sales_price#32, i_category#14] (29) HashAggregate [codegen id : 10] Input [3]: [ss_net_profit#31, ss_ext_sales_price#32, i_category#14] @@ -225,9 +225,9 @@ Output [4]: [i_category#14, i_class#13, sum#50, sum#51] (37) HashAggregate [codegen id : 18] Input [4]: [i_category#14, i_class#13, sum#50, sum#51] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#52, sum(UnscaledValue(ss_ext_sales_price#4))#53] -Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#52,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#53,17,2) AS ss_ext_sales_price#32] +Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#52, sum(UnscaledValue(ss_ext_sales_price#7))#53] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#52,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#53,17,2) AS ss_ext_sales_price#32] (38) HashAggregate [codegen id : 18] Input [2]: [ss_net_profit#31, ss_ext_sales_price#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt index aa85d4870683d..de0eb008c9a54 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt @@ -34,11 +34,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i Project [ss_item_sk,ss_ext_sales_price,ss_net_profit] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -47,6 +43,10 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt index 22479caee2de1..f52623876edb1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt @@ -19,16 +19,16 @@ TakeOrderedAndProject (87) : :- * Sort (13) : : +- Exchange (12) : : +- * Project (11) - : : +- * BroadcastHashJoin Inner BuildRight (10) - : : :- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.web_sales (1) - : : +- BroadcastExchange (9) - : : +- * Project (8) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.date_dim (5) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.date_dim (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.web_sales (6) : +- * Sort (18) : +- Exchange (17) : +- * Filter (16) @@ -49,12 +49,12 @@ TakeOrderedAndProject (87) : :- * Sort (39) : : +- Exchange (38) : : +- * Project (37) - : : +- * BroadcastHashJoin Inner BuildRight (36) - : : :- * Project (34) - : : : +- * Filter (33) - : : : +- * ColumnarToRow (32) - : : : +- Scan parquet default.catalog_sales (31) - : : +- ReusedExchange (35) + : : +- * BroadcastHashJoin Inner BuildLeft (36) + : : :- ReusedExchange (31) + : : +- * Project (35) + : : +- * Filter (34) + : : +- * ColumnarToRow (33) + : : +- Scan parquet default.catalog_sales (32) : +- * Sort (44) : +- Exchange (43) : +- * Filter (42) @@ -75,12 +75,12 @@ TakeOrderedAndProject (87) :- * Sort (65) : +- Exchange (64) : +- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Project (60) - : : +- * Filter (59) - : : +- * ColumnarToRow (58) - : : +- Scan parquet default.store_sales (57) - : +- ReusedExchange (61) + : +- * BroadcastHashJoin Inner BuildLeft (62) + : :- ReusedExchange (57) + : +- * Project (61) + : +- * Filter (60) + : +- * ColumnarToRow (59) + : +- Scan parquet default.store_sales (58) +- * Sort (70) +- Exchange (69) +- * Filter (68) @@ -88,62 +88,62 @@ TakeOrderedAndProject (87) +- Scan parquet default.store_returns (66) -(1) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(3) Filter [codegen id : 2] -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] -Condition : ((((((((isnotnull(ws_net_profit#6) AND isnotnull(ws_net_paid#5)) AND isnotnull(ws_quantity#4)) AND (ws_net_profit#6 > 1.00)) AND (ws_net_paid#5 > 0.00)) AND (ws_quantity#4 > 0)) AND isnotnull(ws_order_number#3)) AND isnotnull(ws_item_sk#2)) AND isnotnull(ws_sold_date_sk#1)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 12)) AND isnotnull(d_date_sk#1)) -(4) Project [codegen id : 2] -Output [5]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(5) Scan parquet default.date_dim -Output [3]: [d_date_sk#7, d_year#8, d_moy#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] -ReadSchema: struct +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] -(6) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(6) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(7) Filter [codegen id : 1] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -Condition : ((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 = 12)) AND isnotnull(d_date_sk#7)) +(7) ColumnarToRow +Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] -(8) Project [codegen id : 1] -Output [1]: [d_date_sk#7] -Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +(8) Filter +Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] +Condition : ((((((((isnotnull(ws_net_profit#10) AND isnotnull(ws_net_paid#9)) AND isnotnull(ws_quantity#8)) AND (ws_net_profit#10 > 1.00)) AND (ws_net_paid#9 > 0.00)) AND (ws_quantity#8 > 0)) AND isnotnull(ws_order_number#7)) AND isnotnull(ws_item_sk#6)) AND isnotnull(ws_sold_date_sk#5)) -(9) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(9) Project +Output [5]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] +Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] (10) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ws_sold_date_sk#5] Join condition: None (11) Project [codegen id : 2] -Output [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] -Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, d_date_sk#7] +Output [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] +Input [6]: [d_date_sk#1, ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] (12) Exchange -Input [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] -Arguments: hashpartitioning(cast(ws_order_number#3 as bigint), cast(ws_item_sk#2 as bigint), 5), true, [id=#11] +Input [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] +Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), cast(ws_item_sk#6 as bigint), 5), true, [id=#11] (13) Sort [codegen id : 3] -Input [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] -Arguments: [cast(ws_order_number#3 as bigint) ASC NULLS FIRST, cast(ws_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 +Input [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] +Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST, cast(ws_item_sk#6 as bigint) ASC NULLS FIRST], false, 0 (14) Scan parquet default.web_returns Output [4]: [wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] @@ -168,31 +168,31 @@ Input [4]: [wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_ Arguments: [wr_order_number#13 ASC NULLS FIRST, wr_item_sk#12 ASC NULLS FIRST], false, 0 (19) SortMergeJoin [codegen id : 6] -Left keys [2]: [cast(ws_order_number#3 as bigint), cast(ws_item_sk#2 as bigint)] +Left keys [2]: [cast(ws_order_number#7 as bigint), cast(ws_item_sk#6 as bigint)] Right keys [2]: [wr_order_number#13, wr_item_sk#12] Join condition: None (20) Project [codegen id : 6] -Output [5]: [ws_item_sk#2, ws_quantity#4, ws_net_paid#5, wr_return_quantity#14, wr_return_amt#15] -Input [8]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] +Output [5]: [ws_item_sk#6, ws_quantity#8, ws_net_paid#9, wr_return_quantity#14, wr_return_amt#15] +Input [8]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] (21) HashAggregate [codegen id : 6] -Input [5]: [ws_item_sk#2, ws_quantity#4, ws_net_paid#5, wr_return_quantity#14, wr_return_amt#15] -Keys [1]: [ws_item_sk#2] -Functions [4]: [partial_sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), partial_sum(cast(coalesce(ws_quantity#4, 0) as bigint)), partial_sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))] +Input [5]: [ws_item_sk#6, ws_quantity#8, ws_net_paid#9, wr_return_quantity#14, wr_return_amt#15] +Keys [1]: [ws_item_sk#6] +Functions [4]: [partial_sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), partial_sum(cast(coalesce(ws_quantity#8, 0) as bigint)), partial_sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))] Aggregate Attributes [6]: [sum#17, sum#18, sum#19, isEmpty#20, sum#21, isEmpty#22] -Results [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Results [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] (22) Exchange -Input [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#29] +Input [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Arguments: hashpartitioning(ws_item_sk#6, 5), true, [id=#29] (23) HashAggregate [codegen id : 7] -Input [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] -Keys [1]: [ws_item_sk#2] -Functions [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), sum(cast(coalesce(ws_quantity#4, 0) as bigint)), sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))] -Aggregate Attributes [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30, sum(cast(coalesce(ws_quantity#4, 0) as bigint))#31, sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32, sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))#33] -Results [3]: [ws_item_sk#2 AS item#34, CheckOverflow((promote_precision(cast(sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30 as decimal(15,4))) / promote_precision(cast(sum(cast(coalesce(ws_quantity#4, 0) as bigint))#31 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#35, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))#33 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#36] +Input [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Keys [1]: [ws_item_sk#6] +Functions [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), sum(cast(coalesce(ws_quantity#8, 0) as bigint)), sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30, sum(cast(coalesce(ws_quantity#8, 0) as bigint))#31, sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32, sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))#33] +Results [3]: [ws_item_sk#6 AS item#34, CheckOverflow((promote_precision(cast(sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30 as decimal(15,4))) / promote_precision(cast(sum(cast(coalesce(ws_quantity#8, 0) as bigint))#31 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#35, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))#33 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#36] (24) Exchange Input [3]: [item#34, return_ratio#35, currency_ratio#36] @@ -222,35 +222,35 @@ Condition : ((return_rank#38 <= 10) OR (currency_rank#39 <= 10)) Output [5]: [web AS channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Input [5]: [item#34, return_ratio#35, currency_ratio#36, return_rank#38, currency_rank#39] -(31) Scan parquet default.catalog_sales +(31) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(32) Scan parquet default.catalog_sales Output [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(32) ColumnarToRow [codegen id : 12] +(33) ColumnarToRow Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] -(33) Filter [codegen id : 12] +(34) Filter Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] Condition : ((((((((isnotnull(cs_net_profit#46) AND isnotnull(cs_net_paid#45)) AND isnotnull(cs_quantity#44)) AND (cs_net_profit#46 > 1.00)) AND (cs_net_paid#45 > 0.00)) AND (cs_quantity#44 > 0)) AND isnotnull(cs_order_number#43)) AND isnotnull(cs_item_sk#42)) AND isnotnull(cs_sold_date_sk#41)) -(34) Project [codegen id : 12] +(35) Project Output [5]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] -(35) ReusedExchange [Reuses operator id: 9] -Output [1]: [d_date_sk#7] - (36) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cs_sold_date_sk#41] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [cs_sold_date_sk#41] Join condition: None (37) Project [codegen id : 12] Output [4]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] -Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, d_date_sk#7] +Input [6]: [d_date_sk#1, cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] (38) Exchange Input [4]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] @@ -337,35 +337,35 @@ Condition : ((return_rank#74 <= 10) OR (currency_rank#75 <= 10)) Output [5]: [catalog AS channel#76, item#70, return_ratio#71, return_rank#74, currency_rank#75] Input [5]: [item#70, return_ratio#71, currency_ratio#72, return_rank#74, currency_rank#75] -(57) Scan parquet default.store_sales +(57) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + +(58) Scan parquet default.store_sales Output [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(58) ColumnarToRow [codegen id : 22] +(59) ColumnarToRow Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] -(59) Filter [codegen id : 22] +(60) Filter Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] Condition : ((((((((isnotnull(ss_net_profit#82) AND isnotnull(ss_net_paid#81)) AND isnotnull(ss_quantity#80)) AND (ss_net_profit#82 > 1.00)) AND (ss_net_paid#81 > 0.00)) AND (ss_quantity#80 > 0)) AND isnotnull(ss_ticket_number#79)) AND isnotnull(ss_item_sk#78)) AND isnotnull(ss_sold_date_sk#77)) -(60) Project [codegen id : 22] +(61) Project Output [5]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] -(61) ReusedExchange [Reuses operator id: 9] -Output [1]: [d_date_sk#7] - (62) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ss_sold_date_sk#77] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#77] Join condition: None (63) Project [codegen id : 22] Output [4]: [ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] -Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, d_date_sk#7] +Input [6]: [d_date_sk#1, ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] (64) Exchange Input [4]: [ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt index ab300ca150457..bc666523baadc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt @@ -35,12 +35,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [ws_order_number,ws_item_sk] #4 WholeStageCodegen (2) Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] - Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk,ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit] + BroadcastHashJoin [d_date_sk,ws_sold_date_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -49,6 +44,11 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk,ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit] InputAdapter WholeStageCodegen (5) Sort [wr_order_number,wr_item_sk] @@ -87,14 +87,14 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [cs_order_number,cs_item_sk] #9 WholeStageCodegen (12) Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit] - InputAdapter - ReusedExchange [d_date_sk] #5 InputAdapter WholeStageCodegen (15) Sort [cr_order_number,cr_item_sk] @@ -133,14 +133,14 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [ss_ticket_number,ss_item_sk] #13 WholeStageCodegen (22) Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 Project [ss_sold_date_sk,ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit] - InputAdapter - ReusedExchange [d_date_sk] #5 InputAdapter WholeStageCodegen (25) Sort [sr_ticket_number,sr_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt index a7f328537b7ac..c2627bd7e4cc9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt @@ -24,15 +24,15 @@ TakeOrderedAndProject (79) : : : : : :- * Project (17) : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : : : : :- * Project (10) - : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : : : : :- * Filter (3) - : : : : : : : : +- * ColumnarToRow (2) - : : : : : : : : +- Scan parquet default.catalog_sales (1) - : : : : : : : +- BroadcastExchange (8) - : : : : : : : +- * Project (7) - : : : : : : : +- * Filter (6) - : : : : : : : +- * ColumnarToRow (5) - : : : : : : : +- Scan parquet default.household_demographics (4) + : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : : : : :- BroadcastExchange (5) + : : : : : : : : +- * Project (4) + : : : : : : : : +- * Filter (3) + : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : +- Scan parquet default.household_demographics (1) + : : : : : : : +- * Filter (8) + : : : : : : : +- * ColumnarToRow (7) + : : : : : : : +- Scan parquet default.catalog_sales (6) : : : : : : +- BroadcastExchange (15) : : : : : : +- * Project (14) : : : : : : +- * Filter (13) @@ -49,26 +49,26 @@ TakeOrderedAndProject (79) : : : : +- Scan parquet default.item (26) : : : +- BroadcastExchange (43) : : : +- * Project (42) - : : : +- * BroadcastHashJoin Inner BuildLeft (41) - : : : :- BroadcastExchange (37) - : : : : +- * Project (36) - : : : : +- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.date_dim (33) - : : : +- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.date_dim (38) + : : : +- * BroadcastHashJoin Inner BuildRight (41) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- BroadcastExchange (40) + : : : +- * Project (39) + : : : +- * Filter (38) + : : : +- * ColumnarToRow (37) + : : : +- Scan parquet default.date_dim (36) : : +- * Sort (58) : : +- Exchange (57) : : +- * Project (56) - : : +- * BroadcastHashJoin Inner BuildRight (55) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.inventory (48) - : : +- BroadcastExchange (54) - : : +- * Filter (53) - : : +- * ColumnarToRow (52) - : : +- Scan parquet default.warehouse (51) + : : +- * BroadcastHashJoin Inner BuildLeft (55) + : : :- BroadcastExchange (51) + : : : +- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.warehouse (48) + : : +- * Filter (54) + : : +- * ColumnarToRow (53) + : : +- Scan parquet default.inventory (52) : +- BroadcastExchange (64) : +- * Filter (63) : +- * ColumnarToRow (62) @@ -80,50 +80,50 @@ TakeOrderedAndProject (79) +- Scan parquet default.catalog_returns (69) -(1) Scan parquet default.catalog_sales -Output [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] - -(3) Filter [codegen id : 4] -Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] -Condition : (((((isnotnull(cs_quantity#8) AND isnotnull(cs_item_sk#5)) AND isnotnull(cs_bill_cdemo_sk#3)) AND isnotnull(cs_bill_hdemo_sk#4)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_ship_date_sk#2)) - -(4) Scan parquet default.household_demographics -Output [2]: [hd_demo_sk#9, hd_buy_potential#10] +(1) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#1, hd_buy_potential#2] Batched: true Location [not included in comparison]/{warehouse_dir}/household_demographics] PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,1001-5000), IsNotNull(hd_demo_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [hd_demo_sk#9, hd_buy_potential#10] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#1, hd_buy_potential#2] + +(3) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#1, hd_buy_potential#2] +Condition : ((isnotnull(hd_buy_potential#2) AND (hd_buy_potential#2 = 1001-5000)) AND isnotnull(hd_demo_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [hd_demo_sk#1] +Input [2]: [hd_demo_sk#1, hd_buy_potential#2] + +(5) BroadcastExchange +Input [1]: [hd_demo_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] -(6) Filter [codegen id : 1] -Input [2]: [hd_demo_sk#9, hd_buy_potential#10] -Condition : ((isnotnull(hd_buy_potential#10) AND (hd_buy_potential#10 = 1001-5000)) AND isnotnull(hd_demo_sk#9)) +(6) Scan parquet default.catalog_sales +Output [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [hd_demo_sk#9] -Input [2]: [hd_demo_sk#9, hd_buy_potential#10] +(7) ColumnarToRow +Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] -(8) BroadcastExchange -Input [1]: [hd_demo_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] +(8) Filter +Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +Condition : (((((isnotnull(cs_quantity#11) AND isnotnull(cs_item_sk#8)) AND isnotnull(cs_bill_cdemo_sk#6)) AND isnotnull(cs_bill_hdemo_sk#7)) AND isnotnull(cs_sold_date_sk#4)) AND isnotnull(cs_ship_date_sk#5)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_bill_hdemo_sk#4] -Right keys [1]: [hd_demo_sk#9] +Left keys [1]: [hd_demo_sk#1] +Right keys [1]: [cs_bill_hdemo_sk#7] Join condition: None (10) Project [codegen id : 4] -Output [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] -Input [9]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, hd_demo_sk#9] +Output [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +Input [9]: [hd_demo_sk#1, cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] (11) Scan parquet default.customer_demographics Output [2]: [cd_demo_sk#12, cd_marital_status#13] @@ -148,13 +148,13 @@ Input [1]: [cd_demo_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_bill_cdemo_sk#3] +Left keys [1]: [cs_bill_cdemo_sk#6] Right keys [1]: [cd_demo_sk#12] Join condition: None (17) Project [codegen id : 4] -Output [6]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] -Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, cd_demo_sk#12] +Output [6]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, cd_demo_sk#12] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#15, d_date#16] @@ -175,21 +175,21 @@ Input [2]: [d_date_sk#15, d_date#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_ship_date_sk#2] +Left keys [1]: [cs_ship_date_sk#5] Right keys [1]: [d_date_sk#15] Join condition: None (23) Project [codegen id : 4] -Output [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] -Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date_sk#15, d_date#16] +Output [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] +Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date_sk#15, d_date#16] (24) Exchange -Input [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] -Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#18] +Input [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] +Arguments: hashpartitioning(cs_item_sk#8, 5), true, [id=#18] (25) Sort [codegen id : 5] -Input [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] -Arguments: [cs_item_sk#5 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] +Arguments: [cs_item_sk#8 ASC NULLS FIRST], false, 0 (26) Scan parquet default.item Output [2]: [i_item_sk#19, i_item_desc#20] @@ -214,137 +214,137 @@ Input [2]: [i_item_sk#19, i_item_desc#20] Arguments: [i_item_sk#19 ASC NULLS FIRST], false, 0 (31) SortMergeJoin [codegen id : 10] -Left keys [1]: [cs_item_sk#5] +Left keys [1]: [cs_item_sk#8] Right keys [1]: [i_item_sk#19] Join condition: None (32) Project [codegen id : 10] -Output [7]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20] -Input [8]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_sk#19, i_item_desc#20] +Output [7]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_desc#20] +Input [8]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_sk#19, i_item_desc#20] (33) Scan parquet default.date_dim -Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +Output [2]: [d_date_sk#22, d_week_seq#23] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] -ReadSchema: struct - -(34) ColumnarToRow [codegen id : 8] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] - -(35) Filter [codegen id : 8] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 2001)) AND isnotnull(d_date_sk#22)) AND isnotnull(d_week_seq#24)) AND isnotnull(d_date#23)) +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(36) Project [codegen id : 8] -Output [3]: [d_date_sk#22, d_date#23, d_week_seq#24] -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +(34) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#22, d_week_seq#23] -(37) BroadcastExchange -Input [3]: [d_date_sk#22, d_date#23, d_week_seq#24] -Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#26] +(35) Filter [codegen id : 9] +Input [2]: [d_date_sk#22, d_week_seq#23] +Condition : (isnotnull(d_week_seq#23) AND isnotnull(d_date_sk#22)) -(38) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_week_seq#28] +(36) Scan parquet default.date_dim +Output [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -(39) ColumnarToRow -Input [2]: [d_date_sk#27, d_week_seq#28] +(38) Filter [codegen id : 8] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +Condition : ((((isnotnull(d_year#27) AND (d_year#27 = 2001)) AND isnotnull(d_date_sk#24)) AND isnotnull(d_week_seq#26)) AND isnotnull(d_date#25)) -(40) Filter -Input [2]: [d_date_sk#27, d_week_seq#28] -Condition : (isnotnull(d_week_seq#28) AND isnotnull(d_date_sk#27)) +(39) Project [codegen id : 8] +Output [3]: [d_date_sk#24, d_date#25, d_week_seq#26] +Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] + +(40) BroadcastExchange +Input [3]: [d_date_sk#24, d_date#25, d_week_seq#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#28] (41) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_week_seq#24] -Right keys [1]: [d_week_seq#28] +Left keys [1]: [d_week_seq#23] +Right keys [1]: [d_week_seq#26] Join condition: None (42) Project [codegen id : 9] -Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] -Input [5]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27, d_week_seq#28] +Output [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Input [5]: [d_date_sk#22, d_week_seq#23, d_date_sk#24, d_date#25, d_week_seq#26] (43) BroadcastExchange -Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#29] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#22] -Join condition: (d_date#16 > d_date#23 + 5 days) +Left keys [1]: [cs_sold_date_sk#4] +Right keys [1]: [d_date_sk#24] +Join condition: (d_date#16 > d_date#25 + 5 days) (45) Project [codegen id : 10] -Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Output [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Input [11]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_desc#20, d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] (46) Exchange -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#27, 5), true, [id=#30] +Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Arguments: hashpartitioning(cs_item_sk#8, d_date_sk#22, 5), true, [id=#30] (47) Sort [codegen id : 11] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] -Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#27 ASC NULLS FIRST], false, 0 - -(48) Scan parquet default.inventory -Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(49) ColumnarToRow [codegen id : 13] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] - -(50) Filter [codegen id : 13] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -Condition : (((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) AND isnotnull(inv_date_sk#31)) +Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] +Arguments: [cs_item_sk#8 ASC NULLS FIRST, d_date_sk#22 ASC NULLS FIRST], false, 0 -(51) Scan parquet default.warehouse -Output [2]: [w_warehouse_sk#35, w_warehouse_name#36] +(48) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#31, w_warehouse_name#32] Batched: true Location [not included in comparison]/{warehouse_dir}/warehouse] PushedFilters: [IsNotNull(w_warehouse_sk)] ReadSchema: struct -(52) ColumnarToRow [codegen id : 12] -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +(49) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] + +(50) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Condition : isnotnull(w_warehouse_sk#31) + +(51) BroadcastExchange +Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(52) Scan parquet default.inventory +Output [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(53) Filter [codegen id : 12] -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -Condition : isnotnull(w_warehouse_sk#35) +(53) ColumnarToRow +Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] -(54) BroadcastExchange -Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] +(54) Filter +Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Condition : (((isnotnull(inv_quantity_on_hand#37) AND isnotnull(inv_item_sk#35)) AND isnotnull(inv_warehouse_sk#36)) AND isnotnull(inv_date_sk#34)) (55) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [inv_warehouse_sk#33] -Right keys [1]: [w_warehouse_sk#35] +Left keys [1]: [w_warehouse_sk#31] +Right keys [1]: [inv_warehouse_sk#36] Join condition: None (56) Project [codegen id : 13] -Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Input [6]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, w_warehouse_sk#35, w_warehouse_name#36] +Output [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Input [6]: [w_warehouse_sk#31, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] (57) Exchange -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#31, 5), true, [id=#38] +Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Arguments: hashpartitioning(inv_item_sk#35, inv_date_sk#34, 5), true, [id=#38] (58) Sort [codegen id : 14] -Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] -Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#31 ASC NULLS FIRST], false, 0 +Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Arguments: [inv_item_sk#35 ASC NULLS FIRST, inv_date_sk#34 ASC NULLS FIRST], false, 0 (59) SortMergeJoin [codegen id : 16] -Left keys [2]: [cs_item_sk#5, d_date_sk#27] -Right keys [2]: [inv_item_sk#32, inv_date_sk#31] -Join condition: (inv_quantity_on_hand#34 < cs_quantity#8) +Left keys [2]: [cs_item_sk#8, d_date_sk#22] +Right keys [2]: [inv_item_sk#35, inv_date_sk#34] +Join condition: (inv_quantity_on_hand#37 < cs_quantity#11) (60) Project [codegen id : 16] -Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27, inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Output [6]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [11]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] (61) Scan parquet default.promotion Output [1]: [p_promo_sk#39] @@ -365,21 +365,21 @@ Input [1]: [p_promo_sk#39] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] (65) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [cs_promo_sk#6] +Left keys [1]: [cs_promo_sk#9] Right keys [1]: [p_promo_sk#39] Join condition: None (66) Project [codegen id : 16] -Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, p_promo_sk#39] +Output [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, p_promo_sk#39] (67) Exchange -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Arguments: hashpartitioning(cs_item_sk#5, cs_order_number#7, 5), true, [id=#41] +Input [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Arguments: hashpartitioning(cs_item_sk#8, cs_order_number#10, 5), true, [id=#41] (68) Sort [codegen id : 17] -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Arguments: [cs_item_sk#5 ASC NULLS FIRST, cs_order_number#7 ASC NULLS FIRST], false, 0 +Input [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Arguments: [cs_item_sk#8 ASC NULLS FIRST, cs_order_number#10 ASC NULLS FIRST], false, 0 (69) Scan parquet default.catalog_returns Output [2]: [cr_item_sk#42, cr_order_number#43] @@ -404,33 +404,33 @@ Input [2]: [cr_item_sk#42, cr_order_number#43] Arguments: [cr_item_sk#42 ASC NULLS FIRST, cr_order_number#43 ASC NULLS FIRST], false, 0 (74) SortMergeJoin -Left keys [2]: [cs_item_sk#5, cs_order_number#7] +Left keys [2]: [cs_item_sk#8, cs_order_number#10] Right keys [2]: [cr_item_sk#42, cr_order_number#43] Join condition: None (75) Project [codegen id : 20] -Output [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, cr_item_sk#42, cr_order_number#43] +Output [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [7]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, cr_item_sk#42, cr_order_number#43] (76) HashAggregate [codegen id : 20] -Input [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] -Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] +Input [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#45] -Results [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Results [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] (77) Exchange -Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] -Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#36, d_week_seq#24, 5), true, [id=#47] +Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#32, d_week_seq#26, 5), true, [id=#47] (78) HashAggregate [codegen id : 21] -Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] -Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] +Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#48] -Results [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] +Results [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] (79) TakeOrderedAndProject -Input [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] -Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#36 ASC NULLS FIRST, d_week_seq#24 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] +Input [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#32 ASC NULLS FIRST, d_week_seq#26 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt index 918508787c4b0..39dba3af02359 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt @@ -23,7 +23,7 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter Exchange [cs_item_sk,d_date_sk] #3 WholeStageCodegen (10) - Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_date_sk,d_week_seq] BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,d_date,i_item_desc] SortMergeJoin [cs_item_sk,i_item_sk] @@ -38,11 +38,7 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom Project [cs_sold_date_sk,cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] Project [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] - BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] - Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_sold_date_sk,cs_ship_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] + BroadcastHashJoin [hd_demo_sk,cs_bill_hdemo_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -51,6 +47,10 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_sold_date_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) @@ -79,8 +79,12 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter BroadcastExchange #9 WholeStageCodegen (9) - Project [d_date_sk,d_date,d_week_seq,d_date_sk] + Project [d_date_sk,d_date_sk,d_date,d_week_seq] BroadcastHashJoin [d_week_seq,d_week_seq] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -89,22 +93,14 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] - Filter [d_week_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter WholeStageCodegen (14) Sort [inv_item_sk,inv_date_sk] InputAdapter Exchange [inv_item_sk,inv_date_sk] #11 WholeStageCodegen (13) - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand,w_warehouse_name] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + Project [w_warehouse_name,inv_date_sk,inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [w_warehouse_sk,inv_warehouse_sk] InputAdapter BroadcastExchange #12 WholeStageCodegen (12) @@ -112,6 +108,10 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #13 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt index 2d4b595efeff6..6e51dfda3143e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt @@ -16,14 +16,14 @@ TakeOrderedAndProject (86) : : : :- * Sort (11) : : : : +- Exchange (10) : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.store_sales (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : : : :- BroadcastExchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_sales (5) : : : +- * Sort (16) : : : +- Exchange (15) : : : +- * Filter (14) @@ -39,14 +39,14 @@ TakeOrderedAndProject (86) : : :- * Sort (35) : : : +- Exchange (34) : : : +- * Project (33) - : : : +- * BroadcastHashJoin Inner BuildRight (32) - : : : :- * Filter (27) - : : : : +- * ColumnarToRow (26) - : : : : +- Scan parquet default.store_sales (25) - : : : +- BroadcastExchange (31) - : : : +- * Filter (30) - : : : +- * ColumnarToRow (29) - : : : +- Scan parquet default.date_dim (28) + : : : +- * BroadcastHashJoin Inner BuildLeft (32) + : : : :- BroadcastExchange (28) + : : : : +- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.date_dim (25) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.store_sales (29) : : +- * Sort (37) : : +- ReusedExchange (36) : +- * Sort (64) @@ -87,54 +87,54 @@ TakeOrderedAndProject (86) +- ReusedExchange (75) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] - -(3) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_year#5] +(1) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_year#5] +(2) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] + +(3) Filter [codegen id : 1] +Input [2]: [d_date_sk#1, d_year#2] +Condition : (((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND d_year#2 IN (2001,2002)) AND isnotnull(d_date_sk#1)) + +(4) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_year#5] -Condition : (((isnotnull(d_year#5) AND (d_year#5 = 2001)) AND d_year#5 IN (2001,2002)) AND isnotnull(d_date_sk#4)) +(6) ColumnarToRow +Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] -(7) BroadcastExchange -Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] +(7) Filter +Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3, d_date_sk#4, d_year#5] +Output [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] (10) Exchange -Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#7] +Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#7] (11) Sort [codegen id : 3] -Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] @@ -159,31 +159,31 @@ Input [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] Arguments: [c_customer_sk#8 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#8] Join condition: None (18) Project [codegen id : 6] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] -Input [7]: [ss_customer_sk#2, ss_net_paid#3, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] +Input [7]: [d_year#2, ss_customer_sk#5, ss_net_paid#6, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (19) HashAggregate [codegen id : 6] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#3))] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] Aggregate Attributes [1]: [sum#13] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] (20) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#15] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#15] (21) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] -Functions [1]: [sum(UnscaledValue(ss_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#16] -Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#16,17,2) AS year_total#18] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#16] +Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#16,17,2) AS year_total#18] (22) Filter [codegen id : 7] Input [2]: [customer_id#17, year_total#18] @@ -197,54 +197,54 @@ Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] Input [2]: [customer_id#17, year_total#18] Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(26) ColumnarToRow [codegen id : 10] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] - -(27) Filter [codegen id : 10] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) - -(28) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_year#5] +(25) Scan parquet default.date_dim +Output [2]: [d_date_sk#1, d_year#2] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#4, d_year#5] +(26) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#1, d_year#2] -(30) Filter [codegen id : 9] -Input [2]: [d_date_sk#4, d_year#5] -Condition : (((isnotnull(d_year#5) AND (d_year#5 = 2002)) AND d_year#5 IN (2001,2002)) AND isnotnull(d_date_sk#4)) +(27) Filter [codegen id : 9] +Input [2]: [d_date_sk#1, d_year#2] +Condition : (((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND d_year#2 IN (2001,2002)) AND isnotnull(d_date_sk#1)) -(31) BroadcastExchange -Input [2]: [d_date_sk#4, d_year#5] +(28) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(29) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow +Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] + +(31) Filter +Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) + (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#4] Join condition: None (33) Project [codegen id : 10] -Output [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3, d_date_sk#4, d_year#5] +Output [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] (34) Exchange -Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] +Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#21] (35) Sort [codegen id : 11] -Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 +Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] @@ -254,31 +254,31 @@ Input [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] Arguments: [c_customer_sk#8 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#2] +Left keys [1]: [ss_customer_sk#5] Right keys [1]: [c_customer_sk#8] Join condition: None (39) Project [codegen id : 14] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] -Input [7]: [ss_customer_sk#2, ss_net_paid#3, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] +Input [7]: [d_year#2, ss_customer_sk#5, ss_net_paid#6, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (40) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#3))] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] Aggregate Attributes [1]: [sum#22] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] (41) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#24] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#24] (42) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] -Functions [1]: [sum(UnscaledValue(ss_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#25] -Results [4]: [c_customer_id#9 AS customer_id#26, c_first_name#10 AS customer_first_name#27, c_last_name#11 AS customer_last_name#28, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#25,17,2) AS year_total#29] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#25] +Results [4]: [c_customer_id#9 AS customer_id#26, c_first_name#10 AS customer_first_name#27, c_last_name#11 AS customer_last_name#28, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#25,17,2) AS year_total#29] (43) Exchange Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] @@ -307,24 +307,24 @@ Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(49) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#4, d_year#5] +(49) ReusedExchange [Reuses operator id: 4] +Output [2]: [d_date_sk#1, d_year#2] (50) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#4] +Right keys [1]: [d_date_sk#1] Join condition: None (51) Project [codegen id : 19] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#1, d_year#2] (52) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#34] (53) Sort [codegen id : 20] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -340,23 +340,23 @@ Right keys [1]: [c_customer_sk#8] Join condition: None (57) Project [codegen id : 23] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (58) HashAggregate [codegen id : 23] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum#35] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] (59) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#37] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#37] (60) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] Functions [1]: [sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#33))#38] Results [2]: [c_customer_id#9 AS customer_id#39, MakeDecimal(sum(UnscaledValue(ws_net_paid#33))#38,17,2) AS year_total#40] @@ -400,24 +400,24 @@ Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(70) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#4, d_year#5] +(70) ReusedExchange [Reuses operator id: 28] +Output [2]: [d_date_sk#1, d_year#2] (71) BroadcastHashJoin [codegen id : 28] Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#4] +Right keys [1]: [d_date_sk#1] Join condition: None (72) Project [codegen id : 28] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#1, d_year#2] (73) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#44] (74) Sort [codegen id : 29] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -433,23 +433,23 @@ Right keys [1]: [c_customer_sk#8] Join condition: None (78) Project [codegen id : 32] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (79) HashAggregate [codegen id : 32] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum#45] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] (80) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#47] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#47] (81) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] Functions [1]: [sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#33))#48] Results [2]: [c_customer_id#9 AS customer_id#49, MakeDecimal(sum(UnscaledValue(ws_net_paid#33))#48,17,2) AS year_total#50] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt index 4e4bc8b75134a..1501079579fa2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt @@ -29,12 +29,8 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [ss_customer_sk,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] + Project [d_year,ss_customer_sk,ss_net_paid] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -42,6 +38,10 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -71,12 +71,8 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [ss_customer_sk] #8 WholeStageCodegen (10) - Project [ss_customer_sk,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] + Project [d_year,ss_customer_sk,ss_net_paid] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -84,6 +80,10 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter WholeStageCodegen (13) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt index 3f452dc9272dc..1bc8c24c2c591 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt @@ -22,15 +22,15 @@ TakeOrderedAndProject (138) : : : : +- * Project (16) : : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : : :- * Project (10) - : : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : : :- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.catalog_sales (1) - : : : : : +- BroadcastExchange (8) - : : : : : +- * Project (7) - : : : : : +- * Filter (6) - : : : : : +- * ColumnarToRow (5) - : : : : : +- Scan parquet default.item (4) + : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : : :- BroadcastExchange (5) + : : : : : : +- * Project (4) + : : : : : : +- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.item (1) + : : : : : +- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.catalog_sales (6) : : : : +- BroadcastExchange (14) : : : : +- * Filter (13) : : : : +- * ColumnarToRow (12) @@ -96,11 +96,11 @@ TakeOrderedAndProject (138) : : : +- * Project (86) : : : +- * BroadcastHashJoin Inner BuildRight (85) : : : :- * Project (80) - : : : : +- * BroadcastHashJoin Inner BuildRight (79) - : : : : :- * Filter (77) - : : : : : +- * ColumnarToRow (76) - : : : : : +- Scan parquet default.catalog_sales (75) - : : : : +- ReusedExchange (78) + : : : : +- * BroadcastHashJoin Inner BuildLeft (79) + : : : : :- ReusedExchange (75) + : : : : +- * Filter (78) + : : : : +- * ColumnarToRow (77) + : : : : +- Scan parquet default.catalog_sales (76) : : : +- BroadcastExchange (84) : : : +- * Filter (83) : : : +- * ColumnarToRow (82) @@ -139,50 +139,50 @@ TakeOrderedAndProject (138) +- ReusedExchange (123) -(1) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] - -(3) Filter [codegen id : 3] -Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] -Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) - -(4) Scan parquet default.item -Output [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] +(1) Scan parquet default.item +Output [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] -(6) Filter [codegen id : 1] -Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] -Condition : ((((((isnotnull(i_category#10) AND (i_category#10 = Books)) AND isnotnull(i_item_sk#6)) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) AND isnotnull(i_manufact_id#11)) +(3) Filter [codegen id : 1] +Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] +Condition : ((((((isnotnull(i_category#5) AND (i_category#5 = Books)) AND isnotnull(i_item_sk#1)) AND isnotnull(i_brand_id#2)) AND isnotnull(i_class_id#3)) AND isnotnull(i_category_id#4)) AND isnotnull(i_manufact_id#6)) -(7) Project [codegen id : 1] -Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] +(4) Project [codegen id : 1] +Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] -(8) BroadcastExchange -Input [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] +(5) BroadcastExchange +Input [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(6) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] + +(8) Filter +Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#9] Join condition: None (10) Project [codegen id : 3] -Output [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Output [9]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Input [10]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#13, d_year#14] @@ -203,21 +203,21 @@ Input [2]: [d_date_sk#13, d_year#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#8] Right keys [1]: [d_date_sk#13] Join condition: None (16) Project [codegen id : 3] -Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Input [11]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] +Output [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [11]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, d_date_sk#13, d_year#14] (17) Exchange -Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), true, [id=#16] +Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Arguments: hashpartitioning(cs_order_number#10, cs_item_sk#9, 5), true, [id=#16] (18) Sort [codegen id : 4] -Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 +Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Arguments: [cs_order_number#10 ASC NULLS FIRST, cs_item_sk#9 ASC NULLS FIRST], false, 0 (19) Scan parquet default.catalog_returns Output [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] @@ -242,13 +242,13 @@ Input [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_ Arguments: [cr_order_number#18 ASC NULLS FIRST, cr_item_sk#17 ASC NULLS FIRST], false, 0 (24) SortMergeJoin -Left keys [2]: [cs_order_number#3, cs_item_sk#2] +Left keys [2]: [cs_order_number#10, cs_item_sk#9] Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (25) Project [codegen id : 7] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (cs_quantity#4 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] -Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] +Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (cs_quantity#11 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#12 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] +Input [13]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] (26) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] @@ -264,17 +264,17 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) -(29) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +(29) ReusedExchange [Reuses operator id: 5] +Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] (30) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#1] Join condition: None (31) Project [codegen id : 10] -Output [9]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Output [9]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Input [10]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] (32) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] @@ -285,15 +285,15 @@ Right keys [1]: [d_date_sk#13] Join condition: None (34) Project [codegen id : 10] -Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Input [11]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] +Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [11]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_date_sk#13, d_year#14] (35) Exchange -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#29] (36) Sort [codegen id : 11] -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] Arguments: [cast(ss_ticket_number#26 as bigint) ASC NULLS FIRST, cast(ss_item_sk#25 as bigint) ASC NULLS FIRST], false, 0 (37) Scan parquet default.store_returns @@ -324,28 +324,28 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (43) Project [codegen id : 14] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#35, CheckOverflow((promote_precision(cast(ss_ext_sales_price#28 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#33, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#36] -Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] +Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#35, CheckOverflow((promote_precision(cast(ss_ext_sales_price#28 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#33, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#36] +Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] (44) Union (45) HashAggregate [codegen id : 15] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] (46) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23, 5), true, [id=#37] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23, 5), true, [id=#37] (47) HashAggregate [codegen id : 16] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] (48) Scan parquet default.web_sales Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] @@ -361,17 +361,17 @@ Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#4 Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Condition : (isnotnull(ws_item_sk#39) AND isnotnull(ws_sold_date_sk#38)) -(51) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +(51) ReusedExchange [Reuses operator id: 5] +Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] (52) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_item_sk#39] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#1] Join condition: None (53) Project [codegen id : 19] -Output [9]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Output [9]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Input [10]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] (54) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] @@ -382,15 +382,15 @@ Right keys [1]: [d_date_sk#13] Join condition: None (56) Project [codegen id : 19] -Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Input [11]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] +Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [11]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_date_sk#13, d_year#14] (57) Exchange -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#43] (58) Sort [codegen id : 20] -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 (59) Scan parquet default.web_returns @@ -421,80 +421,80 @@ Right keys [2]: [wr_order_number#45, wr_item_sk#44] Join condition: None (65) Project [codegen id : 23] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#49, CheckOverflow((promote_precision(cast(ws_ext_sales_price#42 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#47, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#50] -Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#49, CheckOverflow((promote_precision(cast(ws_ext_sales_price#42 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#47, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#50] +Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (66) Union (67) HashAggregate [codegen id : 24] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] (68) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23, 5), true, [id=#51] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23, 5), true, [id=#51] (69) HashAggregate [codegen id : 25] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] (70) HashAggregate [codegen id : 25] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] -Keys [5]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Keys [5]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] Aggregate Attributes [2]: [sum#52, sum#53] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] (71) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#56] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] +Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, 5), true, [id=#56] (72) HashAggregate [codegen id : 26] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] -Keys [5]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] +Keys [5]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#57, sum(UnscaledValue(sales_amt#23))#58] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum(cast(sales_cnt#22 as bigint))#57 AS sales_cnt#59, MakeDecimal(sum(UnscaledValue(sales_amt#23))#58,18,2) AS sales_amt#60] +Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum(cast(sales_cnt#22 as bigint))#57 AS sales_cnt#59, MakeDecimal(sum(UnscaledValue(sales_amt#23))#58,18,2) AS sales_amt#60] (73) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60] -Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#61] +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60] +Arguments: hashpartitioning(i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, 5), true, [id=#61] (74) Sort [codegen id : 27] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60] -Arguments: [i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_manufact_id#11 ASC NULLS FIRST], false, 0 +Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60] +Arguments: [i_brand_id#2 ASC NULLS FIRST, i_class_id#3 ASC NULLS FIRST, i_category_id#4 ASC NULLS FIRST, i_manufact_id#6 ASC NULLS FIRST], false, 0 -(75) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] +(75) ReusedExchange [Reuses operator id: 5] +Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] + +(76) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(76) ColumnarToRow [codegen id : 30] -Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] - -(77) Filter [codegen id : 30] -Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] -Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) +(77) ColumnarToRow +Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -(78) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +(78) Filter +Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) (79) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#62] +Left keys [1]: [i_item_sk#62] +Right keys [1]: [cs_item_sk#9] Join condition: None (80) Project [codegen id : 30] -Output [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -Input [10]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Output [9]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Input [10]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] (81) Scan parquet default.date_dim Output [2]: [d_date_sk#67, d_year#68] @@ -515,21 +515,21 @@ Input [2]: [d_date_sk#67, d_year#68] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] (85) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#8] Right keys [1]: [d_date_sk#67] Join condition: None (86) Project [codegen id : 30] -Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Input [11]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] +Output [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Input [11]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, d_date_sk#67, d_year#68] (87) Exchange -Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), true, [id=#70] +Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cs_order_number#10, cs_item_sk#9, 5), true, [id=#70] (88) Sort [codegen id : 31] -Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 +Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: [cs_order_number#10 ASC NULLS FIRST, cs_item_sk#9 ASC NULLS FIRST], false, 0 (89) ReusedExchange [Reuses operator id: 22] Output [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] @@ -539,13 +539,13 @@ Input [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_ Arguments: [cr_order_number#18 ASC NULLS FIRST, cr_item_sk#17 ASC NULLS FIRST], false, 0 (91) SortMergeJoin -Left keys [2]: [cs_order_number#3, cs_item_sk#2] +Left keys [2]: [cs_order_number#10, cs_item_sk#9] Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (92) Project [codegen id : 34] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (cs_quantity#4 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] -Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] +Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (cs_quantity#11 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#12 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] +Input [13]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] (93) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] @@ -561,7 +561,7 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) -(96) ReusedExchange [Reuses operator id: 8] +(96) ReusedExchange [Reuses operator id: 5] Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (97) BroadcastHashJoin [codegen id : 37] @@ -643,7 +643,7 @@ Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#4 Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Condition : (isnotnull(ws_item_sk#39) AND isnotnull(ws_sold_date_sk#38)) -(115) ReusedExchange [Reuses operator id: 8] +(115) ReusedExchange [Reuses operator id: 5] Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (116) BroadcastHashJoin [codegen id : 46] @@ -738,15 +738,15 @@ Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufac Arguments: [i_brand_id#63 ASC NULLS FIRST, i_class_id#64 ASC NULLS FIRST, i_category_id#65 ASC NULLS FIRST, i_manufact_id#66 ASC NULLS FIRST], false, 0 (136) SortMergeJoin [codegen id : 55] -Left keys [4]: [i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Left keys [4]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] Right keys [4]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#59 as decimal(17,2))) / promote_precision(cast(sales_cnt#86 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (137) Project [codegen id : 55] -Output [10]: [d_year#68 AS prev_year#89, d_year#14 AS year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#86 AS prev_yr_cnt#91, sales_cnt#59 AS curr_yr_cnt#92, (sales_cnt#59 - sales_cnt#86) AS sales_cnt_diff#93, CheckOverflow((promote_precision(cast(sales_amt#60 as decimal(19,2))) - promote_precision(cast(sales_amt#87 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#94] -Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60, d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#86, sales_amt#87] +Output [10]: [d_year#68 AS prev_year#89, d_year#14 AS year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#86 AS prev_yr_cnt#91, sales_cnt#59 AS curr_yr_cnt#92, (sales_cnt#59 - sales_cnt#86) AS sales_cnt_diff#93, CheckOverflow((promote_precision(cast(sales_amt#60 as decimal(19,2))) - promote_precision(cast(sales_amt#87 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#94] +Input [14]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60, d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#86, sales_amt#87] (138) TakeOrderedAndProject -Input [10]: [prev_year#89, year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] -Arguments: 100, [sales_cnt_diff#93 ASC NULLS FIRST, sales_amt_diff#94 ASC NULLS FIRST], [prev_year#89, year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] +Input [10]: [prev_year#89, year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] +Arguments: 100, [sales_cnt_diff#93 ASC NULLS FIRST, sales_amt_diff#94 ASC NULLS FIRST], [prev_year#89, year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt index 69f8b6a5b6789..32eadb186fe2b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt @@ -39,12 +39,8 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (3) Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id] - BroadcastHashJoin [cs_item_sk,i_item_sk] - Filter [cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] + Project [i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] + BroadcastHashJoin [i_item_sk,cs_item_sk] InputAdapter BroadcastExchange #6 WholeStageCodegen (1) @@ -53,6 +49,10 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] + Filter [cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] InputAdapter BroadcastExchange #7 WholeStageCodegen (2) @@ -166,14 +166,14 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (30) Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id] - BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] + BroadcastHashJoin [i_item_sk,cs_item_sk] + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] - InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 InputAdapter BroadcastExchange #18 WholeStageCodegen (29) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt index fc9634469d6df..940031a0344b2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt @@ -4,50 +4,50 @@ TakeOrderedAndProject (70) +- * SortMergeJoin Inner (68) :- * Project (46) : +- * SortMergeJoin Inner (45) - : :- * Sort (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) - : : :- * Project (13) - : : : +- * Filter (12) - : : : +- SortMergeJoin LeftOuter (11) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_returns (6) - : : +- BroadcastExchange (17) - : : +- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.date_dim (14) + : :- * Sort (24) + : : +- * Filter (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (13) + : : : +- * Filter (12) + : : : +- SortMergeJoin LeftOuter (11) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_returns (6) + : : +- BroadcastExchange (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.date_dim (14) : +- * Sort (44) - : +- * Filter (43) - : +- * HashAggregate (42) - : +- Exchange (41) - : +- * HashAggregate (40) - : +- * Project (39) - : +- * BroadcastHashJoin Inner BuildRight (38) - : :- * Project (36) - : : +- * Filter (35) - : : +- SortMergeJoin LeftOuter (34) - : : :- * Sort (28) - : : : +- Exchange (27) - : : : +- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.catalog_sales (24) - : : +- * Sort (33) - : : +- Exchange (32) - : : +- * Filter (31) - : : +- * ColumnarToRow (30) - : : +- Scan parquet default.catalog_returns (29) - : +- ReusedExchange (37) + : +- * HashAggregate (43) + : +- Exchange (42) + : +- * HashAggregate (41) + : +- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * Project (37) + : : +- * Filter (36) + : : +- SortMergeJoin LeftOuter (35) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.store_sales (25) + : : +- * Sort (34) + : : +- Exchange (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.store_returns (30) + : +- ReusedExchange (38) +- * Sort (67) +- * Filter (66) +- * HashAggregate (65) @@ -71,68 +71,68 @@ TakeOrderedAndProject (70) +- ReusedExchange (60) -(1) Scan parquet default.store_sales -Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +(1) Scan parquet default.catalog_sales +Output [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] (3) Filter [codegen id : 1] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Condition : ((isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_bill_customer_sk#2)) (4) Exchange -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint), 5), true, [id=#8] +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#8] (5) Sort [codegen id : 2] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 +Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.store_returns -Output [2]: [sr_item_sk#9, sr_ticket_number#10] +(6) Scan parquet default.catalog_returns +Output [2]: [cr_item_sk#9, cr_order_number#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Input [2]: [cr_item_sk#9, cr_order_number#10] (8) Filter [codegen id : 3] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9)) +Input [2]: [cr_item_sk#9, cr_order_number#10] +Condition : (isnotnull(cr_order_number#10) AND isnotnull(cr_item_sk#9)) (9) Exchange -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Arguments: hashpartitioning(sr_ticket_number#10, sr_item_sk#9, 5), true, [id=#11] +Input [2]: [cr_item_sk#9, cr_order_number#10] +Arguments: hashpartitioning(cr_order_number#10, cr_item_sk#9, 5), true, [id=#11] (10) Sort [codegen id : 4] -Input [2]: [sr_item_sk#9, sr_ticket_number#10] -Arguments: [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST], false, 0 +Input [2]: [cr_item_sk#9, cr_order_number#10] +Arguments: [cr_order_number#10 ASC NULLS FIRST, cr_item_sk#9 ASC NULLS FIRST], false, 0 (11) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint)] -Right keys [2]: [sr_ticket_number#10, sr_item_sk#9] +Left keys [2]: [cs_order_number#4, cs_item_sk#3] +Right keys [2]: [cr_order_number#10, cr_item_sk#9] Join condition: None (12) Filter [codegen id : 6] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] -Condition : isnull(sr_ticket_number#10) +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] +Condition : isnull(cr_order_number#10) (13) Project [codegen id : 6] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] +Output [6]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] (14) Scan parquet default.date_dim Output [2]: [d_date_sk#12, d_year#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_date_sk), EqualTo(d_year,2000), IsNotNull(d_year)] ReadSchema: struct (15) ColumnarToRow [codegen id : 5] @@ -140,146 +140,146 @@ Input [2]: [d_date_sk#12, d_year#13] (16) Filter [codegen id : 5] Input [2]: [d_date_sk#12, d_year#13] -Condition : ((isnotnull(d_year#13) AND (d_year#13 = 2000)) AND isnotnull(d_date_sk#12)) +Condition : ((isnotnull(d_date_sk#12) AND (d_year#13 = 2000)) AND isnotnull(d_year#13)) (17) BroadcastExchange Input [2]: [d_date_sk#12, d_year#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_date_sk#12, d_year#13] +Output [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] +Input [8]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_date_sk#12, d_year#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] -Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] -Functions [3]: [partial_sum(cast(ss_quantity#5 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#6)), partial_sum(UnscaledValue(ss_sales_price#7))] +Input [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] +Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] +Functions [3]: [partial_sum(cast(cs_quantity#5 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#6)), partial_sum(UnscaledValue(cs_sales_price#7))] Aggregate Attributes [3]: [sum#15, sum#16, sum#17] -Results [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Results [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] (21) Exchange -Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] -Arguments: hashpartitioning(d_year#13, ss_item_sk#2, ss_customer_sk#3, 5), true, [id=#21] +Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Arguments: hashpartitioning(d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, 5), true, [id=#21] (22) HashAggregate [codegen id : 7] -Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] -Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] -Functions [3]: [sum(cast(ss_quantity#5 as bigint)), sum(UnscaledValue(ss_wholesale_cost#6)), sum(UnscaledValue(ss_sales_price#7))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#5 as bigint))#22, sum(UnscaledValue(ss_wholesale_cost#6))#23, sum(UnscaledValue(ss_sales_price#7))#24] -Results [6]: [d_year#13 AS ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, sum(cast(ss_quantity#5 as bigint))#22 AS ss_qty#26, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#6))#23,17,2) AS ss_wc#27, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#24,17,2) AS ss_sp#28] - -(23) Sort [codegen id : 7] -Input [6]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] -Arguments: [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST], false, 0 - -(24) Scan parquet default.catalog_sales -Output [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] +Functions [3]: [sum(cast(cs_quantity#5 as bigint)), sum(UnscaledValue(cs_wholesale_cost#6)), sum(UnscaledValue(cs_sales_price#7))] +Aggregate Attributes [3]: [sum(cast(cs_quantity#5 as bigint))#22, sum(UnscaledValue(cs_wholesale_cost#6))#23, sum(UnscaledValue(cs_sales_price#7))#24] +Results [6]: [d_year#13 AS cs_sold_year#25, cs_item_sk#3, cs_bill_customer_sk#2 AS cs_customer_sk#26, sum(cast(cs_quantity#5 as bigint))#22 AS cs_qty#27, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#6))#23,17,2) AS cs_wc#28, MakeDecimal(sum(UnscaledValue(cs_sales_price#7))#24,17,2) AS cs_sp#29] + +(23) Filter [codegen id : 7] +Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] +Condition : (coalesce(cs_qty#27, 0) > 0) + +(24) Sort [codegen id : 7] +Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] +Arguments: [cs_sold_year#25 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST, cs_customer_sk#26 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(25) ColumnarToRow [codegen id : 8] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -(26) Filter [codegen id : 8] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Condition : ((isnotnull(cs_sold_date_sk#29) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_bill_customer_sk#30)) +(27) Filter [codegen id : 8] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Condition : ((isnotnull(ss_sold_date_sk#30) AND isnotnull(ss_item_sk#31)) AND isnotnull(ss_customer_sk#32)) -(27) Exchange -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Arguments: hashpartitioning(cs_order_number#32, cs_item_sk#31, 5), true, [id=#36] +(28) Exchange +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Arguments: hashpartitioning(cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint), 5), true, [id=#37] -(28) Sort [codegen id : 9] -Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Arguments: [cs_order_number#32 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST], false, 0 +(29) Sort [codegen id : 9] +Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Arguments: [cast(ss_ticket_number#33 as bigint) ASC NULLS FIRST, cast(ss_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 -(29) Scan parquet default.catalog_returns -Output [2]: [cr_item_sk#37, cr_order_number#38] +(30) Scan parquet default.store_returns +Output [2]: [sr_item_sk#38, sr_ticket_number#39] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct -(30) ColumnarToRow [codegen id : 10] -Input [2]: [cr_item_sk#37, cr_order_number#38] +(31) ColumnarToRow [codegen id : 10] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] -(31) Filter [codegen id : 10] -Input [2]: [cr_item_sk#37, cr_order_number#38] -Condition : (isnotnull(cr_order_number#38) AND isnotnull(cr_item_sk#37)) +(32) Filter [codegen id : 10] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Condition : (isnotnull(sr_ticket_number#39) AND isnotnull(sr_item_sk#38)) -(32) Exchange -Input [2]: [cr_item_sk#37, cr_order_number#38] -Arguments: hashpartitioning(cr_order_number#38, cr_item_sk#37, 5), true, [id=#39] +(33) Exchange +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Arguments: hashpartitioning(sr_ticket_number#39, sr_item_sk#38, 5), true, [id=#40] -(33) Sort [codegen id : 11] -Input [2]: [cr_item_sk#37, cr_order_number#38] -Arguments: [cr_order_number#38 ASC NULLS FIRST, cr_item_sk#37 ASC NULLS FIRST], false, 0 +(34) Sort [codegen id : 11] +Input [2]: [sr_item_sk#38, sr_ticket_number#39] +Arguments: [sr_ticket_number#39 ASC NULLS FIRST, sr_item_sk#38 ASC NULLS FIRST], false, 0 -(34) SortMergeJoin -Left keys [2]: [cs_order_number#32, cs_item_sk#31] -Right keys [2]: [cr_order_number#38, cr_item_sk#37] +(35) SortMergeJoin +Left keys [2]: [cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint)] +Right keys [2]: [sr_ticket_number#39, sr_item_sk#38] Join condition: None -(35) Filter [codegen id : 13] -Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] -Condition : isnull(cr_order_number#38) +(36) Filter [codegen id : 13] +Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] +Condition : isnull(sr_ticket_number#39) -(36) Project [codegen id : 13] -Output [6]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] +(37) Project [codegen id : 13] +Output [6]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] -(37) ReusedExchange [Reuses operator id: 17] +(38) ReusedExchange [Reuses operator id: 17] Output [2]: [d_date_sk#12, d_year#13] -(38) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [cs_sold_date_sk#29] +(39) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#30] Right keys [1]: [d_date_sk#12] Join condition: None -(39) Project [codegen id : 13] -Output [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] -Input [8]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_date_sk#12, d_year#13] - -(40) HashAggregate [codegen id : 13] -Input [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] -Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] -Functions [3]: [partial_sum(cast(cs_quantity#33 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#34)), partial_sum(UnscaledValue(cs_sales_price#35))] -Aggregate Attributes [3]: [sum#40, sum#41, sum#42] -Results [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +(40) Project [codegen id : 13] +Output [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] +Input [8]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_date_sk#12, d_year#13] -(41) Exchange -Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -Arguments: hashpartitioning(d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, 5), true, [id=#46] +(41) HashAggregate [codegen id : 13] +Input [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] +Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] +Functions [3]: [partial_sum(cast(ss_quantity#34 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#35)), partial_sum(UnscaledValue(ss_sales_price#36))] +Aggregate Attributes [3]: [sum#41, sum#42, sum#43] +Results [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -(42) HashAggregate [codegen id : 14] -Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] -Functions [3]: [sum(cast(cs_quantity#33 as bigint)), sum(UnscaledValue(cs_wholesale_cost#34)), sum(UnscaledValue(cs_sales_price#35))] -Aggregate Attributes [3]: [sum(cast(cs_quantity#33 as bigint))#47, sum(UnscaledValue(cs_wholesale_cost#34))#48, sum(UnscaledValue(cs_sales_price#35))#49] -Results [6]: [d_year#13 AS cs_sold_year#50, cs_item_sk#31, cs_bill_customer_sk#30 AS cs_customer_sk#51, sum(cast(cs_quantity#33 as bigint))#47 AS cs_qty#52, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#34))#48,17,2) AS cs_wc#53, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#49,17,2) AS cs_sp#54] +(42) Exchange +Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +Arguments: hashpartitioning(d_year#13, ss_item_sk#31, ss_customer_sk#32, 5), true, [id=#47] -(43) Filter [codegen id : 14] -Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] -Condition : (coalesce(cs_qty#52, 0) > 0) +(43) HashAggregate [codegen id : 14] +Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] +Functions [3]: [sum(cast(ss_quantity#34 as bigint)), sum(UnscaledValue(ss_wholesale_cost#35)), sum(UnscaledValue(ss_sales_price#36))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#34 as bigint))#48, sum(UnscaledValue(ss_wholesale_cost#35))#49, sum(UnscaledValue(ss_sales_price#36))#50] +Results [6]: [d_year#13 AS ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, sum(cast(ss_quantity#34 as bigint))#48 AS ss_qty#52, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#35))#49,17,2) AS ss_wc#53, MakeDecimal(sum(UnscaledValue(ss_sales_price#36))#50,17,2) AS ss_sp#54] (44) Sort [codegen id : 14] -Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] -Arguments: [cs_sold_year#50 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST, cs_customer_sk#51 ASC NULLS FIRST], false, 0 +Input [6]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Arguments: [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST], false, 0 (45) SortMergeJoin [codegen id : 15] -Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] -Right keys [3]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51] +Left keys [3]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26] +Right keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] Join condition: None (46) Project [codegen id : 15] -Output [9]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54] -Input [12]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Output [9]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Input [12]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] (47) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61] @@ -377,15 +377,15 @@ Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc# Arguments: [ws_sold_year#76 ASC NULLS FIRST, ws_item_sk#56 ASC NULLS FIRST, ws_customer_sk#77 ASC NULLS FIRST], false, 0 (68) SortMergeJoin [codegen id : 23] -Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] +Left keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] Right keys [3]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77] Join condition: None (69) Project [codegen id : 23] -Output [13]: [round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) AS ratio#81, ss_qty#26 AS store_qty#82, ss_wc#27 AS store_wholesale_cost#83, ss_sp#28 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#52, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#53, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#54, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] -Input [15]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] +Output [13]: [round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) AS ratio#81, ss_qty#52 AS store_qty#82, ss_wc#53 AS store_wholesale_cost#83, ss_sp#54 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#27, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#28, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#29, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Input [15]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] (70) TakeOrderedAndProject -Input [13]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] -Arguments: 100, [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST, ss_qty#26 DESC NULLS LAST, ss_wc#27 DESC NULLS LAST, ss_sp#28 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, ratio#81 ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] +Input [13]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Arguments: 100, [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST, ss_qty#52 DESC NULLS LAST, ss_wc#53 DESC NULLS LAST, ss_sp#54 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, ratio#81 ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt index 097d27131cb21..184f9d9b2d8d9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt @@ -4,55 +4,16 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (15) - Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] - SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + Project [cs_qty,cs_wc,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp] + SortMergeJoin [cs_sold_year,cs_item_sk,cs_customer_sk,ss_sold_year,ss_item_sk,ss_customer_sk] InputAdapter WholeStageCodegen (7) - Sort [ss_sold_year,ss_item_sk,ss_customer_sk] - HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] - InputAdapter - Exchange [d_year,ss_item_sk,ss_customer_sk] #1 - WholeStageCodegen (6) - HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] - Filter [sr_ticket_number] - InputAdapter - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - WholeStageCodegen (2) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #2 - WholeStageCodegen (1) - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] - WholeStageCodegen (4) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #3 - WholeStageCodegen (3) - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (5) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (14) Sort [cs_sold_year,cs_item_sk,cs_customer_sk] Filter [cs_qty] HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cast(cs_quantity as bigint)),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 - WholeStageCodegen (13) + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #1 + WholeStageCodegen (6) HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -60,26 +21,65 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp Filter [cr_order_number] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (9) + WholeStageCodegen (2) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #6 - WholeStageCodegen (8) + Exchange [cs_order_number,cs_item_sk] #2 + WholeStageCodegen (1) Filter [cs_sold_date_sk,cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price] - WholeStageCodegen (11) + WholeStageCodegen (4) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #7 - WholeStageCodegen (10) + Exchange [cr_order_number,cr_item_sk] #3 + WholeStageCodegen (3) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number] InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + BroadcastExchange #4 + WholeStageCodegen (5) + Filter [d_date_sk,d_year] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] + Filter [sr_ticket_number] + InputAdapter + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + WholeStageCodegen (9) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #6 + WholeStageCodegen (8) + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] + WholeStageCodegen (11) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (10) + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [ws_sold_year,ws_item_sk,ws_customer_sk] From 7a44562d659e0f3f2cf083d68614ad1dba1a6916 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Fri, 25 Sep 2020 20:07:21 +0300 Subject: [PATCH 03/11] Add CostBasedJoinReorder idempotence check to UTs --- .../sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala | 2 +- .../optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala index b84207397e5cc..ab70c8c61bb97 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala @@ -41,7 +41,7 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB PushPredicateThroughJoin, ColumnPruning, CollapseProject) :: - Batch("Join Reorder", FixedPoint(1), + Batch("Join Reorder", Once, CostBasedJoinReorder) :: Nil } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala index 703be48c6a2a9..0bb12cd873ef8 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala @@ -39,7 +39,7 @@ class StarJoinCostBasedReorderSuite extends JoinReorderPlanTestBase with StatsEs PushPredicateThroughJoin, ColumnPruning, CollapseProject) :: - Batch("Join Reorder", FixedPoint(1), + Batch("Join Reorder", Once, CostBasedJoinReorder) :: Nil } From c995703be0c93257861f51f0a537a425b59cb428 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Sun, 27 Sep 2020 19:17:11 +0300 Subject: [PATCH 04/11] Revert "make CostBasedJoinReorder idempotent" This reverts commit d58966ce --- .../optimizer/CostBasedJoinReorder.scala | 30 +- .../q10.sf100/explain.txt | 322 +++--- .../q10.sf100/simplified.txt | 46 +- .../q27.sf100/explain.txt | 210 ++-- .../q27.sf100/simplified.txt | 22 +- .../q3.sf100/explain.txt | 108 +-- .../q3.sf100/simplified.txt | 12 +- .../q34.sf100/explain.txt | 128 +-- .../q34.sf100/simplified.txt | 10 +- .../q42.sf100/explain.txt | 112 +-- .../q42.sf100/simplified.txt | 12 +- .../q46.sf100/explain.txt | 378 ++++---- .../q46.sf100/simplified.txt | 66 +- .../q52.sf100/explain.txt | 112 +-- .../q52.sf100/simplified.txt | 12 +- .../q55.sf100/explain.txt | 96 +- .../q55.sf100/simplified.txt | 10 +- .../q63.sf100/explain.txt | 136 +-- .../q63.sf100/simplified.txt | 14 +- .../q65.sf100/explain.txt | 196 ++-- .../q65.sf100/simplified.txt | 54 +- .../q68.sf100/explain.txt | 366 +++---- .../q68.sf100/simplified.txt | 50 +- .../q79.sf100/explain.txt | 132 +-- .../q79.sf100/simplified.txt | 10 +- .../q98.sf100/explain.txt | 104 +- .../q98.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q10.sf100/explain.txt | 354 +++---- .../q10.sf100/simplified.txt | 50 +- .../approved-plans-v1_4/q11.sf100/explain.txt | 252 ++--- .../q11.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q12.sf100/explain.txt | 174 ++-- .../q12.sf100/simplified.txt | 52 +- .../q14a.sf100/explain.txt | 896 ++++++++--------- .../q14a.sf100/simplified.txt | 104 +- .../q14b.sf100/explain.txt | 772 +++++++-------- .../q14b.sf100/simplified.txt | 94 +- .../approved-plans-v1_4/q15.sf100/explain.txt | 240 ++--- .../q15.sf100/simplified.txt | 68 +- .../approved-plans-v1_4/q16.sf100/explain.txt | 62 +- .../q16.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q17.sf100/explain.txt | 276 +++--- .../q17.sf100/simplified.txt | 26 +- .../approved-plans-v1_4/q19.sf100/explain.txt | 132 +-- .../q19.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q20.sf100/explain.txt | 196 ++-- .../q20.sf100/simplified.txt | 52 +- .../approved-plans-v1_4/q21.sf100/explain.txt | 120 +-- .../q21.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q22.sf100/explain.txt | 92 +- .../q22.sf100/simplified.txt | 24 +- .../q23b.sf100/explain.txt | 914 +++++++++--------- .../q23b.sf100/simplified.txt | 110 +-- .../q24a.sf100/explain.txt | 282 +++--- .../q24a.sf100/simplified.txt | 34 +- .../q24b.sf100/explain.txt | 282 +++--- .../q24b.sf100/simplified.txt | 34 +- .../approved-plans-v1_4/q26.sf100/explain.txt | 108 +-- .../q26.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q29.sf100/explain.txt | 104 +- .../q29.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q3.sf100/explain.txt | 108 +-- .../q3.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q30.sf100/explain.txt | 550 +++++------ .../q30.sf100/simplified.txt | 94 +- .../approved-plans-v1_4/q31.sf100/explain.txt | 846 ++++++++-------- .../q31.sf100/simplified.txt | 292 +++--- .../approved-plans-v1_4/q32.sf100/explain.txt | 212 ++-- .../q32.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q33.sf100/explain.txt | 158 +-- .../q33.sf100/simplified.txt | 22 +- .../approved-plans-v1_4/q35.sf100/explain.txt | 378 ++++---- .../q35.sf100/simplified.txt | 62 +- .../approved-plans-v1_4/q36.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q37.sf100/explain.txt | 128 +-- .../q37.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q38.sf100/explain.txt | 156 +-- .../q38.sf100/simplified.txt | 16 +- .../q39a.sf100/explain.txt | 218 ++--- .../q39a.sf100/simplified.txt | 28 +- .../q39b.sf100/explain.txt | 218 ++--- .../q39b.sf100/simplified.txt | 28 +- .../approved-plans-v1_4/q4.sf100/explain.txt | 382 ++++---- .../q4.sf100/simplified.txt | 40 +- .../approved-plans-v1_4/q40.sf100/explain.txt | 188 ++-- .../q40.sf100/simplified.txt | 34 +- .../approved-plans-v1_4/q42.sf100/explain.txt | 112 +-- .../q42.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q43.sf100/explain.txt | 96 +- .../q43.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q45.sf100/explain.txt | 204 ++-- .../q45.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q46.sf100/explain.txt | 106 +- .../q46.sf100/simplified.txt | 22 +- .../approved-plans-v1_4/q50.sf100/explain.txt | 196 ++-- .../q50.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q52.sf100/explain.txt | 108 +-- .../q52.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q53.sf100/explain.txt | 136 +-- .../q53.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q55.sf100/explain.txt | 108 +-- .../q55.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q56.sf100/explain.txt | 56 +- .../q56.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q57.sf100/explain.txt | 166 ++-- .../q57.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q6.sf100/explain.txt | 90 +- .../q6.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q60.sf100/explain.txt | 56 +- .../q60.sf100/simplified.txt | 12 +- .../approved-plans-v1_4/q61.sf100/explain.txt | 28 +- .../q61.sf100/simplified.txt | 6 +- .../approved-plans-v1_4/q63.sf100/explain.txt | 136 +-- .../q63.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q65.sf100/explain.txt | 200 ++-- .../q65.sf100/simplified.txt | 54 +- .../approved-plans-v1_4/q67.sf100/explain.txt | 114 +-- .../q67.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q68.sf100/explain.txt | 224 ++--- .../q68.sf100/simplified.txt | 32 +- .../approved-plans-v1_4/q69.sf100/explain.txt | 342 +++---- .../q69.sf100/simplified.txt | 50 +- .../approved-plans-v1_4/q7.sf100/explain.txt | 108 +-- .../q7.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q70.sf100/explain.txt | 156 +-- .../q70.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q72.sf100/explain.txt | 218 ++--- .../q72.sf100/simplified.txt | 24 +- .../approved-plans-v1_4/q73.sf100/explain.txt | 128 +-- .../q73.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q74.sf100/explain.txt | 72 +- .../q74.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q76.sf100/explain.txt | 200 ++-- .../q76.sf100/simplified.txt | 32 +- .../approved-plans-v1_4/q77.sf100/explain.txt | 206 ++-- .../q77.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q78.sf100/explain.txt | 342 +++---- .../q78.sf100/simplified.txt | 100 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 64 +- .../q80.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q81.sf100/explain.txt | 188 ++-- .../q81.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q82.sf100/explain.txt | 128 +-- .../q82.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q83.sf100/explain.txt | 150 +-- .../q83.sf100/simplified.txt | 44 +- .../approved-plans-v1_4/q84.sf100/explain.txt | 210 ++-- .../q84.sf100/simplified.txt | 48 +- .../approved-plans-v1_4/q85.sf100/explain.txt | 122 +-- .../q85.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q86.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q87.sf100/explain.txt | 156 +-- .../q87.sf100/simplified.txt | 16 +- .../approved-plans-v1_4/q88.sf100/explain.txt | 466 ++++----- .../q88.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q89.sf100/explain.txt | 128 +-- .../q89.sf100/simplified.txt | 14 +- .../approved-plans-v1_4/q91.sf100/explain.txt | 202 ++-- .../q91.sf100/simplified.txt | 26 +- .../approved-plans-v1_4/q92.sf100/explain.txt | 224 ++--- .../q92.sf100/simplified.txt | 30 +- .../approved-plans-v1_4/q94.sf100/explain.txt | 300 +++--- .../q94.sf100/simplified.txt | 60 +- .../approved-plans-v1_4/q95.sf100/explain.txt | 428 ++++---- .../q95.sf100/simplified.txt | 84 +- .../approved-plans-v1_4/q96.sf100/explain.txt | 90 +- .../q96.sf100/simplified.txt | 10 +- .../approved-plans-v1_4/q98.sf100/explain.txt | 204 ++-- .../q98.sf100/simplified.txt | 52 +- .../approved-plans-v1_4/q99.sf100/explain.txt | 108 +-- .../q99.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q11.sf100/explain.txt | 36 +- .../q11.sf100/simplified.txt | 8 +- .../approved-plans-v2_7/q14.sf100/explain.txt | 196 ++-- .../q14.sf100/simplified.txt | 46 +- .../q14a.sf100/explain.txt | 28 +- .../q14a.sf100/simplified.txt | 6 +- .../q18a.sf100/explain.txt | 180 ++-- .../q18a.sf100/simplified.txt | 34 +- .../approved-plans-v2_7/q20.sf100/explain.txt | 104 +- .../q20.sf100/simplified.txt | 10 +- .../q22a.sf100/explain.txt | 174 ++-- .../q22a.sf100/simplified.txt | 30 +- .../approved-plans-v2_7/q24.sf100/explain.txt | 286 +++--- .../q24.sf100/simplified.txt | 36 +- .../q27a.sf100/explain.txt | 268 ++--- .../q27a.sf100/simplified.txt | 54 +- .../approved-plans-v2_7/q34.sf100/explain.txt | 132 +-- .../q34.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q35.sf100/explain.txt | 378 ++++---- .../q35.sf100/simplified.txt | 62 +- .../q36a.sf100/explain.txt | 114 +-- .../q36a.sf100/simplified.txt | 10 +- .../approved-plans-v2_7/q49.sf100/explain.txt | 188 ++-- .../q49.sf100/simplified.txt | 24 +- .../approved-plans-v2_7/q72.sf100/explain.txt | 334 +++---- .../q72.sf100/simplified.txt | 34 +- .../approved-plans-v2_7/q74.sf100/explain.txt | 278 +++--- .../q74.sf100/simplified.txt | 24 +- .../approved-plans-v2_7/q75.sf100/explain.txt | 272 +++--- .../q75.sf100/simplified.txt | 20 +- .../approved-plans-v2_7/q78.sf100/explain.txt | 342 +++---- .../q78.sf100/simplified.txt | 100 +- 203 files changed, 12464 insertions(+), 12472 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala index ceef1ebfd6602..8b019f35263f3 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala @@ -40,7 +40,15 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { if (!conf.cboEnabled || !conf.joinReorderEnabled) { plan } else { - val result = plan transformDown applyLocally + val result = plan transformDown { + // Start reordering with a joinable item, which is an InnerLike join with conditions. + // Avoid reordering if a join hint is present. + case j @ Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE) => + reorder(j, j.output) + case p @ Project(projectList, Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE)) + if projectList.forall(_.isInstanceOf[Attribute]) => + reorder(p, p.output) + } // After reordering is finished, convert OrderedJoin back to Join. result transform { case OrderedJoin(left, right, jt, cond) => Join(left, right, jt, cond, JoinHint.NONE) @@ -48,17 +56,6 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { } } - private val applyLocally: PartialFunction[LogicalPlan, LogicalPlan] = { - // Start reordering with a joinable item, which is an InnerLike join with conditions. - // Avoid reordering if a join hint is present. - case j @ Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE) => - reorder(j, j.output) - case p @ Project(projectList, Join(_, _, _: InnerLike, Some(cond), JoinHint.NONE)) - if projectList.forall(_.isInstanceOf[Attribute]) => - reorder(p, p.output) - - } - private def reorder(plan: LogicalPlan, output: Seq[Attribute]): LogicalPlan = { val (items, conditions) = extractInnerJoins(plan) val result = @@ -66,9 +63,7 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with PredicateHelper { // We also need to check if costs of all items can be evaluated. if (items.size > 2 && items.size <= conf.joinReorderDPThreshold && conditions.nonEmpty && items.forall(_.stats.rowCount.isDefined)) { - // Transform and sort all the items to guarantee idempotence - val transformedItems = items.map(_ transformDown applyLocally).sortBy(_.semanticHash()) - JoinReorderDP.search(conf, transformedItems, conditions, output) + JoinReorderDP.search(conf, items, conditions, output) } else { plan } @@ -347,10 +342,7 @@ object JoinReorderDP extends PredicateHelper with Logging { /** Get the cost of the root node of this plan tree. */ def rootCost(conf: SQLConf): Cost = { if (itemIds.size > 1) { - val rootStats = (plan transform { - // The OrderedJoin does not propagate stats - case OrderedJoin(left, right, jt, cond) => Join(left, right, jt, cond, JoinHint.NONE) - }).stats + val rootStats = plan.stats Cost(rootStats.rowCount.get, rootStats.sizeInBytes) } else { // If the plan is a leaf item, it has zero cost. diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt index 5fc91b10ea49d..d39916159cb37 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt @@ -7,236 +7,236 @@ TakeOrderedAndProject (52) +- * BroadcastHashJoin Inner BuildLeft (47) :- BroadcastExchange (43) : +- * Project (42) - : +- * BroadcastHashJoin Inner BuildLeft (41) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) - : +- * Project (40) - : +- SortMergeJoin LeftSemi (39) - : :- SortMergeJoin LeftSemi (30) - : : :- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.customer (6) - : : +- * Sort (29) - : : +- Exchange (28) - : : +- Union (27) - : : :- * Project (20) - : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : :- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.web_sales (11) - : : : +- BroadcastExchange (18) - : : : +- * Project (17) - : : : +- * Filter (16) - : : : +- * ColumnarToRow (15) - : : : +- Scan parquet default.date_dim (14) - : : +- * Project (26) - : : +- * BroadcastHashJoin Inner BuildRight (25) - : : :- * Filter (23) - : : : +- * ColumnarToRow (22) - : : : +- Scan parquet default.catalog_sales (21) - : : +- ReusedExchange (24) - : +- * Sort (38) - : +- Exchange (37) - : +- * Project (36) - : +- * BroadcastHashJoin Inner BuildRight (35) - : :- * Filter (33) - : : +- * ColumnarToRow (32) - : : +- Scan parquet default.store_sales (31) - : +- ReusedExchange (34) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- SortMergeJoin LeftSemi (34) + : : :- SortMergeJoin LeftSemi (25) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- Union (22) + : : : :- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.web_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.catalog_sales (16) + : : : +- ReusedExchange (19) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.store_sales (26) + : : +- ReusedExchange (29) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.customer_address (36) +- * Filter (46) +- * ColumnarToRow (45) +- Scan parquet default.customer_demographics (44) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_county#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_county#2] - -(3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_county#2] -Condition : (ca_county#2 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#1] -Input [2]: [ca_address_sk#1, ca_county#2] - -(5) BroadcastExchange -Input [1]: [ca_address_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] - -(6) Scan parquet default.customer -Output [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(8) Filter [codegen id : 2] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Condition : ((isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#6)) AND isnotnull(c_current_cdemo_sk#5)) +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2)) -(9) Exchange -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#7] +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#4] -(10) Sort [codegen id : 3] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] +(6) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 5] -Input [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] -(13) Filter [codegen id : 5] -Input [2]: [ws_sold_date_sk#8, ws_bill_customer_sk#9] -Condition : (isnotnull(ws_sold_date_sk#8) AND isnotnull(ws_bill_customer_sk#9)) +(8) Filter [codegen id : 4] +Input [2]: [ws_sold_date_sk#5, ws_bill_customer_sk#6] +Condition : (isnotnull(ws_sold_date_sk#5) AND isnotnull(ws_bill_customer_sk#6)) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(16) Filter [codegen id : 4] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#12)) AND (d_year#11 = 2002)) AND (d_moy#12 >= 4)) AND (d_moy#12 <= 7)) AND isnotnull(d_date_sk#10)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2002)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 7)) AND isnotnull(d_date_sk#7)) -(17) Project [codegen id : 4] -Output [1]: [d_date_sk#10] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(18) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(13) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(19) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ws_sold_date_sk#8] -Right keys [1]: [d_date_sk#10] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] Join condition: None -(20) Project [codegen id : 5] -Output [1]: [ws_bill_customer_sk#9 AS customer_sk#14] -Input [3]: [ws_sold_date_sk#8, ws_bill_customer_sk#9, d_date_sk#10] +(15) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#6 AS customer_sk#11] +Input [3]: [ws_sold_date_sk#5, ws_bill_customer_sk#6, d_date_sk#7] -(21) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(16) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_customer_sk)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 7] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(17) ColumnarToRow [codegen id : 6] +Input [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] -(23) Filter [codegen id : 7] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_ship_customer_sk#16)) +(18) Filter [codegen id : 6] +Input [2]: [cs_sold_date_sk#12, cs_ship_customer_sk#13] +Condition : (isnotnull(cs_sold_date_sk#12) AND isnotnull(cs_ship_customer_sk#13)) -(24) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#10] +(19) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(25) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [cs_sold_date_sk#15] -Right keys [1]: [d_date_sk#10] +(20) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#12] +Right keys [1]: [d_date_sk#7] Join condition: None -(26) Project [codegen id : 7] -Output [1]: [cs_ship_customer_sk#16 AS customer_sk#17] -Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#10] +(21) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#13 AS customer_sk#14] +Input [3]: [cs_sold_date_sk#12, cs_ship_customer_sk#13, d_date_sk#7] -(27) Union +(22) Union -(28) Exchange -Input [1]: [customer_sk#14] -Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#18] +(23) Exchange +Input [1]: [customer_sk#11] +Arguments: hashpartitioning(customer_sk#11, 5), true, [id=#15] -(29) Sort [codegen id : 8] -Input [1]: [customer_sk#14] -Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 7] +Input [1]: [customer_sk#11] +Arguments: [customer_sk#11 ASC NULLS FIRST], false, 0 -(30) SortMergeJoin -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [customer_sk#14] +(25) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#11] Join condition: None -(31) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#19, ss_customer_sk#20] +(26) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#16, ss_customer_sk#17] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_customer_sk)] ReadSchema: struct -(32) ColumnarToRow [codegen id : 10] -Input [2]: [ss_sold_date_sk#19, ss_customer_sk#20] +(27) ColumnarToRow [codegen id : 9] +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] -(33) Filter [codegen id : 10] -Input [2]: [ss_sold_date_sk#19, ss_customer_sk#20] -Condition : (isnotnull(ss_sold_date_sk#19) AND isnotnull(ss_customer_sk#20)) +(28) Filter [codegen id : 9] +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Condition : (isnotnull(ss_sold_date_sk#16) AND isnotnull(ss_customer_sk#17)) -(34) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#10] +(29) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(35) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#19] -Right keys [1]: [d_date_sk#10] +(30) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#16] +Right keys [1]: [d_date_sk#7] Join condition: None -(36) Project [codegen id : 10] -Output [1]: [ss_customer_sk#20 AS customer_sk#21] -Input [3]: [ss_sold_date_sk#19, ss_customer_sk#20, d_date_sk#10] +(31) Project [codegen id : 9] +Output [1]: [ss_customer_sk#17 AS customer_sk#18] +Input [3]: [ss_sold_date_sk#16, ss_customer_sk#17, d_date_sk#7] -(37) Exchange -Input [1]: [customer_sk#21] -Arguments: hashpartitioning(customer_sk#21, 5), true, [id=#22] +(32) Exchange +Input [1]: [customer_sk#18] +Arguments: hashpartitioning(customer_sk#18, 5), true, [id=#19] -(38) Sort [codegen id : 11] -Input [1]: [customer_sk#21] -Arguments: [customer_sk#21 ASC NULLS FIRST], false, 0 +(33) Sort [codegen id : 10] +Input [1]: [customer_sk#18] +Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0 -(39) SortMergeJoin -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [customer_sk#21] +(34) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#18] Join condition: None -(40) Project -Output [2]: [c_current_cdemo_sk#5, c_current_addr_sk#6] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(35) Project [codegen id : 12] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(36) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_county#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 11] +Input [2]: [ca_address_sk#20, ca_county#21] + +(38) Filter [codegen id : 11] +Input [2]: [ca_address_sk#20, ca_county#21] +Condition : (ca_county#21 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#20)) + +(39) Project [codegen id : 11] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_county#21] + +(40) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (41) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#6] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#20] Join condition: None (42) Project [codegen id : 12] -Output [1]: [c_current_cdemo_sk#5] -Input [3]: [ca_address_sk#1, c_current_cdemo_sk#5, c_current_addr_sk#6] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] (43) BroadcastExchange -Input [1]: [c_current_cdemo_sk#5] +Input [1]: [c_current_cdemo_sk#2] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (44) Scan parquet default.customer_demographics @@ -254,13 +254,13 @@ Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_stat Condition : isnotnull(cd_demo_sk#24) (47) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [c_current_cdemo_sk#5] +Left keys [1]: [c_current_cdemo_sk#2] Right keys [1]: [cd_demo_sk#24] Join condition: None (48) Project [codegen id : 13] Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] -Input [10]: [c_current_cdemo_sk#5, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] (49) HashAggregate [codegen id : 13] Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt index 73227ad66d180..7d5fa795f98f8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt @@ -11,34 +11,26 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha BroadcastExchange #2 WholeStageCodegen (12) Project [c_current_cdemo_sk] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] Project [c_current_cdemo_sk,c_current_addr_sk] InputAdapter SortMergeJoin [c_customer_sk,customer_sk] SortMergeJoin [c_customer_sk,customer_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (2) + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (8) + WholeStageCodegen (7) Sort [customer_sk] InputAdapter - Exchange [customer_sk] #5 + Exchange [customer_sk] #4 Union - WholeStageCodegen (5) + WholeStageCodegen (4) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_customer_sk] @@ -46,14 +38,14 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (7) + WholeStageCodegen (6) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_ship_customer_sk] @@ -61,12 +53,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (11) + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (10) Sort [customer_sk] InputAdapter - Exchange [customer_sk] #7 - WholeStageCodegen (10) + Exchange [customer_sk] #6 + WholeStageCodegen (9) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_customer_sk] @@ -74,7 +66,15 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (11) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt index fa01042350149..b3b11b60ded0b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (77) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : :- BroadcastExchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.store_sales (6) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -43,11 +43,11 @@ TakeOrderedAndProject (77) : : :- * Project (45) : : : +- * BroadcastHashJoin Inner BuildRight (44) : : : :- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildLeft (37) - : : : : :- ReusedExchange (33) - : : : : +- * Filter (36) - : : : : +- * ColumnarToRow (35) - : : : : +- Scan parquet default.store_sales (34) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) : : : +- BroadcastExchange (43) : : : +- * Project (42) : : : +- * Filter (41) @@ -65,11 +65,11 @@ TakeOrderedAndProject (77) : :- * Project (63) : : +- * BroadcastHashJoin Inner BuildRight (62) : : :- * Project (60) - : : : +- * BroadcastHashJoin Inner BuildLeft (59) - : : : :- ReusedExchange (55) - : : : +- * Filter (58) - : : : +- * ColumnarToRow (57) - : : : +- Scan parquet default.store_sales (56) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) : : +- ReusedExchange (61) : +- ReusedExchange (64) +- BroadcastExchange (70) @@ -78,50 +78,50 @@ TakeOrderedAndProject (77) +- Scan parquet default.item (67) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(1) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND (d_date_sk#1 >= 2451545)) AND (d_date_sk#1 <= 2451910)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#9, d_year#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#9, d_year#10] -(6) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#9, d_year#10] +Condition : ((((isnotnull(d_year#10) AND (d_year#10 = 2000)) AND (d_date_sk#9 >= 2451545)) AND (d_date_sk#9 <= 2451910)) AND isnotnull(d_date_sk#9)) -(7) ColumnarToRow -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [2]: [d_date_sk#9, d_year#10] -(8) Filter -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) +(8) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] (11) Scan parquet default.customer_demographics Output [4]: [cd_demo_sk#12, cd_gender#13, cd_marital_status#14, cd_education_status#15] @@ -146,13 +146,13 @@ Input [1]: [cd_demo_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_cdemo_sk#6] +Left keys [1]: [ss_cdemo_sk#3] Right keys [1]: [cd_demo_sk#12] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_item_sk#5, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] +Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -173,13 +173,13 @@ Input [2]: [s_store_sk#17, s_state#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 5] -Output [6]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_state#18] -Input [8]: [ss_item_sk#5, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17, s_state#18] +Output [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18] +Input [8]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17, s_state#18] (24) Scan parquet default.item Output [2]: [i_item_sk#20, i_item_id#21] @@ -200,13 +200,13 @@ Input [2]: [i_item_sk#20, i_item_id#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (29) Project [codegen id : 5] -Output [6]: [i_item_id#21, s_state#18, ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] -Input [8]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_state#18, i_item_sk#20, i_item_id#21] +Output [6]: [i_item_id#21, s_state#18, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [8]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18, i_item_sk#20, i_item_id#21] (30) HashAggregate [codegen id : 5] Input [6]: [i_item_id#21, s_state#18, agg1#23, agg2#24, agg3#25, agg4#26] @@ -226,31 +226,31 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#44, avg(UnscaledValue(agg2#24))#45, avg(UnscaledValue(agg3#25))#46, avg(UnscaledValue(agg4#26))#47] Results [7]: [i_item_id#21, s_state#18, 0 AS g_state#48, avg(cast(agg1#23 as bigint))#44 AS agg1#49, cast((avg(UnscaledValue(agg2#24))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(agg3#25))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(agg4#26))#47 / 100.0) as decimal(11,6)) AS agg4#52] -(33) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(34) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +(33) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(35) ColumnarToRow -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] + +(35) Filter [codegen id : 11] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) -(36) Filter -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#9] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None (38) Project [codegen id : 11] -Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] (39) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -275,37 +275,37 @@ Input [1]: [s_store_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] (44) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None (45) Project [codegen id : 11] -Output [6]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17] +Output [6]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] (46) ReusedExchange [Reuses operator id: 15] Output [1]: [cd_demo_sk#12] (47) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_cdemo_sk#6] +Left keys [1]: [ss_cdemo_sk#3] Right keys [1]: [cd_demo_sk#12] Join condition: None (48) Project [codegen id : 11] -Output [5]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] +Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] (49) ReusedExchange [Reuses operator id: 27] Output [2]: [i_item_sk#20, i_item_id#21] (50) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (51) Project [codegen id : 11] -Output [5]: [i_item_id#21, ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] -Input [7]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, i_item_sk#20, i_item_id#21] +Output [5]: [i_item_id#21, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20, i_item_id#21] (52) HashAggregate [codegen id : 11] Input [5]: [i_item_id#21, agg1#23, agg2#24, agg3#25, agg4#26] @@ -325,55 +325,55 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#71, avg(UnscaledValue(agg2#24))#72, avg(UnscaledValue(agg3#25))#73, avg(UnscaledValue(agg4#26))#74] Results [7]: [i_item_id#21, null AS s_state#75, 1 AS g_state#76, avg(cast(agg1#23 as bigint))#71 AS agg1#77, cast((avg(UnscaledValue(agg2#24))#72 / 100.0) as decimal(11,6)) AS agg2#78, cast((avg(UnscaledValue(agg3#25))#73 / 100.0) as decimal(11,6)) AS agg3#79, cast((avg(UnscaledValue(agg4#26))#74 / 100.0) as decimal(11,6)) AS agg4#80] -(55) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(56) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +(55) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451545), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(57) ColumnarToRow -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] + +(57) Filter [codegen id : 17] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451545)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) -(58) Filter -Input [8]: [ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Condition : (((((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451545)) AND (ss_sold_date_sk#4 <= 2451910)) AND isnotnull(ss_cdemo_sk#6)) AND isnotnull(ss_store_sk#7)) AND isnotnull(ss_item_sk#5)) +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#9] (59) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None (60) Project [codegen id : 17] -Output [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [9]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] +Output [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#9] (61) ReusedExchange [Reuses operator id: 43] Output [1]: [s_store_sk#17] (62) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None (63) Project [codegen id : 17] -Output [6]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [8]: [ss_item_sk#5, ss_cdemo_sk#6, ss_store_sk#7, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, s_store_sk#17] +Output [6]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] (64) ReusedExchange [Reuses operator id: 15] Output [1]: [cd_demo_sk#12] (65) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_cdemo_sk#6] +Left keys [1]: [ss_cdemo_sk#3] Right keys [1]: [cd_demo_sk#12] Join condition: None (66) Project [codegen id : 17] -Output [5]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11] -Input [7]: [ss_item_sk#5, ss_cdemo_sk#6, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, cd_demo_sk#12] +Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [7]: [ss_item_sk#2, ss_cdemo_sk#3, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#12] (67) Scan parquet default.item Output [1]: [i_item_sk#20] @@ -394,13 +394,13 @@ Input [1]: [i_item_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] (71) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (72) Project [codegen id : 17] -Output [4]: [ss_quantity#8 AS agg1#23, ss_list_price#9 AS agg2#24, ss_coupon_amt#11 AS agg3#25, ss_sales_price#10 AS agg4#26] -Input [6]: [ss_item_sk#5, ss_quantity#8, ss_list_price#9, ss_sales_price#10, ss_coupon_amt#11, i_item_sk#20] +Output [4]: [ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20] (73) HashAggregate [codegen id : 17] Input [4]: [agg1#23, agg2#24, agg3#25, agg4#26] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt index fc7202e739bcc..d14061de1d1f4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt @@ -13,7 +13,11 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -22,10 +26,6 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -61,13 +61,13 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter BroadcastExchange #7 WholeStageCodegen (8) @@ -93,13 +93,13 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_cdemo_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [s_store_sk] #7 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt index 8fe4c15db5841..93736a83ebfc6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2415355),LessThanOrEqual(ss_sold_date_sk,2415385)),And(GreaterThanOrEqual(ss_sold_date_sk,2415720),LessThanOrEqual(ss_sold_date_sk,2415750))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416085),LessThanOrEqual(ss_sold_date_sk,2416115)),And(GreaterThanOrEqual(ss_sold_date_sk,2416450),LessThanOrEqual(ss_sold_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416816),LessThanOrEqual(ss_sold_date_sk,2416846)),And(GreaterThanOrEqual(ss_sold_date_sk,2417181),LessThanOrEqual(ss_sold_date_sk,2417211))),And(GreaterThanOrEqual(ss_sold_date_sk,2417546),LessThanOrEqual(ss_sold_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2417911),LessThanOrEqual(ss_sold_date_sk,2417941)),And(GreaterThanOrEqual(ss_sold_date_sk,2418277),LessThanOrEqual(ss_sold_date_sk,2418307))),And(GreaterThanOrEqual(ss_sold_date_sk,2418642),LessThanOrEqual(ss_sold_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2419007),LessThanOrEqual(ss_sold_date_sk,2419037)),And(GreaterThanOrEqual(ss_sold_date_sk,2419372),LessThanOrEqual(ss_sold_date_sk,2419402))),And(GreaterThanOrEqual(ss_sold_date_sk,2419738),LessThanOrEqual(ss_sold_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2420103),LessThanOrEqual(ss_sold_date_sk,2420133)),And(GreaterThanOrEqual(ss_sold_date_sk,2420468),LessThanOrEqual(ss_sold_date_sk,2420498))),And(GreaterThanOrEqual(ss_sold_date_sk,2420833),LessThanOrEqual(ss_sold_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2421199),LessThanOrEqual(ss_sold_date_sk,2421229)),And(GreaterThanOrEqual(ss_sold_date_sk,2421564),LessThanOrEqual(ss_sold_date_sk,2421594))),And(GreaterThanOrEqual(ss_sold_date_sk,2421929),LessThanOrEqual(ss_sold_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2422294),LessThanOrEqual(ss_sold_date_sk,2422324)),And(GreaterThanOrEqual(ss_sold_date_sk,2422660),LessThanOrEqual(ss_sold_date_sk,2422690))),And(GreaterThanOrEqual(ss_sold_date_sk,2423025),LessThanOrEqual(ss_sold_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2423390),LessThanOrEqual(ss_sold_date_sk,2423420)),And(GreaterThanOrEqual(ss_sold_date_sk,2423755),LessThanOrEqual(ss_sold_date_sk,2423785))),And(GreaterThanOrEqual(ss_sold_date_sk,2424121),LessThanOrEqual(ss_sold_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2424486),LessThanOrEqual(ss_sold_date_sk,2424516)),And(GreaterThanOrEqual(ss_sold_date_sk,2424851),LessThanOrEqual(ss_sold_date_sk,2424881))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425216),LessThanOrEqual(ss_sold_date_sk,2425246)),And(GreaterThanOrEqual(ss_sold_date_sk,2425582),LessThanOrEqual(ss_sold_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425947),LessThanOrEqual(ss_sold_date_sk,2425977)),And(GreaterThanOrEqual(ss_sold_date_sk,2426312),LessThanOrEqual(ss_sold_date_sk,2426342))),And(GreaterThanOrEqual(ss_sold_date_sk,2426677),LessThanOrEqual(ss_sold_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2427043),LessThanOrEqual(ss_sold_date_sk,2427073)),And(GreaterThanOrEqual(ss_sold_date_sk,2427408),LessThanOrEqual(ss_sold_date_sk,2427438))),And(GreaterThanOrEqual(ss_sold_date_sk,2427773),LessThanOrEqual(ss_sold_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2428138),LessThanOrEqual(ss_sold_date_sk,2428168)),And(GreaterThanOrEqual(ss_sold_date_sk,2428504),LessThanOrEqual(ss_sold_date_sk,2428534))),And(GreaterThanOrEqual(ss_sold_date_sk,2428869),LessThanOrEqual(ss_sold_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2429234),LessThanOrEqual(ss_sold_date_sk,2429264)),And(GreaterThanOrEqual(ss_sold_date_sk,2429599),LessThanOrEqual(ss_sold_date_sk,2429629))),And(GreaterThanOrEqual(ss_sold_date_sk,2429965),LessThanOrEqual(ss_sold_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2430330),LessThanOrEqual(ss_sold_date_sk,2430360)),And(GreaterThanOrEqual(ss_sold_date_sk,2430695),LessThanOrEqual(ss_sold_date_sk,2430725))),And(GreaterThanOrEqual(ss_sold_date_sk,2431060),LessThanOrEqual(ss_sold_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2431426),LessThanOrEqual(ss_sold_date_sk,2431456)),And(GreaterThanOrEqual(ss_sold_date_sk,2431791),LessThanOrEqual(ss_sold_date_sk,2431821))),And(GreaterThanOrEqual(ss_sold_date_sk,2432156),LessThanOrEqual(ss_sold_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2432521),LessThanOrEqual(ss_sold_date_sk,2432551)),And(GreaterThanOrEqual(ss_sold_date_sk,2432887),LessThanOrEqual(ss_sold_date_sk,2432917))),And(GreaterThanOrEqual(ss_sold_date_sk,2433252),LessThanOrEqual(ss_sold_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2433617),LessThanOrEqual(ss_sold_date_sk,2433647)),And(GreaterThanOrEqual(ss_sold_date_sk,2433982),LessThanOrEqual(ss_sold_date_sk,2434012))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2434348),LessThanOrEqual(ss_sold_date_sk,2434378)),And(GreaterThanOrEqual(ss_sold_date_sk,2434713),LessThanOrEqual(ss_sold_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2435078),LessThanOrEqual(ss_sold_date_sk,2435108)),And(GreaterThanOrEqual(ss_sold_date_sk,2435443),LessThanOrEqual(ss_sold_date_sk,2435473))),And(GreaterThanOrEqual(ss_sold_date_sk,2435809),LessThanOrEqual(ss_sold_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2436174),LessThanOrEqual(ss_sold_date_sk,2436204)),And(GreaterThanOrEqual(ss_sold_date_sk,2436539),LessThanOrEqual(ss_sold_date_sk,2436569))),And(GreaterThanOrEqual(ss_sold_date_sk,2436904),LessThanOrEqual(ss_sold_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2437270),LessThanOrEqual(ss_sold_date_sk,2437300)),And(GreaterThanOrEqual(ss_sold_date_sk,2437635),LessThanOrEqual(ss_sold_date_sk,2437665))),And(GreaterThanOrEqual(ss_sold_date_sk,2438000),LessThanOrEqual(ss_sold_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2438365),LessThanOrEqual(ss_sold_date_sk,2438395)),And(GreaterThanOrEqual(ss_sold_date_sk,2438731),LessThanOrEqual(ss_sold_date_sk,2438761))),And(GreaterThanOrEqual(ss_sold_date_sk,2439096),LessThanOrEqual(ss_sold_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2439461),LessThanOrEqual(ss_sold_date_sk,2439491)),And(GreaterThanOrEqual(ss_sold_date_sk,2439826),LessThanOrEqual(ss_sold_date_sk,2439856))),And(GreaterThanOrEqual(ss_sold_date_sk,2440192),LessThanOrEqual(ss_sold_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2440557),LessThanOrEqual(ss_sold_date_sk,2440587)),And(GreaterThanOrEqual(ss_sold_date_sk,2440922),LessThanOrEqual(ss_sold_date_sk,2440952))),And(GreaterThanOrEqual(ss_sold_date_sk,2441287),LessThanOrEqual(ss_sold_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2441653),LessThanOrEqual(ss_sold_date_sk,2441683)),And(GreaterThanOrEqual(ss_sold_date_sk,2442018),LessThanOrEqual(ss_sold_date_sk,2442048))),And(GreaterThanOrEqual(ss_sold_date_sk,2442383),LessThanOrEqual(ss_sold_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2442748),LessThanOrEqual(ss_sold_date_sk,2442778)),And(GreaterThanOrEqual(ss_sold_date_sk,2443114),LessThanOrEqual(ss_sold_date_sk,2443144))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2443479),LessThanOrEqual(ss_sold_date_sk,2443509)),And(GreaterThanOrEqual(ss_sold_date_sk,2443844),LessThanOrEqual(ss_sold_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2444209),LessThanOrEqual(ss_sold_date_sk,2444239)),And(GreaterThanOrEqual(ss_sold_date_sk,2444575),LessThanOrEqual(ss_sold_date_sk,2444605))),And(GreaterThanOrEqual(ss_sold_date_sk,2444940),LessThanOrEqual(ss_sold_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2445305),LessThanOrEqual(ss_sold_date_sk,2445335)),And(GreaterThanOrEqual(ss_sold_date_sk,2445670),LessThanOrEqual(ss_sold_date_sk,2445700))),And(GreaterThanOrEqual(ss_sold_date_sk,2446036),LessThanOrEqual(ss_sold_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2446401),LessThanOrEqual(ss_sold_date_sk,2446431)),And(GreaterThanOrEqual(ss_sold_date_sk,2446766),LessThanOrEqual(ss_sold_date_sk,2446796))),And(GreaterThanOrEqual(ss_sold_date_sk,2447131),LessThanOrEqual(ss_sold_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2447497),LessThanOrEqual(ss_sold_date_sk,2447527)),And(GreaterThanOrEqual(ss_sold_date_sk,2447862),LessThanOrEqual(ss_sold_date_sk,2447892))),And(GreaterThanOrEqual(ss_sold_date_sk,2448227),LessThanOrEqual(ss_sold_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2448592),LessThanOrEqual(ss_sold_date_sk,2448622)),And(GreaterThanOrEqual(ss_sold_date_sk,2448958),LessThanOrEqual(ss_sold_date_sk,2448988))),And(GreaterThanOrEqual(ss_sold_date_sk,2449323),LessThanOrEqual(ss_sold_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2449688),LessThanOrEqual(ss_sold_date_sk,2449718)),And(GreaterThanOrEqual(ss_sold_date_sk,2450053),LessThanOrEqual(ss_sold_date_sk,2450083))),And(GreaterThanOrEqual(ss_sold_date_sk,2450419),LessThanOrEqual(ss_sold_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2450784),LessThanOrEqual(ss_sold_date_sk,2450814)),And(GreaterThanOrEqual(ss_sold_date_sk,2451149),LessThanOrEqual(ss_sold_date_sk,2451179))),And(GreaterThanOrEqual(ss_sold_date_sk,2451514),LessThanOrEqual(ss_sold_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2451880),LessThanOrEqual(ss_sold_date_sk,2451910)),And(GreaterThanOrEqual(ss_sold_date_sk,2452245),LessThanOrEqual(ss_sold_date_sk,2452275))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2452610),LessThanOrEqual(ss_sold_date_sk,2452640)),And(GreaterThanOrEqual(ss_sold_date_sk,2452975),LessThanOrEqual(ss_sold_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2453341),LessThanOrEqual(ss_sold_date_sk,2453371)),And(GreaterThanOrEqual(ss_sold_date_sk,2453706),LessThanOrEqual(ss_sold_date_sk,2453736))),And(GreaterThanOrEqual(ss_sold_date_sk,2454071),LessThanOrEqual(ss_sold_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2454436),LessThanOrEqual(ss_sold_date_sk,2454466)),And(GreaterThanOrEqual(ss_sold_date_sk,2454802),LessThanOrEqual(ss_sold_date_sk,2454832))),And(GreaterThanOrEqual(ss_sold_date_sk,2455167),LessThanOrEqual(ss_sold_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2455532),LessThanOrEqual(ss_sold_date_sk,2455562)),And(GreaterThanOrEqual(ss_sold_date_sk,2455897),LessThanOrEqual(ss_sold_date_sk,2455927))),And(GreaterThanOrEqual(ss_sold_date_sk,2456263),LessThanOrEqual(ss_sold_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2456628),LessThanOrEqual(ss_sold_date_sk,2456658)),And(GreaterThanOrEqual(ss_sold_date_sk,2456993),LessThanOrEqual(ss_sold_date_sk,2457023))),And(GreaterThanOrEqual(ss_sold_date_sk,2457358),LessThanOrEqual(ss_sold_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2457724),LessThanOrEqual(ss_sold_date_sk,2457754)),And(GreaterThanOrEqual(ss_sold_date_sk,2458089),LessThanOrEqual(ss_sold_date_sk,2458119))),And(GreaterThanOrEqual(ss_sold_date_sk,2458454),LessThanOrEqual(ss_sold_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2458819),LessThanOrEqual(ss_sold_date_sk,2458849)),And(GreaterThanOrEqual(ss_sold_date_sk,2459185),LessThanOrEqual(ss_sold_date_sk,2459215))),And(GreaterThanOrEqual(ss_sold_date_sk,2459550),LessThanOrEqual(ss_sold_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2459915),LessThanOrEqual(ss_sold_date_sk,2459945)),And(GreaterThanOrEqual(ss_sold_date_sk,2460280),LessThanOrEqual(ss_sold_date_sk,2460310))),And(GreaterThanOrEqual(ss_sold_date_sk,2460646),LessThanOrEqual(ss_sold_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461011),LessThanOrEqual(ss_sold_date_sk,2461041)),And(GreaterThanOrEqual(ss_sold_date_sk,2461376),LessThanOrEqual(ss_sold_date_sk,2461406))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461741),LessThanOrEqual(ss_sold_date_sk,2461771)),And(GreaterThanOrEqual(ss_sold_date_sk,2462107),LessThanOrEqual(ss_sold_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2462472),LessThanOrEqual(ss_sold_date_sk,2462502)),And(GreaterThanOrEqual(ss_sold_date_sk,2462837),LessThanOrEqual(ss_sold_date_sk,2462867))),And(GreaterThanOrEqual(ss_sold_date_sk,2463202),LessThanOrEqual(ss_sold_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2463568),LessThanOrEqual(ss_sold_date_sk,2463598)),And(GreaterThanOrEqual(ss_sold_date_sk,2463933),LessThanOrEqual(ss_sold_date_sk,2463963))),And(GreaterThanOrEqual(ss_sold_date_sk,2464298),LessThanOrEqual(ss_sold_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2464663),LessThanOrEqual(ss_sold_date_sk,2464693)),And(GreaterThanOrEqual(ss_sold_date_sk,2465029),LessThanOrEqual(ss_sold_date_sk,2465059))),And(GreaterThanOrEqual(ss_sold_date_sk,2465394),LessThanOrEqual(ss_sold_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2465759),LessThanOrEqual(ss_sold_date_sk,2465789)),And(GreaterThanOrEqual(ss_sold_date_sk,2466124),LessThanOrEqual(ss_sold_date_sk,2466154))),And(GreaterThanOrEqual(ss_sold_date_sk,2466490),LessThanOrEqual(ss_sold_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2466855),LessThanOrEqual(ss_sold_date_sk,2466885)),And(GreaterThanOrEqual(ss_sold_date_sk,2467220),LessThanOrEqual(ss_sold_date_sk,2467250))),And(GreaterThanOrEqual(ss_sold_date_sk,2467585),LessThanOrEqual(ss_sold_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2467951),LessThanOrEqual(ss_sold_date_sk,2467981)),And(GreaterThanOrEqual(ss_sold_date_sk,2468316),LessThanOrEqual(ss_sold_date_sk,2468346))),And(GreaterThanOrEqual(ss_sold_date_sk,2468681),LessThanOrEqual(ss_sold_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2469046),LessThanOrEqual(ss_sold_date_sk,2469076)),And(GreaterThanOrEqual(ss_sold_date_sk,2469412),LessThanOrEqual(ss_sold_date_sk,2469442))),And(GreaterThanOrEqual(ss_sold_date_sk,2469777),LessThanOrEqual(ss_sold_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470142),LessThanOrEqual(ss_sold_date_sk,2470172)),And(GreaterThanOrEqual(ss_sold_date_sk,2470507),LessThanOrEqual(ss_sold_date_sk,2470537))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470873),LessThanOrEqual(ss_sold_date_sk,2470903)),And(GreaterThanOrEqual(ss_sold_date_sk,2471238),LessThanOrEqual(ss_sold_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2471603),LessThanOrEqual(ss_sold_date_sk,2471633)),And(GreaterThanOrEqual(ss_sold_date_sk,2471968),LessThanOrEqual(ss_sold_date_sk,2471998))),And(GreaterThanOrEqual(ss_sold_date_sk,2472334),LessThanOrEqual(ss_sold_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2472699),LessThanOrEqual(ss_sold_date_sk,2472729)),And(GreaterThanOrEqual(ss_sold_date_sk,2473064),LessThanOrEqual(ss_sold_date_sk,2473094))),And(GreaterThanOrEqual(ss_sold_date_sk,2473429),LessThanOrEqual(ss_sold_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2473795),LessThanOrEqual(ss_sold_date_sk,2473825)),And(GreaterThanOrEqual(ss_sold_date_sk,2474160),LessThanOrEqual(ss_sold_date_sk,2474190))),And(GreaterThanOrEqual(ss_sold_date_sk,2474525),LessThanOrEqual(ss_sold_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2474890),LessThanOrEqual(ss_sold_date_sk,2474920)),And(GreaterThanOrEqual(ss_sold_date_sk,2475256),LessThanOrEqual(ss_sold_date_sk,2475286))),And(GreaterThanOrEqual(ss_sold_date_sk,2475621),LessThanOrEqual(ss_sold_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2475986),LessThanOrEqual(ss_sold_date_sk,2476016)),And(GreaterThanOrEqual(ss_sold_date_sk,2476351),LessThanOrEqual(ss_sold_date_sk,2476381))),And(GreaterThanOrEqual(ss_sold_date_sk,2476717),LessThanOrEqual(ss_sold_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2477082),LessThanOrEqual(ss_sold_date_sk,2477112)),And(GreaterThanOrEqual(ss_sold_date_sk,2477447),LessThanOrEqual(ss_sold_date_sk,2477477))),And(GreaterThanOrEqual(ss_sold_date_sk,2477812),LessThanOrEqual(ss_sold_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2478178),LessThanOrEqual(ss_sold_date_sk,2478208)),And(GreaterThanOrEqual(ss_sold_date_sk,2478543),LessThanOrEqual(ss_sold_date_sk,2478573))),And(GreaterThanOrEqual(ss_sold_date_sk,2478908),LessThanOrEqual(ss_sold_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2479273),LessThanOrEqual(ss_sold_date_sk,2479303)),And(GreaterThanOrEqual(ss_sold_date_sk,2479639),LessThanOrEqual(ss_sold_date_sk,2479669))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480004),LessThanOrEqual(ss_sold_date_sk,2480034)),And(GreaterThanOrEqual(ss_sold_date_sk,2480369),LessThanOrEqual(ss_sold_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480734),LessThanOrEqual(ss_sold_date_sk,2480764)),And(GreaterThanOrEqual(ss_sold_date_sk,2481100),LessThanOrEqual(ss_sold_date_sk,2481130))),And(GreaterThanOrEqual(ss_sold_date_sk,2481465),LessThanOrEqual(ss_sold_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2481830),LessThanOrEqual(ss_sold_date_sk,2481860)),And(GreaterThanOrEqual(ss_sold_date_sk,2482195),LessThanOrEqual(ss_sold_date_sk,2482225))),And(GreaterThanOrEqual(ss_sold_date_sk,2482561),LessThanOrEqual(ss_sold_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2482926),LessThanOrEqual(ss_sold_date_sk,2482956)),And(GreaterThanOrEqual(ss_sold_date_sk,2483291),LessThanOrEqual(ss_sold_date_sk,2483321))),And(GreaterThanOrEqual(ss_sold_date_sk,2483656),LessThanOrEqual(ss_sold_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2484022),LessThanOrEqual(ss_sold_date_sk,2484052)),And(GreaterThanOrEqual(ss_sold_date_sk,2484387),LessThanOrEqual(ss_sold_date_sk,2484417))),And(GreaterThanOrEqual(ss_sold_date_sk,2484752),LessThanOrEqual(ss_sold_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2485117),LessThanOrEqual(ss_sold_date_sk,2485147)),And(GreaterThanOrEqual(ss_sold_date_sk,2485483),LessThanOrEqual(ss_sold_date_sk,2485513))),And(GreaterThanOrEqual(ss_sold_date_sk,2485848),LessThanOrEqual(ss_sold_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2486213),LessThanOrEqual(ss_sold_date_sk,2486243)),And(GreaterThanOrEqual(ss_sold_date_sk,2486578),LessThanOrEqual(ss_sold_date_sk,2486608))),And(GreaterThanOrEqual(ss_sold_date_sk,2486944),LessThanOrEqual(ss_sold_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2487309),LessThanOrEqual(ss_sold_date_sk,2487339)),And(GreaterThanOrEqual(ss_sold_date_sk,2487674),LessThanOrEqual(ss_sold_date_sk,2487704))),And(GreaterThanOrEqual(ss_sold_date_sk,2488039),LessThanOrEqual(ss_sold_date_sk,2488069))))))))), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] -Condition : ((isnotnull(i_manufact_id#4) AND (i_manufact_id#4 = 436)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3] +Condition : ((((((((((((ss_sold_date_sk#1 >= 2415355) AND (ss_sold_date_sk#1 <= 2415385)) OR ((ss_sold_date_sk#1 >= 2415720) AND (ss_sold_date_sk#1 <= 2415750))) OR (((ss_sold_date_sk#1 >= 2416085) AND (ss_sold_date_sk#1 <= 2416115)) OR ((ss_sold_date_sk#1 >= 2416450) AND (ss_sold_date_sk#1 <= 2416480)))) OR ((((ss_sold_date_sk#1 >= 2416816) AND (ss_sold_date_sk#1 <= 2416846)) OR ((ss_sold_date_sk#1 >= 2417181) AND (ss_sold_date_sk#1 <= 2417211))) OR ((ss_sold_date_sk#1 >= 2417546) AND (ss_sold_date_sk#1 <= 2417576)))) OR (((((ss_sold_date_sk#1 >= 2417911) AND (ss_sold_date_sk#1 <= 2417941)) OR ((ss_sold_date_sk#1 >= 2418277) AND (ss_sold_date_sk#1 <= 2418307))) OR ((ss_sold_date_sk#1 >= 2418642) AND (ss_sold_date_sk#1 <= 2418672))) OR ((((ss_sold_date_sk#1 >= 2419007) AND (ss_sold_date_sk#1 <= 2419037)) OR ((ss_sold_date_sk#1 >= 2419372) AND (ss_sold_date_sk#1 <= 2419402))) OR ((ss_sold_date_sk#1 >= 2419738) AND (ss_sold_date_sk#1 <= 2419768))))) OR ((((((ss_sold_date_sk#1 >= 2420103) AND (ss_sold_date_sk#1 <= 2420133)) OR ((ss_sold_date_sk#1 >= 2420468) AND (ss_sold_date_sk#1 <= 2420498))) OR ((ss_sold_date_sk#1 >= 2420833) AND (ss_sold_date_sk#1 <= 2420863))) OR ((((ss_sold_date_sk#1 >= 2421199) AND (ss_sold_date_sk#1 <= 2421229)) OR ((ss_sold_date_sk#1 >= 2421564) AND (ss_sold_date_sk#1 <= 2421594))) OR ((ss_sold_date_sk#1 >= 2421929) AND (ss_sold_date_sk#1 <= 2421959)))) OR (((((ss_sold_date_sk#1 >= 2422294) AND (ss_sold_date_sk#1 <= 2422324)) OR ((ss_sold_date_sk#1 >= 2422660) AND (ss_sold_date_sk#1 <= 2422690))) OR ((ss_sold_date_sk#1 >= 2423025) AND (ss_sold_date_sk#1 <= 2423055))) OR ((((ss_sold_date_sk#1 >= 2423390) AND (ss_sold_date_sk#1 <= 2423420)) OR ((ss_sold_date_sk#1 >= 2423755) AND (ss_sold_date_sk#1 <= 2423785))) OR ((ss_sold_date_sk#1 >= 2424121) AND (ss_sold_date_sk#1 <= 2424151)))))) OR (((((((ss_sold_date_sk#1 >= 2424486) AND (ss_sold_date_sk#1 <= 2424516)) OR ((ss_sold_date_sk#1 >= 2424851) AND (ss_sold_date_sk#1 <= 2424881))) OR (((ss_sold_date_sk#1 >= 2425216) AND (ss_sold_date_sk#1 <= 2425246)) OR ((ss_sold_date_sk#1 >= 2425582) AND (ss_sold_date_sk#1 <= 2425612)))) OR ((((ss_sold_date_sk#1 >= 2425947) AND (ss_sold_date_sk#1 <= 2425977)) OR ((ss_sold_date_sk#1 >= 2426312) AND (ss_sold_date_sk#1 <= 2426342))) OR ((ss_sold_date_sk#1 >= 2426677) AND (ss_sold_date_sk#1 <= 2426707)))) OR (((((ss_sold_date_sk#1 >= 2427043) AND (ss_sold_date_sk#1 <= 2427073)) OR ((ss_sold_date_sk#1 >= 2427408) AND (ss_sold_date_sk#1 <= 2427438))) OR ((ss_sold_date_sk#1 >= 2427773) AND (ss_sold_date_sk#1 <= 2427803))) OR ((((ss_sold_date_sk#1 >= 2428138) AND (ss_sold_date_sk#1 <= 2428168)) OR ((ss_sold_date_sk#1 >= 2428504) AND (ss_sold_date_sk#1 <= 2428534))) OR ((ss_sold_date_sk#1 >= 2428869) AND (ss_sold_date_sk#1 <= 2428899))))) OR ((((((ss_sold_date_sk#1 >= 2429234) AND (ss_sold_date_sk#1 <= 2429264)) OR ((ss_sold_date_sk#1 >= 2429599) AND (ss_sold_date_sk#1 <= 2429629))) OR ((ss_sold_date_sk#1 >= 2429965) AND (ss_sold_date_sk#1 <= 2429995))) OR ((((ss_sold_date_sk#1 >= 2430330) AND (ss_sold_date_sk#1 <= 2430360)) OR ((ss_sold_date_sk#1 >= 2430695) AND (ss_sold_date_sk#1 <= 2430725))) OR ((ss_sold_date_sk#1 >= 2431060) AND (ss_sold_date_sk#1 <= 2431090)))) OR (((((ss_sold_date_sk#1 >= 2431426) AND (ss_sold_date_sk#1 <= 2431456)) OR ((ss_sold_date_sk#1 >= 2431791) AND (ss_sold_date_sk#1 <= 2431821))) OR ((ss_sold_date_sk#1 >= 2432156) AND (ss_sold_date_sk#1 <= 2432186))) OR ((((ss_sold_date_sk#1 >= 2432521) AND (ss_sold_date_sk#1 <= 2432551)) OR ((ss_sold_date_sk#1 >= 2432887) AND (ss_sold_date_sk#1 <= 2432917))) OR ((ss_sold_date_sk#1 >= 2433252) AND (ss_sold_date_sk#1 <= 2433282))))))) OR ((((((((ss_sold_date_sk#1 >= 2433617) AND (ss_sold_date_sk#1 <= 2433647)) OR ((ss_sold_date_sk#1 >= 2433982) AND (ss_sold_date_sk#1 <= 2434012))) OR (((ss_sold_date_sk#1 >= 2434348) AND (ss_sold_date_sk#1 <= 2434378)) OR ((ss_sold_date_sk#1 >= 2434713) AND (ss_sold_date_sk#1 <= 2434743)))) OR ((((ss_sold_date_sk#1 >= 2435078) AND (ss_sold_date_sk#1 <= 2435108)) OR ((ss_sold_date_sk#1 >= 2435443) AND (ss_sold_date_sk#1 <= 2435473))) OR ((ss_sold_date_sk#1 >= 2435809) AND (ss_sold_date_sk#1 <= 2435839)))) OR (((((ss_sold_date_sk#1 >= 2436174) AND (ss_sold_date_sk#1 <= 2436204)) OR ((ss_sold_date_sk#1 >= 2436539) AND (ss_sold_date_sk#1 <= 2436569))) OR ((ss_sold_date_sk#1 >= 2436904) AND (ss_sold_date_sk#1 <= 2436934))) OR ((((ss_sold_date_sk#1 >= 2437270) AND (ss_sold_date_sk#1 <= 2437300)) OR ((ss_sold_date_sk#1 >= 2437635) AND (ss_sold_date_sk#1 <= 2437665))) OR ((ss_sold_date_sk#1 >= 2438000) AND (ss_sold_date_sk#1 <= 2438030))))) OR ((((((ss_sold_date_sk#1 >= 2438365) AND (ss_sold_date_sk#1 <= 2438395)) OR ((ss_sold_date_sk#1 >= 2438731) AND (ss_sold_date_sk#1 <= 2438761))) OR ((ss_sold_date_sk#1 >= 2439096) AND (ss_sold_date_sk#1 <= 2439126))) OR ((((ss_sold_date_sk#1 >= 2439461) AND (ss_sold_date_sk#1 <= 2439491)) OR ((ss_sold_date_sk#1 >= 2439826) AND (ss_sold_date_sk#1 <= 2439856))) OR ((ss_sold_date_sk#1 >= 2440192) AND (ss_sold_date_sk#1 <= 2440222)))) OR (((((ss_sold_date_sk#1 >= 2440557) AND (ss_sold_date_sk#1 <= 2440587)) OR ((ss_sold_date_sk#1 >= 2440922) AND (ss_sold_date_sk#1 <= 2440952))) OR ((ss_sold_date_sk#1 >= 2441287) AND (ss_sold_date_sk#1 <= 2441317))) OR ((((ss_sold_date_sk#1 >= 2441653) AND (ss_sold_date_sk#1 <= 2441683)) OR ((ss_sold_date_sk#1 >= 2442018) AND (ss_sold_date_sk#1 <= 2442048))) OR ((ss_sold_date_sk#1 >= 2442383) AND (ss_sold_date_sk#1 <= 2442413)))))) OR (((((((ss_sold_date_sk#1 >= 2442748) AND (ss_sold_date_sk#1 <= 2442778)) OR ((ss_sold_date_sk#1 >= 2443114) AND (ss_sold_date_sk#1 <= 2443144))) OR (((ss_sold_date_sk#1 >= 2443479) AND (ss_sold_date_sk#1 <= 2443509)) OR ((ss_sold_date_sk#1 >= 2443844) AND (ss_sold_date_sk#1 <= 2443874)))) OR ((((ss_sold_date_sk#1 >= 2444209) AND (ss_sold_date_sk#1 <= 2444239)) OR ((ss_sold_date_sk#1 >= 2444575) AND (ss_sold_date_sk#1 <= 2444605))) OR ((ss_sold_date_sk#1 >= 2444940) AND (ss_sold_date_sk#1 <= 2444970)))) OR (((((ss_sold_date_sk#1 >= 2445305) AND (ss_sold_date_sk#1 <= 2445335)) OR ((ss_sold_date_sk#1 >= 2445670) AND (ss_sold_date_sk#1 <= 2445700))) OR ((ss_sold_date_sk#1 >= 2446036) AND (ss_sold_date_sk#1 <= 2446066))) OR ((((ss_sold_date_sk#1 >= 2446401) AND (ss_sold_date_sk#1 <= 2446431)) OR ((ss_sold_date_sk#1 >= 2446766) AND (ss_sold_date_sk#1 <= 2446796))) OR ((ss_sold_date_sk#1 >= 2447131) AND (ss_sold_date_sk#1 <= 2447161))))) OR ((((((ss_sold_date_sk#1 >= 2447497) AND (ss_sold_date_sk#1 <= 2447527)) OR ((ss_sold_date_sk#1 >= 2447862) AND (ss_sold_date_sk#1 <= 2447892))) OR ((ss_sold_date_sk#1 >= 2448227) AND (ss_sold_date_sk#1 <= 2448257))) OR ((((ss_sold_date_sk#1 >= 2448592) AND (ss_sold_date_sk#1 <= 2448622)) OR ((ss_sold_date_sk#1 >= 2448958) AND (ss_sold_date_sk#1 <= 2448988))) OR ((ss_sold_date_sk#1 >= 2449323) AND (ss_sold_date_sk#1 <= 2449353)))) OR (((((ss_sold_date_sk#1 >= 2449688) AND (ss_sold_date_sk#1 <= 2449718)) OR ((ss_sold_date_sk#1 >= 2450053) AND (ss_sold_date_sk#1 <= 2450083))) OR ((ss_sold_date_sk#1 >= 2450419) AND (ss_sold_date_sk#1 <= 2450449))) OR ((((ss_sold_date_sk#1 >= 2450784) AND (ss_sold_date_sk#1 <= 2450814)) OR ((ss_sold_date_sk#1 >= 2451149) AND (ss_sold_date_sk#1 <= 2451179))) OR ((ss_sold_date_sk#1 >= 2451514) AND (ss_sold_date_sk#1 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#1 >= 2451880) AND (ss_sold_date_sk#1 <= 2451910)) OR ((ss_sold_date_sk#1 >= 2452245) AND (ss_sold_date_sk#1 <= 2452275))) OR (((ss_sold_date_sk#1 >= 2452610) AND (ss_sold_date_sk#1 <= 2452640)) OR ((ss_sold_date_sk#1 >= 2452975) AND (ss_sold_date_sk#1 <= 2453005)))) OR ((((ss_sold_date_sk#1 >= 2453341) AND (ss_sold_date_sk#1 <= 2453371)) OR ((ss_sold_date_sk#1 >= 2453706) AND (ss_sold_date_sk#1 <= 2453736))) OR ((ss_sold_date_sk#1 >= 2454071) AND (ss_sold_date_sk#1 <= 2454101)))) OR (((((ss_sold_date_sk#1 >= 2454436) AND (ss_sold_date_sk#1 <= 2454466)) OR ((ss_sold_date_sk#1 >= 2454802) AND (ss_sold_date_sk#1 <= 2454832))) OR ((ss_sold_date_sk#1 >= 2455167) AND (ss_sold_date_sk#1 <= 2455197))) OR ((((ss_sold_date_sk#1 >= 2455532) AND (ss_sold_date_sk#1 <= 2455562)) OR ((ss_sold_date_sk#1 >= 2455897) AND (ss_sold_date_sk#1 <= 2455927))) OR ((ss_sold_date_sk#1 >= 2456263) AND (ss_sold_date_sk#1 <= 2456293))))) OR ((((((ss_sold_date_sk#1 >= 2456628) AND (ss_sold_date_sk#1 <= 2456658)) OR ((ss_sold_date_sk#1 >= 2456993) AND (ss_sold_date_sk#1 <= 2457023))) OR ((ss_sold_date_sk#1 >= 2457358) AND (ss_sold_date_sk#1 <= 2457388))) OR ((((ss_sold_date_sk#1 >= 2457724) AND (ss_sold_date_sk#1 <= 2457754)) OR ((ss_sold_date_sk#1 >= 2458089) AND (ss_sold_date_sk#1 <= 2458119))) OR ((ss_sold_date_sk#1 >= 2458454) AND (ss_sold_date_sk#1 <= 2458484)))) OR (((((ss_sold_date_sk#1 >= 2458819) AND (ss_sold_date_sk#1 <= 2458849)) OR ((ss_sold_date_sk#1 >= 2459185) AND (ss_sold_date_sk#1 <= 2459215))) OR ((ss_sold_date_sk#1 >= 2459550) AND (ss_sold_date_sk#1 <= 2459580))) OR ((((ss_sold_date_sk#1 >= 2459915) AND (ss_sold_date_sk#1 <= 2459945)) OR ((ss_sold_date_sk#1 >= 2460280) AND (ss_sold_date_sk#1 <= 2460310))) OR ((ss_sold_date_sk#1 >= 2460646) AND (ss_sold_date_sk#1 <= 2460676)))))) OR (((((((ss_sold_date_sk#1 >= 2461011) AND (ss_sold_date_sk#1 <= 2461041)) OR ((ss_sold_date_sk#1 >= 2461376) AND (ss_sold_date_sk#1 <= 2461406))) OR (((ss_sold_date_sk#1 >= 2461741) AND (ss_sold_date_sk#1 <= 2461771)) OR ((ss_sold_date_sk#1 >= 2462107) AND (ss_sold_date_sk#1 <= 2462137)))) OR ((((ss_sold_date_sk#1 >= 2462472) AND (ss_sold_date_sk#1 <= 2462502)) OR ((ss_sold_date_sk#1 >= 2462837) AND (ss_sold_date_sk#1 <= 2462867))) OR ((ss_sold_date_sk#1 >= 2463202) AND (ss_sold_date_sk#1 <= 2463232)))) OR (((((ss_sold_date_sk#1 >= 2463568) AND (ss_sold_date_sk#1 <= 2463598)) OR ((ss_sold_date_sk#1 >= 2463933) AND (ss_sold_date_sk#1 <= 2463963))) OR ((ss_sold_date_sk#1 >= 2464298) AND (ss_sold_date_sk#1 <= 2464328))) OR ((((ss_sold_date_sk#1 >= 2464663) AND (ss_sold_date_sk#1 <= 2464693)) OR ((ss_sold_date_sk#1 >= 2465029) AND (ss_sold_date_sk#1 <= 2465059))) OR ((ss_sold_date_sk#1 >= 2465394) AND (ss_sold_date_sk#1 <= 2465424))))) OR ((((((ss_sold_date_sk#1 >= 2465759) AND (ss_sold_date_sk#1 <= 2465789)) OR ((ss_sold_date_sk#1 >= 2466124) AND (ss_sold_date_sk#1 <= 2466154))) OR ((ss_sold_date_sk#1 >= 2466490) AND (ss_sold_date_sk#1 <= 2466520))) OR ((((ss_sold_date_sk#1 >= 2466855) AND (ss_sold_date_sk#1 <= 2466885)) OR ((ss_sold_date_sk#1 >= 2467220) AND (ss_sold_date_sk#1 <= 2467250))) OR ((ss_sold_date_sk#1 >= 2467585) AND (ss_sold_date_sk#1 <= 2467615)))) OR (((((ss_sold_date_sk#1 >= 2467951) AND (ss_sold_date_sk#1 <= 2467981)) OR ((ss_sold_date_sk#1 >= 2468316) AND (ss_sold_date_sk#1 <= 2468346))) OR ((ss_sold_date_sk#1 >= 2468681) AND (ss_sold_date_sk#1 <= 2468711))) OR ((((ss_sold_date_sk#1 >= 2469046) AND (ss_sold_date_sk#1 <= 2469076)) OR ((ss_sold_date_sk#1 >= 2469412) AND (ss_sold_date_sk#1 <= 2469442))) OR ((ss_sold_date_sk#1 >= 2469777) AND (ss_sold_date_sk#1 <= 2469807))))))) OR ((((((((ss_sold_date_sk#1 >= 2470142) AND (ss_sold_date_sk#1 <= 2470172)) OR ((ss_sold_date_sk#1 >= 2470507) AND (ss_sold_date_sk#1 <= 2470537))) OR (((ss_sold_date_sk#1 >= 2470873) AND (ss_sold_date_sk#1 <= 2470903)) OR ((ss_sold_date_sk#1 >= 2471238) AND (ss_sold_date_sk#1 <= 2471268)))) OR ((((ss_sold_date_sk#1 >= 2471603) AND (ss_sold_date_sk#1 <= 2471633)) OR ((ss_sold_date_sk#1 >= 2471968) AND (ss_sold_date_sk#1 <= 2471998))) OR ((ss_sold_date_sk#1 >= 2472334) AND (ss_sold_date_sk#1 <= 2472364)))) OR (((((ss_sold_date_sk#1 >= 2472699) AND (ss_sold_date_sk#1 <= 2472729)) OR ((ss_sold_date_sk#1 >= 2473064) AND (ss_sold_date_sk#1 <= 2473094))) OR ((ss_sold_date_sk#1 >= 2473429) AND (ss_sold_date_sk#1 <= 2473459))) OR ((((ss_sold_date_sk#1 >= 2473795) AND (ss_sold_date_sk#1 <= 2473825)) OR ((ss_sold_date_sk#1 >= 2474160) AND (ss_sold_date_sk#1 <= 2474190))) OR ((ss_sold_date_sk#1 >= 2474525) AND (ss_sold_date_sk#1 <= 2474555))))) OR ((((((ss_sold_date_sk#1 >= 2474890) AND (ss_sold_date_sk#1 <= 2474920)) OR ((ss_sold_date_sk#1 >= 2475256) AND (ss_sold_date_sk#1 <= 2475286))) OR ((ss_sold_date_sk#1 >= 2475621) AND (ss_sold_date_sk#1 <= 2475651))) OR ((((ss_sold_date_sk#1 >= 2475986) AND (ss_sold_date_sk#1 <= 2476016)) OR ((ss_sold_date_sk#1 >= 2476351) AND (ss_sold_date_sk#1 <= 2476381))) OR ((ss_sold_date_sk#1 >= 2476717) AND (ss_sold_date_sk#1 <= 2476747)))) OR (((((ss_sold_date_sk#1 >= 2477082) AND (ss_sold_date_sk#1 <= 2477112)) OR ((ss_sold_date_sk#1 >= 2477447) AND (ss_sold_date_sk#1 <= 2477477))) OR ((ss_sold_date_sk#1 >= 2477812) AND (ss_sold_date_sk#1 <= 2477842))) OR ((((ss_sold_date_sk#1 >= 2478178) AND (ss_sold_date_sk#1 <= 2478208)) OR ((ss_sold_date_sk#1 >= 2478543) AND (ss_sold_date_sk#1 <= 2478573))) OR ((ss_sold_date_sk#1 >= 2478908) AND (ss_sold_date_sk#1 <= 2478938)))))) OR (((((((ss_sold_date_sk#1 >= 2479273) AND (ss_sold_date_sk#1 <= 2479303)) OR ((ss_sold_date_sk#1 >= 2479639) AND (ss_sold_date_sk#1 <= 2479669))) OR (((ss_sold_date_sk#1 >= 2480004) AND (ss_sold_date_sk#1 <= 2480034)) OR ((ss_sold_date_sk#1 >= 2480369) AND (ss_sold_date_sk#1 <= 2480399)))) OR ((((ss_sold_date_sk#1 >= 2480734) AND (ss_sold_date_sk#1 <= 2480764)) OR ((ss_sold_date_sk#1 >= 2481100) AND (ss_sold_date_sk#1 <= 2481130))) OR ((ss_sold_date_sk#1 >= 2481465) AND (ss_sold_date_sk#1 <= 2481495)))) OR (((((ss_sold_date_sk#1 >= 2481830) AND (ss_sold_date_sk#1 <= 2481860)) OR ((ss_sold_date_sk#1 >= 2482195) AND (ss_sold_date_sk#1 <= 2482225))) OR ((ss_sold_date_sk#1 >= 2482561) AND (ss_sold_date_sk#1 <= 2482591))) OR ((((ss_sold_date_sk#1 >= 2482926) AND (ss_sold_date_sk#1 <= 2482956)) OR ((ss_sold_date_sk#1 >= 2483291) AND (ss_sold_date_sk#1 <= 2483321))) OR ((ss_sold_date_sk#1 >= 2483656) AND (ss_sold_date_sk#1 <= 2483686))))) OR ((((((ss_sold_date_sk#1 >= 2484022) AND (ss_sold_date_sk#1 <= 2484052)) OR ((ss_sold_date_sk#1 >= 2484387) AND (ss_sold_date_sk#1 <= 2484417))) OR ((ss_sold_date_sk#1 >= 2484752) AND (ss_sold_date_sk#1 <= 2484782))) OR ((((ss_sold_date_sk#1 >= 2485117) AND (ss_sold_date_sk#1 <= 2485147)) OR ((ss_sold_date_sk#1 >= 2485483) AND (ss_sold_date_sk#1 <= 2485513))) OR ((ss_sold_date_sk#1 >= 2485848) AND (ss_sold_date_sk#1 <= 2485878)))) OR (((((ss_sold_date_sk#1 >= 2486213) AND (ss_sold_date_sk#1 <= 2486243)) OR ((ss_sold_date_sk#1 >= 2486578) AND (ss_sold_date_sk#1 <= 2486608))) OR ((ss_sold_date_sk#1 >= 2486944) AND (ss_sold_date_sk#1 <= 2486974))) OR ((((ss_sold_date_sk#1 >= 2487309) AND (ss_sold_date_sk#1 <= 2487339)) OR ((ss_sold_date_sk#1 >= 2487674) AND (ss_sold_date_sk#1 <= 2487704))) OR ((ss_sold_date_sk#1 >= 2488039) AND (ss_sold_date_sk#1 <= 2488069))))))))) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(4) Scan parquet default.item +Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2415355),LessThanOrEqual(ss_sold_date_sk,2415385)),And(GreaterThanOrEqual(ss_sold_date_sk,2415720),LessThanOrEqual(ss_sold_date_sk,2415750))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416085),LessThanOrEqual(ss_sold_date_sk,2416115)),And(GreaterThanOrEqual(ss_sold_date_sk,2416450),LessThanOrEqual(ss_sold_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2416816),LessThanOrEqual(ss_sold_date_sk,2416846)),And(GreaterThanOrEqual(ss_sold_date_sk,2417181),LessThanOrEqual(ss_sold_date_sk,2417211))),And(GreaterThanOrEqual(ss_sold_date_sk,2417546),LessThanOrEqual(ss_sold_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2417911),LessThanOrEqual(ss_sold_date_sk,2417941)),And(GreaterThanOrEqual(ss_sold_date_sk,2418277),LessThanOrEqual(ss_sold_date_sk,2418307))),And(GreaterThanOrEqual(ss_sold_date_sk,2418642),LessThanOrEqual(ss_sold_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2419007),LessThanOrEqual(ss_sold_date_sk,2419037)),And(GreaterThanOrEqual(ss_sold_date_sk,2419372),LessThanOrEqual(ss_sold_date_sk,2419402))),And(GreaterThanOrEqual(ss_sold_date_sk,2419738),LessThanOrEqual(ss_sold_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2420103),LessThanOrEqual(ss_sold_date_sk,2420133)),And(GreaterThanOrEqual(ss_sold_date_sk,2420468),LessThanOrEqual(ss_sold_date_sk,2420498))),And(GreaterThanOrEqual(ss_sold_date_sk,2420833),LessThanOrEqual(ss_sold_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2421199),LessThanOrEqual(ss_sold_date_sk,2421229)),And(GreaterThanOrEqual(ss_sold_date_sk,2421564),LessThanOrEqual(ss_sold_date_sk,2421594))),And(GreaterThanOrEqual(ss_sold_date_sk,2421929),LessThanOrEqual(ss_sold_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2422294),LessThanOrEqual(ss_sold_date_sk,2422324)),And(GreaterThanOrEqual(ss_sold_date_sk,2422660),LessThanOrEqual(ss_sold_date_sk,2422690))),And(GreaterThanOrEqual(ss_sold_date_sk,2423025),LessThanOrEqual(ss_sold_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2423390),LessThanOrEqual(ss_sold_date_sk,2423420)),And(GreaterThanOrEqual(ss_sold_date_sk,2423755),LessThanOrEqual(ss_sold_date_sk,2423785))),And(GreaterThanOrEqual(ss_sold_date_sk,2424121),LessThanOrEqual(ss_sold_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2424486),LessThanOrEqual(ss_sold_date_sk,2424516)),And(GreaterThanOrEqual(ss_sold_date_sk,2424851),LessThanOrEqual(ss_sold_date_sk,2424881))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425216),LessThanOrEqual(ss_sold_date_sk,2425246)),And(GreaterThanOrEqual(ss_sold_date_sk,2425582),LessThanOrEqual(ss_sold_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2425947),LessThanOrEqual(ss_sold_date_sk,2425977)),And(GreaterThanOrEqual(ss_sold_date_sk,2426312),LessThanOrEqual(ss_sold_date_sk,2426342))),And(GreaterThanOrEqual(ss_sold_date_sk,2426677),LessThanOrEqual(ss_sold_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2427043),LessThanOrEqual(ss_sold_date_sk,2427073)),And(GreaterThanOrEqual(ss_sold_date_sk,2427408),LessThanOrEqual(ss_sold_date_sk,2427438))),And(GreaterThanOrEqual(ss_sold_date_sk,2427773),LessThanOrEqual(ss_sold_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2428138),LessThanOrEqual(ss_sold_date_sk,2428168)),And(GreaterThanOrEqual(ss_sold_date_sk,2428504),LessThanOrEqual(ss_sold_date_sk,2428534))),And(GreaterThanOrEqual(ss_sold_date_sk,2428869),LessThanOrEqual(ss_sold_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2429234),LessThanOrEqual(ss_sold_date_sk,2429264)),And(GreaterThanOrEqual(ss_sold_date_sk,2429599),LessThanOrEqual(ss_sold_date_sk,2429629))),And(GreaterThanOrEqual(ss_sold_date_sk,2429965),LessThanOrEqual(ss_sold_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2430330),LessThanOrEqual(ss_sold_date_sk,2430360)),And(GreaterThanOrEqual(ss_sold_date_sk,2430695),LessThanOrEqual(ss_sold_date_sk,2430725))),And(GreaterThanOrEqual(ss_sold_date_sk,2431060),LessThanOrEqual(ss_sold_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2431426),LessThanOrEqual(ss_sold_date_sk,2431456)),And(GreaterThanOrEqual(ss_sold_date_sk,2431791),LessThanOrEqual(ss_sold_date_sk,2431821))),And(GreaterThanOrEqual(ss_sold_date_sk,2432156),LessThanOrEqual(ss_sold_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2432521),LessThanOrEqual(ss_sold_date_sk,2432551)),And(GreaterThanOrEqual(ss_sold_date_sk,2432887),LessThanOrEqual(ss_sold_date_sk,2432917))),And(GreaterThanOrEqual(ss_sold_date_sk,2433252),LessThanOrEqual(ss_sold_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2433617),LessThanOrEqual(ss_sold_date_sk,2433647)),And(GreaterThanOrEqual(ss_sold_date_sk,2433982),LessThanOrEqual(ss_sold_date_sk,2434012))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2434348),LessThanOrEqual(ss_sold_date_sk,2434378)),And(GreaterThanOrEqual(ss_sold_date_sk,2434713),LessThanOrEqual(ss_sold_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2435078),LessThanOrEqual(ss_sold_date_sk,2435108)),And(GreaterThanOrEqual(ss_sold_date_sk,2435443),LessThanOrEqual(ss_sold_date_sk,2435473))),And(GreaterThanOrEqual(ss_sold_date_sk,2435809),LessThanOrEqual(ss_sold_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2436174),LessThanOrEqual(ss_sold_date_sk,2436204)),And(GreaterThanOrEqual(ss_sold_date_sk,2436539),LessThanOrEqual(ss_sold_date_sk,2436569))),And(GreaterThanOrEqual(ss_sold_date_sk,2436904),LessThanOrEqual(ss_sold_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2437270),LessThanOrEqual(ss_sold_date_sk,2437300)),And(GreaterThanOrEqual(ss_sold_date_sk,2437635),LessThanOrEqual(ss_sold_date_sk,2437665))),And(GreaterThanOrEqual(ss_sold_date_sk,2438000),LessThanOrEqual(ss_sold_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2438365),LessThanOrEqual(ss_sold_date_sk,2438395)),And(GreaterThanOrEqual(ss_sold_date_sk,2438731),LessThanOrEqual(ss_sold_date_sk,2438761))),And(GreaterThanOrEqual(ss_sold_date_sk,2439096),LessThanOrEqual(ss_sold_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2439461),LessThanOrEqual(ss_sold_date_sk,2439491)),And(GreaterThanOrEqual(ss_sold_date_sk,2439826),LessThanOrEqual(ss_sold_date_sk,2439856))),And(GreaterThanOrEqual(ss_sold_date_sk,2440192),LessThanOrEqual(ss_sold_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2440557),LessThanOrEqual(ss_sold_date_sk,2440587)),And(GreaterThanOrEqual(ss_sold_date_sk,2440922),LessThanOrEqual(ss_sold_date_sk,2440952))),And(GreaterThanOrEqual(ss_sold_date_sk,2441287),LessThanOrEqual(ss_sold_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2441653),LessThanOrEqual(ss_sold_date_sk,2441683)),And(GreaterThanOrEqual(ss_sold_date_sk,2442018),LessThanOrEqual(ss_sold_date_sk,2442048))),And(GreaterThanOrEqual(ss_sold_date_sk,2442383),LessThanOrEqual(ss_sold_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2442748),LessThanOrEqual(ss_sold_date_sk,2442778)),And(GreaterThanOrEqual(ss_sold_date_sk,2443114),LessThanOrEqual(ss_sold_date_sk,2443144))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2443479),LessThanOrEqual(ss_sold_date_sk,2443509)),And(GreaterThanOrEqual(ss_sold_date_sk,2443844),LessThanOrEqual(ss_sold_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2444209),LessThanOrEqual(ss_sold_date_sk,2444239)),And(GreaterThanOrEqual(ss_sold_date_sk,2444575),LessThanOrEqual(ss_sold_date_sk,2444605))),And(GreaterThanOrEqual(ss_sold_date_sk,2444940),LessThanOrEqual(ss_sold_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2445305),LessThanOrEqual(ss_sold_date_sk,2445335)),And(GreaterThanOrEqual(ss_sold_date_sk,2445670),LessThanOrEqual(ss_sold_date_sk,2445700))),And(GreaterThanOrEqual(ss_sold_date_sk,2446036),LessThanOrEqual(ss_sold_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2446401),LessThanOrEqual(ss_sold_date_sk,2446431)),And(GreaterThanOrEqual(ss_sold_date_sk,2446766),LessThanOrEqual(ss_sold_date_sk,2446796))),And(GreaterThanOrEqual(ss_sold_date_sk,2447131),LessThanOrEqual(ss_sold_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2447497),LessThanOrEqual(ss_sold_date_sk,2447527)),And(GreaterThanOrEqual(ss_sold_date_sk,2447862),LessThanOrEqual(ss_sold_date_sk,2447892))),And(GreaterThanOrEqual(ss_sold_date_sk,2448227),LessThanOrEqual(ss_sold_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2448592),LessThanOrEqual(ss_sold_date_sk,2448622)),And(GreaterThanOrEqual(ss_sold_date_sk,2448958),LessThanOrEqual(ss_sold_date_sk,2448988))),And(GreaterThanOrEqual(ss_sold_date_sk,2449323),LessThanOrEqual(ss_sold_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2449688),LessThanOrEqual(ss_sold_date_sk,2449718)),And(GreaterThanOrEqual(ss_sold_date_sk,2450053),LessThanOrEqual(ss_sold_date_sk,2450083))),And(GreaterThanOrEqual(ss_sold_date_sk,2450419),LessThanOrEqual(ss_sold_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2450784),LessThanOrEqual(ss_sold_date_sk,2450814)),And(GreaterThanOrEqual(ss_sold_date_sk,2451149),LessThanOrEqual(ss_sold_date_sk,2451179))),And(GreaterThanOrEqual(ss_sold_date_sk,2451514),LessThanOrEqual(ss_sold_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2451880),LessThanOrEqual(ss_sold_date_sk,2451910)),And(GreaterThanOrEqual(ss_sold_date_sk,2452245),LessThanOrEqual(ss_sold_date_sk,2452275))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2452610),LessThanOrEqual(ss_sold_date_sk,2452640)),And(GreaterThanOrEqual(ss_sold_date_sk,2452975),LessThanOrEqual(ss_sold_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2453341),LessThanOrEqual(ss_sold_date_sk,2453371)),And(GreaterThanOrEqual(ss_sold_date_sk,2453706),LessThanOrEqual(ss_sold_date_sk,2453736))),And(GreaterThanOrEqual(ss_sold_date_sk,2454071),LessThanOrEqual(ss_sold_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2454436),LessThanOrEqual(ss_sold_date_sk,2454466)),And(GreaterThanOrEqual(ss_sold_date_sk,2454802),LessThanOrEqual(ss_sold_date_sk,2454832))),And(GreaterThanOrEqual(ss_sold_date_sk,2455167),LessThanOrEqual(ss_sold_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2455532),LessThanOrEqual(ss_sold_date_sk,2455562)),And(GreaterThanOrEqual(ss_sold_date_sk,2455897),LessThanOrEqual(ss_sold_date_sk,2455927))),And(GreaterThanOrEqual(ss_sold_date_sk,2456263),LessThanOrEqual(ss_sold_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2456628),LessThanOrEqual(ss_sold_date_sk,2456658)),And(GreaterThanOrEqual(ss_sold_date_sk,2456993),LessThanOrEqual(ss_sold_date_sk,2457023))),And(GreaterThanOrEqual(ss_sold_date_sk,2457358),LessThanOrEqual(ss_sold_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2457724),LessThanOrEqual(ss_sold_date_sk,2457754)),And(GreaterThanOrEqual(ss_sold_date_sk,2458089),LessThanOrEqual(ss_sold_date_sk,2458119))),And(GreaterThanOrEqual(ss_sold_date_sk,2458454),LessThanOrEqual(ss_sold_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2458819),LessThanOrEqual(ss_sold_date_sk,2458849)),And(GreaterThanOrEqual(ss_sold_date_sk,2459185),LessThanOrEqual(ss_sold_date_sk,2459215))),And(GreaterThanOrEqual(ss_sold_date_sk,2459550),LessThanOrEqual(ss_sold_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2459915),LessThanOrEqual(ss_sold_date_sk,2459945)),And(GreaterThanOrEqual(ss_sold_date_sk,2460280),LessThanOrEqual(ss_sold_date_sk,2460310))),And(GreaterThanOrEqual(ss_sold_date_sk,2460646),LessThanOrEqual(ss_sold_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461011),LessThanOrEqual(ss_sold_date_sk,2461041)),And(GreaterThanOrEqual(ss_sold_date_sk,2461376),LessThanOrEqual(ss_sold_date_sk,2461406))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2461741),LessThanOrEqual(ss_sold_date_sk,2461771)),And(GreaterThanOrEqual(ss_sold_date_sk,2462107),LessThanOrEqual(ss_sold_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2462472),LessThanOrEqual(ss_sold_date_sk,2462502)),And(GreaterThanOrEqual(ss_sold_date_sk,2462837),LessThanOrEqual(ss_sold_date_sk,2462867))),And(GreaterThanOrEqual(ss_sold_date_sk,2463202),LessThanOrEqual(ss_sold_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2463568),LessThanOrEqual(ss_sold_date_sk,2463598)),And(GreaterThanOrEqual(ss_sold_date_sk,2463933),LessThanOrEqual(ss_sold_date_sk,2463963))),And(GreaterThanOrEqual(ss_sold_date_sk,2464298),LessThanOrEqual(ss_sold_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2464663),LessThanOrEqual(ss_sold_date_sk,2464693)),And(GreaterThanOrEqual(ss_sold_date_sk,2465029),LessThanOrEqual(ss_sold_date_sk,2465059))),And(GreaterThanOrEqual(ss_sold_date_sk,2465394),LessThanOrEqual(ss_sold_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2465759),LessThanOrEqual(ss_sold_date_sk,2465789)),And(GreaterThanOrEqual(ss_sold_date_sk,2466124),LessThanOrEqual(ss_sold_date_sk,2466154))),And(GreaterThanOrEqual(ss_sold_date_sk,2466490),LessThanOrEqual(ss_sold_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2466855),LessThanOrEqual(ss_sold_date_sk,2466885)),And(GreaterThanOrEqual(ss_sold_date_sk,2467220),LessThanOrEqual(ss_sold_date_sk,2467250))),And(GreaterThanOrEqual(ss_sold_date_sk,2467585),LessThanOrEqual(ss_sold_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2467951),LessThanOrEqual(ss_sold_date_sk,2467981)),And(GreaterThanOrEqual(ss_sold_date_sk,2468316),LessThanOrEqual(ss_sold_date_sk,2468346))),And(GreaterThanOrEqual(ss_sold_date_sk,2468681),LessThanOrEqual(ss_sold_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2469046),LessThanOrEqual(ss_sold_date_sk,2469076)),And(GreaterThanOrEqual(ss_sold_date_sk,2469412),LessThanOrEqual(ss_sold_date_sk,2469442))),And(GreaterThanOrEqual(ss_sold_date_sk,2469777),LessThanOrEqual(ss_sold_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470142),LessThanOrEqual(ss_sold_date_sk,2470172)),And(GreaterThanOrEqual(ss_sold_date_sk,2470507),LessThanOrEqual(ss_sold_date_sk,2470537))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2470873),LessThanOrEqual(ss_sold_date_sk,2470903)),And(GreaterThanOrEqual(ss_sold_date_sk,2471238),LessThanOrEqual(ss_sold_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2471603),LessThanOrEqual(ss_sold_date_sk,2471633)),And(GreaterThanOrEqual(ss_sold_date_sk,2471968),LessThanOrEqual(ss_sold_date_sk,2471998))),And(GreaterThanOrEqual(ss_sold_date_sk,2472334),LessThanOrEqual(ss_sold_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2472699),LessThanOrEqual(ss_sold_date_sk,2472729)),And(GreaterThanOrEqual(ss_sold_date_sk,2473064),LessThanOrEqual(ss_sold_date_sk,2473094))),And(GreaterThanOrEqual(ss_sold_date_sk,2473429),LessThanOrEqual(ss_sold_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2473795),LessThanOrEqual(ss_sold_date_sk,2473825)),And(GreaterThanOrEqual(ss_sold_date_sk,2474160),LessThanOrEqual(ss_sold_date_sk,2474190))),And(GreaterThanOrEqual(ss_sold_date_sk,2474525),LessThanOrEqual(ss_sold_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2474890),LessThanOrEqual(ss_sold_date_sk,2474920)),And(GreaterThanOrEqual(ss_sold_date_sk,2475256),LessThanOrEqual(ss_sold_date_sk,2475286))),And(GreaterThanOrEqual(ss_sold_date_sk,2475621),LessThanOrEqual(ss_sold_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2475986),LessThanOrEqual(ss_sold_date_sk,2476016)),And(GreaterThanOrEqual(ss_sold_date_sk,2476351),LessThanOrEqual(ss_sold_date_sk,2476381))),And(GreaterThanOrEqual(ss_sold_date_sk,2476717),LessThanOrEqual(ss_sold_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2477082),LessThanOrEqual(ss_sold_date_sk,2477112)),And(GreaterThanOrEqual(ss_sold_date_sk,2477447),LessThanOrEqual(ss_sold_date_sk,2477477))),And(GreaterThanOrEqual(ss_sold_date_sk,2477812),LessThanOrEqual(ss_sold_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2478178),LessThanOrEqual(ss_sold_date_sk,2478208)),And(GreaterThanOrEqual(ss_sold_date_sk,2478543),LessThanOrEqual(ss_sold_date_sk,2478573))),And(GreaterThanOrEqual(ss_sold_date_sk,2478908),LessThanOrEqual(ss_sold_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2479273),LessThanOrEqual(ss_sold_date_sk,2479303)),And(GreaterThanOrEqual(ss_sold_date_sk,2479639),LessThanOrEqual(ss_sold_date_sk,2479669))),Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480004),LessThanOrEqual(ss_sold_date_sk,2480034)),And(GreaterThanOrEqual(ss_sold_date_sk,2480369),LessThanOrEqual(ss_sold_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2480734),LessThanOrEqual(ss_sold_date_sk,2480764)),And(GreaterThanOrEqual(ss_sold_date_sk,2481100),LessThanOrEqual(ss_sold_date_sk,2481130))),And(GreaterThanOrEqual(ss_sold_date_sk,2481465),LessThanOrEqual(ss_sold_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2481830),LessThanOrEqual(ss_sold_date_sk,2481860)),And(GreaterThanOrEqual(ss_sold_date_sk,2482195),LessThanOrEqual(ss_sold_date_sk,2482225))),And(GreaterThanOrEqual(ss_sold_date_sk,2482561),LessThanOrEqual(ss_sold_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2482926),LessThanOrEqual(ss_sold_date_sk,2482956)),And(GreaterThanOrEqual(ss_sold_date_sk,2483291),LessThanOrEqual(ss_sold_date_sk,2483321))),And(GreaterThanOrEqual(ss_sold_date_sk,2483656),LessThanOrEqual(ss_sold_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2484022),LessThanOrEqual(ss_sold_date_sk,2484052)),And(GreaterThanOrEqual(ss_sold_date_sk,2484387),LessThanOrEqual(ss_sold_date_sk,2484417))),And(GreaterThanOrEqual(ss_sold_date_sk,2484752),LessThanOrEqual(ss_sold_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2485117),LessThanOrEqual(ss_sold_date_sk,2485147)),And(GreaterThanOrEqual(ss_sold_date_sk,2485483),LessThanOrEqual(ss_sold_date_sk,2485513))),And(GreaterThanOrEqual(ss_sold_date_sk,2485848),LessThanOrEqual(ss_sold_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2486213),LessThanOrEqual(ss_sold_date_sk,2486243)),And(GreaterThanOrEqual(ss_sold_date_sk,2486578),LessThanOrEqual(ss_sold_date_sk,2486608))),And(GreaterThanOrEqual(ss_sold_date_sk,2486944),LessThanOrEqual(ss_sold_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(ss_sold_date_sk,2487309),LessThanOrEqual(ss_sold_date_sk,2487339)),And(GreaterThanOrEqual(ss_sold_date_sk,2487674),LessThanOrEqual(ss_sold_date_sk,2487704))),And(GreaterThanOrEqual(ss_sold_date_sk,2488039),LessThanOrEqual(ss_sold_date_sk,2488069))))))))), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +Condition : ((isnotnull(i_manufact_id#7) AND (i_manufact_id#7 = 436)) AND isnotnull(i_item_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -(8) Filter -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] -Condition : ((((((((((((ss_sold_date_sk#6 >= 2415355) AND (ss_sold_date_sk#6 <= 2415385)) OR ((ss_sold_date_sk#6 >= 2415720) AND (ss_sold_date_sk#6 <= 2415750))) OR (((ss_sold_date_sk#6 >= 2416085) AND (ss_sold_date_sk#6 <= 2416115)) OR ((ss_sold_date_sk#6 >= 2416450) AND (ss_sold_date_sk#6 <= 2416480)))) OR ((((ss_sold_date_sk#6 >= 2416816) AND (ss_sold_date_sk#6 <= 2416846)) OR ((ss_sold_date_sk#6 >= 2417181) AND (ss_sold_date_sk#6 <= 2417211))) OR ((ss_sold_date_sk#6 >= 2417546) AND (ss_sold_date_sk#6 <= 2417576)))) OR (((((ss_sold_date_sk#6 >= 2417911) AND (ss_sold_date_sk#6 <= 2417941)) OR ((ss_sold_date_sk#6 >= 2418277) AND (ss_sold_date_sk#6 <= 2418307))) OR ((ss_sold_date_sk#6 >= 2418642) AND (ss_sold_date_sk#6 <= 2418672))) OR ((((ss_sold_date_sk#6 >= 2419007) AND (ss_sold_date_sk#6 <= 2419037)) OR ((ss_sold_date_sk#6 >= 2419372) AND (ss_sold_date_sk#6 <= 2419402))) OR ((ss_sold_date_sk#6 >= 2419738) AND (ss_sold_date_sk#6 <= 2419768))))) OR ((((((ss_sold_date_sk#6 >= 2420103) AND (ss_sold_date_sk#6 <= 2420133)) OR ((ss_sold_date_sk#6 >= 2420468) AND (ss_sold_date_sk#6 <= 2420498))) OR ((ss_sold_date_sk#6 >= 2420833) AND (ss_sold_date_sk#6 <= 2420863))) OR ((((ss_sold_date_sk#6 >= 2421199) AND (ss_sold_date_sk#6 <= 2421229)) OR ((ss_sold_date_sk#6 >= 2421564) AND (ss_sold_date_sk#6 <= 2421594))) OR ((ss_sold_date_sk#6 >= 2421929) AND (ss_sold_date_sk#6 <= 2421959)))) OR (((((ss_sold_date_sk#6 >= 2422294) AND (ss_sold_date_sk#6 <= 2422324)) OR ((ss_sold_date_sk#6 >= 2422660) AND (ss_sold_date_sk#6 <= 2422690))) OR ((ss_sold_date_sk#6 >= 2423025) AND (ss_sold_date_sk#6 <= 2423055))) OR ((((ss_sold_date_sk#6 >= 2423390) AND (ss_sold_date_sk#6 <= 2423420)) OR ((ss_sold_date_sk#6 >= 2423755) AND (ss_sold_date_sk#6 <= 2423785))) OR ((ss_sold_date_sk#6 >= 2424121) AND (ss_sold_date_sk#6 <= 2424151)))))) OR (((((((ss_sold_date_sk#6 >= 2424486) AND (ss_sold_date_sk#6 <= 2424516)) OR ((ss_sold_date_sk#6 >= 2424851) AND (ss_sold_date_sk#6 <= 2424881))) OR (((ss_sold_date_sk#6 >= 2425216) AND (ss_sold_date_sk#6 <= 2425246)) OR ((ss_sold_date_sk#6 >= 2425582) AND (ss_sold_date_sk#6 <= 2425612)))) OR ((((ss_sold_date_sk#6 >= 2425947) AND (ss_sold_date_sk#6 <= 2425977)) OR ((ss_sold_date_sk#6 >= 2426312) AND (ss_sold_date_sk#6 <= 2426342))) OR ((ss_sold_date_sk#6 >= 2426677) AND (ss_sold_date_sk#6 <= 2426707)))) OR (((((ss_sold_date_sk#6 >= 2427043) AND (ss_sold_date_sk#6 <= 2427073)) OR ((ss_sold_date_sk#6 >= 2427408) AND (ss_sold_date_sk#6 <= 2427438))) OR ((ss_sold_date_sk#6 >= 2427773) AND (ss_sold_date_sk#6 <= 2427803))) OR ((((ss_sold_date_sk#6 >= 2428138) AND (ss_sold_date_sk#6 <= 2428168)) OR ((ss_sold_date_sk#6 >= 2428504) AND (ss_sold_date_sk#6 <= 2428534))) OR ((ss_sold_date_sk#6 >= 2428869) AND (ss_sold_date_sk#6 <= 2428899))))) OR ((((((ss_sold_date_sk#6 >= 2429234) AND (ss_sold_date_sk#6 <= 2429264)) OR ((ss_sold_date_sk#6 >= 2429599) AND (ss_sold_date_sk#6 <= 2429629))) OR ((ss_sold_date_sk#6 >= 2429965) AND (ss_sold_date_sk#6 <= 2429995))) OR ((((ss_sold_date_sk#6 >= 2430330) AND (ss_sold_date_sk#6 <= 2430360)) OR ((ss_sold_date_sk#6 >= 2430695) AND (ss_sold_date_sk#6 <= 2430725))) OR ((ss_sold_date_sk#6 >= 2431060) AND (ss_sold_date_sk#6 <= 2431090)))) OR (((((ss_sold_date_sk#6 >= 2431426) AND (ss_sold_date_sk#6 <= 2431456)) OR ((ss_sold_date_sk#6 >= 2431791) AND (ss_sold_date_sk#6 <= 2431821))) OR ((ss_sold_date_sk#6 >= 2432156) AND (ss_sold_date_sk#6 <= 2432186))) OR ((((ss_sold_date_sk#6 >= 2432521) AND (ss_sold_date_sk#6 <= 2432551)) OR ((ss_sold_date_sk#6 >= 2432887) AND (ss_sold_date_sk#6 <= 2432917))) OR ((ss_sold_date_sk#6 >= 2433252) AND (ss_sold_date_sk#6 <= 2433282))))))) OR ((((((((ss_sold_date_sk#6 >= 2433617) AND (ss_sold_date_sk#6 <= 2433647)) OR ((ss_sold_date_sk#6 >= 2433982) AND (ss_sold_date_sk#6 <= 2434012))) OR (((ss_sold_date_sk#6 >= 2434348) AND (ss_sold_date_sk#6 <= 2434378)) OR ((ss_sold_date_sk#6 >= 2434713) AND (ss_sold_date_sk#6 <= 2434743)))) OR ((((ss_sold_date_sk#6 >= 2435078) AND (ss_sold_date_sk#6 <= 2435108)) OR ((ss_sold_date_sk#6 >= 2435443) AND (ss_sold_date_sk#6 <= 2435473))) OR ((ss_sold_date_sk#6 >= 2435809) AND (ss_sold_date_sk#6 <= 2435839)))) OR (((((ss_sold_date_sk#6 >= 2436174) AND (ss_sold_date_sk#6 <= 2436204)) OR ((ss_sold_date_sk#6 >= 2436539) AND (ss_sold_date_sk#6 <= 2436569))) OR ((ss_sold_date_sk#6 >= 2436904) AND (ss_sold_date_sk#6 <= 2436934))) OR ((((ss_sold_date_sk#6 >= 2437270) AND (ss_sold_date_sk#6 <= 2437300)) OR ((ss_sold_date_sk#6 >= 2437635) AND (ss_sold_date_sk#6 <= 2437665))) OR ((ss_sold_date_sk#6 >= 2438000) AND (ss_sold_date_sk#6 <= 2438030))))) OR ((((((ss_sold_date_sk#6 >= 2438365) AND (ss_sold_date_sk#6 <= 2438395)) OR ((ss_sold_date_sk#6 >= 2438731) AND (ss_sold_date_sk#6 <= 2438761))) OR ((ss_sold_date_sk#6 >= 2439096) AND (ss_sold_date_sk#6 <= 2439126))) OR ((((ss_sold_date_sk#6 >= 2439461) AND (ss_sold_date_sk#6 <= 2439491)) OR ((ss_sold_date_sk#6 >= 2439826) AND (ss_sold_date_sk#6 <= 2439856))) OR ((ss_sold_date_sk#6 >= 2440192) AND (ss_sold_date_sk#6 <= 2440222)))) OR (((((ss_sold_date_sk#6 >= 2440557) AND (ss_sold_date_sk#6 <= 2440587)) OR ((ss_sold_date_sk#6 >= 2440922) AND (ss_sold_date_sk#6 <= 2440952))) OR ((ss_sold_date_sk#6 >= 2441287) AND (ss_sold_date_sk#6 <= 2441317))) OR ((((ss_sold_date_sk#6 >= 2441653) AND (ss_sold_date_sk#6 <= 2441683)) OR ((ss_sold_date_sk#6 >= 2442018) AND (ss_sold_date_sk#6 <= 2442048))) OR ((ss_sold_date_sk#6 >= 2442383) AND (ss_sold_date_sk#6 <= 2442413)))))) OR (((((((ss_sold_date_sk#6 >= 2442748) AND (ss_sold_date_sk#6 <= 2442778)) OR ((ss_sold_date_sk#6 >= 2443114) AND (ss_sold_date_sk#6 <= 2443144))) OR (((ss_sold_date_sk#6 >= 2443479) AND (ss_sold_date_sk#6 <= 2443509)) OR ((ss_sold_date_sk#6 >= 2443844) AND (ss_sold_date_sk#6 <= 2443874)))) OR ((((ss_sold_date_sk#6 >= 2444209) AND (ss_sold_date_sk#6 <= 2444239)) OR ((ss_sold_date_sk#6 >= 2444575) AND (ss_sold_date_sk#6 <= 2444605))) OR ((ss_sold_date_sk#6 >= 2444940) AND (ss_sold_date_sk#6 <= 2444970)))) OR (((((ss_sold_date_sk#6 >= 2445305) AND (ss_sold_date_sk#6 <= 2445335)) OR ((ss_sold_date_sk#6 >= 2445670) AND (ss_sold_date_sk#6 <= 2445700))) OR ((ss_sold_date_sk#6 >= 2446036) AND (ss_sold_date_sk#6 <= 2446066))) OR ((((ss_sold_date_sk#6 >= 2446401) AND (ss_sold_date_sk#6 <= 2446431)) OR ((ss_sold_date_sk#6 >= 2446766) AND (ss_sold_date_sk#6 <= 2446796))) OR ((ss_sold_date_sk#6 >= 2447131) AND (ss_sold_date_sk#6 <= 2447161))))) OR ((((((ss_sold_date_sk#6 >= 2447497) AND (ss_sold_date_sk#6 <= 2447527)) OR ((ss_sold_date_sk#6 >= 2447862) AND (ss_sold_date_sk#6 <= 2447892))) OR ((ss_sold_date_sk#6 >= 2448227) AND (ss_sold_date_sk#6 <= 2448257))) OR ((((ss_sold_date_sk#6 >= 2448592) AND (ss_sold_date_sk#6 <= 2448622)) OR ((ss_sold_date_sk#6 >= 2448958) AND (ss_sold_date_sk#6 <= 2448988))) OR ((ss_sold_date_sk#6 >= 2449323) AND (ss_sold_date_sk#6 <= 2449353)))) OR (((((ss_sold_date_sk#6 >= 2449688) AND (ss_sold_date_sk#6 <= 2449718)) OR ((ss_sold_date_sk#6 >= 2450053) AND (ss_sold_date_sk#6 <= 2450083))) OR ((ss_sold_date_sk#6 >= 2450419) AND (ss_sold_date_sk#6 <= 2450449))) OR ((((ss_sold_date_sk#6 >= 2450784) AND (ss_sold_date_sk#6 <= 2450814)) OR ((ss_sold_date_sk#6 >= 2451149) AND (ss_sold_date_sk#6 <= 2451179))) OR ((ss_sold_date_sk#6 >= 2451514) AND (ss_sold_date_sk#6 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#6 >= 2451880) AND (ss_sold_date_sk#6 <= 2451910)) OR ((ss_sold_date_sk#6 >= 2452245) AND (ss_sold_date_sk#6 <= 2452275))) OR (((ss_sold_date_sk#6 >= 2452610) AND (ss_sold_date_sk#6 <= 2452640)) OR ((ss_sold_date_sk#6 >= 2452975) AND (ss_sold_date_sk#6 <= 2453005)))) OR ((((ss_sold_date_sk#6 >= 2453341) AND (ss_sold_date_sk#6 <= 2453371)) OR ((ss_sold_date_sk#6 >= 2453706) AND (ss_sold_date_sk#6 <= 2453736))) OR ((ss_sold_date_sk#6 >= 2454071) AND (ss_sold_date_sk#6 <= 2454101)))) OR (((((ss_sold_date_sk#6 >= 2454436) AND (ss_sold_date_sk#6 <= 2454466)) OR ((ss_sold_date_sk#6 >= 2454802) AND (ss_sold_date_sk#6 <= 2454832))) OR ((ss_sold_date_sk#6 >= 2455167) AND (ss_sold_date_sk#6 <= 2455197))) OR ((((ss_sold_date_sk#6 >= 2455532) AND (ss_sold_date_sk#6 <= 2455562)) OR ((ss_sold_date_sk#6 >= 2455897) AND (ss_sold_date_sk#6 <= 2455927))) OR ((ss_sold_date_sk#6 >= 2456263) AND (ss_sold_date_sk#6 <= 2456293))))) OR ((((((ss_sold_date_sk#6 >= 2456628) AND (ss_sold_date_sk#6 <= 2456658)) OR ((ss_sold_date_sk#6 >= 2456993) AND (ss_sold_date_sk#6 <= 2457023))) OR ((ss_sold_date_sk#6 >= 2457358) AND (ss_sold_date_sk#6 <= 2457388))) OR ((((ss_sold_date_sk#6 >= 2457724) AND (ss_sold_date_sk#6 <= 2457754)) OR ((ss_sold_date_sk#6 >= 2458089) AND (ss_sold_date_sk#6 <= 2458119))) OR ((ss_sold_date_sk#6 >= 2458454) AND (ss_sold_date_sk#6 <= 2458484)))) OR (((((ss_sold_date_sk#6 >= 2458819) AND (ss_sold_date_sk#6 <= 2458849)) OR ((ss_sold_date_sk#6 >= 2459185) AND (ss_sold_date_sk#6 <= 2459215))) OR ((ss_sold_date_sk#6 >= 2459550) AND (ss_sold_date_sk#6 <= 2459580))) OR ((((ss_sold_date_sk#6 >= 2459915) AND (ss_sold_date_sk#6 <= 2459945)) OR ((ss_sold_date_sk#6 >= 2460280) AND (ss_sold_date_sk#6 <= 2460310))) OR ((ss_sold_date_sk#6 >= 2460646) AND (ss_sold_date_sk#6 <= 2460676)))))) OR (((((((ss_sold_date_sk#6 >= 2461011) AND (ss_sold_date_sk#6 <= 2461041)) OR ((ss_sold_date_sk#6 >= 2461376) AND (ss_sold_date_sk#6 <= 2461406))) OR (((ss_sold_date_sk#6 >= 2461741) AND (ss_sold_date_sk#6 <= 2461771)) OR ((ss_sold_date_sk#6 >= 2462107) AND (ss_sold_date_sk#6 <= 2462137)))) OR ((((ss_sold_date_sk#6 >= 2462472) AND (ss_sold_date_sk#6 <= 2462502)) OR ((ss_sold_date_sk#6 >= 2462837) AND (ss_sold_date_sk#6 <= 2462867))) OR ((ss_sold_date_sk#6 >= 2463202) AND (ss_sold_date_sk#6 <= 2463232)))) OR (((((ss_sold_date_sk#6 >= 2463568) AND (ss_sold_date_sk#6 <= 2463598)) OR ((ss_sold_date_sk#6 >= 2463933) AND (ss_sold_date_sk#6 <= 2463963))) OR ((ss_sold_date_sk#6 >= 2464298) AND (ss_sold_date_sk#6 <= 2464328))) OR ((((ss_sold_date_sk#6 >= 2464663) AND (ss_sold_date_sk#6 <= 2464693)) OR ((ss_sold_date_sk#6 >= 2465029) AND (ss_sold_date_sk#6 <= 2465059))) OR ((ss_sold_date_sk#6 >= 2465394) AND (ss_sold_date_sk#6 <= 2465424))))) OR ((((((ss_sold_date_sk#6 >= 2465759) AND (ss_sold_date_sk#6 <= 2465789)) OR ((ss_sold_date_sk#6 >= 2466124) AND (ss_sold_date_sk#6 <= 2466154))) OR ((ss_sold_date_sk#6 >= 2466490) AND (ss_sold_date_sk#6 <= 2466520))) OR ((((ss_sold_date_sk#6 >= 2466855) AND (ss_sold_date_sk#6 <= 2466885)) OR ((ss_sold_date_sk#6 >= 2467220) AND (ss_sold_date_sk#6 <= 2467250))) OR ((ss_sold_date_sk#6 >= 2467585) AND (ss_sold_date_sk#6 <= 2467615)))) OR (((((ss_sold_date_sk#6 >= 2467951) AND (ss_sold_date_sk#6 <= 2467981)) OR ((ss_sold_date_sk#6 >= 2468316) AND (ss_sold_date_sk#6 <= 2468346))) OR ((ss_sold_date_sk#6 >= 2468681) AND (ss_sold_date_sk#6 <= 2468711))) OR ((((ss_sold_date_sk#6 >= 2469046) AND (ss_sold_date_sk#6 <= 2469076)) OR ((ss_sold_date_sk#6 >= 2469412) AND (ss_sold_date_sk#6 <= 2469442))) OR ((ss_sold_date_sk#6 >= 2469777) AND (ss_sold_date_sk#6 <= 2469807))))))) OR ((((((((ss_sold_date_sk#6 >= 2470142) AND (ss_sold_date_sk#6 <= 2470172)) OR ((ss_sold_date_sk#6 >= 2470507) AND (ss_sold_date_sk#6 <= 2470537))) OR (((ss_sold_date_sk#6 >= 2470873) AND (ss_sold_date_sk#6 <= 2470903)) OR ((ss_sold_date_sk#6 >= 2471238) AND (ss_sold_date_sk#6 <= 2471268)))) OR ((((ss_sold_date_sk#6 >= 2471603) AND (ss_sold_date_sk#6 <= 2471633)) OR ((ss_sold_date_sk#6 >= 2471968) AND (ss_sold_date_sk#6 <= 2471998))) OR ((ss_sold_date_sk#6 >= 2472334) AND (ss_sold_date_sk#6 <= 2472364)))) OR (((((ss_sold_date_sk#6 >= 2472699) AND (ss_sold_date_sk#6 <= 2472729)) OR ((ss_sold_date_sk#6 >= 2473064) AND (ss_sold_date_sk#6 <= 2473094))) OR ((ss_sold_date_sk#6 >= 2473429) AND (ss_sold_date_sk#6 <= 2473459))) OR ((((ss_sold_date_sk#6 >= 2473795) AND (ss_sold_date_sk#6 <= 2473825)) OR ((ss_sold_date_sk#6 >= 2474160) AND (ss_sold_date_sk#6 <= 2474190))) OR ((ss_sold_date_sk#6 >= 2474525) AND (ss_sold_date_sk#6 <= 2474555))))) OR ((((((ss_sold_date_sk#6 >= 2474890) AND (ss_sold_date_sk#6 <= 2474920)) OR ((ss_sold_date_sk#6 >= 2475256) AND (ss_sold_date_sk#6 <= 2475286))) OR ((ss_sold_date_sk#6 >= 2475621) AND (ss_sold_date_sk#6 <= 2475651))) OR ((((ss_sold_date_sk#6 >= 2475986) AND (ss_sold_date_sk#6 <= 2476016)) OR ((ss_sold_date_sk#6 >= 2476351) AND (ss_sold_date_sk#6 <= 2476381))) OR ((ss_sold_date_sk#6 >= 2476717) AND (ss_sold_date_sk#6 <= 2476747)))) OR (((((ss_sold_date_sk#6 >= 2477082) AND (ss_sold_date_sk#6 <= 2477112)) OR ((ss_sold_date_sk#6 >= 2477447) AND (ss_sold_date_sk#6 <= 2477477))) OR ((ss_sold_date_sk#6 >= 2477812) AND (ss_sold_date_sk#6 <= 2477842))) OR ((((ss_sold_date_sk#6 >= 2478178) AND (ss_sold_date_sk#6 <= 2478208)) OR ((ss_sold_date_sk#6 >= 2478543) AND (ss_sold_date_sk#6 <= 2478573))) OR ((ss_sold_date_sk#6 >= 2478908) AND (ss_sold_date_sk#6 <= 2478938)))))) OR (((((((ss_sold_date_sk#6 >= 2479273) AND (ss_sold_date_sk#6 <= 2479303)) OR ((ss_sold_date_sk#6 >= 2479639) AND (ss_sold_date_sk#6 <= 2479669))) OR (((ss_sold_date_sk#6 >= 2480004) AND (ss_sold_date_sk#6 <= 2480034)) OR ((ss_sold_date_sk#6 >= 2480369) AND (ss_sold_date_sk#6 <= 2480399)))) OR ((((ss_sold_date_sk#6 >= 2480734) AND (ss_sold_date_sk#6 <= 2480764)) OR ((ss_sold_date_sk#6 >= 2481100) AND (ss_sold_date_sk#6 <= 2481130))) OR ((ss_sold_date_sk#6 >= 2481465) AND (ss_sold_date_sk#6 <= 2481495)))) OR (((((ss_sold_date_sk#6 >= 2481830) AND (ss_sold_date_sk#6 <= 2481860)) OR ((ss_sold_date_sk#6 >= 2482195) AND (ss_sold_date_sk#6 <= 2482225))) OR ((ss_sold_date_sk#6 >= 2482561) AND (ss_sold_date_sk#6 <= 2482591))) OR ((((ss_sold_date_sk#6 >= 2482926) AND (ss_sold_date_sk#6 <= 2482956)) OR ((ss_sold_date_sk#6 >= 2483291) AND (ss_sold_date_sk#6 <= 2483321))) OR ((ss_sold_date_sk#6 >= 2483656) AND (ss_sold_date_sk#6 <= 2483686))))) OR ((((((ss_sold_date_sk#6 >= 2484022) AND (ss_sold_date_sk#6 <= 2484052)) OR ((ss_sold_date_sk#6 >= 2484387) AND (ss_sold_date_sk#6 <= 2484417))) OR ((ss_sold_date_sk#6 >= 2484752) AND (ss_sold_date_sk#6 <= 2484782))) OR ((((ss_sold_date_sk#6 >= 2485117) AND (ss_sold_date_sk#6 <= 2485147)) OR ((ss_sold_date_sk#6 >= 2485483) AND (ss_sold_date_sk#6 <= 2485513))) OR ((ss_sold_date_sk#6 >= 2485848) AND (ss_sold_date_sk#6 <= 2485878)))) OR (((((ss_sold_date_sk#6 >= 2486213) AND (ss_sold_date_sk#6 <= 2486243)) OR ((ss_sold_date_sk#6 >= 2486578) AND (ss_sold_date_sk#6 <= 2486608))) OR ((ss_sold_date_sk#6 >= 2486944) AND (ss_sold_date_sk#6 <= 2486974))) OR ((((ss_sold_date_sk#6 >= 2487309) AND (ss_sold_date_sk#6 <= 2487339)) OR ((ss_sold_date_sk#6 >= 2487674) AND (ss_sold_date_sk#6 <= 2487704))) OR ((ss_sold_date_sk#6 >= 2488039) AND (ss_sold_date_sk#6 <= 2488069))))))))) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_net_profit#8] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_net_profit#8] +Output [4]: [ss_sold_date_sk#1, ss_net_profit#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_net_profit#3, i_item_sk#4, i_brand_id#5, i_brand#6] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_net_profit#8, i_brand_id#2, i_brand#3] -Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_net_profit#8, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_net_profit#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_net_profit#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_net_profit#8, i_brand_id#2, i_brand#3] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#8))] +Input [4]: [d_year#10, ss_net_profit#3, i_brand_id#5, i_brand#6] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [sum(UnscaledValue(ss_net_profit#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#8))#16] -Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#16,17,2) AS sum_agg#19] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#16] +Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#16,17,2) AS sum_agg#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, sum_agg#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt index 1412978aac023..6ab00e122c5c5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_net_profit] [sum,sum] Project [d_year,ss_net_profit,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand_id,i_brand,ss_sold_date_sk,ss_net_profit] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_net_profit,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_net_profit] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_net_profit] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt index 1672f33d47adb..ac1fca4f67a02 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_dom#3] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450816), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -Condition : (((((((d_dom#3 >= 1) AND (d_dom#3 <= 3)) OR ((d_dom#3 >= 25) AND (d_dom#3 <= 28))) AND d_year#2 IN (1998,1999,2000)) AND (d_date_sk#1 >= 2450816)) AND (d_date_sk#1 <= 2451910)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2450816)) AND (ss_sold_date_sk#1 <= 2451910)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450816), LessThanOrEqual(ss_sold_date_sk,2451910), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +Condition : (((((((d_dom#8 >= 1) AND (d_dom#8 <= 3)) OR ((d_dom#8 >= 25) AND (d_dom#8 <= 28))) AND d_year#7 IN (1998,1999,2000)) AND (d_date_sk#6 >= 2450816)) AND (d_date_sk#6 <= 2451910)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(8) Filter -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Condition : (((((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2450816)) AND (ss_sold_date_sk#5 <= 2451910)) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#8] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] -Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] +Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] +Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#7] +Left keys [1]: [ss_hdemo_sk#3] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#6, ss_ticket_number#9] -Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] +Output [2]: [ss_customer_sk#2, ss_ticket_number#5] +Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#6, ss_ticket_number#9] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [2]: [ss_customer_sk#2, ss_ticket_number#5] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] (26) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] Condition : ((cnt#22 >= 15) AND (cnt#22 <= 20)) (29) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#6] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] -Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt index ba415dbb4e9a4..d9b416ddba9ef 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt @@ -22,7 +22,11 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt index da9a33f01e806..10f7d4b9d3b4b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451149)) AND (ss_sold_date_sk#1 <= 2451179)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 12)) AND (d_year#5 = 1998)) AND (d_date_sk#4 >= 2451149)) AND (d_date_sk#4 <= 2451179)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [d_date_sk#4, d_year#5] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -(8) BroadcastExchange -Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2451149)) AND (ss_sold_date_sk#5 <= 2451179)) AND isnotnull(ss_item_sk#6)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5] +Output [3]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7] +Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] @@ -90,33 +90,33 @@ Input [3]: [i_item_sk#8, i_category_id#9, i_category#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#6] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#5, ss_ext_sales_price#3, i_category_id#9, i_category#10] -Input [6]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5, i_item_sk#8, i_category_id#9, i_category#10] +Output [4]: [d_year#2, ss_ext_sales_price#7, i_category_id#9, i_category#10] +Input [6]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_category_id#9, i_category#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#5, ss_ext_sales_price#3, i_category_id#9, i_category#10] -Keys [3]: [d_year#5, i_category_id#9, i_category#10] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [4]: [d_year#2, ss_ext_sales_price#7, i_category_id#9, i_category#10] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] +Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] (19) Exchange -Input [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] -Arguments: hashpartitioning(d_year#5, i_category_id#9, i_category#10, 5), true, [id=#15] +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#5, i_category_id#9, i_category#10, sum#14] -Keys [3]: [d_year#5, i_category_id#9, i_category#10] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [4]: [d_year#5, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum(ss_ext_sales_price)#17] +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] +Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS sum(ss_ext_sales_price)#17] (21) TakeOrderedAndProject -Input [4]: [d_year#5, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] -Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#5 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#5, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt index f010e3f1ac2d5..96e2f0b12cfb1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_category_id,i_category] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [ss_item_sk,ss_ext_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt index ed9f51c2db1e9..7e82e34c4c637 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt @@ -6,276 +6,276 @@ TakeOrderedAndProject (51) : +- Exchange (45) : +- * Project (44) : +- * SortMergeJoin Inner (43) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer (1) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * HashAggregate (34) + : : +- * Project (33) + : : +- * SortMergeJoin Inner (32) + : : :- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.customer_address (27) : +- * Sort (42) : +- Exchange (41) - : +- * HashAggregate (40) - : +- * HashAggregate (39) - : +- * Project (38) - : +- * SortMergeJoin Inner (37) - : :- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Project (22) - : : : +- * BroadcastHashJoin Inner BuildRight (21) - : : : :- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildLeft (14) - : : : : :- BroadcastExchange (10) - : : : : : +- * Project (9) - : : : : : +- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.date_dim (6) - : : : : +- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store_sales (11) - : : : +- BroadcastExchange (20) - : : : +- * Project (19) - : : : +- * Filter (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.store (16) - : : +- BroadcastExchange (27) - : : +- * Project (26) - : : +- * Filter (25) - : : +- * ColumnarToRow (24) - : : +- Scan parquet default.household_demographics (23) - : +- * Sort (36) - : +- Exchange (35) - : +- * Filter (34) - : +- * ColumnarToRow (33) - : +- Scan parquet default.customer_address (32) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer (38) +- * Sort (48) +- ReusedExchange (47) -(1) Scan parquet default.customer -Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +(1) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] - -(3) Filter [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [In(ss_sold_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(4) Exchange -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#5] +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -(5) Sort [codegen id : 2] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 +(3) Filter [codegen id : 4] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Condition : (((((ss_sold_date_sk#1 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_addr_sk#4)) AND isnotnull(ss_customer_sk#2)) -(6) Scan parquet default.date_dim -Output [3]: [d_date_sk#6, d_year#7, d_dow#8] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_dow#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(d_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#6, d_year#7, d_dow#8] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -(8) Filter [codegen id : 3] -Input [3]: [d_date_sk#6, d_year#7, d_dow#8] -Condition : (((d_dow#8 IN (6,0) AND d_year#7 IN (1999,2000,2001)) AND d_date_sk#6 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#6)) +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +Condition : (((d_dow#11 IN (6,0) AND d_year#10 IN (1999,2000,2001)) AND d_date_sk#9 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#9)) -(9) Project [codegen id : 3] -Output [1]: [d_date_sk#6] -Input [3]: [d_date_sk#6, d_year#7, d_dow#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -(10) BroadcastExchange -Input [1]: [d_date_sk#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(8) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(11) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [In(ss_sold_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(12) ColumnarToRow -Input [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] - -(13) Filter -Input [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Condition : (((((ss_sold_date_sk#10 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028) AND isnotnull(ss_sold_date_sk#10)) AND isnotnull(ss_store_sk#14)) AND isnotnull(ss_hdemo_sk#12)) AND isnotnull(ss_addr_sk#13)) AND isnotnull(ss_customer_sk#11)) - -(14) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [d_date_sk#6] -Right keys [1]: [ss_sold_date_sk#10] +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None -(15) Project [codegen id : 6] -Output [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Input [9]: [d_date_sk#6, ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, d_date_sk#9] -(16) Scan parquet default.store -Output [2]: [s_store_sk#18, s_city#19] +(11) Scan parquet default.store +Output [2]: [s_store_sk#13, s_city#14] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [In(s_city, [Midway,Concord,Spring Hill,Brownsville,Greenville]), IsNotNull(s_store_sk)] ReadSchema: struct -(17) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#18, s_city#19] +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#13, s_city#14] -(18) Filter [codegen id : 4] -Input [2]: [s_store_sk#18, s_city#19] -Condition : (s_city#19 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#18)) +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#13, s_city#14] +Condition : (s_city#14 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#13)) -(19) Project [codegen id : 4] -Output [1]: [s_store_sk#18] -Input [2]: [s_store_sk#18, s_city#19] +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#13] +Input [2]: [s_store_sk#13, s_city#14] -(20) BroadcastExchange -Input [1]: [s_store_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(15) BroadcastExchange +Input [1]: [s_store_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(21) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_store_sk#14] -Right keys [1]: [s_store_sk#18] +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#13] Join condition: None -(22) Project [codegen id : 6] -Output [6]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Input [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, s_store_sk#18] +(17) Project [codegen id : 4] +Output [6]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#13] -(23) Scan parquet default.household_demographics -Output [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] Batched: true Location [not included in comparison]/{warehouse_dir}/household_demographics] PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] ReadSchema: struct -(24) ColumnarToRow [codegen id : 5] -Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] -(25) Filter [codegen id : 5] -Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] -Condition : (((hd_dep_count#22 = 5) OR (hd_vehicle_count#23 = 3)) AND isnotnull(hd_demo_sk#21)) +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] +Condition : (((hd_dep_count#17 = 5) OR (hd_vehicle_count#18 = 3)) AND isnotnull(hd_demo_sk#16)) -(26) Project [codegen id : 5] -Output [1]: [hd_demo_sk#21] -Input [3]: [hd_demo_sk#21, hd_dep_count#22, hd_vehicle_count#23] +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#16] +Input [3]: [hd_demo_sk#16, hd_dep_count#17, hd_vehicle_count#18] -(27) BroadcastExchange -Input [1]: [hd_demo_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] +(22) BroadcastExchange +Input [1]: [hd_demo_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] -(28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_hdemo_sk#12] -Right keys [1]: [hd_demo_sk#21] +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#16] Join condition: None -(29) Project [codegen id : 6] -Output [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Input [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, hd_demo_sk#21] +(24) Project [codegen id : 4] +Output [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, hd_demo_sk#16] -(30) Exchange -Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#25] +(25) Exchange +Input [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Arguments: hashpartitioning(ss_addr_sk#4, 5), true, [id=#20] -(31) Sort [codegen id : 7] -Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] -Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 5] +Input [5]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Arguments: [ss_addr_sk#4 ASC NULLS FIRST], false, 0 -(32) Scan parquet default.customer_address -Output [2]: [ca_address_sk#26, ca_city#27] +(27) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_city#22] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct -(33) ColumnarToRow [codegen id : 8] -Input [2]: [ca_address_sk#26, ca_city#27] +(28) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#21, ca_city#22] -(34) Filter [codegen id : 8] -Input [2]: [ca_address_sk#26, ca_city#27] -Condition : (isnotnull(ca_address_sk#26) AND isnotnull(ca_city#27)) +(29) Filter [codegen id : 6] +Input [2]: [ca_address_sk#21, ca_city#22] +Condition : (isnotnull(ca_address_sk#21) AND isnotnull(ca_city#22)) -(35) Exchange -Input [2]: [ca_address_sk#26, ca_city#27] -Arguments: hashpartitioning(ca_address_sk#26, 5), true, [id=#28] +(30) Exchange +Input [2]: [ca_address_sk#21, ca_city#22] +Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] -(36) Sort [codegen id : 9] -Input [2]: [ca_address_sk#26, ca_city#27] -Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 +(31) Sort [codegen id : 7] +Input [2]: [ca_address_sk#21, ca_city#22] +Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 -(37) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_addr_sk#13] -Right keys [1]: [ca_address_sk#26] +(32) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_addr_sk#4] +Right keys [1]: [ca_address_sk#21] Join condition: None -(38) Project [codegen id : 10] -Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#27] -Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#26, ca_city#27] +(33) Project [codegen id : 8] +Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_city#22] +Input [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_address_sk#21, ca_city#22] + +(34) HashAggregate [codegen id : 8] +Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, ca_city#22] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#7)), partial_sum(UnscaledValue(ss_net_profit#8))] +Aggregate Attributes [2]: [sum#24, sum#25] +Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22, sum#26, sum#27] + +(35) HashAggregate [codegen id : 8] +Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22, sum#26, sum#27] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#22] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#28, sum(UnscaledValue(ss_net_profit#8))#29] +Results [5]: [ss_ticket_number#6, ss_customer_sk#2, ca_city#22 AS bought_city#30, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#28,17,2) AS amt#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#29,17,2) AS profit#32] + +(36) Exchange +Input [5]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#33] + +(37) Sort [codegen id : 9] +Input [5]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer +Output [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(39) HashAggregate [codegen id : 10] -Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#27] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27] -Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#16)), partial_sum(UnscaledValue(ss_net_profit#17))] -Aggregate Attributes [2]: [sum#29, sum#30] -Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27, sum#31, sum#32] +(39) ColumnarToRow [codegen id : 10] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] -(40) HashAggregate [codegen id : 10] -Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27, sum#31, sum#32] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#27] -Functions [2]: [sum(UnscaledValue(ss_coupon_amt#16)), sum(UnscaledValue(ss_net_profit#17))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#16))#33, sum(UnscaledValue(ss_net_profit#17))#34] -Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#27 AS bought_city#35, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#33,17,2) AS amt#36, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#34,17,2) AS profit#37] +(40) Filter [codegen id : 10] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Condition : (isnotnull(c_customer_sk#34) AND isnotnull(c_current_addr_sk#35)) (41) Exchange -Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] -Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#38] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: hashpartitioning(c_customer_sk#34, 5), true, [id=#38] (42) Sort [codegen id : 11] -Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] -Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: [c_customer_sk#34 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 12] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ss_customer_sk#11] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#34] Join condition: None (44) Project [codegen id : 12] -Output [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] -Input [9]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, ss_customer_sk#11, bought_city#35, amt#36, profit#37] +Output [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Input [9]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#30, amt#31, profit#32, c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] (45) Exchange -Input [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] -Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#39] +Input [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: hashpartitioning(c_current_addr_sk#35, 5), true, [id=#39] (46) Sort [codegen id : 13] -Input [7]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37] -Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [7]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: [c_current_addr_sk#35 ASC NULLS FIRST], false, 0 -(47) ReusedExchange [Reuses operator id: 35] -Output [2]: [ca_address_sk#26, ca_city#27] +(47) ReusedExchange [Reuses operator id: 30] +Output [2]: [ca_address_sk#21, ca_city#22] (48) Sort [codegen id : 15] -Input [2]: [ca_address_sk#26, ca_city#27] -Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#21, ca_city#22] +Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_current_addr_sk#2] -Right keys [1]: [ca_address_sk#26] -Join condition: NOT (ca_city#27 = bought_city#35) +Left keys [1]: [c_current_addr_sk#35] +Right keys [1]: [ca_address_sk#21] +Join condition: NOT (ca_city#22 = bought_city#30) (50) Project [codegen id : 16] -Output [7]: [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] -Input [9]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#15, bought_city#35, amt#36, profit#37, ca_address_sk#26, ca_city#27] +Output [7]: [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] +Input [9]: [ss_ticket_number#6, bought_city#30, amt#31, profit#32, c_current_addr_sk#35, c_first_name#36, c_last_name#37, ca_address_sk#21, ca_city#22] (51) TakeOrderedAndProject -Input [7]: [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] -Arguments: 100, [c_last_name#4 ASC NULLS FIRST, c_first_name#3 ASC NULLS FIRST, ca_city#27 ASC NULLS FIRST, bought_city#35 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#27, bought_city#35, ss_ticket_number#15, amt#36, profit#37] +Input [7]: [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] +Arguments: 100, [c_last_name#37 ASC NULLS FIRST, c_first_name#36 ASC NULLS FIRST, ca_city#22 ASC NULLS FIRST, bought_city#30 ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST], [c_last_name#37, c_first_name#36, ca_city#22, bought_city#30, ss_ticket_number#6, amt#31, profit#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt index 3bb84cbbada01..bc83e3b7e2eba 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt @@ -8,80 +8,80 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu InputAdapter Exchange [c_current_addr_sk] #1 WholeStageCodegen (12) - Project [c_current_addr_sk,c_first_name,c_last_name,ss_ticket_number,bought_city,amt,profit] - SortMergeJoin [c_customer_sk,ss_customer_sk] + Project [ss_ticket_number,bought_city,amt,profit,c_current_addr_sk,c_first_name,c_last_name] + SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (2) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #2 - WholeStageCodegen (1) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] - InputAdapter - WholeStageCodegen (11) + WholeStageCodegen (9) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #3 - WholeStageCodegen (10) + Exchange [ss_customer_sk] #2 + WholeStageCodegen (8) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] SortMergeJoin [ss_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (5) Sort [ss_addr_sk] InputAdapter - Exchange [ss_addr_sk] #4 - WholeStageCodegen (6) + Exchange [ss_addr_sk] #3 + WholeStageCodegen (4) Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) + BroadcastExchange #4 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_dow,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dow] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (2) Project [s_store_sk] Filter [s_city,s_store_sk] ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_city] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (5) + BroadcastExchange #6 + WholeStageCodegen (3) Project [hd_demo_sk] Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] ColumnarToRow InputAdapter Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (7) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #8 - WholeStageCodegen (8) + Exchange [ca_address_sk] #7 + WholeStageCodegen (6) Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (10) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (15) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #8 + ReusedExchange [ca_address_sk,ca_city] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt index 69b361736c334..aa33cd1be7482 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451149)) AND (ss_sold_date_sk#1 <= 2451179)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 12)) AND (d_year#5 = 1998)) AND (d_date_sk#4 >= 2451149)) AND (d_date_sk#4 <= 2451179)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451149), LessThanOrEqual(ss_sold_date_sk,2451179), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [d_date_sk#4, d_year#5] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -(8) BroadcastExchange -Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2451149)) AND (ss_sold_date_sk#5 <= 2451179)) AND isnotnull(ss_item_sk#6)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5] -Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5] +Output [3]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7] +Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] @@ -90,33 +90,33 @@ Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#6] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#5, ss_ext_sales_price#3, i_brand_id#9, i_brand#10] -Input [6]: [ss_item_sk#2, ss_ext_sales_price#3, d_year#5, i_item_sk#8, i_brand_id#9, i_brand#10] +Output [4]: [d_year#2, ss_ext_sales_price#7, i_brand_id#9, i_brand#10] +Input [6]: [d_year#2, ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_brand_id#9, i_brand#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#5, ss_ext_sales_price#3, i_brand_id#9, i_brand#10] -Keys [3]: [d_year#5, i_brand#10, i_brand_id#9] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Input [4]: [d_year#2, ss_ext_sales_price#7, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] +Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] (19) Exchange -Input [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] -Arguments: hashpartitioning(d_year#5, i_brand#10, i_brand_id#9, 5), true, [id=#15] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#5, i_brand#10, i_brand_id#9, sum#14] -Keys [3]: [d_year#5, i_brand#10, i_brand_id#9] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [4]: [d_year#5, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] +Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject -Input [4]: [d_year#5, brand_id#17, brand#18, ext_price#19] -Arguments: 100, [d_year#5 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#5, brand_id#17, brand#18, ext_price#19] +Input [4]: [d_year#2, brand_id#17, brand#18, ext_price#19] +Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt index b39ff773cb600..f4aaf3df75135 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [ss_item_sk,ss_ext_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt index d1438c53682b9..6d9a28f187916 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.item (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452215), LessThanOrEqual(ss_sold_date_sk,2452244), IsNotNull(ss_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2452215)) AND (ss_sold_date_sk#1 <= 2452244)) AND isnotnull(ss_item_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#4, d_year#5, d_moy#6] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2001), GreaterThanOrEqual(d_date_sk,2452215), LessThanOrEqual(d_date_sk,2452244), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] -Condition : ((((((isnotnull(d_moy#6) AND isnotnull(d_year#5)) AND (d_moy#6 = 11)) AND (d_year#5 = 2001)) AND (d_date_sk#4 >= 2452215)) AND (d_date_sk#4 <= 2452244)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2001)) AND (d_date_sk#1 >= 2452215)) AND (d_date_sk#1 <= 2452244)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452215), LessThanOrEqual(ss_sold_date_sk,2452244), IsNotNull(ss_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [3]: [d_date_sk#4, d_year#5, d_moy#6] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] +Condition : (((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2452215)) AND (ss_sold_date_sk#5 <= 2452244)) AND isnotnull(ss_item_sk#6)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 3] -Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] +Output [2]: [ss_item_sk#6, ss_ext_sales_price#7] +Input [4]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_ext_sales_price#7] (11) Scan parquet default.item Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] @@ -90,18 +90,18 @@ Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#2] +Left keys [1]: [ss_item_sk#6] Right keys [1]: [i_item_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#3, i_brand_id#9, i_brand#10] -Input [5]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_brand_id#9, i_brand#10] +Output [3]: [ss_ext_sales_price#7, i_brand_id#9, i_brand#10] +Input [5]: [ss_item_sk#6, ss_ext_sales_price#7, i_item_sk#8, i_brand_id#9, i_brand#10] (18) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#3, i_brand_id#9, i_brand#10] +Input [3]: [ss_ext_sales_price#7, i_brand_id#9, i_brand#10] Keys [2]: [i_brand#10, i_brand_id#9] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] Aggregate Attributes [1]: [sum#13] Results [3]: [i_brand#10, i_brand_id#9, sum#14] @@ -112,9 +112,9 @@ Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] Input [3]: [i_brand#10, i_brand_id#9, sum#14] Keys [2]: [i_brand#10, i_brand_id#9] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] -Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#16] +Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [3]: [brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt index 8e1c7d56dc223..4f375c80678e8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt @@ -8,11 +8,7 @@ TakeOrderedAndProject [ext_price,brand_id,brand] Project [ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt index 25c306bc1ec64..5c4a69d38637d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.item (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452123), LessThanOrEqual(ss_sold_date_sk,2452487), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -(3) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2452123)) AND (ss_sold_date_sk#1 <= 2452487)) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_store_sk#3)) +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,reference,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) -(4) Scan parquet default.item -Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -(5) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manager_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(6) Filter [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,reference,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2452123), LessThanOrEqual(ss_sold_date_sk,2452487), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [i_item_sk#5, i_manager_id#9] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +(7) ColumnarToRow +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -(8) BroadcastExchange -Input [2]: [i_item_sk#5, i_manager_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(8) Filter +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Condition : ((((isnotnull(ss_sold_date_sk#11) AND (ss_sold_date_sk#11 >= 2452123)) AND (ss_sold_date_sk#11 <= 2452487)) AND isnotnull(ss_item_sk#12)) AND isnotnull(ss_store_sk#13)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#12] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manager_id#9] +Output [4]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#13] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9] -Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9, s_store_sk#15] +Output [3]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14] +Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_moy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_moy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#11] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] -Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9, d_date_sk#17, d_moy#19] +Output [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] +Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_moy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] -Keys [2]: [i_manager_id#9, d_moy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] +Input [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] +Keys [2]: [i_manager_id#5, d_moy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manager_id#9, d_moy#19, sum#22] +Results [3]: [i_manager_id#5, d_moy#19, sum#22] (25) Exchange -Input [3]: [i_manager_id#9, d_moy#19, sum#22] -Arguments: hashpartitioning(i_manager_id#9, d_moy#19, 5), true, [id=#23] +Input [3]: [i_manager_id#5, d_moy#19, sum#22] +Arguments: hashpartitioning(i_manager_id#5, d_moy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manager_id#9, d_moy#19, sum#22] -Keys [2]: [i_manager_id#9, d_moy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] -Results [3]: [i_manager_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] +Input [3]: [i_manager_id#5, d_moy#19, sum#22] +Keys [2]: [i_manager_id#5, d_moy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manager_id#9, 5), true, [id=#27] +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manager_id#5, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: [i_manager_id#9 ASC NULLS FIRST], false, 0 +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#9] +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#5] (30) Filter [codegen id : 7] -Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] +Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] Condition : (CASE WHEN (avg_monthly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] -Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] +Output [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] -Arguments: 100, [i_manager_id#9 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Input [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt index 659a892c7ff2e..3570e17b2f176 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt @@ -16,14 +16,10 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] Project [i_manager_id,ss_sales_price,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_sales_price,i_manager_id] + Project [i_manager_id,ss_sold_date_sk,ss_sales_price] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manager_id] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + Project [i_manager_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -32,6 +28,10 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt index 8589ca31275ea..6601207c6587b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt @@ -7,34 +7,34 @@ TakeOrderedAndProject (42) : +- * BroadcastHashJoin Inner BuildLeft (34) : :- BroadcastExchange (30) : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildLeft (28) - : : :- BroadcastExchange (17) - : : : +- * HashAggregate (16) - : : : +- Exchange (15) - : : : +- * HashAggregate (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- * Filter (27) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (27) : : +- * HashAggregate (26) : : +- Exchange (25) : : +- * HashAggregate (24) - : : +- * Project (23) - : : +- * BroadcastHashJoin Inner BuildRight (22) - : : :- * Filter (20) - : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.store_sales (18) - : : +- ReusedExchange (21) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_sales (15) + : : +- ReusedExchange (18) : +- * Filter (33) : +- * ColumnarToRow (32) : +- Scan parquet default.store (31) @@ -47,7 +47,7 @@ TakeOrderedAndProject (42) Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 2] @@ -55,7 +55,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] (3) Filter [codegen id : 2] Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2452275)) AND isnotnull(ss_store_sk#3)) +Condition : ((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2452275)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#5, d_month_seq#6] @@ -99,94 +99,94 @@ Results [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Arguments: hashpartitioning(ss_store_sk#3, ss_item_sk#2, 5), true, [id=#10] -(13) HashAggregate [codegen id : 3] +(13) HashAggregate [codegen id : 7] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Keys [2]: [ss_store_sk#3, ss_item_sk#2] Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#11] -Results [2]: [ss_store_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] - -(14) HashAggregate [codegen id : 3] -Input [2]: [ss_store_sk#3, revenue#12] -Keys [1]: [ss_store_sk#3] -Functions [1]: [partial_avg(revenue#12)] -Aggregate Attributes [2]: [sum#13, count#14] -Results [3]: [ss_store_sk#3, sum#15, count#16] - -(15) Exchange -Input [3]: [ss_store_sk#3, sum#15, count#16] -Arguments: hashpartitioning(ss_store_sk#3, 5), true, [id=#17] - -(16) HashAggregate [codegen id : 4] -Input [3]: [ss_store_sk#3, sum#15, count#16] -Keys [1]: [ss_store_sk#3] -Functions [1]: [avg(revenue#12)] -Aggregate Attributes [1]: [avg(revenue#12)#18] -Results [2]: [ss_store_sk#3, avg(revenue#12)#18 AS ave#19] - -(17) BroadcastExchange -Input [2]: [ss_store_sk#3, ave#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] - -(18) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Results [3]: [ss_store_sk#3, ss_item_sk#2, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] + +(14) Filter [codegen id : 7] +Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] +Condition : isnotnull(revenue#12) + +(15) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 6] -Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +(16) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -(20) Filter [codegen id : 6] -Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Condition : ((((isnotnull(ss_sold_date_sk#21) AND (ss_sold_date_sk#21 >= 2451911)) AND (ss_sold_date_sk#21 <= 2452275)) AND isnotnull(ss_store_sk#23)) AND isnotnull(ss_item_sk#22)) +(17) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Condition : (((isnotnull(ss_sold_date_sk#13) AND (ss_sold_date_sk#13 >= 2451911)) AND (ss_sold_date_sk#13 <= 2452275)) AND isnotnull(ss_store_sk#15)) -(21) ReusedExchange [Reuses operator id: 8] +(18) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#5] -(22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#21] +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] Right keys [1]: [d_date_sk#5] Join condition: None -(23) Project [codegen id : 6] -Output [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Input [5]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24, d_date_sk#5] - -(24) HashAggregate [codegen id : 6] -Input [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Keys [2]: [ss_store_sk#23, ss_item_sk#22] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#24))] -Aggregate Attributes [1]: [sum#25] -Results [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +(20) Project [codegen id : 4] +Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Input [5]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, d_date_sk#5] + +(21) HashAggregate [codegen id : 4] +Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum#17] +Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] + +(22) Exchange +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] +Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), true, [id=#19] + +(23) HashAggregate [codegen id : 5] +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#20] +Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#20,17,2) AS revenue#21] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ss_store_sk#15, revenue#21] +Keys [1]: [ss_store_sk#15] +Functions [1]: [partial_avg(revenue#21)] +Aggregate Attributes [2]: [sum#22, count#23] +Results [3]: [ss_store_sk#15, sum#24, count#25] (25) Exchange -Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] -Arguments: hashpartitioning(ss_store_sk#23, ss_item_sk#22, 5), true, [id=#27] +Input [3]: [ss_store_sk#15, sum#24, count#25] +Arguments: hashpartitioning(ss_store_sk#15, 5), true, [id=#26] -(26) HashAggregate -Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] -Keys [2]: [ss_store_sk#23, ss_item_sk#22] -Functions [1]: [sum(UnscaledValue(ss_sales_price#24))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#24))#28] -Results [3]: [ss_store_sk#23, ss_item_sk#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#24))#28,17,2) AS revenue#29] +(26) HashAggregate [codegen id : 6] +Input [3]: [ss_store_sk#15, sum#24, count#25] +Keys [1]: [ss_store_sk#15] +Functions [1]: [avg(revenue#21)] +Aggregate Attributes [1]: [avg(revenue#21)#27] +Results [2]: [ss_store_sk#15, avg(revenue#21)#27 AS ave#28] -(27) Filter -Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] -Condition : isnotnull(revenue#29) +(27) BroadcastExchange +Input [2]: [ss_store_sk#15, ave#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (28) BroadcastHashJoin [codegen id : 7] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [ss_store_sk#23] -Join condition: (cast(revenue#29 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#19)), DecimalType(23,7), true)) +Right keys [1]: [ss_store_sk#15] +Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true)) (29) Project [codegen id : 7] -Output [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] -Input [5]: [ss_store_sk#3, ave#19, ss_store_sk#23, ss_item_sk#22, revenue#29] +Output [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] +Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, ss_store_sk#15, ave#28] (30) BroadcastExchange -Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] +Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] (31) Scan parquet default.store @@ -204,16 +204,16 @@ Input [2]: [s_store_sk#31, s_store_name#32] Condition : isnotnull(s_store_sk#31) (34) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ss_store_sk#23] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#31] Join condition: None (35) Project [codegen id : 8] -Output [3]: [ss_item_sk#22, revenue#29, s_store_name#32] -Input [5]: [ss_store_sk#23, ss_item_sk#22, revenue#29, s_store_sk#31, s_store_name#32] +Output [3]: [ss_item_sk#2, revenue#12, s_store_name#32] +Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, s_store_sk#31, s_store_name#32] (36) BroadcastExchange -Input [3]: [ss_item_sk#22, revenue#29, s_store_name#32] +Input [3]: [ss_item_sk#2, revenue#12, s_store_name#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33] (37) Scan parquet default.item @@ -231,15 +231,15 @@ Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#3 Condition : isnotnull(i_item_sk#34) (40) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_item_sk#22] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#34] Join condition: None (41) Project [codegen id : 9] -Output [6]: [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Input [8]: [ss_item_sk#22, revenue#29, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Output [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [8]: [ss_item_sk#2, revenue#12, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] (42) TakeOrderedAndProject -Input [6]: [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt index 0ab5c13022fea..21aa4974877f6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt @@ -12,18 +12,38 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes WholeStageCodegen (7) Project [ss_store_sk,ss_item_sk,revenue] BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #3 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #3 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (6) HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] InputAdapter - Exchange [ss_store_sk] #4 - WholeStageCodegen (3) + Exchange [ss_store_sk] #6 + WholeStageCodegen (5) HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] InputAdapter - Exchange [ss_store_sk,ss_item_sk] #5 - WholeStageCodegen (2) + Exchange [ss_store_sk,ss_item_sk] #7 + WholeStageCodegen (4) HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] Project [ss_item_sk,ss_store_sk,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -32,27 +52,7 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] - Filter [revenue] - HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] - InputAdapter - Exchange [ss_store_sk,ss_item_sk] #7 - WholeStageCodegen (6) - HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] - Project [ss_item_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #6 + ReusedExchange [d_date_sk] #4 Filter [s_store_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt index 4d5b12418398f..52641b6986146 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt @@ -6,46 +6,46 @@ TakeOrderedAndProject (52) : +- Exchange (43) : +- * Project (42) : +- * SortMergeJoin Inner (41) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer (1) + : :- * Sort (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildLeft (29) + : : :- BroadcastExchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.customer_address (26) : +- * Sort (40) : +- Exchange (39) - : +- * HashAggregate (38) - : +- Exchange (37) - : +- * HashAggregate (36) - : +- * Project (35) - : +- * BroadcastHashJoin Inner BuildLeft (34) - : :- BroadcastExchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Project (22) - : : : +- * BroadcastHashJoin Inner BuildRight (21) - : : : :- * Project (15) - : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : :- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.store_sales (6) - : : : : +- BroadcastExchange (13) - : : : : +- * Project (12) - : : : : +- * Filter (11) - : : : : +- * ColumnarToRow (10) - : : : : +- Scan parquet default.date_dim (9) - : : : +- BroadcastExchange (20) - : : : +- * Project (19) - : : : +- * Filter (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.store (16) - : : +- BroadcastExchange (27) - : : +- * Project (26) - : : +- * Filter (25) - : : +- * ColumnarToRow (24) - : : +- Scan parquet default.household_demographics (23) - : +- * Filter (33) - : +- * ColumnarToRow (32) - : +- Scan parquet default.customer_address (31) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.customer (36) +- * Sort (49) +- Exchange (48) +- * Filter (47) @@ -53,237 +53,237 @@ TakeOrderedAndProject (52) +- Scan parquet default.customer_address (45) -(1) Scan parquet default.customer -Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] - -(3) Filter [codegen id : 1] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) - -(4) Exchange -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#5] - -(5) Sort [codegen id : 2] -Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] -Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.store_sales -Output [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +(1) Scan parquet default.store_sales +Output [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [In(ss_sold_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 6] -Input [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] +(2) ColumnarToRow [codegen id : 4] +Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] -(8) Filter [codegen id : 6] -Input [9]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -Condition : (((((ss_sold_date_sk#6 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_hdemo_sk#8)) AND isnotnull(ss_addr_sk#9)) AND isnotnull(ss_customer_sk#7)) +(3) Filter [codegen id : 4] +Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +Condition : (((((ss_sold_date_sk#1 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_addr_sk#4)) AND isnotnull(ss_customer_sk#2)) -(9) Scan parquet default.date_dim -Output [3]: [d_date_sk#15, d_year#16, d_dom#17] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dom#12] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#15, d_year#16, d_dom#17] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] -(11) Filter [codegen id : 3] -Input [3]: [d_date_sk#15, d_year#16, d_dom#17] -Condition : (((((isnotnull(d_dom#17) AND (d_dom#17 >= 1)) AND (d_dom#17 <= 2)) AND d_year#16 IN (1999,2000,2001)) AND d_date_sk#15 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#15)) +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +Condition : (((((isnotnull(d_dom#12) AND (d_dom#12 >= 1)) AND (d_dom#12 <= 2)) AND d_year#11 IN (1999,2000,2001)) AND d_date_sk#10 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#10)) -(12) Project [codegen id : 3] -Output [1]: [d_date_sk#15] -Input [3]: [d_date_sk#15, d_year#16, d_dom#17] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dom#12] -(13) BroadcastExchange -Input [1]: [d_date_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] -(14) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#15] +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None -(15) Project [codegen id : 6] -Output [8]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -Input [10]: [ss_sold_date_sk#6, ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, d_date_sk#15] +(10) Project [codegen id : 4] +Output [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +Input [10]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, d_date_sk#10] -(16) Scan parquet default.store -Output [2]: [s_store_sk#19, s_city#20] +(11) Scan parquet default.store +Output [2]: [s_store_sk#14, s_city#15] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] ReadSchema: struct -(17) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#19, s_city#20] +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] -(18) Filter [codegen id : 4] -Input [2]: [s_store_sk#19, s_city#20] -Condition : (s_city#20 IN (Midway,Fairview) AND isnotnull(s_store_sk#19)) +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] +Condition : (s_city#15 IN (Midway,Fairview) AND isnotnull(s_store_sk#14)) -(19) Project [codegen id : 4] -Output [1]: [s_store_sk#19] -Input [2]: [s_store_sk#19, s_city#20] +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_city#15] -(20) BroadcastExchange -Input [1]: [s_store_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] +(15) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] -(21) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_store_sk#10] -Right keys [1]: [s_store_sk#19] +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#14] Join condition: None -(22) Project [codegen id : 6] -Output [7]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -Input [9]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, s_store_sk#19] +(17) Project [codegen id : 4] +Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +Input [9]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, s_store_sk#14] -(23) Scan parquet default.household_demographics -Output [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] Batched: true Location [not included in comparison]/{warehouse_dir}/household_demographics] PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] ReadSchema: struct -(24) ColumnarToRow [codegen id : 5] -Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] -(25) Filter [codegen id : 5] -Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] -Condition : (((hd_dep_count#23 = 5) OR (hd_vehicle_count#24 = 3)) AND isnotnull(hd_demo_sk#22)) +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Condition : (((hd_dep_count#18 = 5) OR (hd_vehicle_count#19 = 3)) AND isnotnull(hd_demo_sk#17)) -(26) Project [codegen id : 5] -Output [1]: [hd_demo_sk#22] -Input [3]: [hd_demo_sk#22, hd_dep_count#23, hd_vehicle_count#24] +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#17] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] -(27) BroadcastExchange -Input [1]: [hd_demo_sk#22] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] +(22) BroadcastExchange +Input [1]: [hd_demo_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] -(28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_hdemo_sk#8] -Right keys [1]: [hd_demo_sk#22] +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#17] Join condition: None -(29) Project [codegen id : 6] -Output [6]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -Input [8]: [ss_customer_sk#7, ss_hdemo_sk#8, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, hd_demo_sk#22] +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, hd_demo_sk#17] -(30) BroadcastExchange -Input [6]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#26] +(25) BroadcastExchange +Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#21] -(31) Scan parquet default.customer_address -Output [2]: [ca_address_sk#27, ca_city#28] +(26) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_city#23] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct -(32) ColumnarToRow -Input [2]: [ca_address_sk#27, ca_city#28] +(27) ColumnarToRow +Input [2]: [ca_address_sk#22, ca_city#23] -(33) Filter -Input [2]: [ca_address_sk#27, ca_city#28] -Condition : (isnotnull(ca_address_sk#27) AND isnotnull(ca_city#28)) +(28) Filter +Input [2]: [ca_address_sk#22, ca_city#23] +Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) -(34) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_addr_sk#9] -Right keys [1]: [ca_address_sk#27] +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#4] +Right keys [1]: [ca_address_sk#22] Join condition: None -(35) Project [codegen id : 7] -Output [7]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_city#28] -Input [8]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_address_sk#27, ca_city#28] - -(36) HashAggregate [codegen id : 7] -Input [7]: [ss_customer_sk#7, ss_addr_sk#9, ss_ticket_number#11, ss_ext_sales_price#12, ss_ext_list_price#13, ss_ext_tax#14, ca_city#28] -Keys [4]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28] -Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#12)), partial_sum(UnscaledValue(ss_ext_list_price#13)), partial_sum(UnscaledValue(ss_ext_tax#14))] -Aggregate Attributes [3]: [sum#29, sum#30, sum#31] -Results [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] +(30) Project [codegen id : 5] +Output [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_city#23] +Input [8]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_address_sk#22, ca_city#23] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_ext_sales_price#7, ss_ext_list_price#8, ss_ext_tax#9, ca_city#23] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#7)), partial_sum(UnscaledValue(ss_ext_list_price#8)), partial_sum(UnscaledValue(ss_ext_tax#9))] +Aggregate Attributes [3]: [sum#24, sum#25, sum#26] +Results [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] + +(32) Exchange +Input [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] +Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, 5), true, [id=#30] + +(33) HashAggregate [codegen id : 6] +Input [7]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23, sum#27, sum#28, sum#29] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, ca_city#23] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#7)), sum(UnscaledValue(ss_ext_list_price#8)), sum(UnscaledValue(ss_ext_tax#9))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#7))#31, sum(UnscaledValue(ss_ext_list_price#8))#32, sum(UnscaledValue(ss_ext_tax#9))#33] +Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ca_city#23 AS bought_city#34, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#31,17,2) AS extended_price#35, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#8))#32,17,2) AS list_price#36, MakeDecimal(sum(UnscaledValue(ss_ext_tax#9))#33,17,2) AS extended_tax#37] + +(34) Exchange +Input [6]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#38] + +(35) Sort [codegen id : 7] +Input [6]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(36) Scan parquet default.customer +Output [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(37) Exchange -Input [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] -Arguments: hashpartitioning(ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, 5), true, [id=#35] +(37) ColumnarToRow [codegen id : 8] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] -(38) HashAggregate [codegen id : 8] -Input [7]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28, sum#32, sum#33, sum#34] -Keys [4]: [ss_ticket_number#11, ss_customer_sk#7, ss_addr_sk#9, ca_city#28] -Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#12)), sum(UnscaledValue(ss_ext_list_price#13)), sum(UnscaledValue(ss_ext_tax#14))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#12))#36, sum(UnscaledValue(ss_ext_list_price#13))#37, sum(UnscaledValue(ss_ext_tax#14))#38] -Results [6]: [ss_ticket_number#11, ss_customer_sk#7, ca_city#28 AS bought_city#39, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#12))#36,17,2) AS extended_price#40, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#13))#37,17,2) AS list_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_tax#14))#38,17,2) AS extended_tax#42] +(38) Filter [codegen id : 8] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#40)) (39) Exchange -Input [6]: [ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] -Arguments: hashpartitioning(ss_customer_sk#7, 5), true, [id=#43] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: hashpartitioning(c_customer_sk#39, 5), true, [id=#43] (40) Sort [codegen id : 9] -Input [6]: [ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] -Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: [c_customer_sk#39 ASC NULLS FIRST], false, 0 (41) SortMergeJoin [codegen id : 10] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ss_customer_sk#7] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#39] Join condition: None (42) Project [codegen id : 10] -Output [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] -Input [10]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, ss_customer_sk#7, bought_city#39, extended_price#40, list_price#41, extended_tax#42] +Output [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Input [10]: [ss_ticket_number#6, ss_customer_sk#2, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] (43) Exchange -Input [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] -Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#44] +Input [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: hashpartitioning(c_current_addr_sk#40, 5), true, [id=#44] (44) Sort [codegen id : 11] -Input [8]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42] -Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [8]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: [c_current_addr_sk#40 ASC NULLS FIRST], false, 0 (45) Scan parquet default.customer_address -Output [2]: [ca_address_sk#27, ca_city#28] +Output [2]: [ca_address_sk#22, ca_city#23] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] ReadSchema: struct (46) ColumnarToRow [codegen id : 12] -Input [2]: [ca_address_sk#27, ca_city#28] +Input [2]: [ca_address_sk#22, ca_city#23] (47) Filter [codegen id : 12] -Input [2]: [ca_address_sk#27, ca_city#28] -Condition : (isnotnull(ca_address_sk#27) AND isnotnull(ca_city#28)) +Input [2]: [ca_address_sk#22, ca_city#23] +Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) (48) Exchange -Input [2]: [ca_address_sk#27, ca_city#28] -Arguments: hashpartitioning(ca_address_sk#27, 5), true, [id=#45] +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: hashpartitioning(ca_address_sk#22, 5), true, [id=#45] (49) Sort [codegen id : 13] -Input [2]: [ca_address_sk#27, ca_city#28] -Arguments: [ca_address_sk#27 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: [ca_address_sk#22 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 14] -Left keys [1]: [c_current_addr_sk#2] -Right keys [1]: [ca_address_sk#27] -Join condition: NOT (ca_city#28 = bought_city#39) +Left keys [1]: [c_current_addr_sk#40] +Right keys [1]: [ca_address_sk#22] +Join condition: NOT (ca_city#23 = bought_city#34) (51) Project [codegen id : 14] -Output [8]: [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] -Input [10]: [c_current_addr_sk#2, c_first_name#3, c_last_name#4, ss_ticket_number#11, bought_city#39, extended_price#40, list_price#41, extended_tax#42, ca_address_sk#27, ca_city#28] +Output [8]: [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] +Input [10]: [ss_ticket_number#6, bought_city#34, extended_price#35, list_price#36, extended_tax#37, c_current_addr_sk#40, c_first_name#41, c_last_name#42, ca_address_sk#22, ca_city#23] (52) TakeOrderedAndProject -Input [8]: [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] -Arguments: 100, [c_last_name#4 ASC NULLS FIRST, ss_ticket_number#11 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#28, bought_city#39, ss_ticket_number#11, extended_price#40, extended_tax#42, list_price#41] +Input [8]: [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] +Arguments: 100, [c_last_name#42 ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, ca_city#23, bought_city#34, ss_ticket_number#6, extended_price#35, extended_tax#37, list_price#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt index eaa24f00b9cfe..6fd7148b9a8fb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt @@ -8,34 +8,24 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Exchange [c_current_addr_sk] #1 WholeStageCodegen (10) - Project [c_current_addr_sk,c_first_name,c_last_name,ss_ticket_number,bought_city,extended_price,list_price,extended_tax] - SortMergeJoin [c_customer_sk,ss_customer_sk] + Project [ss_ticket_number,bought_city,extended_price,list_price,extended_tax,c_current_addr_sk,c_first_name,c_last_name] + SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (2) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #2 - WholeStageCodegen (1) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] - InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (7) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #3 - WholeStageCodegen (8) + Exchange [ss_customer_sk] #2 + WholeStageCodegen (6) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] InputAdapter - Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #4 - WholeStageCodegen (7) + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #3 + WholeStageCodegen (5) HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] BroadcastHashJoin [ss_addr_sk,ca_address_sk] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (6) + BroadcastExchange #4 + WholeStageCodegen (4) Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] @@ -47,24 +37,24 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (3) + BroadcastExchange #5 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_dom,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (4) + BroadcastExchange #6 + WholeStageCodegen (2) Project [s_store_sk] Filter [s_city,s_store_sk] ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_city] InputAdapter - BroadcastExchange #8 - WholeStageCodegen (5) + BroadcastExchange #7 + WholeStageCodegen (3) Project [hd_demo_sk] Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] ColumnarToRow @@ -74,6 +64,16 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (8) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (13) Sort [ca_address_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt index 4fcabebfce591..034d9fd0344b0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (37) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -38,50 +38,50 @@ TakeOrderedAndProject (37) +- Scan parquet default.customer (30) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_dow#3] +(1) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450819), LessThanOrEqual(ss_sold_date_sk,2451904), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dow#3] +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dow#3] -Condition : (((((isnotnull(d_dow#3) AND (d_dow#3 = 1)) AND d_year#2 IN (1998,1999,2000)) AND (d_date_sk#1 >= 2450819)) AND (d_date_sk#1 <= 2451904)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Condition : (((((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2450819)) AND (ss_sold_date_sk#1 <= 2451904)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_dow#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_dow#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -(6) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2450819), LessThanOrEqual(ss_sold_date_sk,2451904), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] +Condition : (((((isnotnull(d_dow#11) AND (d_dow#11 = 1)) AND d_year#10 IN (1998,1999,2000)) AND (d_date_sk#9 >= 2450819)) AND (d_date_sk#9 <= 2451904)) AND isnotnull(d_date_sk#9)) -(7) ColumnarToRow -Input [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_dow#11] -(8) Filter -Input [8]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] -Condition : (((((isnotnull(ss_sold_date_sk#5) AND (ss_sold_date_sk#5 >= 2450819)) AND (ss_sold_date_sk#5 <= 2451904)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None (10) Project [codegen id : 4] -Output [7]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] -Input [9]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] +Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, d_date_sk#9] (11) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15] @@ -106,13 +106,13 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#7] +Left keys [1]: [ss_hdemo_sk#3] Right keys [1]: [hd_demo_sk#13] Join condition: None (17) Project [codegen id : 4] -Output [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12] -Input [8]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, hd_demo_sk#13] +Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8] +Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, hd_demo_sk#13] (18) Scan parquet default.store Output [3]: [s_store_sk#17, s_number_employees#18, s_city#19] @@ -137,39 +137,39 @@ Input [2]: [s_store_sk#17, s_city#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#9] +Left keys [1]: [ss_store_sk#5] Right keys [1]: [s_store_sk#17] Join condition: None (24) Project [codegen id : 4] -Output [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_city#19] -Input [8]: [ss_customer_sk#6, ss_addr_sk#8, ss_store_sk#9, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_store_sk#17, s_city#19] +Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#19] +Input [8]: [ss_customer_sk#2, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#17, s_city#19] (25) HashAggregate [codegen id : 4] -Input [6]: [ss_customer_sk#6, ss_addr_sk#8, ss_ticket_number#10, ss_coupon_amt#11, ss_net_profit#12, s_city#19] -Keys [4]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19] -Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#11)), partial_sum(UnscaledValue(ss_net_profit#12))] +Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#19] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#7)), partial_sum(UnscaledValue(ss_net_profit#8))] Aggregate Attributes [2]: [sum#21, sum#22] -Results [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] +Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] (26) Exchange -Input [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] -Arguments: hashpartitioning(ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, 5), true, [id=#25] +Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] +Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, 5), true, [id=#25] (27) HashAggregate [codegen id : 5] -Input [6]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19, sum#23, sum#24] -Keys [4]: [ss_ticket_number#10, ss_customer_sk#6, ss_addr_sk#8, s_city#19] -Functions [2]: [sum(UnscaledValue(ss_coupon_amt#11)), sum(UnscaledValue(ss_net_profit#12))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#11))#26, sum(UnscaledValue(ss_net_profit#12))#27] -Results [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#26,17,2) AS amt#28, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#27,17,2) AS profit#29] +Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19, sum#23, sum#24] +Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#19] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#26, sum(UnscaledValue(ss_net_profit#8))#27] +Results [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#26,17,2) AS amt#28, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#27,17,2) AS profit#29] (28) Exchange -Input [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29] -Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#30] +Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29] -Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 +Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (30) Scan parquet default.customer Output [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] @@ -194,15 +194,15 @@ Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 (35) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#6] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#31] Join condition: None (36) Project [codegen id : 9] -Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#19, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29, s_city#19] -Input [8]: [ss_ticket_number#10, ss_customer_sk#6, s_city#19, amt#28, profit#29, c_customer_sk#31, c_first_name#32, c_last_name#33] +Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#19, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29, s_city#19] +Input [8]: [ss_ticket_number#6, ss_customer_sk#2, s_city#19, amt#28, profit#29, c_customer_sk#31, c_first_name#32, c_last_name#33] (37) TakeOrderedAndProject -Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29, s_city#19] -Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#19, 1, 30) ASC NULLS FIRST, profit#29 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#10, amt#28, profit#29] +Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29, s_city#19] +Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#19, 1, 30) ASC NULLS FIRST, profit#29 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#6, amt#28, profit#29] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt index c4063593260b3..e031b8c4c836c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt @@ -18,7 +18,11 @@ TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, Project [ss_customer_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -27,10 +31,6 @@ TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dow] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt index 45502e5d3db55..47842568c1bc7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt @@ -14,15 +14,15 @@ :- * Sort (12) : +- Exchange (11) : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- * Sort (17) +- Exchange (16) +- * Filter (15) @@ -30,58 +30,58 @@ +- Scan parquet default.item (13) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_date#2] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2451941), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] -Condition : (((((isnotnull(d_date#2) AND (d_date#2 >= 11323)) AND (d_date#2 <= 11353)) AND (d_date_sk#1 >= 2451911)) AND (d_date_sk#1 <= 2451941)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (((isnotnull(ss_sold_date_sk#1) AND (ss_sold_date_sk#1 >= 2451911)) AND (ss_sold_date_sk#1 <= 2451941)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_date#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2451941), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((((isnotnull(d_date#5) AND (d_date#5 >= 11323)) AND (d_date#5 <= 11353)) AND (d_date_sk#4 >= 2451911)) AND (d_date_sk#4 <= 2451941)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter -Input [3]: [ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] -Condition : (((isnotnull(ss_sold_date_sk#4) AND (ss_sold_date_sk#4 >= 2451911)) AND (ss_sold_date_sk#4 <= 2451941)) AND isnotnull(ss_item_sk#5)) +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 2] -Output [2]: [ss_item_sk#5, ss_ext_sales_price#6] -Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_ext_sales_price#6] +Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] (11) Exchange -Input [2]: [ss_item_sk#5, ss_ext_sales_price#6] -Arguments: hashpartitioning(ss_item_sk#5, 5), true, [id=#7] +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] -Input [2]: [ss_item_sk#5, ss_ext_sales_price#6] -Arguments: [ss_item_sk#5 ASC NULLS FIRST], false, 0 +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 (13) Scan parquet default.item Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -106,18 +106,18 @@ Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_clas Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 (18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -128,9 +128,9 @@ Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class# (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#18,17,2) AS _w1#21, i_item_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt index 03c07cdabbf00..7146d246053b3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt @@ -26,7 +26,11 @@ WholeStageCodegen (10) Exchange [ss_item_sk] #4 WholeStageCodegen (2) Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -35,10 +39,6 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt index f8ff205c69fea..5bd420ff1a820 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt @@ -8,50 +8,50 @@ TakeOrderedAndProject (58) :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildLeft (44) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) - : +- * Project (43) - : +- * Filter (42) - : +- SortMergeJoin ExistenceJoin(exists#1) (41) - : :- SortMergeJoin ExistenceJoin(exists#2) (32) - : : :- SortMergeJoin LeftSemi (23) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.customer (6) - : : : +- * Sort (22) - : : : +- Exchange (21) - : : : +- * Project (20) - : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : :- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store_sales (11) - : : : +- BroadcastExchange (18) - : : : +- * Project (17) - : : : +- * Filter (16) - : : : +- * ColumnarToRow (15) - : : : +- Scan parquet default.date_dim (14) - : : +- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_sales (24) - : : +- ReusedExchange (27) - : +- * Sort (40) - : +- Exchange (39) - : +- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.catalog_sales (33) - : +- ReusedExchange (36) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (38) + : : +- * Filter (37) + : : +- SortMergeJoin ExistenceJoin(exists#1) (36) + : : :- SortMergeJoin ExistenceJoin(exists#2) (27) + : : : :- SortMergeJoin LeftSemi (18) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (17) + : : : : +- Exchange (16) + : : : : +- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.catalog_sales (28) + : : +- ReusedExchange (31) + : +- BroadcastExchange (43) + : +- * Project (42) + : +- * Filter (41) + : +- * ColumnarToRow (40) + : +- Scan parquet default.customer_address (39) +- * Sort (52) +- Exchange (51) +- * Filter (50) @@ -59,210 +59,210 @@ TakeOrderedAndProject (58) +- Scan parquet default.customer_demographics (48) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#3, ca_county#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_county#4] - -(3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_county#4] -Condition : (ca_county#4 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#3)) - -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#3] -Input [2]: [ca_address_sk#3, ca_county#4] - -(5) BroadcastExchange -Input [1]: [ca_address_sk#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] - -(6) Scan parquet default.customer -Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] -(8) Filter [codegen id : 2] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) -(9) Exchange -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] +(4) Exchange +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] -(10) Sort [codegen id : 3] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(6) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -(13) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -Condition : isnotnull(ss_sold_date_sk#10) +(8) Filter [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +Condition : isnotnull(ss_sold_date_sk#7) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#12, d_year#13, d_moy#14] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_moy#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#12, d_year#13, d_moy#14] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] -(16) Filter [codegen id : 4] -Input [3]: [d_date_sk#12, d_year#13, d_moy#14] -Condition : (((((isnotnull(d_year#13) AND isnotnull(d_moy#14)) AND (d_year#13 = 2002)) AND (d_moy#14 >= 1)) AND (d_moy#14 <= 4)) AND isnotnull(d_date_sk#12)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] +Condition : (((((isnotnull(d_year#10) AND isnotnull(d_moy#11)) AND (d_year#10 = 2002)) AND (d_moy#11 >= 1)) AND (d_moy#11 <= 4)) AND isnotnull(d_date_sk#9)) -(17) Project [codegen id : 4] -Output [1]: [d_date_sk#12] -Input [3]: [d_date_sk#12, d_year#13, d_moy#14] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] -(18) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(13) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(19) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#10] -Right keys [1]: [d_date_sk#12] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] Join condition: None -(20) Project [codegen id : 5] -Output [1]: [ss_customer_sk#11] -Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] +(15) Project [codegen id : 4] +Output [1]: [ss_customer_sk#8] +Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] -(21) Exchange -Input [1]: [ss_customer_sk#11] -Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] +(16) Exchange +Input [1]: [ss_customer_sk#8] +Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] -(22) Sort [codegen id : 6] -Input [1]: [ss_customer_sk#11] -Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#8] +Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 -(23) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ss_customer_sk#11] +(18) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#8] Join condition: None -(24) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(19) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 8] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -(26) Filter [codegen id : 8] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -Condition : isnotnull(ws_sold_date_sk#17) +(21) Filter [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +Condition : isnotnull(ws_sold_date_sk#14) -(27) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(28) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ws_sold_date_sk#17] -Right keys [1]: [d_date_sk#12] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#9] Join condition: None -(29) Project [codegen id : 8] -Output [1]: [ws_bill_customer_sk#18] -Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] -(30) Exchange -Input [1]: [ws_bill_customer_sk#18] -Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] +(25) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] -(31) Sort [codegen id : 9] -Input [1]: [ws_bill_customer_sk#18] -Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 8] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 -(32) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ws_bill_customer_sk#18] +(27) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] Join condition: None -(33) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(28) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(29) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -(35) Filter [codegen id : 11] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -Condition : isnotnull(cs_sold_date_sk#20) +(30) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +Condition : isnotnull(cs_sold_date_sk#17) -(36) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(31) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_sold_date_sk#20] -Right keys [1]: [d_date_sk#12] +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#9] Join condition: None -(38) Project [codegen id : 11] -Output [1]: [cs_ship_customer_sk#21] -Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] +(33) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] -(39) Exchange -Input [1]: [cs_ship_customer_sk#21] -Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] +(34) Exchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] -(40) Sort [codegen id : 12] -Input [1]: [cs_ship_customer_sk#21] -Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 +(35) Sort [codegen id : 11] +Input [1]: [cs_ship_customer_sk#18] +Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [cs_ship_customer_sk#21] +(36) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] Join condition: None -(42) Filter -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +(37) Filter [codegen id : 13] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] Condition : (exists#2 OR exists#1) -(43) Project -Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +(38) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(39) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_county#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 12] +Input [2]: [ca_address_sk#20, ca_county#21] + +(41) Filter [codegen id : 12] +Input [2]: [ca_address_sk#20, ca_county#21] +Condition : (ca_county#21 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#20)) + +(42) Project [codegen id : 12] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_county#21] + +(43) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (44) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ca_address_sk#3] -Right keys [1]: [c_current_addr_sk#8] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#20] Join condition: None (45) Project [codegen id : 13] -Output [1]: [c_current_cdemo_sk#7] -Input [3]: [ca_address_sk#3, c_current_cdemo_sk#7, c_current_addr_sk#8] +Output [1]: [c_current_cdemo_sk#4] +Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#20] (46) Exchange -Input [1]: [c_current_cdemo_sk#7] -Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#23] +Input [1]: [c_current_cdemo_sk#4] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#23] (47) Sort [codegen id : 14] -Input [1]: [c_current_cdemo_sk#7] -Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 +Input [1]: [c_current_cdemo_sk#4] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 (48) Scan parquet default.customer_demographics Output [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] @@ -287,13 +287,13 @@ Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_stat Arguments: [cd_demo_sk#24 ASC NULLS FIRST], false, 0 (53) SortMergeJoin [codegen id : 17] -Left keys [1]: [c_current_cdemo_sk#7] +Left keys [1]: [c_current_cdemo_sk#4] Right keys [1]: [cd_demo_sk#24] Join condition: None (54) Project [codegen id : 17] Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] -Input [10]: [c_current_cdemo_sk#7, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] (55) HashAggregate [codegen id : 17] Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt index e49432924d06d..85b7f1195a257 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt @@ -14,35 +14,27 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (13) Project [c_current_cdemo_sk] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (2) + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (6) + WholeStageCodegen (5) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #5 - WholeStageCodegen (5) + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -50,18 +42,18 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (9) + WholeStageCodegen (8) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #7 - WholeStageCodegen (8) + Exchange [ws_bill_customer_sk] #6 + WholeStageCodegen (7) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -69,12 +61,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (12) + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (11) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #8 - WholeStageCodegen (11) + Exchange [cs_ship_customer_sk] #7 + WholeStageCodegen (10) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -82,7 +74,15 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (12) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] InputAdapter WholeStageCodegen (16) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt index 3e1c71d76a5f0..d8dbb6d131d66 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt @@ -17,14 +17,14 @@ TakeOrderedAndProject (87) : : : :- * Sort (11) : : : : +- Exchange (10) : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : :- BroadcastExchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (7) - : : : : +- * ColumnarToRow (6) - : : : : +- Scan parquet default.store_sales (5) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- * Sort (16) : : : +- Exchange (15) : : : +- * Filter (14) @@ -62,11 +62,11 @@ TakeOrderedAndProject (87) : :- * Sort (54) : : +- Exchange (53) : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildLeft (51) - : : :- ReusedExchange (47) - : : +- * Filter (50) - : : +- * ColumnarToRow (49) - : : +- Scan parquet default.web_sales (48) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) : +- * Sort (56) : +- ReusedExchange (55) +- * Sort (84) @@ -88,54 +88,54 @@ TakeOrderedAndProject (87) +- ReusedExchange (76) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] -(4) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] +(3) Filter [codegen id : 2] +Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(5) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_year#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(6) ColumnarToRow -Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] -(7) Filter -Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] +Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2001)) AND isnotnull(d_date_sk#5)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#5, d_year#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (9) Project [codegen id : 2] -Output [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] -Input [6]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Output [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_date_sk#5, d_year#6] (10) Exchange -Input [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#8] +Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#8] (11) Sort [codegen id : 3] -Input [4]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] @@ -160,31 +160,31 @@ Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None (18) Project [codegen id : 6] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Input [12]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Input [12]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (19) HashAggregate [codegen id : 6] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#18] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] (20) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#20] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#20] (21) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#21] -Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21] +Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] (22) Filter [codegen id : 7] Input [2]: [customer_id#22, year_total#23] @@ -199,53 +199,53 @@ Input [2]: [customer_id#22, year_total#23] Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 (25) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (26) ColumnarToRow [codegen id : 10] -Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] +Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] (27) Filter [codegen id : 10] -Input [4]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) +Input [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) (28) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +Output [2]: [d_date_sk#5, d_year#6] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] ReadSchema: struct (29) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] +Input [2]: [d_date_sk#5, d_year#6] (30) Filter [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND isnotnull(d_date_sk#1)) +Input [2]: [d_date_sk#5, d_year#6] +Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2002)) AND isnotnull(d_date_sk#5)) (31) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] +Input [2]: [d_date_sk#5, d_year#6] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_sold_date_sk#4] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (33) Project [codegen id : 10] -Output [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_date_sk#1, d_year#2] +Output [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_date_sk#5, d_year#6] (34) Exchange -Input [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#26] +Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#26] (35) Sort [codegen id : 11] -Input [4]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [4]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] @@ -255,31 +255,31 @@ Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None (39) Project [codegen id : 14] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Input [12]: [ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Input [12]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (40) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#6, ss_ext_list_price#7, d_year#2] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#27] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] (41) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#29] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#29] (42) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#2, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#30] -Results [3]: [c_customer_id#10 AS customer_id#31, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#32, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#7 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(8,2)))), DecimalType(8,2), true)))#30,18,2) AS year_total#33] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30] +Results [3]: [c_customer_id#10 AS customer_id#31, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#32, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30,18,2) AS year_total#33] (43) Exchange Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] @@ -298,38 +298,38 @@ Join condition: None Output [4]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33] Input [5]: [customer_id#22, year_total#23, customer_id#31, customer_preferred_cust_flag#32, year_total#33] -(47) ReusedExchange [Reuses operator id: 4] -Output [2]: [d_date_sk#1, d_year#2] - -(48) Scan parquet default.web_sales +(47) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(49) ColumnarToRow +(48) ColumnarToRow [codegen id : 19] Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] -(50) Filter +(49) Filter [codegen id : 19] Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] Condition : (isnotnull(ws_bill_customer_sk#36) AND isnotnull(ws_sold_date_sk#35)) +(50) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#5, d_year#6] + (51) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#35] +Left keys [1]: [ws_sold_date_sk#35] +Right keys [1]: [d_date_sk#5] Join condition: None (52) Project [codegen id : 19] -Output [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] -Input [6]: [d_date_sk#1, d_year#2, ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] +Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#5, d_year#6] (53) Exchange -Input [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] Arguments: hashpartitioning(ws_bill_customer_sk#36, 5), true, [id=#39] (54) Sort [codegen id : 20] -Input [4]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 (55) ReusedExchange [Reuses operator id: 15] @@ -345,23 +345,23 @@ Right keys [1]: [c_customer_sk#9] Join condition: None (58) Project [codegen id : 23] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] -Input [12]: [d_year#2, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (59) HashAggregate [codegen id : 23] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#40] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] (60) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, 5), true, [id=#42] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#42] (61) HashAggregate [codegen id : 24] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#41] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#41] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#43] Results [2]: [c_customer_id#10 AS customer_id#44, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#43,18,2) AS year_total#45] @@ -406,23 +406,23 @@ Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, Condition : (isnotnull(ws_bill_customer_sk#36) AND isnotnull(ws_sold_date_sk#35)) (71) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#1, d_year#2] +Output [2]: [d_date_sk#5, d_year#6] (72) BroadcastHashJoin [codegen id : 28] Left keys [1]: [ws_sold_date_sk#35] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (73) Project [codegen id : 28] -Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] -Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#1, d_year#2] +Output [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [6]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_date_sk#5, d_year#6] (74) Exchange -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] Arguments: hashpartitioning(ws_bill_customer_sk#36, 5), true, [id=#49] (75) Sort [codegen id : 29] -Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] +Input [4]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 (76) ReusedExchange [Reuses operator id: 15] @@ -438,23 +438,23 @@ Right keys [1]: [c_customer_sk#9] Join condition: None (79) Project [codegen id : 32] -Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] -Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Input [12]: [ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (80) HashAggregate [codegen id : 32] -Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#2] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] +Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#37, ws_ext_list_price#38, d_year#6] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum#50] -Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] +Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] (81) Exchange -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] -Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, 5), true, [id=#52] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#52] (82) HashAggregate [codegen id : 33] -Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2, sum#51] -Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#2] +Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#51] +Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))] Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#53] Results [2]: [c_customer_id#10 AS customer_id#54, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#38 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#37 as decimal(8,2)))), DecimalType(8,2), true)))#53,18,2) AS year_total#55] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt index bcb61d9a84823..72588fa138fc5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt @@ -30,8 +30,12 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -39,10 +43,6 @@ TakeOrderedAndProject [customer_preferred_cust_flag] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -111,14 +111,14 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt index d6da0e09de6be..b4dd8173664b6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Exchange -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] -Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] -Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt index 2207b0fee23ce..e9b94a6b4651c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (1) + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (2) + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt index 77f9c05a340e6..b346701fa3148 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt @@ -13,76 +13,76 @@ TakeOrderedAndProject (131) : +- * Project (82) : +- * BroadcastHashJoin Inner BuildRight (81) : :- * Project (71) - : : +- * BroadcastHashJoin Inner BuildLeft (70) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- SortMergeJoin LeftSemi (69) - : : :- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) - : : +- * Sort (68) - : : +- Exchange (67) - : : +- * Project (66) - : : +- * BroadcastHashJoin Inner BuildRight (65) - : : :- * Filter (13) - : : : +- * ColumnarToRow (12) - : : : +- Scan parquet default.item (11) - : : +- BroadcastExchange (64) - : : +- * HashAggregate (63) - : : +- * HashAggregate (62) - : : +- * HashAggregate (61) - : : +- Exchange (60) - : : +- * HashAggregate (59) - : : +- SortMergeJoin LeftSemi (58) - : : :- SortMergeJoin LeftSemi (46) - : : : :- * Sort (31) - : : : : +- Exchange (30) - : : : : +- * Project (29) - : : : : +- * BroadcastHashJoin Inner BuildRight (28) - : : : : :- * Project (23) - : : : : : +- * BroadcastHashJoin Inner BuildRight (22) - : : : : : :- * Filter (16) - : : : : : : +- * ColumnarToRow (15) - : : : : : : +- Scan parquet default.store_sales (14) - : : : : : +- BroadcastExchange (21) - : : : : : +- * Project (20) - : : : : : +- * Filter (19) - : : : : : +- * ColumnarToRow (18) - : : : : : +- Scan parquet default.date_dim (17) - : : : : +- BroadcastExchange (27) - : : : : +- * Filter (26) - : : : : +- * ColumnarToRow (25) - : : : : +- Scan parquet default.item (24) - : : : +- * Sort (45) - : : : +- Exchange (44) - : : : +- * Project (43) - : : : +- * BroadcastHashJoin Inner BuildRight (42) - : : : :- * Project (37) - : : : : +- * BroadcastHashJoin Inner BuildRight (36) - : : : : :- * Filter (34) - : : : : : +- * ColumnarToRow (33) - : : : : : +- Scan parquet default.catalog_sales (32) - : : : : +- ReusedExchange (35) - : : : +- BroadcastExchange (41) - : : : +- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.item (38) - : : +- * Sort (57) - : : +- Exchange (56) - : : +- * Project (55) - : : +- * BroadcastHashJoin Inner BuildRight (54) - : : :- * Project (52) - : : : +- * BroadcastHashJoin Inner BuildRight (51) - : : : :- * Filter (49) - : : : : +- * ColumnarToRow (48) - : : : : +- Scan parquet default.web_sales (47) - : : : +- ReusedExchange (50) - : : +- ReusedExchange (53) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- SortMergeJoin LeftSemi (64) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (63) + : : : +- Exchange (62) + : : : +- * Project (61) + : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : :- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.item (6) + : : : +- BroadcastExchange (59) + : : : +- * HashAggregate (58) + : : : +- * HashAggregate (57) + : : : +- * HashAggregate (56) + : : : +- Exchange (55) + : : : +- * HashAggregate (54) + : : : +- SortMergeJoin LeftSemi (53) + : : : :- SortMergeJoin LeftSemi (41) + : : : : :- * Sort (26) + : : : : : +- Exchange (25) + : : : : : +- * Project (24) + : : : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : : : :- * Project (18) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : : :- * Filter (11) + : : : : : : : +- * ColumnarToRow (10) + : : : : : : : +- Scan parquet default.store_sales (9) + : : : : : : +- BroadcastExchange (16) + : : : : : : +- * Project (15) + : : : : : : +- * Filter (14) + : : : : : : +- * ColumnarToRow (13) + : : : : : : +- Scan parquet default.date_dim (12) + : : : : : +- BroadcastExchange (22) + : : : : : +- * Filter (21) + : : : : : +- * ColumnarToRow (20) + : : : : : +- Scan parquet default.item (19) + : : : : +- * Sort (40) + : : : : +- Exchange (39) + : : : : +- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Project (32) + : : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : : :- * Filter (29) + : : : : : : +- * ColumnarToRow (28) + : : : : : : +- Scan parquet default.catalog_sales (27) + : : : : : +- ReusedExchange (30) + : : : : +- BroadcastExchange (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.item (33) + : : : +- * Sort (52) + : : : +- Exchange (51) + : : : +- * Project (50) + : : : +- * BroadcastHashJoin Inner BuildRight (49) + : : : :- * Project (47) + : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : :- * Filter (44) + : : : : : +- * ColumnarToRow (43) + : : : : : +- Scan parquet default.web_sales (42) + : : : : +- ReusedExchange (45) + : : : +- ReusedExchange (48) + : : +- BroadcastExchange (69) + : : +- * Project (68) + : : +- * Filter (67) + : : +- * ColumnarToRow (66) + : : +- Scan parquet default.date_dim (65) : +- BroadcastExchange (80) : +- SortMergeJoin LeftSemi (79) : :- * Sort (76) @@ -100,16 +100,16 @@ TakeOrderedAndProject (131) : +- * Project (101) : +- * BroadcastHashJoin Inner BuildRight (100) : :- * Project (98) - : : +- * BroadcastHashJoin Inner BuildLeft (97) - : : :- ReusedExchange (88) - : : +- SortMergeJoin LeftSemi (96) - : : :- * Sort (93) - : : : +- Exchange (92) - : : : +- * Filter (91) - : : : +- * ColumnarToRow (90) - : : : +- Scan parquet default.catalog_sales (89) - : : +- * Sort (95) - : : +- ReusedExchange (94) + : : +- * BroadcastHashJoin Inner BuildRight (97) + : : :- SortMergeJoin LeftSemi (95) + : : : :- * Sort (92) + : : : : +- Exchange (91) + : : : : +- * Filter (90) + : : : : +- * ColumnarToRow (89) + : : : : +- Scan parquet default.catalog_sales (88) + : : : +- * Sort (94) + : : : +- ReusedExchange (93) + : : +- ReusedExchange (96) : +- ReusedExchange (99) +- * Project (125) +- * Filter (124) @@ -119,587 +119,587 @@ TakeOrderedAndProject (131) +- * Project (120) +- * BroadcastHashJoin Inner BuildRight (119) :- * Project (117) - : +- * BroadcastHashJoin Inner BuildLeft (116) - : :- ReusedExchange (107) - : +- SortMergeJoin LeftSemi (115) - : :- * Sort (112) - : : +- Exchange (111) - : : +- * Filter (110) - : : +- * ColumnarToRow (109) - : : +- Scan parquet default.web_sales (108) - : +- * Sort (114) - : +- ReusedExchange (113) + : +- * BroadcastHashJoin Inner BuildRight (116) + : :- SortMergeJoin LeftSemi (114) + : : :- * Sort (111) + : : : +- Exchange (110) + : : : +- * Filter (109) + : : : +- * ColumnarToRow (108) + : : : +- Scan parquet default.web_sales (107) + : : +- * Sort (113) + : : +- ReusedExchange (112) + : +- ReusedExchange (115) +- ReusedExchange (118) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] - -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 11)) AND isnotnull(d_date_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] - -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] - -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -(8) Filter [codegen id : 2] -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] -Condition : (isnotnull(ss_item_sk#6) AND isnotnull(ss_sold_date_sk#5)) +(3) Filter [codegen id : 1] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(9) Exchange -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] -Arguments: hashpartitioning(ss_item_sk#6, 5), true, [id=#9] +(4) Exchange +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#5] -(10) Sort [codegen id : 3] -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] -Arguments: [ss_item_sk#6 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.item -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(6) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 18] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(7) ColumnarToRow [codegen id : 17] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(13) Filter [codegen id : 18] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Condition : ((isnotnull(i_brand_id#11) AND isnotnull(i_class_id#12)) AND isnotnull(i_category_id#13)) +(8) Filter [codegen id : 17] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(14) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#5, ss_item_sk#6] +(9) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#5, ss_item_sk#6] +(10) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -(16) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#5, ss_item_sk#6] -Condition : (isnotnull(ss_item_sk#6) AND isnotnull(ss_sold_date_sk#5)) +(11) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(17) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(18) ColumnarToRow [codegen id : 4] -Input [2]: [d_date_sk#1, d_year#2] +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#10, d_year#11] -(19) Filter [codegen id : 4] -Input [2]: [d_date_sk#1, d_year#2] -Condition : (((isnotnull(d_year#2) AND (d_year#2 >= 1999)) AND (d_year#2 <= 2001)) AND isnotnull(d_date_sk#1)) +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) -(20) Project [codegen id : 4] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#2] +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] -(21) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(16) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#5] -Right keys [1]: [d_date_sk#1] +(17) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None -(23) Project [codegen id : 6] -Output [1]: [ss_item_sk#6] -Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, d_date_sk#1] +(18) Project [codegen id : 5] +Output [1]: [ss_item_sk#2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] -(24) Scan parquet default.item -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(19) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 5] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(26) Filter [codegen id : 5] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Condition : (((isnotnull(i_item_sk#10) AND isnotnull(i_brand_id#11)) AND isnotnull(i_class_id#12)) AND isnotnull(i_category_id#13)) +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(27) BroadcastExchange -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] +(22) BroadcastExchange +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] -(28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#6] -Right keys [1]: [i_item_sk#10] +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None -(29) Project [codegen id : 6] -Output [3]: [i_brand_id#11 AS brand_id#16, i_class_id#12 AS class_id#17, i_category_id#13 AS category_id#18] -Input [5]: [ss_item_sk#6, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(24) Project [codegen id : 5] +Output [3]: [i_brand_id#7 AS brand_id#14, i_class_id#8 AS class_id#15, i_category_id#9 AS category_id#16] +Input [5]: [ss_item_sk#2, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(30) Exchange -Input [3]: [brand_id#16, class_id#17, category_id#18] -Arguments: hashpartitioning(coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18), 5), true, [id=#19] +(25) Exchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16), 5), true, [id=#17] -(31) Sort [codegen id : 7] -Input [3]: [brand_id#16, class_id#17, category_id#18] -Arguments: [coalesce(brand_id#16, 0) ASC NULLS FIRST, isnull(brand_id#16) ASC NULLS FIRST, coalesce(class_id#17, 0) ASC NULLS FIRST, isnull(class_id#17) ASC NULLS FIRST, coalesce(category_id#18, 0) ASC NULLS FIRST, isnull(category_id#18) ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 6] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 -(32) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#20, cs_item_sk#21] +(27) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(33) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#20, cs_item_sk#21] +(28) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -(34) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#20, cs_item_sk#21] -Condition : (isnotnull(cs_item_sk#21) AND isnotnull(cs_sold_date_sk#20)) +(29) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) -(35) ReusedExchange [Reuses operator id: 21] -Output [1]: [d_date_sk#1] +(30) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] -(36) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#20] -Right keys [1]: [d_date_sk#1] +(31) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None -(37) Project [codegen id : 10] -Output [1]: [cs_item_sk#21] -Input [3]: [cs_sold_date_sk#20, cs_item_sk#21, d_date_sk#1] +(32) Project [codegen id : 9] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] -(38) Scan parquet default.item -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(33) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 9] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(34) ColumnarToRow [codegen id : 8] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(40) Filter [codegen id : 9] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Condition : isnotnull(i_item_sk#10) +(35) Filter [codegen id : 8] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : isnotnull(i_item_sk#6) -(41) BroadcastExchange -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] +(36) BroadcastExchange +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(42) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_item_sk#21] -Right keys [1]: [i_item_sk#10] +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#19] +Right keys [1]: [i_item_sk#6] Join condition: None -(43) Project [codegen id : 10] -Output [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Input [5]: [cs_item_sk#21, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(38) Project [codegen id : 9] +Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [cs_item_sk#19, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(44) Exchange -Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: hashpartitioning(coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13), 5), true, [id=#23] +(39) Exchange +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#21] -(45) Sort [codegen id : 11] -Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: [coalesce(i_brand_id#11, 0) ASC NULLS FIRST, isnull(i_brand_id#11) ASC NULLS FIRST, coalesce(i_class_id#12, 0) ASC NULLS FIRST, isnull(i_class_id#12) ASC NULLS FIRST, coalesce(i_category_id#13, 0) ASC NULLS FIRST, isnull(i_category_id#13) ASC NULLS FIRST], false, 0 +(40) Sort [codegen id : 10] +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 -(46) SortMergeJoin -Left keys [6]: [coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18)] -Right keys [6]: [coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13)] +(41) SortMergeJoin +Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] +Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(47) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#24, ws_item_sk#25] +(42) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow [codegen id : 14] -Input [2]: [ws_sold_date_sk#24, ws_item_sk#25] +(43) ColumnarToRow [codegen id : 13] +Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(49) Filter [codegen id : 14] -Input [2]: [ws_sold_date_sk#24, ws_item_sk#25] -Condition : (isnotnull(ws_item_sk#25) AND isnotnull(ws_sold_date_sk#24)) +(44) Filter [codegen id : 13] +Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] +Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) -(50) ReusedExchange [Reuses operator id: 21] -Output [1]: [d_date_sk#1] +(45) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] -(51) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#24] -Right keys [1]: [d_date_sk#1] +(46) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None -(52) Project [codegen id : 14] -Output [1]: [ws_item_sk#25] -Input [3]: [ws_sold_date_sk#24, ws_item_sk#25, d_date_sk#1] +(47) Project [codegen id : 13] +Output [1]: [ws_item_sk#23] +Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] -(53) ReusedExchange [Reuses operator id: 41] -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(48) ReusedExchange [Reuses operator id: 36] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(54) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#25] -Right keys [1]: [i_item_sk#10] +(49) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_item_sk#23] +Right keys [1]: [i_item_sk#6] Join condition: None -(55) Project [codegen id : 14] -Output [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Input [5]: [ws_item_sk#25, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +(50) Project [codegen id : 13] +Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [ws_item_sk#23, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(56) Exchange -Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: hashpartitioning(coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13), 5), true, [id=#26] +(51) Exchange +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#24] -(57) Sort [codegen id : 15] -Input [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: [coalesce(i_brand_id#11, 0) ASC NULLS FIRST, isnull(i_brand_id#11) ASC NULLS FIRST, coalesce(i_class_id#12, 0) ASC NULLS FIRST, isnull(i_class_id#12) ASC NULLS FIRST, coalesce(i_category_id#13, 0) ASC NULLS FIRST, isnull(i_category_id#13) ASC NULLS FIRST], false, 0 +(52) Sort [codegen id : 14] +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 -(58) SortMergeJoin -Left keys [6]: [coalesce(brand_id#16, 0), isnull(brand_id#16), coalesce(class_id#17, 0), isnull(class_id#17), coalesce(category_id#18, 0), isnull(category_id#18)] -Right keys [6]: [coalesce(i_brand_id#11, 0), isnull(i_brand_id#11), coalesce(i_class_id#12, 0), isnull(i_class_id#12), coalesce(i_category_id#13, 0), isnull(i_category_id#13)] +(53) SortMergeJoin +Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] +Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(59) HashAggregate [codegen id : 16] -Input [3]: [brand_id#16, class_id#17, category_id#18] -Keys [3]: [brand_id#16, class_id#17, category_id#18] +(54) HashAggregate [codegen id : 15] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#16, class_id#17, category_id#18] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(60) Exchange -Input [3]: [brand_id#16, class_id#17, category_id#18] -Arguments: hashpartitioning(brand_id#16, class_id#17, category_id#18, 5), true, [id=#27] +(55) Exchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: hashpartitioning(brand_id#14, class_id#15, category_id#16, 5), true, [id=#25] -(61) HashAggregate [codegen id : 17] -Input [3]: [brand_id#16, class_id#17, category_id#18] -Keys [3]: [brand_id#16, class_id#17, category_id#18] +(56) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#16, class_id#17, category_id#18] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(62) HashAggregate [codegen id : 17] -Input [3]: [brand_id#16, class_id#17, category_id#18] -Keys [3]: [brand_id#16, class_id#17, category_id#18] +(57) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#16, class_id#17, category_id#18] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(63) HashAggregate [codegen id : 17] -Input [3]: [brand_id#16, class_id#17, category_id#18] -Keys [3]: [brand_id#16, class_id#17, category_id#18] +(58) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#16, class_id#17, category_id#18] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(64) BroadcastExchange -Input [3]: [brand_id#16, class_id#17, category_id#18] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#28] +(59) BroadcastExchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#26] -(65) BroadcastHashJoin [codegen id : 18] -Left keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Right keys [3]: [brand_id#16, class_id#17, category_id#18] +(60) BroadcastHashJoin [codegen id : 17] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#14, class_id#15, category_id#16] Join condition: None -(66) Project [codegen id : 18] -Output [1]: [i_item_sk#10 AS ss_item_sk#29] -Input [7]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13, brand_id#16, class_id#17, category_id#18] +(61) Project [codegen id : 17] +Output [1]: [i_item_sk#6 AS ss_item_sk#27] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#14, class_id#15, category_id#16] -(67) Exchange -Input [1]: [ss_item_sk#29] -Arguments: hashpartitioning(ss_item_sk#29, 5), true, [id=#30] +(62) Exchange +Input [1]: [ss_item_sk#27] +Arguments: hashpartitioning(ss_item_sk#27, 5), true, [id=#28] -(68) Sort [codegen id : 19] -Input [1]: [ss_item_sk#29] -Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 +(63) Sort [codegen id : 18] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 -(69) SortMergeJoin -Left keys [1]: [ss_item_sk#6] -Right keys [1]: [ss_item_sk#29] +(64) SortMergeJoin +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [ss_item_sk#27] Join condition: None +(65) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(66) ColumnarToRow [codegen id : 19] +Input [3]: [d_date_sk#10, d_year#11, d_moy#29] + +(67) Filter [codegen id : 19] +Input [3]: [d_date_sk#10, d_year#11, d_moy#29] +Condition : ((((isnotnull(d_year#11) AND isnotnull(d_moy#29)) AND (d_year#11 = 2001)) AND (d_moy#29 = 11)) AND isnotnull(d_date_sk#10)) + +(68) Project [codegen id : 19] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_moy#29] + +(69) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + (70) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (71) Project [codegen id : 38] -Output [3]: [ss_item_sk#6, ss_quantity#7, ss_list_price#8] -Input [5]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_quantity#7, ss_list_price#8] +Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] (72) Scan parquet default.item -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (73) ColumnarToRow [codegen id : 20] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (74) Filter [codegen id : 20] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Condition : isnotnull(i_item_sk#10) +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : isnotnull(i_item_sk#6) (75) Exchange -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: hashpartitioning(i_item_sk#10, 5), true, [id=#31] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#31] (76) Sort [codegen id : 21] -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: [i_item_sk#10 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 -(77) ReusedExchange [Reuses operator id: 67] -Output [1]: [ss_item_sk#29] +(77) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] (78) Sort [codegen id : 37] -Input [1]: [ss_item_sk#29] -Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 (79) SortMergeJoin -Left keys [1]: [i_item_sk#10] -Right keys [1]: [ss_item_sk#29] +Left keys [1]: [i_item_sk#6] +Right keys [1]: [ss_item_sk#27] Join condition: None (80) BroadcastExchange -Input [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (81) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_item_sk#6] -Right keys [1]: [i_item_sk#10] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None (82) Project [codegen id : 38] -Output [5]: [ss_quantity#7, ss_list_price#8, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [7]: [ss_item_sk#6, ss_quantity#7, ss_list_price#8, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (83) HashAggregate [codegen id : 38] -Input [5]: [ss_quantity#7, ss_list_price#8, i_brand_id#11, i_class_id#12, i_category_id#13] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#33, isEmpty#34, count#35] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] (84) Exchange -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] -Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#39] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] +Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#39] (85) HashAggregate [codegen id : 39] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#36, isEmpty#37, count#38] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40, count(1)#41] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sales#42, count(1)#41 AS number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#36, isEmpty#37, count#38] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40, count(1)#41] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sales#42, count(1)#41 AS number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#40 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] (86) Filter [codegen id : 39] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44 as decimal(32,6)) > cast(Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44 as decimal(32,6)) > cast(Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (87) Project [codegen id : 39] -Output [6]: [sales#42, number_sales#43, store AS channel#47, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#7 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#8 as decimal(12,2)))), DecimalType(18,2), true))#44] - -(88) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +Output [6]: [sales#42, number_sales#43, store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#44] -(89) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +(88) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(90) ColumnarToRow [codegen id : 41] -Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +(89) ColumnarToRow [codegen id : 40] +Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] -(91) Filter [codegen id : 41] -Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] -Condition : (isnotnull(cs_item_sk#21) AND isnotnull(cs_sold_date_sk#20)) +(90) Filter [codegen id : 40] +Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) -(92) Exchange -Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] -Arguments: hashpartitioning(cs_item_sk#21, 5), true, [id=#50] +(91) Exchange +Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] +Arguments: hashpartitioning(cs_item_sk#19, 5), true, [id=#50] -(93) Sort [codegen id : 42] -Input [4]: [cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] -Arguments: [cs_item_sk#21 ASC NULLS FIRST], false, 0 +(92) Sort [codegen id : 41] +Input [4]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49] +Arguments: [cs_item_sk#19 ASC NULLS FIRST], false, 0 -(94) ReusedExchange [Reuses operator id: 67] -Output [1]: [ss_item_sk#29] +(93) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] -(95) Sort [codegen id : 58] -Input [1]: [ss_item_sk#29] -Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 +(94) Sort [codegen id : 57] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 -(96) SortMergeJoin -Left keys [1]: [cs_item_sk#21] -Right keys [1]: [ss_item_sk#29] +(95) SortMergeJoin +Left keys [1]: [cs_item_sk#19] +Right keys [1]: [ss_item_sk#27] Join condition: None +(96) ReusedExchange [Reuses operator id: 69] +Output [1]: [d_date_sk#10] + (97) BroadcastHashJoin [codegen id : 77] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#20] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None (98) Project [codegen id : 77] -Output [3]: [cs_item_sk#21, cs_quantity#48, cs_list_price#49] -Input [5]: [d_date_sk#1, cs_sold_date_sk#20, cs_item_sk#21, cs_quantity#48, cs_list_price#49] +Output [3]: [cs_item_sk#19, cs_quantity#48, cs_list_price#49] +Input [5]: [cs_sold_date_sk#18, cs_item_sk#19, cs_quantity#48, cs_list_price#49, d_date_sk#10] (99) ReusedExchange [Reuses operator id: 80] -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (100) BroadcastHashJoin [codegen id : 77] -Left keys [1]: [cs_item_sk#21] -Right keys [1]: [i_item_sk#10] +Left keys [1]: [cs_item_sk#19] +Right keys [1]: [i_item_sk#6] Join condition: None (101) Project [codegen id : 77] -Output [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [7]: [cs_item_sk#21, cs_quantity#48, cs_list_price#49, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [7]: [cs_item_sk#19, cs_quantity#48, cs_list_price#49, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (102) HashAggregate [codegen id : 77] -Input [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#11, i_class_id#12, i_category_id#13] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [5]: [cs_quantity#48, cs_list_price#49, i_brand_id#7, i_class_id#8, i_category_id#9] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#51, isEmpty#52, count#53] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] (103) Exchange -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] -Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#57] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] +Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#57] (104) HashAggregate [codegen id : 78] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#54, isEmpty#55, count#56] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#54, isEmpty#55, count#56] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58, count(1)#59] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sales#60, count(1)#59 AS number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sales#60, count(1)#59 AS number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#58 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] (105) Filter [codegen id : 78] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (106) Project [codegen id : 78] -Output [6]: [sales#60, number_sales#61, catalog AS channel#63, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] - -(107) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +Output [6]: [sales#60, number_sales#61, catalog AS channel#63, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#48 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#49 as decimal(12,2)))), DecimalType(18,2), true))#62] -(108) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +(107) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(109) ColumnarToRow [codegen id : 80] -Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +(108) ColumnarToRow [codegen id : 79] +Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] -(110) Filter [codegen id : 80] -Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] -Condition : (isnotnull(ws_item_sk#25) AND isnotnull(ws_sold_date_sk#24)) +(109) Filter [codegen id : 79] +Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] +Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) -(111) Exchange -Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] -Arguments: hashpartitioning(ws_item_sk#25, 5), true, [id=#66] +(110) Exchange +Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] +Arguments: hashpartitioning(ws_item_sk#23, 5), true, [id=#66] -(112) Sort [codegen id : 81] -Input [4]: [ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] -Arguments: [ws_item_sk#25 ASC NULLS FIRST], false, 0 +(111) Sort [codegen id : 80] +Input [4]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65] +Arguments: [ws_item_sk#23 ASC NULLS FIRST], false, 0 -(113) ReusedExchange [Reuses operator id: 67] -Output [1]: [ss_item_sk#29] +(112) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] -(114) Sort [codegen id : 97] -Input [1]: [ss_item_sk#29] -Arguments: [ss_item_sk#29 ASC NULLS FIRST], false, 0 +(113) Sort [codegen id : 96] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 -(115) SortMergeJoin -Left keys [1]: [ws_item_sk#25] -Right keys [1]: [ss_item_sk#29] +(114) SortMergeJoin +Left keys [1]: [ws_item_sk#23] +Right keys [1]: [ss_item_sk#27] Join condition: None +(115) ReusedExchange [Reuses operator id: 69] +Output [1]: [d_date_sk#10] + (116) BroadcastHashJoin [codegen id : 116] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#24] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None (117) Project [codegen id : 116] -Output [3]: [ws_item_sk#25, ws_quantity#64, ws_list_price#65] -Input [5]: [d_date_sk#1, ws_sold_date_sk#24, ws_item_sk#25, ws_quantity#64, ws_list_price#65] +Output [3]: [ws_item_sk#23, ws_quantity#64, ws_list_price#65] +Input [5]: [ws_sold_date_sk#22, ws_item_sk#23, ws_quantity#64, ws_list_price#65, d_date_sk#10] (118) ReusedExchange [Reuses operator id: 80] -Output [4]: [i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (119) BroadcastHashJoin [codegen id : 116] -Left keys [1]: [ws_item_sk#25] -Right keys [1]: [i_item_sk#10] +Left keys [1]: [ws_item_sk#23] +Right keys [1]: [i_item_sk#6] Join condition: None (120) Project [codegen id : 116] -Output [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [7]: [ws_item_sk#25, ws_quantity#64, ws_list_price#65, i_item_sk#10, i_brand_id#11, i_class_id#12, i_category_id#13] +Output [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [7]: [ws_item_sk#23, ws_quantity#64, ws_list_price#65, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (121) HashAggregate [codegen id : 116] -Input [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#11, i_class_id#12, i_category_id#13] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [5]: [ws_quantity#64, ws_list_price#65, i_brand_id#7, i_class_id#8, i_category_id#9] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#67, isEmpty#68, count#69] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] (122) Exchange -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] -Arguments: hashpartitioning(i_brand_id#11, i_class_id#12, i_category_id#13, 5), true, [id=#73] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] +Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#73] (123) HashAggregate [codegen id : 117] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum#70, isEmpty#71, count#72] -Keys [3]: [i_brand_id#11, i_class_id#12, i_category_id#13] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#70, isEmpty#71, count#72] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74, count(1)#75] -Results [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sales#76, count(1)#75 AS number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sales#76, count(1)#75 AS number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#74 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] (124) Filter [codegen id : 117] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (125) Project [codegen id : 117] -Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#11, i_class_id#12, i_category_id#13] -Input [6]: [i_brand_id#11, i_class_id#12, i_category_id#13, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] +Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#64 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#65 as decimal(12,2)))), DecimalType(18,2), true))#78] (126) Union (127) Expand [codegen id : 118] -Input [6]: [sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, i_category_id#13] -Arguments: [List(sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, i_category_id#13, 0), List(sales#42, number_sales#43, channel#47, i_brand_id#11, i_class_id#12, null, 1), List(sales#42, number_sales#43, channel#47, i_brand_id#11, null, null, 3), List(sales#42, number_sales#43, channel#47, null, null, null, 7), List(sales#42, number_sales#43, null, null, null, null, 15)], [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] +Input [6]: [sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [List(sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 0), List(sales#42, number_sales#43, channel#47, i_brand_id#7, i_class_id#8, null, 1), List(sales#42, number_sales#43, channel#47, i_brand_id#7, null, null, 3), List(sales#42, number_sales#43, channel#47, null, null, null, 7), List(sales#42, number_sales#43, null, null, null, null, 15)], [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] (128) HashAggregate [codegen id : 118] Input [7]: [sales#42, number_sales#43, channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] @@ -755,101 +755,101 @@ Subquery:1 Hosting operator id = 86 Hosting Expression = Subquery scalar-subquer (132) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] +Output [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct (133) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] +Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] (134) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8] -Condition : isnotnull(ss_sold_date_sk#5) +Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Condition : isnotnull(ss_sold_date_sk#1) (135) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (136) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +Input [2]: [d_date_sk#10, d_year#11] (137) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : (((isnotnull(d_year#2) AND (d_year#2 >= 1999)) AND (d_year#2 <= 2001)) AND isnotnull(d_date_sk#1)) +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) (138) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#2] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] (139) BroadcastExchange -Input [1]: [d_date_sk#1] +Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#96] (140) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#5] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (141) Project [codegen id : 2] -Output [2]: [ss_quantity#7 AS quantity#97, ss_list_price#8 AS list_price#98] -Input [4]: [ss_sold_date_sk#5, ss_quantity#7, ss_list_price#8, d_date_sk#1] +Output [2]: [ss_quantity#3 AS quantity#97, ss_list_price#4 AS list_price#98] +Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (142) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] +Output [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct (143) ColumnarToRow [codegen id : 4] -Input [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] +Input [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] (144) Filter [codegen id : 4] -Input [3]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49] -Condition : isnotnull(cs_sold_date_sk#20) +Input [3]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49] +Condition : isnotnull(cs_sold_date_sk#18) (145) ReusedExchange [Reuses operator id: 139] -Output [1]: [d_date_sk#1] +Output [1]: [d_date_sk#10] (146) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_sold_date_sk#20] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None (147) Project [codegen id : 4] Output [2]: [cs_quantity#48 AS quantity#99, cs_list_price#49 AS list_price#100] -Input [4]: [cs_sold_date_sk#20, cs_quantity#48, cs_list_price#49, d_date_sk#1] +Input [4]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49, d_date_sk#10] (148) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] +Output [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct (149) ColumnarToRow [codegen id : 6] -Input [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] +Input [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] (150) Filter [codegen id : 6] -Input [3]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65] -Condition : isnotnull(ws_sold_date_sk#24) +Input [3]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65] +Condition : isnotnull(ws_sold_date_sk#22) (151) ReusedExchange [Reuses operator id: 139] -Output [1]: [d_date_sk#1] +Output [1]: [d_date_sk#10] (152) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#24] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None (153) Project [codegen id : 6] Output [2]: [ws_quantity#64 AS quantity#101, ws_list_price#65 AS list_price#102] -Input [4]: [ws_sold_date_sk#24, ws_quantity#64, ws_list_price#65, d_date_sk#1] +Input [4]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65, d_date_sk#10] (154) Union diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt index 1c435feeb64ac..5b93392d023db 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt @@ -61,31 +61,23 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_year,d_moy,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (2) + Exchange [ss_item_sk] #3 + WholeStageCodegen (1) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] - WholeStageCodegen (19) + WholeStageCodegen (18) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #5 - WholeStageCodegen (18) + Exchange [ss_item_sk] #4 + WholeStageCodegen (17) Project [i_item_sk] BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] Filter [i_brand_id,i_class_id,i_category_id] @@ -93,23 +85,23 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (17) + BroadcastExchange #5 + WholeStageCodegen (16) HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #7 - WholeStageCodegen (16) + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (15) HashAggregate [brand_id,class_id,category_id] InputAdapter SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (7) + WholeStageCodegen (6) Sort [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #8 - WholeStageCodegen (6) + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (5) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] @@ -119,25 +111,25 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #9 - WholeStageCodegen (4) + BroadcastExchange #8 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter - BroadcastExchange #10 - WholeStageCodegen (5) + BroadcastExchange #9 + WholeStageCodegen (4) Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (11) + WholeStageCodegen (10) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #11 - WholeStageCodegen (10) + Exchange [i_brand_id,i_class_id,i_category_id] #10 + WholeStageCodegen (9) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] @@ -147,19 +139,19 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] InputAdapter - ReusedExchange [d_date_sk] #9 + ReusedExchange [d_date_sk] #8 InputAdapter - BroadcastExchange #12 - WholeStageCodegen (9) + BroadcastExchange #11 + WholeStageCodegen (8) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (15) + WholeStageCodegen (14) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #13 - WholeStageCodegen (14) + Exchange [i_brand_id,i_class_id,i_category_id] #12 + WholeStageCodegen (13) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] @@ -169,9 +161,17 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] InputAdapter - ReusedExchange [d_date_sk] #9 + ReusedExchange [d_date_sk] #8 InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12 + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (19) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] InputAdapter BroadcastExchange #14 SortMergeJoin [i_item_sk,ss_item_sk] @@ -187,7 +187,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (37) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #5 + ReusedExchange [ss_item_sk] #4 WholeStageCodegen (78) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -200,24 +200,24 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk,cs_quantity,cs_list_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [cs_item_sk,ss_item_sk] - WholeStageCodegen (42) + WholeStageCodegen (41) Sort [cs_item_sk] InputAdapter Exchange [cs_item_sk] #19 - WholeStageCodegen (41) + WholeStageCodegen (40) Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price] - WholeStageCodegen (58) + WholeStageCodegen (57) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #5 + ReusedExchange [ss_item_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #13 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #14 WholeStageCodegen (117) @@ -232,23 +232,23 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_quantity,ws_list_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [ws_item_sk,ss_item_sk] - WholeStageCodegen (81) + WholeStageCodegen (80) Sort [ws_item_sk] InputAdapter Exchange [ws_item_sk] #21 - WholeStageCodegen (80) + WholeStageCodegen (79) Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_quantity,ws_list_price] - WholeStageCodegen (97) + WholeStageCodegen (96) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #5 + ReusedExchange [ss_item_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #13 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #14 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt index b4b32c16cb496..2d2b56e32bdb8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt @@ -9,76 +9,76 @@ TakeOrderedAndProject (110) : +- * Project (82) : +- * BroadcastHashJoin Inner BuildRight (81) : :- * Project (71) - : : +- * BroadcastHashJoin Inner BuildLeft (70) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- SortMergeJoin LeftSemi (69) - : : :- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) - : : +- * Sort (68) - : : +- Exchange (67) - : : +- * Project (66) - : : +- * BroadcastHashJoin Inner BuildRight (65) - : : :- * Filter (13) - : : : +- * ColumnarToRow (12) - : : : +- Scan parquet default.item (11) - : : +- BroadcastExchange (64) - : : +- * HashAggregate (63) - : : +- * HashAggregate (62) - : : +- * HashAggregate (61) - : : +- Exchange (60) - : : +- * HashAggregate (59) - : : +- SortMergeJoin LeftSemi (58) - : : :- SortMergeJoin LeftSemi (46) - : : : :- * Sort (31) - : : : : +- Exchange (30) - : : : : +- * Project (29) - : : : : +- * BroadcastHashJoin Inner BuildRight (28) - : : : : :- * Project (23) - : : : : : +- * BroadcastHashJoin Inner BuildRight (22) - : : : : : :- * Filter (16) - : : : : : : +- * ColumnarToRow (15) - : : : : : : +- Scan parquet default.store_sales (14) - : : : : : +- BroadcastExchange (21) - : : : : : +- * Project (20) - : : : : : +- * Filter (19) - : : : : : +- * ColumnarToRow (18) - : : : : : +- Scan parquet default.date_dim (17) - : : : : +- BroadcastExchange (27) - : : : : +- * Filter (26) - : : : : +- * ColumnarToRow (25) - : : : : +- Scan parquet default.item (24) - : : : +- * Sort (45) - : : : +- Exchange (44) - : : : +- * Project (43) - : : : +- * BroadcastHashJoin Inner BuildRight (42) - : : : :- * Project (37) - : : : : +- * BroadcastHashJoin Inner BuildRight (36) - : : : : :- * Filter (34) - : : : : : +- * ColumnarToRow (33) - : : : : : +- Scan parquet default.catalog_sales (32) - : : : : +- ReusedExchange (35) - : : : +- BroadcastExchange (41) - : : : +- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.item (38) - : : +- * Sort (57) - : : +- Exchange (56) - : : +- * Project (55) - : : +- * BroadcastHashJoin Inner BuildRight (54) - : : :- * Project (52) - : : : +- * BroadcastHashJoin Inner BuildRight (51) - : : : :- * Filter (49) - : : : : +- * ColumnarToRow (48) - : : : : +- Scan parquet default.web_sales (47) - : : : +- ReusedExchange (50) - : : +- ReusedExchange (53) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- SortMergeJoin LeftSemi (64) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (63) + : : : +- Exchange (62) + : : : +- * Project (61) + : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : :- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.item (6) + : : : +- BroadcastExchange (59) + : : : +- * HashAggregate (58) + : : : +- * HashAggregate (57) + : : : +- * HashAggregate (56) + : : : +- Exchange (55) + : : : +- * HashAggregate (54) + : : : +- SortMergeJoin LeftSemi (53) + : : : :- SortMergeJoin LeftSemi (41) + : : : : :- * Sort (26) + : : : : : +- Exchange (25) + : : : : : +- * Project (24) + : : : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : : : :- * Project (18) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : : :- * Filter (11) + : : : : : : : +- * ColumnarToRow (10) + : : : : : : : +- Scan parquet default.store_sales (9) + : : : : : : +- BroadcastExchange (16) + : : : : : : +- * Project (15) + : : : : : : +- * Filter (14) + : : : : : : +- * ColumnarToRow (13) + : : : : : : +- Scan parquet default.date_dim (12) + : : : : : +- BroadcastExchange (22) + : : : : : +- * Filter (21) + : : : : : +- * ColumnarToRow (20) + : : : : : +- Scan parquet default.item (19) + : : : : +- * Sort (40) + : : : : +- Exchange (39) + : : : : +- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Project (32) + : : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : : :- * Filter (29) + : : : : : : +- * ColumnarToRow (28) + : : : : : : +- Scan parquet default.catalog_sales (27) + : : : : : +- ReusedExchange (30) + : : : : +- BroadcastExchange (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.item (33) + : : : +- * Sort (52) + : : : +- Exchange (51) + : : : +- * Project (50) + : : : +- * BroadcastHashJoin Inner BuildRight (49) + : : : :- * Project (47) + : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : :- * Filter (44) + : : : : : +- * ColumnarToRow (43) + : : : : : +- Scan parquet default.web_sales (42) + : : : : +- ReusedExchange (45) + : : : +- ReusedExchange (48) + : : +- BroadcastExchange (69) + : : +- * Project (68) + : : +- * Filter (67) + : : +- * ColumnarToRow (66) + : : +- Scan parquet default.date_dim (65) : +- BroadcastExchange (80) : +- SortMergeJoin LeftSemi (79) : :- * Sort (76) @@ -111,467 +111,467 @@ TakeOrderedAndProject (110) +- ReusedExchange (100) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_week_seq#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_week_seq#2] - -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_week_seq#2] -Condition : ((isnotnull(d_week_seq#2) AND (d_week_seq#2 = Subquery scalar-subquery#3, [id=#4])) AND isnotnull(d_date_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_week_seq#2] - -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] - -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -(8) Filter [codegen id : 2] -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Condition : (isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) +(3) Filter [codegen id : 1] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(9) Exchange -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Arguments: hashpartitioning(ss_item_sk#7, 5), true, [id=#10] +(4) Exchange +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#5] -(10) Sort [codegen id : 3] -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Arguments: [ss_item_sk#7 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.item -Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(6) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 18] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(7) ColumnarToRow [codegen id : 17] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(13) Filter [codegen id : 18] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Condition : ((isnotnull(i_brand_id#12) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) +(8) Filter [codegen id : 17] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(14) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#6, ss_item_sk#7] +(9) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#6, ss_item_sk#7] +(10) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -(16) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#6, ss_item_sk#7] -Condition : (isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) +(11) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(17) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#15] +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct -(18) ColumnarToRow [codegen id : 4] -Input [2]: [d_date_sk#1, d_year#15] +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#10, d_year#11] -(19) Filter [codegen id : 4] -Input [2]: [d_date_sk#1, d_year#15] -Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#1)) +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) -(20) Project [codegen id : 4] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#15] +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] -(21) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +(16) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#1] +(17) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None -(23) Project [codegen id : 6] -Output [1]: [ss_item_sk#7] -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, d_date_sk#1] +(18) Project [codegen id : 5] +Output [1]: [ss_item_sk#2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] -(24) Scan parquet default.item -Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(19) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 5] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(26) Filter [codegen id : 5] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Condition : (((isnotnull(i_item_sk#11) AND isnotnull(i_brand_id#12)) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(27) BroadcastExchange -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] +(22) BroadcastExchange +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] -(28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#7] -Right keys [1]: [i_item_sk#11] +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None -(29) Project [codegen id : 6] -Output [3]: [i_brand_id#12 AS brand_id#18, i_class_id#13 AS class_id#19, i_category_id#14 AS category_id#20] -Input [5]: [ss_item_sk#7, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(24) Project [codegen id : 5] +Output [3]: [i_brand_id#7 AS brand_id#14, i_class_id#8 AS class_id#15, i_category_id#9 AS category_id#16] +Input [5]: [ss_item_sk#2, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(30) Exchange -Input [3]: [brand_id#18, class_id#19, category_id#20] -Arguments: hashpartitioning(coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20), 5), true, [id=#21] +(25) Exchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16), 5), true, [id=#17] -(31) Sort [codegen id : 7] -Input [3]: [brand_id#18, class_id#19, category_id#20] -Arguments: [coalesce(brand_id#18, 0) ASC NULLS FIRST, isnull(brand_id#18) ASC NULLS FIRST, coalesce(class_id#19, 0) ASC NULLS FIRST, isnull(class_id#19) ASC NULLS FIRST, coalesce(category_id#20, 0) ASC NULLS FIRST, isnull(category_id#20) ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 6] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 -(32) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#22, cs_item_sk#23] +(27) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(33) ColumnarToRow [codegen id : 10] -Input [2]: [cs_sold_date_sk#22, cs_item_sk#23] +(28) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -(34) Filter [codegen id : 10] -Input [2]: [cs_sold_date_sk#22, cs_item_sk#23] -Condition : (isnotnull(cs_item_sk#23) AND isnotnull(cs_sold_date_sk#22)) +(29) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) -(35) ReusedExchange [Reuses operator id: 21] -Output [1]: [d_date_sk#1] +(30) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] -(36) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#22] -Right keys [1]: [d_date_sk#1] +(31) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None -(37) Project [codegen id : 10] -Output [1]: [cs_item_sk#23] -Input [3]: [cs_sold_date_sk#22, cs_item_sk#23, d_date_sk#1] +(32) Project [codegen id : 9] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] -(38) Scan parquet default.item -Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(33) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 9] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(34) ColumnarToRow [codegen id : 8] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(40) Filter [codegen id : 9] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Condition : isnotnull(i_item_sk#11) +(35) Filter [codegen id : 8] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : isnotnull(i_item_sk#6) -(41) BroadcastExchange -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] +(36) BroadcastExchange +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(42) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_item_sk#23] -Right keys [1]: [i_item_sk#11] +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#19] +Right keys [1]: [i_item_sk#6] Join condition: None -(43) Project [codegen id : 10] -Output [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Input [5]: [cs_item_sk#23, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(38) Project [codegen id : 9] +Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [cs_item_sk#19, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(44) Exchange -Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: hashpartitioning(coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14), 5), true, [id=#25] +(39) Exchange +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#21] -(45) Sort [codegen id : 11] -Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: [coalesce(i_brand_id#12, 0) ASC NULLS FIRST, isnull(i_brand_id#12) ASC NULLS FIRST, coalesce(i_class_id#13, 0) ASC NULLS FIRST, isnull(i_class_id#13) ASC NULLS FIRST, coalesce(i_category_id#14, 0) ASC NULLS FIRST, isnull(i_category_id#14) ASC NULLS FIRST], false, 0 +(40) Sort [codegen id : 10] +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 -(46) SortMergeJoin -Left keys [6]: [coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20)] -Right keys [6]: [coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14)] +(41) SortMergeJoin +Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] +Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(47) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#26, ws_item_sk#27] +(42) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow [codegen id : 14] -Input [2]: [ws_sold_date_sk#26, ws_item_sk#27] +(43) ColumnarToRow [codegen id : 13] +Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(49) Filter [codegen id : 14] -Input [2]: [ws_sold_date_sk#26, ws_item_sk#27] -Condition : (isnotnull(ws_item_sk#27) AND isnotnull(ws_sold_date_sk#26)) +(44) Filter [codegen id : 13] +Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] +Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) -(50) ReusedExchange [Reuses operator id: 21] -Output [1]: [d_date_sk#1] +(45) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] -(51) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#26] -Right keys [1]: [d_date_sk#1] +(46) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None -(52) Project [codegen id : 14] -Output [1]: [ws_item_sk#27] -Input [3]: [ws_sold_date_sk#26, ws_item_sk#27, d_date_sk#1] +(47) Project [codegen id : 13] +Output [1]: [ws_item_sk#23] +Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] -(53) ReusedExchange [Reuses operator id: 41] -Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(48) ReusedExchange [Reuses operator id: 36] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(54) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#27] -Right keys [1]: [i_item_sk#11] +(49) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_item_sk#23] +Right keys [1]: [i_item_sk#6] Join condition: None -(55) Project [codegen id : 14] -Output [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Input [5]: [ws_item_sk#27, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +(50) Project [codegen id : 13] +Output [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Input [5]: [ws_item_sk#23, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] -(56) Exchange -Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: hashpartitioning(coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14), 5), true, [id=#28] +(51) Exchange +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9), 5), true, [id=#24] -(57) Sort [codegen id : 15] -Input [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: [coalesce(i_brand_id#12, 0) ASC NULLS FIRST, isnull(i_brand_id#12) ASC NULLS FIRST, coalesce(i_class_id#13, 0) ASC NULLS FIRST, isnull(i_class_id#13) ASC NULLS FIRST, coalesce(i_category_id#14, 0) ASC NULLS FIRST, isnull(i_category_id#14) ASC NULLS FIRST], false, 0 +(52) Sort [codegen id : 14] +Input [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [coalesce(i_brand_id#7, 0) ASC NULLS FIRST, isnull(i_brand_id#7) ASC NULLS FIRST, coalesce(i_class_id#8, 0) ASC NULLS FIRST, isnull(i_class_id#8) ASC NULLS FIRST, coalesce(i_category_id#9, 0) ASC NULLS FIRST, isnull(i_category_id#9) ASC NULLS FIRST], false, 0 -(58) SortMergeJoin -Left keys [6]: [coalesce(brand_id#18, 0), isnull(brand_id#18), coalesce(class_id#19, 0), isnull(class_id#19), coalesce(category_id#20, 0), isnull(category_id#20)] -Right keys [6]: [coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14)] +(53) SortMergeJoin +Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id#15, 0), isnull(class_id#15), coalesce(category_id#16, 0), isnull(category_id#16)] +Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(59) HashAggregate [codegen id : 16] -Input [3]: [brand_id#18, class_id#19, category_id#20] -Keys [3]: [brand_id#18, class_id#19, category_id#20] +(54) HashAggregate [codegen id : 15] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#18, class_id#19, category_id#20] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(60) Exchange -Input [3]: [brand_id#18, class_id#19, category_id#20] -Arguments: hashpartitioning(brand_id#18, class_id#19, category_id#20, 5), true, [id=#29] +(55) Exchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: hashpartitioning(brand_id#14, class_id#15, category_id#16, 5), true, [id=#25] -(61) HashAggregate [codegen id : 17] -Input [3]: [brand_id#18, class_id#19, category_id#20] -Keys [3]: [brand_id#18, class_id#19, category_id#20] +(56) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#18, class_id#19, category_id#20] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(62) HashAggregate [codegen id : 17] -Input [3]: [brand_id#18, class_id#19, category_id#20] -Keys [3]: [brand_id#18, class_id#19, category_id#20] +(57) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#18, class_id#19, category_id#20] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(63) HashAggregate [codegen id : 17] -Input [3]: [brand_id#18, class_id#19, category_id#20] -Keys [3]: [brand_id#18, class_id#19, category_id#20] +(58) HashAggregate [codegen id : 16] +Input [3]: [brand_id#14, class_id#15, category_id#16] +Keys [3]: [brand_id#14, class_id#15, category_id#16] Functions: [] Aggregate Attributes: [] -Results [3]: [brand_id#18, class_id#19, category_id#20] +Results [3]: [brand_id#14, class_id#15, category_id#16] -(64) BroadcastExchange -Input [3]: [brand_id#18, class_id#19, category_id#20] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#30] +(59) BroadcastExchange +Input [3]: [brand_id#14, class_id#15, category_id#16] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#26] -(65) BroadcastHashJoin [codegen id : 18] -Left keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Right keys [3]: [brand_id#18, class_id#19, category_id#20] +(60) BroadcastHashJoin [codegen id : 17] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#14, class_id#15, category_id#16] Join condition: None -(66) Project [codegen id : 18] -Output [1]: [i_item_sk#11 AS ss_item_sk#31] -Input [7]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14, brand_id#18, class_id#19, category_id#20] +(61) Project [codegen id : 17] +Output [1]: [i_item_sk#6 AS ss_item_sk#27] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#14, class_id#15, category_id#16] -(67) Exchange -Input [1]: [ss_item_sk#31] -Arguments: hashpartitioning(ss_item_sk#31, 5), true, [id=#32] +(62) Exchange +Input [1]: [ss_item_sk#27] +Arguments: hashpartitioning(ss_item_sk#27, 5), true, [id=#28] -(68) Sort [codegen id : 19] -Input [1]: [ss_item_sk#31] -Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 +(63) Sort [codegen id : 18] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 -(69) SortMergeJoin -Left keys [1]: [ss_item_sk#7] -Right keys [1]: [ss_item_sk#31] +(64) SortMergeJoin +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [ss_item_sk#27] Join condition: None +(65) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_week_seq#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(66) ColumnarToRow [codegen id : 19] +Input [2]: [d_date_sk#10, d_week_seq#29] + +(67) Filter [codegen id : 19] +Input [2]: [d_date_sk#10, d_week_seq#29] +Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#30, [id=#31])) AND isnotnull(d_date_sk#10)) + +(68) Project [codegen id : 19] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_week_seq#29] + +(69) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] + (70) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (71) Project [codegen id : 38] -Output [3]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Input [5]: [d_date_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] (72) Scan parquet default.item -Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] ReadSchema: struct (73) ColumnarToRow [codegen id : 20] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (74) Filter [codegen id : 20] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Condition : (((isnotnull(i_item_sk#11) AND isnotnull(i_brand_id#12)) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14)) +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : (((isnotnull(i_item_sk#6) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) (75) Exchange -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: hashpartitioning(i_item_sk#11, 5), true, [id=#33] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#33] (76) Sort [codegen id : 21] -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] -Arguments: [i_item_sk#11 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 -(77) ReusedExchange [Reuses operator id: 67] -Output [1]: [ss_item_sk#31] +(77) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] (78) Sort [codegen id : 37] -Input [1]: [ss_item_sk#31] -Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 (79) SortMergeJoin -Left keys [1]: [i_item_sk#11] -Right keys [1]: [ss_item_sk#31] +Left keys [1]: [i_item_sk#6] +Right keys [1]: [ss_item_sk#27] Join condition: None (80) BroadcastExchange -Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] (81) BroadcastHashJoin [codegen id : 38] -Left keys [1]: [ss_item_sk#7] -Right keys [1]: [i_item_sk#11] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None (82) Project [codegen id : 38] -Output [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#12, i_class_id#13, i_category_id#14] -Input [7]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14] +Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] +Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] (83) HashAggregate [codegen id : 38] -Input [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#12, i_class_id#13, i_category_id#14] -Keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#7, i_class_id#8, i_category_id#9] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#35, isEmpty#36, count#37] -Results [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] (84) Exchange -Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] -Arguments: hashpartitioning(i_brand_id#12, i_class_id#13, i_category_id#14, 5), true, [id=#41] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] +Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#41] (85) HashAggregate [codegen id : 78] -Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum#38, isEmpty#39, count#40] -Keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42, count(1)#43] -Results [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sales#44, count(1)#43 AS number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#38, isEmpty#39, count#40] +Keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42, count(1)#43] +Results [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sales#44, count(1)#43 AS number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#42 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] (86) Filter [codegen id : 78] -Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46 as decimal(32,6)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46 as decimal(32,6)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) (87) Project [codegen id : 78] -Output [6]: [store AS channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45] -Input [6]: [i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#46] +Output [6]: [store AS channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] -(88) ReusedExchange [Reuses operator id: 9] -Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] +(88) ReusedExchange [Reuses operator id: 4] +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] (89) Sort [codegen id : 40] -Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Arguments: [ss_item_sk#7 ASC NULLS FIRST], false, 0 +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(90) ReusedExchange [Reuses operator id: 67] -Output [1]: [ss_item_sk#31] +(90) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] (91) Sort [codegen id : 56] -Input [1]: [ss_item_sk#31] -Arguments: [ss_item_sk#31 ASC NULLS FIRST], false, 0 +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 (92) SortMergeJoin -Left keys [1]: [ss_item_sk#7] -Right keys [1]: [ss_item_sk#31] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [ss_item_sk#27] Join condition: None (93) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_week_seq#2] +Output [2]: [d_date_sk#10, d_week_seq#29] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] ReadSchema: struct (94) ColumnarToRow [codegen id : 57] -Input [2]: [d_date_sk#1, d_week_seq#2] +Input [2]: [d_date_sk#10, d_week_seq#29] (95) Filter [codegen id : 57] -Input [2]: [d_date_sk#1, d_week_seq#2] -Condition : ((isnotnull(d_week_seq#2) AND (d_week_seq#2 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#1)) +Input [2]: [d_date_sk#10, d_week_seq#29] +Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#10)) (96) Project [codegen id : 57] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_week_seq#2] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_week_seq#29] (97) BroadcastExchange -Input [1]: [d_date_sk#1] +Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] (98) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (99) Project [codegen id : 76] -Output [3]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9] -Input [5]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#8, ss_list_price#9, d_date_sk#1] +Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] (100) ReusedExchange [Reuses operator id: 80] Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] (101) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#53] Join condition: None (102) Project [codegen id : 76] -Output [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#54, i_class_id#55, i_category_id#56] -Input [7]: [ss_item_sk#7, ss_quantity#8, ss_list_price#9, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Output [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [7]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] (103) HashAggregate [codegen id : 76] -Input [5]: [ss_quantity#8, ss_list_price#9, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [5]: [ss_quantity#3, ss_list_price#4, i_brand_id#54, i_class_id#55, i_category_id#56] Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] -Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] Aggregate Attributes [3]: [sum#57, isEmpty#58, count#59] Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#60, isEmpty#61, count#62] @@ -582,30 +582,30 @@ Arguments: hashpartitioning(i_brand_id#54, i_class_id#55, i_category_id#56, 5), (105) HashAggregate [codegen id : 77] Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#60, isEmpty#61, count#62] Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] -Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64, count(1)#65] -Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sales#66, count(1)#65 AS number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64, count(1)#65] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sales#66, count(1)#65 AS number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] (106) Filter [codegen id : 77] -Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#47, [id=#48] as decimal(32,6)))) (107) Project [codegen id : 77] Output [6]: [store AS channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] -Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#68] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#68] (108) BroadcastExchange Input [6]: [channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#70] (109) BroadcastHashJoin [codegen id : 78] -Left keys [3]: [i_brand_id#12, i_class_id#13, i_category_id#14] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] Right keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] Join condition: None (110) TakeOrderedAndProject -Input [12]: [channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] -Arguments: 100, [i_brand_id#12 ASC NULLS FIRST, i_class_id#13 ASC NULLS FIRST, i_category_id#14 ASC NULLS FIRST], [channel#49, i_brand_id#12, i_class_id#13, i_category_id#14, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] +Input [12]: [channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] +Arguments: 100, [i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST], [channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, channel#69, i_brand_id#54, i_class_id#55, i_category_id#56, sales#66, number_sales#67] ===== Subqueries ===== @@ -639,101 +639,101 @@ Subquery:1 Hosting operator id = 86 Hosting Expression = Subquery scalar-subquer (111) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] +Output [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct (112) ColumnarToRow [codegen id : 2] -Input [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] +Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] (113) Filter [codegen id : 2] -Input [3]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9] -Condition : isnotnull(ss_sold_date_sk#6) +Input [3]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4] +Condition : isnotnull(ss_sold_date_sk#1) (114) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#15] +Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] ReadSchema: struct (115) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#15] +Input [2]: [d_date_sk#10, d_year#11] (116) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#15] -Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#1)) +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1999)) AND (d_year#11 <= 2001)) AND isnotnull(d_date_sk#10)) (117) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#15] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] (118) BroadcastExchange -Input [1]: [d_date_sk#1] +Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#71] (119) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (120) Project [codegen id : 2] -Output [2]: [ss_quantity#8 AS quantity#72, ss_list_price#9 AS list_price#73] -Input [4]: [ss_sold_date_sk#6, ss_quantity#8, ss_list_price#9, d_date_sk#1] +Output [2]: [ss_quantity#3 AS quantity#72, ss_list_price#4 AS list_price#73] +Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (121) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] +Output [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct (122) ColumnarToRow [codegen id : 4] -Input [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] +Input [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] (123) Filter [codegen id : 4] -Input [3]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75] -Condition : isnotnull(cs_sold_date_sk#22) +Input [3]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75] +Condition : isnotnull(cs_sold_date_sk#18) (124) ReusedExchange [Reuses operator id: 118] -Output [1]: [d_date_sk#1] +Output [1]: [d_date_sk#10] (125) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_sold_date_sk#22] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None (126) Project [codegen id : 4] Output [2]: [cs_quantity#74 AS quantity#76, cs_list_price#75 AS list_price#77] -Input [4]: [cs_sold_date_sk#22, cs_quantity#74, cs_list_price#75, d_date_sk#1] +Input [4]: [cs_sold_date_sk#18, cs_quantity#74, cs_list_price#75, d_date_sk#10] (127) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] +Output [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct (128) ColumnarToRow [codegen id : 6] -Input [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] +Input [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] (129) Filter [codegen id : 6] -Input [3]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79] -Condition : isnotnull(ws_sold_date_sk#26) +Input [3]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79] +Condition : isnotnull(ws_sold_date_sk#22) (130) ReusedExchange [Reuses operator id: 118] -Output [1]: [d_date_sk#1] +Output [1]: [d_date_sk#10] (131) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#26] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None (132) Project [codegen id : 6] Output [2]: [ws_quantity#78 AS quantity#80, ws_list_price#79 AS list_price#81] -Input [4]: [ws_sold_date_sk#26, ws_quantity#78, ws_list_price#79, d_date_sk#1] +Input [4]: [ws_sold_date_sk#22, ws_quantity#78, ws_list_price#79, d_date_sk#10] (133) Union @@ -755,7 +755,7 @@ Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as de Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#73 as decimal(12,2)))), DecimalType(18,2), true))#87] Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#72 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#73 as decimal(12,2)))), DecimalType(18,2), true))#87 AS average_sales#88] -Subquery:2 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#3, [id=#4] +Subquery:2 Hosting operator id = 67 Hosting Expression = Subquery scalar-subquery#30, [id=#31] * Project (140) +- * Filter (139) +- * ColumnarToRow (138) @@ -763,22 +763,22 @@ Subquery:2 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery (137) Scan parquet default.date_dim -Output [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Output [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)] ReadSchema: struct (138) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] (139) Filter [codegen id : 1] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] -Condition : (((((isnotnull(d_year#15) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#15 = 2000)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#11 = 2000)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) (140) Project [codegen id : 1] -Output [1]: [d_week_seq#2] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Output [1]: [d_week_seq#29] +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] @@ -790,21 +790,21 @@ Subquery:4 Hosting operator id = 95 Hosting Expression = Subquery scalar-subquer (141) Scan parquet default.date_dim -Output [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Output [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)] ReadSchema: struct (142) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] (143) Filter [codegen id : 1] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] -Condition : (((((isnotnull(d_year#15) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#15 = 1999)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#89)) AND isnotnull(d_dom#90)) AND (d_year#11 = 1999)) AND (d_moy#89 = 12)) AND (d_dom#90 = 11)) (144) Project [codegen id : 1] -Output [1]: [d_week_seq#2] -Input [4]: [d_week_seq#2, d_year#15, d_moy#89, d_dom#90] +Output [1]: [d_week_seq#29] +Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt index 7c6035cef4d71..d6b8ba4395d2e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt @@ -53,38 +53,23 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_week_seq,d_date_sk] - Subquery #1 - WholeStageCodegen (1) - Project [d_week_seq] - Filter [d_year,d_moy,d_dom] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #3 - WholeStageCodegen (2) + Exchange [ss_item_sk] #2 + WholeStageCodegen (1) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] - WholeStageCodegen (19) + WholeStageCodegen (18) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (18) + Exchange [ss_item_sk] #3 + WholeStageCodegen (17) Project [i_item_sk] BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] Filter [i_brand_id,i_class_id,i_category_id] @@ -92,23 +77,23 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (17) + BroadcastExchange #4 + WholeStageCodegen (16) HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] HashAggregate [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #6 - WholeStageCodegen (16) + Exchange [brand_id,class_id,category_id] #5 + WholeStageCodegen (15) HashAggregate [brand_id,class_id,category_id] InputAdapter SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (7) + WholeStageCodegen (6) Sort [brand_id,class_id,category_id] InputAdapter - Exchange [brand_id,class_id,category_id] #7 - WholeStageCodegen (6) + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (5) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] @@ -118,25 +103,25 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #8 - WholeStageCodegen (4) + BroadcastExchange #7 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter - BroadcastExchange #9 - WholeStageCodegen (5) + BroadcastExchange #8 + WholeStageCodegen (4) Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (11) + WholeStageCodegen (10) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #10 - WholeStageCodegen (10) + Exchange [i_brand_id,i_class_id,i_category_id] #9 + WholeStageCodegen (9) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] @@ -146,19 +131,19 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [d_date_sk] #7 InputAdapter - BroadcastExchange #11 - WholeStageCodegen (9) + BroadcastExchange #10 + WholeStageCodegen (8) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] - WholeStageCodegen (15) + WholeStageCodegen (14) Sort [i_brand_id,i_class_id,i_category_id] InputAdapter - Exchange [i_brand_id,i_class_id,i_category_id] #12 - WholeStageCodegen (14) + Exchange [i_brand_id,i_class_id,i_category_id] #11 + WholeStageCodegen (13) Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] @@ -168,9 +153,24 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [d_date_sk] #7 InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (19) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #1 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter BroadcastExchange #13 SortMergeJoin [i_item_sk,ss_item_sk] @@ -186,7 +186,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (37) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #4 + ReusedExchange [ss_item_sk] #3 InputAdapter BroadcastExchange #17 WholeStageCodegen (77) @@ -207,11 +207,11 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (40) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #3 + ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 WholeStageCodegen (56) Sort [ss_item_sk] InputAdapter - ReusedExchange [ss_item_sk] #4 + ReusedExchange [ss_item_sk] #3 InputAdapter BroadcastExchange #19 WholeStageCodegen (57) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt index 6b86b55b2aa4f..5aa95486f8209 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt @@ -5,176 +5,176 @@ TakeOrderedAndProject (32) +- * HashAggregate (29) +- * Project (28) +- * SortMergeJoin Inner (27) - :- * Sort (14) - : +- Exchange (13) - : +- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.customer (6) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- * Sort (26) +- Exchange (25) +- * Project (24) - +- * BroadcastHashJoin Inner BuildRight (23) - :- * Filter (17) - : +- * ColumnarToRow (16) - : +- Scan parquet default.catalog_sales (15) - +- BroadcastExchange (22) - +- * Project (21) + +- * SortMergeJoin Inner (23) + :- * Sort (17) + : +- Exchange (16) + : +- * Filter (15) + : +- * ColumnarToRow (14) + : +- Scan parquet default.customer (13) + +- * Sort (22) + +- Exchange (21) +- * Filter (20) +- * ColumnarToRow (19) - +- Scan parquet default.date_dim (18) + +- Scan parquet default.customer_address (18) -(1) Scan parquet default.customer_address -Output [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] +(1) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] - -(3) Filter [codegen id : 1] -Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] -Condition : isnotnull(ca_address_sk#1) +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(4) Exchange -Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] -Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#4] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] -(5) Sort [codegen id : 2] -Input [3]: [ca_address_sk#1, ca_state#2, ca_zip#3] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +(3) Filter [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3] +Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(6) Scan parquet default.customer -Output [2]: [c_customer_sk#5, c_current_addr_sk#6] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_year#5, d_qoy#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] -(8) Filter [codegen id : 3] -Input [2]: [c_customer_sk#5, c_current_addr_sk#6] -Condition : (isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#6)) +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] +Condition : ((((isnotnull(d_qoy#6) AND isnotnull(d_year#5)) AND (d_qoy#6 = 2)) AND (d_year#5 = 2001)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [2]: [c_customer_sk#5, c_current_addr_sk#6] -Arguments: hashpartitioning(c_current_addr_sk#6, 5), true, [id=#7] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] -(10) Sort [codegen id : 4] -Input [2]: [c_customer_sk#5, c_current_addr_sk#6] -Arguments: [c_current_addr_sk#6 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] -(11) SortMergeJoin [codegen id : 5] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#6] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 5] -Output [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] -Input [5]: [ca_address_sk#1, ca_state#2, ca_zip#3, c_customer_sk#5, c_current_addr_sk#6] +(10) Project [codegen id : 2] +Output [2]: [cs_bill_customer_sk#2, cs_sales_price#3] +Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3, d_date_sk#4] -(13) Exchange -Input [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] -Arguments: hashpartitioning(c_customer_sk#5, 5), true, [id=#8] +(11) Exchange +Input [2]: [cs_bill_customer_sk#2, cs_sales_price#3] +Arguments: hashpartitioning(cs_bill_customer_sk#2, 5), true, [id=#8] -(14) Sort [codegen id : 6] -Input [3]: [ca_state#2, ca_zip#3, c_customer_sk#5] -Arguments: [c_customer_sk#5 ASC NULLS FIRST], false, 0 +(12) Sort [codegen id : 3] +Input [2]: [cs_bill_customer_sk#2, cs_sales_price#3] +Arguments: [cs_bill_customer_sk#2 ASC NULLS FIRST], false, 0 -(15) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] +(13) Scan parquet default.customer +Output [2]: [c_customer_sk#9, c_current_addr_sk#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [2]: [c_customer_sk#9, c_current_addr_sk#10] -(16) ColumnarToRow [codegen id : 8] -Input [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] +(15) Filter [codegen id : 4] +Input [2]: [c_customer_sk#9, c_current_addr_sk#10] +Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_current_addr_sk#10)) -(17) Filter [codegen id : 8] -Input [3]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11] -Condition : (isnotnull(cs_bill_customer_sk#10) AND isnotnull(cs_sold_date_sk#9)) +(16) Exchange +Input [2]: [c_customer_sk#9, c_current_addr_sk#10] +Arguments: hashpartitioning(c_current_addr_sk#10, 5), true, [id=#11] -(18) Scan parquet default.date_dim -Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(17) Sort [codegen id : 5] +Input [2]: [c_customer_sk#9, c_current_addr_sk#10] +Arguments: [c_current_addr_sk#10 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.customer_address +Output [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(19) ColumnarToRow [codegen id : 7] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(19) ColumnarToRow [codegen id : 6] +Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] -(20) Filter [codegen id : 7] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -Condition : ((((isnotnull(d_qoy#14) AND isnotnull(d_year#13)) AND (d_qoy#14 = 2)) AND (d_year#13 = 2001)) AND isnotnull(d_date_sk#12)) +(20) Filter [codegen id : 6] +Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] +Condition : isnotnull(ca_address_sk#12) -(21) Project [codegen id : 7] -Output [1]: [d_date_sk#12] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(21) Exchange +Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] +Arguments: hashpartitioning(ca_address_sk#12, 5), true, [id=#15] -(22) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(22) Sort [codegen id : 7] +Input [3]: [ca_address_sk#12, ca_state#13, ca_zip#14] +Arguments: [ca_address_sk#12 ASC NULLS FIRST], false, 0 -(23) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_sold_date_sk#9] -Right keys [1]: [d_date_sk#12] +(23) SortMergeJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#10] +Right keys [1]: [ca_address_sk#12] Join condition: None (24) Project [codegen id : 8] -Output [2]: [cs_bill_customer_sk#10, cs_sales_price#11] -Input [4]: [cs_sold_date_sk#9, cs_bill_customer_sk#10, cs_sales_price#11, d_date_sk#12] +Output [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] +Input [5]: [c_customer_sk#9, c_current_addr_sk#10, ca_address_sk#12, ca_state#13, ca_zip#14] (25) Exchange -Input [2]: [cs_bill_customer_sk#10, cs_sales_price#11] -Arguments: hashpartitioning(cs_bill_customer_sk#10, 5), true, [id=#16] +Input [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] +Arguments: hashpartitioning(c_customer_sk#9, 5), true, [id=#16] (26) Sort [codegen id : 9] -Input [2]: [cs_bill_customer_sk#10, cs_sales_price#11] -Arguments: [cs_bill_customer_sk#10 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#9, ca_state#13, ca_zip#14] +Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 (27) SortMergeJoin [codegen id : 10] -Left keys [1]: [c_customer_sk#5] -Right keys [1]: [cs_bill_customer_sk#10] -Join condition: ((substr(ca_zip#3, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#2 IN (CA,WA,GA)) OR (cs_sales_price#11 > 500.00)) +Left keys [1]: [cs_bill_customer_sk#2] +Right keys [1]: [c_customer_sk#9] +Join condition: ((substr(ca_zip#14, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#13 IN (CA,WA,GA)) OR (cs_sales_price#3 > 500.00)) (28) Project [codegen id : 10] -Output [2]: [cs_sales_price#11, ca_zip#3] -Input [5]: [ca_state#2, ca_zip#3, c_customer_sk#5, cs_bill_customer_sk#10, cs_sales_price#11] +Output [2]: [cs_sales_price#3, ca_zip#14] +Input [5]: [cs_bill_customer_sk#2, cs_sales_price#3, c_customer_sk#9, ca_state#13, ca_zip#14] (29) HashAggregate [codegen id : 10] -Input [2]: [cs_sales_price#11, ca_zip#3] -Keys [1]: [ca_zip#3] -Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#11))] +Input [2]: [cs_sales_price#3, ca_zip#14] +Keys [1]: [ca_zip#14] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#3))] Aggregate Attributes [1]: [sum#17] -Results [2]: [ca_zip#3, sum#18] +Results [2]: [ca_zip#14, sum#18] (30) Exchange -Input [2]: [ca_zip#3, sum#18] -Arguments: hashpartitioning(ca_zip#3, 5), true, [id=#19] +Input [2]: [ca_zip#14, sum#18] +Arguments: hashpartitioning(ca_zip#14, 5), true, [id=#19] (31) HashAggregate [codegen id : 11] -Input [2]: [ca_zip#3, sum#18] -Keys [1]: [ca_zip#3] -Functions [1]: [sum(UnscaledValue(cs_sales_price#11))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#11))#20] -Results [2]: [ca_zip#3, MakeDecimal(sum(UnscaledValue(cs_sales_price#11))#20,17,2) AS sum(cs_sales_price)#21] +Input [2]: [ca_zip#14, sum#18] +Keys [1]: [ca_zip#14] +Functions [1]: [sum(UnscaledValue(cs_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#20] +Results [2]: [ca_zip#14, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#20,17,2) AS sum(cs_sales_price)#21] (32) TakeOrderedAndProject -Input [2]: [ca_zip#3, sum(cs_sales_price)#21] -Arguments: 100, [ca_zip#3 ASC NULLS FIRST], [ca_zip#3, sum(cs_sales_price)#21] +Input [2]: [ca_zip#14, sum(cs_sales_price)#21] +Arguments: 100, [ca_zip#14 ASC NULLS FIRST], [ca_zip#14, sum(cs_sales_price)#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt index 710bcac90b971..cd452ad14548c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt @@ -6,41 +6,13 @@ TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] WholeStageCodegen (10) HashAggregate [ca_zip,cs_sales_price] [sum,sum] Project [cs_sales_price,ca_zip] - SortMergeJoin [c_customer_sk,cs_bill_customer_sk,ca_zip,ca_state,cs_sales_price] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk,ca_zip,ca_state,cs_sales_price] InputAdapter - WholeStageCodegen (6) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #2 - WholeStageCodegen (5) - Project [ca_state,ca_zip,c_customer_sk] - SortMergeJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #3 - WholeStageCodegen (1) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] - InputAdapter - WholeStageCodegen (4) - Sort [c_current_addr_sk] - InputAdapter - Exchange [c_current_addr_sk] #4 - WholeStageCodegen (3) - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] - InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (3) Sort [cs_bill_customer_sk] InputAdapter - Exchange [cs_bill_customer_sk] #5 - WholeStageCodegen (8) + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (2) Project [cs_bill_customer_sk,cs_sales_price] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_bill_customer_sk,cs_sold_date_sk] @@ -48,10 +20,38 @@ TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_sales_price] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (7) + BroadcastExchange #3 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_qoy,d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #4 + WholeStageCodegen (8) + Project [c_customer_sk,ca_state,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (5) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #6 + WholeStageCodegen (6) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt index d7e8e52208058..509fb0133095b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -37,12 +37,12 @@ TakeOrderedAndProject (44) : +- * Project (28) : +- * Filter (27) : +- * ColumnarToRow (26) - : +- Scan parquet default.date_dim (25) + : +- Scan parquet default.call_center (25) +- BroadcastExchange (36) +- * Project (35) +- * Filter (34) +- * ColumnarToRow (33) - +- Scan parquet default.call_center (32) + +- Scan parquet default.date_dim (32) (1) Scan parquet default.catalog_sales @@ -150,67 +150,67 @@ Join condition: None Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#14] -(25) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_date#18] +(25) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#17, cc_county#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] +ReadSchema: struct (26) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#17, d_date#18] +Input [2]: [cc_call_center_sk#17, cc_county#18] (27) Filter [codegen id : 9] -Input [2]: [d_date_sk#17, d_date#18] -Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 11719)) AND (d_date#18 <= 11779)) AND isnotnull(d_date_sk#17)) +Input [2]: [cc_call_center_sk#17, cc_county#18] +Condition : ((isnotnull(cc_county#18) AND (cc_county#18 = Williamson County)) AND isnotnull(cc_call_center_sk#17)) (28) Project [codegen id : 9] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_date#18] +Output [1]: [cc_call_center_sk#17] +Input [2]: [cc_call_center_sk#17, cc_county#18] (29) BroadcastExchange -Input [1]: [d_date_sk#17] +Input [1]: [cc_call_center_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (30) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_ship_date_sk#1] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#17] Join condition: None (31) Project [codegen id : 11] -Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#17] +Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#17] -(32) Scan parquet default.call_center -Output [2]: [cc_call_center_sk#20, cc_county#21] +(32) Scan parquet default.date_dim +Output [2]: [d_date_sk#20, d_date#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/call_center] -PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (33) ColumnarToRow [codegen id : 10] -Input [2]: [cc_call_center_sk#20, cc_county#21] +Input [2]: [d_date_sk#20, d_date#21] (34) Filter [codegen id : 10] -Input [2]: [cc_call_center_sk#20, cc_county#21] -Condition : ((isnotnull(cc_county#21) AND (cc_county#21 = Williamson County)) AND isnotnull(cc_call_center_sk#20)) +Input [2]: [d_date_sk#20, d_date#21] +Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 11719)) AND (d_date#21 <= 11779)) AND isnotnull(d_date_sk#20)) (35) Project [codegen id : 10] -Output [1]: [cc_call_center_sk#20] -Input [2]: [cc_call_center_sk#20, cc_county#21] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_date#21] (36) BroadcastExchange -Input [1]: [cc_call_center_sk#20] +Input [1]: [d_date_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_call_center_sk#3] -Right keys [1]: [cc_call_center_sk#20] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#20] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#20] +Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#20] (39) HashAggregate [codegen id : 11] Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt index d2b88a409c0ab..ea9a0b27ff700 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt @@ -8,9 +8,9 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] Project [cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] - Project [cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] Project [cs_ship_date_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk] InputAdapter @@ -56,16 +56,16 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] InputAdapter BroadcastExchange #6 WholeStageCodegen (9) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [cc_call_center_sk] + Filter [cc_county,cc_call_center_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.call_center [cc_call_center_sk,cc_county] InputAdapter BroadcastExchange #7 WholeStageCodegen (10) - Project [cc_call_center_sk] - Filter [cc_county,cc_call_center_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.call_center [cc_call_center_sk,cc_county] + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt index 4495dcd5821ad..a17356ae04a03 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt @@ -18,15 +18,15 @@ TakeOrderedAndProject (57) : : : +- * Project (16) : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : :- BroadcastExchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.store_sales (6) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- BroadcastExchange (14) : : : +- * Filter (13) : : : +- * ColumnarToRow (12) @@ -39,69 +39,69 @@ TakeOrderedAndProject (57) : +- * Sort (39) : +- Exchange (38) : +- * Project (37) - : +- * BroadcastHashJoin Inner BuildLeft (36) - : :- BroadcastExchange (32) - : : +- * Project (31) - : : +- * Filter (30) - : : +- * ColumnarToRow (29) - : : +- Scan parquet default.date_dim (28) - : +- * Filter (35) - : +- * ColumnarToRow (34) - : +- Scan parquet default.store_returns (33) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.store_returns (28) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.date_dim (31) +- * Sort (51) +- Exchange (50) +- * Project (49) - +- * BroadcastHashJoin Inner BuildLeft (48) - :- ReusedExchange (44) - +- * Filter (47) - +- * ColumnarToRow (46) - +- Scan parquet default.catalog_sales (45) + +- * BroadcastHashJoin Inner BuildRight (48) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- ReusedExchange (47) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_quarter_name#2] +(1) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_quarter_name#2] +(2) ColumnarToRow [codegen id : 3] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_quarter_name#2] -Condition : ((isnotnull(d_quarter_name#2) AND (d_quarter_name#2 = 2001Q1)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] +Condition : ((((isnotnull(ss_customer_sk#3) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_ticket_number#5)) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_quarter_name#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_quarter_name#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_quarter_name#8] -(6) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_quarter_name#8] +Condition : ((isnotnull(d_quarter_name#8) AND (d_quarter_name#8 = 2001Q1)) AND isnotnull(d_date_sk#7)) -(7) ColumnarToRow -Input [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_quarter_name#8] -(8) Filter -Input [6]: [ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] -Condition : ((((isnotnull(ss_customer_sk#6) AND isnotnull(ss_item_sk#5)) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_sold_date_sk#4)) AND isnotnull(ss_store_sk#7)) +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (10) Project [codegen id : 3] -Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] -Input [7]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9] +Output [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6, d_date_sk#7] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_state#11] @@ -122,21 +122,21 @@ Input [2]: [s_store_sk#10, s_state#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#10] Join condition: None (16) Project [codegen id : 3] -Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] -Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ticket_number#8, ss_quantity#9, s_store_sk#10, s_state#11] +Output [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] +Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_quantity#6, s_store_sk#10, s_state#11] (17) Exchange -Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] -Arguments: hashpartitioning(ss_item_sk#5, 5), true, [id=#13] +Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#13] (18) Sort [codegen id : 4] -Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11] -Arguments: [ss_item_sk#5 ASC NULLS FIRST], false, 0 +Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [3]: [i_item_sk#14, i_item_id#15, i_item_desc#16] @@ -161,139 +161,139 @@ Input [3]: [i_item_sk#14, i_item_id#15, i_item_desc#16] Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#14] Join condition: None (25) Project [codegen id : 7] -Output [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] -Input [8]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_sk#14, i_item_id#15, i_item_desc#16] +Output [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] +Input [8]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_sk#14, i_item_id#15, i_item_desc#16] (26) Exchange -Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] -Arguments: hashpartitioning(cast(ss_customer_sk#6 as bigint), cast(ss_item_sk#5 as bigint), cast(ss_ticket_number#8 as bigint), 5), true, [id=#18] +Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] +Arguments: hashpartitioning(cast(ss_customer_sk#3 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint), 5), true, [id=#18] (27) Sort [codegen id : 8] -Input [7]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16] -Arguments: [cast(ss_customer_sk#6 as bigint) ASC NULLS FIRST, cast(ss_item_sk#5 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#8 as bigint) ASC NULLS FIRST], false, 0 +Input [7]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16] +Arguments: [cast(ss_customer_sk#3 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST, cast(ss_ticket_number#5 as bigint) ASC NULLS FIRST], false, 0 -(28) Scan parquet default.date_dim -Output [2]: [d_date_sk#19, d_quarter_name#20] +(28) Scan parquet default.store_returns +Output [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct -(29) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#19, d_quarter_name#20] +(29) ColumnarToRow [codegen id : 10] +Input [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] -(30) Filter [codegen id : 9] -Input [2]: [d_date_sk#19, d_quarter_name#20] -Condition : (d_quarter_name#20 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#19)) +(30) Filter [codegen id : 10] +Input [5]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Condition : (((isnotnull(sr_customer_sk#21) AND isnotnull(sr_item_sk#20)) AND isnotnull(sr_ticket_number#22)) AND isnotnull(sr_returned_date_sk#19)) -(31) Project [codegen id : 9] -Output [1]: [d_date_sk#19] -Input [2]: [d_date_sk#19, d_quarter_name#20] +(31) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_quarter_name#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] +ReadSchema: struct -(32) BroadcastExchange -Input [1]: [d_date_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] +(32) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#24, d_quarter_name#25] -(33) Scan parquet default.store_returns -Output [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct +(33) Filter [codegen id : 9] +Input [2]: [d_date_sk#24, d_quarter_name#25] +Condition : (d_quarter_name#25 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#24)) -(34) ColumnarToRow -Input [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +(34) Project [codegen id : 9] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_quarter_name#25] -(35) Filter -Input [5]: [sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] -Condition : (((isnotnull(sr_customer_sk#24) AND isnotnull(sr_item_sk#23)) AND isnotnull(sr_ticket_number#25)) AND isnotnull(sr_returned_date_sk#22)) +(35) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] (36) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cast(d_date_sk#19 as bigint)] -Right keys [1]: [sr_returned_date_sk#22] +Left keys [1]: [sr_returned_date_sk#19] +Right keys [1]: [cast(d_date_sk#24 as bigint)] Join condition: None (37) Project [codegen id : 10] -Output [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] -Input [6]: [d_date_sk#19, sr_returned_date_sk#22, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Output [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Input [6]: [sr_returned_date_sk#19, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, d_date_sk#24] (38) Exchange -Input [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] -Arguments: hashpartitioning(sr_customer_sk#24, sr_item_sk#23, sr_ticket_number#25, 5), true, [id=#27] +Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22, 5), true, [id=#27] (39) Sort [codegen id : 11] -Input [4]: [sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] -Arguments: [sr_customer_sk#24 ASC NULLS FIRST, sr_item_sk#23 ASC NULLS FIRST, sr_ticket_number#25 ASC NULLS FIRST], false, 0 +Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST, sr_ticket_number#22 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [3]: [cast(ss_customer_sk#6 as bigint), cast(ss_item_sk#5 as bigint), cast(ss_ticket_number#8 as bigint)] -Right keys [3]: [sr_customer_sk#24, sr_item_sk#23, sr_ticket_number#25] +Left keys [3]: [cast(ss_customer_sk#3 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint)] +Right keys [3]: [sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22] Join condition: None (41) Project [codegen id : 12] -Output [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] -Input [11]: [ss_item_sk#5, ss_customer_sk#6, ss_ticket_number#8, ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_ticket_number#25, sr_return_quantity#26] +Output [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Input [11]: [ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] (42) Exchange -Input [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] -Arguments: hashpartitioning(sr_customer_sk#24, sr_item_sk#23, 5), true, [id=#28] +Input [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, 5), true, [id=#28] (43) Sort [codegen id : 13] -Input [7]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26] -Arguments: [sr_customer_sk#24 ASC NULLS FIRST, sr_item_sk#23 ASC NULLS FIRST], false, 0 - -(44) ReusedExchange [Reuses operator id: 32] -Output [1]: [d_date_sk#29] +Input [7]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST], false, 0 -(45) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +(44) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(46) ColumnarToRow -Input [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] + +(46) Filter [codegen id : 15] +Input [4]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Condition : ((isnotnull(cs_bill_customer_sk#30) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_sold_date_sk#29)) -(47) Filter -Input [4]: [cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] -Condition : ((isnotnull(cs_bill_customer_sk#31) AND isnotnull(cs_item_sk#32)) AND isnotnull(cs_sold_date_sk#30)) +(47) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#33] (48) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [d_date_sk#29] -Right keys [1]: [cs_sold_date_sk#30] +Left keys [1]: [cs_sold_date_sk#29] +Right keys [1]: [d_date_sk#33] Join condition: None (49) Project [codegen id : 15] -Output [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] -Input [5]: [d_date_sk#29, cs_sold_date_sk#30, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Output [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Input [5]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32, d_date_sk#33] (50) Exchange -Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#31 as bigint), cast(cs_item_sk#32 as bigint), 5), true, [id=#34] +Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Arguments: hashpartitioning(cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint), 5), true, [id=#34] (51) Sort [codegen id : 16] -Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] -Arguments: [cast(cs_bill_customer_sk#31 as bigint) ASC NULLS FIRST, cast(cs_item_sk#32 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] +Arguments: [cast(cs_bill_customer_sk#30 as bigint) ASC NULLS FIRST, cast(cs_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 (52) SortMergeJoin [codegen id : 17] -Left keys [2]: [sr_customer_sk#24, sr_item_sk#23] -Right keys [2]: [cast(cs_bill_customer_sk#31 as bigint), cast(cs_item_sk#32 as bigint)] +Left keys [2]: [sr_customer_sk#21, sr_item_sk#20] +Right keys [2]: [cast(cs_bill_customer_sk#30 as bigint), cast(cs_item_sk#31 as bigint)] Join condition: None (53) Project [codegen id : 17] -Output [6]: [ss_quantity#9, sr_return_quantity#26, cs_quantity#33, s_state#11, i_item_id#15, i_item_desc#16] -Input [10]: [ss_quantity#9, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#23, sr_customer_sk#24, sr_return_quantity#26, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Output [6]: [ss_quantity#6, sr_return_quantity#23, cs_quantity#32, s_state#11, i_item_id#15, i_item_desc#16] +Input [10]: [ss_quantity#6, s_state#11, i_item_id#15, i_item_desc#16, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#32] (54) HashAggregate [codegen id : 17] -Input [6]: [ss_quantity#9, sr_return_quantity#26, cs_quantity#33, s_state#11, i_item_id#15, i_item_desc#16] +Input [6]: [ss_quantity#6, sr_return_quantity#23, cs_quantity#32, s_state#11, i_item_id#15, i_item_desc#16] Keys [3]: [i_item_id#15, i_item_desc#16, s_state#11] -Functions [9]: [partial_count(ss_quantity#9), partial_avg(cast(ss_quantity#9 as bigint)), partial_stddev_samp(cast(ss_quantity#9 as double)), partial_count(sr_return_quantity#26), partial_avg(cast(sr_return_quantity#26 as bigint)), partial_stddev_samp(cast(sr_return_quantity#26 as double)), partial_count(cs_quantity#33), partial_avg(cast(cs_quantity#33 as bigint)), partial_stddev_samp(cast(cs_quantity#33 as double))] +Functions [9]: [partial_count(ss_quantity#6), partial_avg(cast(ss_quantity#6 as bigint)), partial_stddev_samp(cast(ss_quantity#6 as double)), partial_count(sr_return_quantity#23), partial_avg(cast(sr_return_quantity#23 as bigint)), partial_stddev_samp(cast(sr_return_quantity#23 as double)), partial_count(cs_quantity#32), partial_avg(cast(cs_quantity#32 as bigint)), partial_stddev_samp(cast(cs_quantity#32 as double))] Aggregate Attributes [18]: [count#35, sum#36, count#37, n#38, avg#39, m2#40, count#41, sum#42, count#43, n#44, avg#45, m2#46, count#47, sum#48, count#49, n#50, avg#51, m2#52] Results [21]: [i_item_id#15, i_item_desc#16, s_state#11, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] @@ -304,9 +304,9 @@ Arguments: hashpartitioning(i_item_id#15, i_item_desc#16, s_state#11, 5), true, (56) HashAggregate [codegen id : 18] Input [21]: [i_item_id#15, i_item_desc#16, s_state#11, count#53, sum#54, count#55, n#56, avg#57, m2#58, count#59, sum#60, count#61, n#62, avg#63, m2#64, count#65, sum#66, count#67, n#68, avg#69, m2#70] Keys [3]: [i_item_id#15, i_item_desc#16, s_state#11] -Functions [9]: [count(ss_quantity#9), avg(cast(ss_quantity#9 as bigint)), stddev_samp(cast(ss_quantity#9 as double)), count(sr_return_quantity#26), avg(cast(sr_return_quantity#26 as bigint)), stddev_samp(cast(sr_return_quantity#26 as double)), count(cs_quantity#33), avg(cast(cs_quantity#33 as bigint)), stddev_samp(cast(cs_quantity#33 as double))] -Aggregate Attributes [9]: [count(ss_quantity#9)#72, avg(cast(ss_quantity#9 as bigint))#73, stddev_samp(cast(ss_quantity#9 as double))#74, count(sr_return_quantity#26)#75, avg(cast(sr_return_quantity#26 as bigint))#76, stddev_samp(cast(sr_return_quantity#26 as double))#77, count(cs_quantity#33)#78, avg(cast(cs_quantity#33 as bigint))#79, stddev_samp(cast(cs_quantity#33 as double))#80] -Results [15]: [i_item_id#15, i_item_desc#16, s_state#11, count(ss_quantity#9)#72 AS store_sales_quantitycount#81, avg(cast(ss_quantity#9 as bigint))#73 AS store_sales_quantityave#82, stddev_samp(cast(ss_quantity#9 as double))#74 AS store_sales_quantitystdev#83, (stddev_samp(cast(ss_quantity#9 as double))#74 / avg(cast(ss_quantity#9 as bigint))#73) AS store_sales_quantitycov#84, count(sr_return_quantity#26)#75 AS as_store_returns_quantitycount#85, avg(cast(sr_return_quantity#26 as bigint))#76 AS as_store_returns_quantityave#86, stddev_samp(cast(sr_return_quantity#26 as double))#77 AS as_store_returns_quantitystdev#87, (stddev_samp(cast(sr_return_quantity#26 as double))#77 / avg(cast(sr_return_quantity#26 as bigint))#76) AS store_returns_quantitycov#88, count(cs_quantity#33)#78 AS catalog_sales_quantitycount#89, avg(cast(cs_quantity#33 as bigint))#79 AS catalog_sales_quantityave#90, (stddev_samp(cast(cs_quantity#33 as double))#80 / avg(cast(cs_quantity#33 as bigint))#79) AS catalog_sales_quantitystdev#91, (stddev_samp(cast(cs_quantity#33 as double))#80 / avg(cast(cs_quantity#33 as bigint))#79) AS catalog_sales_quantitycov#92] +Functions [9]: [count(ss_quantity#6), avg(cast(ss_quantity#6 as bigint)), stddev_samp(cast(ss_quantity#6 as double)), count(sr_return_quantity#23), avg(cast(sr_return_quantity#23 as bigint)), stddev_samp(cast(sr_return_quantity#23 as double)), count(cs_quantity#32), avg(cast(cs_quantity#32 as bigint)), stddev_samp(cast(cs_quantity#32 as double))] +Aggregate Attributes [9]: [count(ss_quantity#6)#72, avg(cast(ss_quantity#6 as bigint))#73, stddev_samp(cast(ss_quantity#6 as double))#74, count(sr_return_quantity#23)#75, avg(cast(sr_return_quantity#23 as bigint))#76, stddev_samp(cast(sr_return_quantity#23 as double))#77, count(cs_quantity#32)#78, avg(cast(cs_quantity#32 as bigint))#79, stddev_samp(cast(cs_quantity#32 as double))#80] +Results [15]: [i_item_id#15, i_item_desc#16, s_state#11, count(ss_quantity#6)#72 AS store_sales_quantitycount#81, avg(cast(ss_quantity#6 as bigint))#73 AS store_sales_quantityave#82, stddev_samp(cast(ss_quantity#6 as double))#74 AS store_sales_quantitystdev#83, (stddev_samp(cast(ss_quantity#6 as double))#74 / avg(cast(ss_quantity#6 as bigint))#73) AS store_sales_quantitycov#84, count(sr_return_quantity#23)#75 AS as_store_returns_quantitycount#85, avg(cast(sr_return_quantity#23 as bigint))#76 AS as_store_returns_quantityave#86, stddev_samp(cast(sr_return_quantity#23 as double))#77 AS as_store_returns_quantitystdev#87, (stddev_samp(cast(sr_return_quantity#23 as double))#77 / avg(cast(sr_return_quantity#23 as bigint))#76) AS store_returns_quantitycov#88, count(cs_quantity#32)#78 AS catalog_sales_quantitycount#89, avg(cast(cs_quantity#32 as bigint))#79 AS catalog_sales_quantityave#90, (stddev_samp(cast(cs_quantity#32 as double))#80 / avg(cast(cs_quantity#32 as bigint))#79) AS catalog_sales_quantitystdev#91, (stddev_samp(cast(cs_quantity#32 as double))#80 / avg(cast(cs_quantity#32 as bigint))#79) AS catalog_sales_quantitycov#92] (57) TakeOrderedAndProject Input [15]: [i_item_id#15, i_item_desc#16, s_state#11, store_sales_quantitycount#81, store_sales_quantityave#82, store_sales_quantitystdev#83, store_sales_quantitycov#84, as_store_returns_quantitycount#85, as_store_returns_quantityave#86, as_store_returns_quantitystdev#87, store_returns_quantitycov#88, catalog_sales_quantitycount#89, catalog_sales_quantityave#90, catalog_sales_quantitystdev#91, catalog_sales_quantitycov#92] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt index 1bb1679d6208e..bfb59441f483b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt @@ -32,7 +32,11 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -41,10 +45,6 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_quarter_name] - Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) @@ -69,7 +69,11 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 WholeStageCodegen (10) Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] - BroadcastHashJoin [d_date_sk,sr_returned_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number,sr_returned_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -78,10 +82,6 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_quarter_name] - Filter [sr_customer_sk,sr_item_sk,sr_ticket_number,sr_returned_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] InputAdapter WholeStageCodegen (16) Sort [cs_bill_customer_sk,cs_item_sk] @@ -89,10 +89,10 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,s Exchange [cs_bill_customer_sk,cs_item_sk] #10 WholeStageCodegen (15) Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #9 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] + InputAdapter + ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt index 353620897fc40..88b5168f6049c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (45) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.item (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -46,50 +46,50 @@ TakeOrderedAndProject (45) +- Scan parquet default.customer_address (31) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] -Condition : ((isnotnull(i_manager_id#6) AND (i_manager_id#6 = 8)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5] +Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_store_sk#4)) -(4) Project [codegen id : 1] -Output [5]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, i_manager_id#6] +(4) Scan parquet default.item +Output [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [5]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 8)) AND isnotnull(i_item_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Input [6]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, i_manager_id#11] -(8) Filter -Input [5]: [ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] -Condition : (((isnotnull(ss_sold_date_sk#8) AND isnotnull(ss_item_sk#9)) AND isnotnull(ss_customer_sk#10)) AND isnotnull(ss_store_sk#11)) +(8) BroadcastExchange +Input [5]: [i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#9] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [8]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] -Input [10]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_item_sk#9, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] +Output [8]: [ss_sold_date_sk#1, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Input [10]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_item_sk#6, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#13, d_year#14, d_moy#15] @@ -114,13 +114,13 @@ Input [1]: [d_date_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#8] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#13] Join condition: None (17) Project [codegen id : 4] -Output [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12] -Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_sold_date_sk#8, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12, d_date_sk#13] +Output [7]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Input [9]: [ss_sold_date_sk#1, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, d_date_sk#13] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_zip#18] @@ -141,21 +141,21 @@ Input [2]: [s_store_sk#17, s_zip#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#11] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] -Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_store_sk#11, ss_ext_sales_price#12, s_store_sk#17, s_zip#18] +Output [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] +Input [9]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_store_sk#17, s_zip#18] (24) Exchange -Input [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] -Arguments: hashpartitioning(ss_customer_sk#10, 5), true, [id=#20] +Input [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] +Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#20] (25) Sort [codegen id : 5] -Input [7]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18] -Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false, 0 +Input [7]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18] +Arguments: [ss_customer_sk#3 ASC NULLS FIRST], false, 0 (26) Scan parquet default.customer Output [2]: [c_customer_sk#21, c_current_addr_sk#22] @@ -219,33 +219,33 @@ Input [2]: [c_customer_sk#21, ca_zip#25] Arguments: [c_customer_sk#21 ASC NULLS FIRST], false, 0 (40) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_customer_sk#10] +Left keys [1]: [ss_customer_sk#3] Right keys [1]: [c_customer_sk#21] Join condition: NOT (substr(ca_zip#25, 1, 5) = substr(s_zip#18, 1, 5)) (41) Project [codegen id : 12] -Output [5]: [ss_ext_sales_price#12, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] -Input [9]: [i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5, ss_customer_sk#10, ss_ext_sales_price#12, s_zip#18, c_customer_sk#21, ca_zip#25] +Output [5]: [ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Input [9]: [ss_customer_sk#3, ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10, s_zip#18, c_customer_sk#21, ca_zip#25] (42) HashAggregate [codegen id : 12] -Input [5]: [ss_ext_sales_price#12, i_brand_id#2, i_brand#3, i_manufact_id#4, i_manufact#5] -Keys [4]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#12))] +Input [5]: [ss_ext_sales_price#5, i_brand_id#7, i_brand#8, i_manufact_id#9, i_manufact#10] +Keys [4]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] Aggregate Attributes [1]: [sum#28] -Results [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] +Results [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] (43) Exchange -Input [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, 5), true, [id=#30] +Input [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] +Arguments: hashpartitioning(i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, 5), true, [id=#30] (44) HashAggregate [codegen id : 13] -Input [5]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5, sum#29] -Keys [4]: [i_brand#3, i_brand_id#2, i_manufact_id#4, i_manufact#5] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#12))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#12))#31] -Results [5]: [i_brand_id#2 AS brand_id#32, i_brand#3 AS brand#33, i_manufact_id#4, i_manufact#5, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#12))#31,17,2) AS ext_price#34] +Input [5]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10, sum#29] +Keys [4]: [i_brand#8, i_brand_id#7, i_manufact_id#9, i_manufact#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#31] +Results [5]: [i_brand_id#7 AS brand_id#32, i_brand#8 AS brand#33, i_manufact_id#9, i_manufact#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#31,17,2) AS ext_price#34] (45) TakeOrderedAndProject -Input [5]: [brand_id#32, brand#33, i_manufact_id#4, i_manufact#5, ext_price#34] -Arguments: 100, [ext_price#34 DESC NULLS LAST, brand#33 ASC NULLS FIRST, brand_id#32 ASC NULLS FIRST, i_manufact_id#4 ASC NULLS FIRST, i_manufact#5 ASC NULLS FIRST], [brand_id#32, brand#33, i_manufact_id#4, i_manufact#5, ext_price#34] +Input [5]: [brand_id#32, brand#33, i_manufact_id#9, i_manufact#10, ext_price#34] +Arguments: 100, [ext_price#34 DESC NULLS LAST, brand#33 ASC NULLS FIRST, brand_id#32 ASC NULLS FIRST, i_manufact_id#9 ASC NULLS FIRST, i_manufact#10 ASC NULLS FIRST], [brand_id#32, brand#33, i_manufact_id#9, i_manufact#10, ext_price#34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt index 749e88cdd49c4..05fa3f82e27df 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt @@ -13,12 +13,16 @@ TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] InputAdapter Exchange [ss_customer_sk] #2 WholeStageCodegen (4) - Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_customer_sk,ss_ext_sales_price,s_zip] + Project [ss_customer_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,s_zip] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand_id,i_brand,i_manufact_id,i_manufact,ss_sold_date_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -27,10 +31,6 @@ TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt index d297bea4aec63..2ef3660bc7ba4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -8,145 +8,145 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.catalog_sales (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +(1) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] - -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Condition : (i_category#6 IN (Sports,Books,Home) AND isnotnull(i_item_sk#1)) +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(4) Exchange -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#7] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(5) Sort [codegen id : 2] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +(3) Filter [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(6) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] -Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] -Arguments: hashpartitioning(cs_item_sk#9, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [3]: [cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] -Arguments: [cs_item_sk#9 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [cs_item_sk#9] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_ext_sales_price#10] -Input [9]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_item_sk#9, cs_ext_sales_price#10] +(10) Project [codegen id : 2] +Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(11) Exchange +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#8] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Input [8]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, cs_sold_date_sk#8, cs_ext_sales_price#10, d_date_sk#12] +Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] -Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#10))] +Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] -Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] -Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] -Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#10))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#10))#18] -Results [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#10))#18,17,2) AS _w1#21, i_item_id#2] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: hashpartitioning(i_class#5, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: [i_class#5 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#5] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#2] -Input [9]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] -Arguments: 100, [i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt index aad2b527cb44d..1e8ab18f5e21a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [i_item_id,i_item_desc,i_current_price,i_class,i_category,cs_sold_date_sk,cs_ext_sales_price] - SortMergeJoin [i_item_sk,cs_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #3 - WholeStageCodegen (1) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] - InputAdapter - WholeStageCodegen (4) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #4 - WholeStageCodegen (3) + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (2) + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt index 04cd0813d6471..9de369f611d0e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt @@ -9,15 +9,15 @@ TakeOrderedAndProject (27) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.inventory (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -28,50 +28,50 @@ TakeOrderedAndProject (27) +- Scan parquet default.warehouse (17) -(1) Scan parquet default.item -Output [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +(1) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -(3) Filter [codegen id : 1] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] -Condition : (((isnotnull(i_current_price#3) AND (i_current_price#3 >= 0.99)) AND (i_current_price#3 <= 1.49)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_warehouse_sk#3) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) -(4) Project [codegen id : 1] -Output [2]: [i_item_sk#1, i_item_id#2] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +(4) Scan parquet default.item +Output [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [i_item_sk#1, i_item_id#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] -(6) Scan parquet default.inventory -Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] +Condition : (((isnotnull(i_current_price#7) AND (i_current_price#7 >= 0.99)) AND (i_current_price#7 <= 1.49)) AND isnotnull(i_item_sk#5)) -(7) ColumnarToRow -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +(7) Project [codegen id : 1] +Output [2]: [i_item_sk#5, i_item_id#6] +Input [3]: [i_item_sk#5, i_item_id#6, i_current_price#7] -(8) Filter -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Condition : ((isnotnull(inv_warehouse_sk#7) AND isnotnull(inv_item_sk#6)) AND isnotnull(inv_date_sk#5)) +(8) BroadcastExchange +Input [2]: [i_item_sk#5, i_item_id#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [inv_item_sk#6] +Left keys [1]: [inv_item_sk#2] +Right keys [1]: [i_item_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [i_item_id#2, inv_date_sk#5, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Input [6]: [i_item_sk#1, i_item_id#2, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Output [4]: [inv_date_sk#1, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6] +Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_sk#5, i_item_id#6] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#9, d_date#10] @@ -92,13 +92,13 @@ Input [2]: [d_date_sk#9, d_date#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_date_sk#5] +Left keys [1]: [inv_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [i_item_id#2, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date#10] -Input [6]: [i_item_id#2, inv_date_sk#5, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date_sk#9, d_date#10] +Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date#10] +Input [6]: [inv_date_sk#1, inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date_sk#9, d_date#10] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#12, w_warehouse_name#13] @@ -119,37 +119,37 @@ Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#7] +Left keys [1]: [inv_warehouse_sk#3] Right keys [1]: [w_warehouse_sk#12] Join condition: None (22) Project [codegen id : 4] -Output [4]: [inv_quantity_on_hand#8, w_warehouse_name#13, i_item_id#2, d_date#10] -Input [6]: [i_item_id#2, inv_warehouse_sk#7, inv_quantity_on_hand#8, d_date#10, w_warehouse_sk#12, w_warehouse_name#13] +Output [4]: [inv_quantity_on_hand#4, w_warehouse_name#13, i_item_id#6, d_date#10] +Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, i_item_id#6, d_date#10, w_warehouse_sk#12, w_warehouse_name#13] (23) HashAggregate [codegen id : 4] -Input [4]: [inv_quantity_on_hand#8, w_warehouse_name#13, i_item_id#2, d_date#10] -Keys [2]: [w_warehouse_name#13, i_item_id#2] -Functions [2]: [partial_sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))] +Input [4]: [inv_quantity_on_hand#4, w_warehouse_name#13, i_item_id#6, d_date#10] +Keys [2]: [w_warehouse_name#13, i_item_id#6] +Functions [2]: [partial_sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))] Aggregate Attributes [2]: [sum#15, sum#16] -Results [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] +Results [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] (24) Exchange -Input [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] -Arguments: hashpartitioning(w_warehouse_name#13, i_item_id#2, 5), true, [id=#19] +Input [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] +Arguments: hashpartitioning(w_warehouse_name#13, i_item_id#6, 5), true, [id=#19] (25) HashAggregate [codegen id : 5] -Input [4]: [w_warehouse_name#13, i_item_id#2, sum#17, sum#18] -Keys [2]: [w_warehouse_name#13, i_item_id#2] -Functions [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint)), sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))] -Aggregate Attributes [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#20, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#21] -Results [4]: [w_warehouse_name#13, i_item_id#2, sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#20 AS inv_before#22, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#8 ELSE 0 END as bigint))#21 AS inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#6, sum#17, sum#18] +Keys [2]: [w_warehouse_name#13, i_item_id#6] +Functions [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint)), sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))] +Aggregate Attributes [2]: [sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#20, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#21] +Results [4]: [w_warehouse_name#13, i_item_id#6, sum(cast(CASE WHEN (d_date#10 < 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#20 AS inv_before#22, sum(cast(CASE WHEN (d_date#10 >= 11027) THEN inv_quantity_on_hand#4 ELSE 0 END as bigint))#21 AS inv_after#23] (26) Filter [codegen id : 5] -Input [4]: [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] Condition : ((CASE WHEN (inv_before#22 > 0) THEN (cast(inv_after#23 as double) / cast(inv_before#22 as double)) ELSE null END >= 0.666667) AND (CASE WHEN (inv_before#22 > 0) THEN (cast(inv_after#23 as double) / cast(inv_before#22 as double)) ELSE null END <= 1.5)) (27) TakeOrderedAndProject -Input [4]: [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] -Arguments: 100, [w_warehouse_name#13 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST], [w_warehouse_name#13, i_item_id#2, inv_before#22, inv_after#23] +Input [4]: [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] +Arguments: 100, [w_warehouse_name#13 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST], [w_warehouse_name#13, i_item_id#6, inv_before#22, inv_after#23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt index 80beaf66c66a0..0ee47d05af65b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt @@ -8,10 +8,14 @@ TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] HashAggregate [w_warehouse_name,i_item_id,d_date,inv_quantity_on_hand] [sum,sum,sum,sum] Project [inv_quantity_on_hand,w_warehouse_name,i_item_id,d_date] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [i_item_id,inv_warehouse_sk,inv_quantity_on_hand,d_date] + Project [inv_warehouse_sk,inv_quantity_on_hand,i_item_id,d_date] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [i_item_id,inv_date_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [i_item_sk,inv_item_sk] + Project [inv_date_sk,inv_warehouse_sk,inv_quantity_on_hand,i_item_id] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_warehouse_sk,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -20,10 +24,6 @@ TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_current_price] - Filter [inv_warehouse_sk,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt index 9319644f52d16..a405f658951d3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt @@ -10,20 +10,20 @@ TakeOrderedAndProject (30) : +- Exchange (17) : +- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) - : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) : : :- * Filter (3) : : : +- * ColumnarToRow (2) : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.warehouse (4) : +- BroadcastExchange (14) - : +- * Filter (13) - : +- * ColumnarToRow (12) - : +- Scan parquet default.warehouse (11) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) +- * Sort (23) +- Exchange (22) +- * Filter (21) @@ -45,63 +45,63 @@ Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_ha Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#5, d_month_seq#6] +(4) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#5, d_month_seq#6] +Input [1]: [w_warehouse_sk#5] (6) Filter [codegen id : 1] -Input [2]: [d_date_sk#5, d_month_seq#6] -Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) - -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#5] -Input [2]: [d_date_sk#5, d_month_seq#6] +Input [1]: [w_warehouse_sk#5] +Condition : isnotnull(w_warehouse_sk#5) -(8) BroadcastExchange -Input [1]: [d_date_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(7) BroadcastExchange +Input [1]: [w_warehouse_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] -(9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#5] +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#5] Join condition: None -(10) Project [codegen id : 3] -Output [3]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5] +(9) Project [codegen id : 3] +Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] +Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] -(11) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#8] +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_month_seq#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#7, d_month_seq#8] -(12) ColumnarToRow [codegen id : 2] -Input [1]: [w_warehouse_sk#8] +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#7, d_month_seq#8] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1200)) AND (d_month_seq#8 <= 1211)) AND isnotnull(d_date_sk#7)) -(13) Filter [codegen id : 2] -Input [1]: [w_warehouse_sk#8] -Condition : isnotnull(w_warehouse_sk#8) +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_month_seq#8] (14) BroadcastExchange -Input [1]: [w_warehouse_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#3] -Right keys [1]: [w_warehouse_sk#8] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (16) Project [codegen id : 3] Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#8] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt index 484a6d5dd2288..2c4258c9d48e6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt @@ -15,9 +15,9 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_date_sk,d_date_sk] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter @@ -25,18 +25,18 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt index 93f04b0c81375..51b85142f37ff 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt @@ -7,64 +7,64 @@ TakeOrderedAndProject (130) : +- * Project (79) : +- * SortMergeJoin Inner (78) : :- * Project (59) - : : +- * BroadcastHashJoin Inner BuildLeft (58) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- SortMergeJoin LeftSemi (57) - : : :- * Sort (39) - : : : +- Exchange (38) - : : : +- * Project (37) - : : : +- SortMergeJoin LeftSemi (36) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.catalog_sales (6) - : : : +- * Sort (35) - : : : +- Exchange (34) - : : : +- * Project (33) - : : : +- * Filter (32) - : : : +- * HashAggregate (31) - : : : +- * HashAggregate (30) - : : : +- * Project (29) - : : : +- * SortMergeJoin Inner (28) - : : : :- * Sort (22) - : : : : +- Exchange (21) - : : : : +- * Project (20) - : : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : : :- * Filter (13) - : : : : : +- * ColumnarToRow (12) - : : : : : +- Scan parquet default.store_sales (11) - : : : : +- BroadcastExchange (18) - : : : : +- * Project (17) - : : : : +- * Filter (16) - : : : : +- * ColumnarToRow (15) - : : : : +- Scan parquet default.date_dim (14) - : : : +- * Sort (27) - : : : +- Exchange (26) - : : : +- * Filter (25) - : : : +- * ColumnarToRow (24) - : : : +- Scan parquet default.item (23) - : : +- * Sort (56) - : : +- * Project (55) - : : +- * Filter (54) - : : +- * HashAggregate (53) - : : +- * HashAggregate (52) - : : +- * Project (51) - : : +- * SortMergeJoin Inner (50) - : : :- * Sort (44) - : : : +- Exchange (43) - : : : +- * Filter (42) - : : : +- * ColumnarToRow (41) - : : : +- Scan parquet default.store_sales (40) - : : +- * Sort (49) - : : +- Exchange (48) - : : +- * Filter (47) - : : +- * ColumnarToRow (46) - : : +- Scan parquet default.customer (45) + : : +- * BroadcastHashJoin Inner BuildRight (58) + : : :- SortMergeJoin LeftSemi (52) + : : : :- * Sort (34) + : : : : +- Exchange (33) + : : : : +- * Project (32) + : : : : +- SortMergeJoin LeftSemi (31) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- * Sort (30) + : : : : +- Exchange (29) + : : : : +- * Project (28) + : : : : +- * Filter (27) + : : : : +- * HashAggregate (26) + : : : : +- * HashAggregate (25) + : : : : +- * Project (24) + : : : : +- * SortMergeJoin Inner (23) + : : : : :- * Sort (17) + : : : : : +- Exchange (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Filter (8) + : : : : : : +- * ColumnarToRow (7) + : : : : : : +- Scan parquet default.store_sales (6) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Project (12) + : : : : : +- * Filter (11) + : : : : : +- * ColumnarToRow (10) + : : : : : +- Scan parquet default.date_dim (9) + : : : : +- * Sort (22) + : : : : +- Exchange (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.item (18) + : : : +- * Sort (51) + : : : +- * Project (50) + : : : +- * Filter (49) + : : : +- * HashAggregate (48) + : : : +- * HashAggregate (47) + : : : +- * Project (46) + : : : +- * SortMergeJoin Inner (45) + : : : :- * Sort (39) + : : : : +- Exchange (38) + : : : : +- * Filter (37) + : : : : +- * ColumnarToRow (36) + : : : : +- Scan parquet default.store_sales (35) + : : : +- * Sort (44) + : : : +- Exchange (43) + : : : +- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.customer (40) + : : +- BroadcastExchange (57) + : : +- * Project (56) + : : +- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.date_dim (53) : +- SortMergeJoin LeftSemi (77) : :- * Sort (64) : : +- Exchange (63) @@ -89,31 +89,31 @@ TakeOrderedAndProject (130) +- * Project (125) +- * SortMergeJoin Inner (124) :- * Project (108) - : +- * BroadcastHashJoin Inner BuildLeft (107) - : :- ReusedExchange (83) - : +- SortMergeJoin LeftSemi (106) - : :- * Sort (94) - : : +- Exchange (93) - : : +- * Project (92) - : : +- SortMergeJoin LeftSemi (91) - : : :- * Sort (88) - : : : +- Exchange (87) - : : : +- * Filter (86) - : : : +- * ColumnarToRow (85) - : : : +- Scan parquet default.web_sales (84) - : : +- * Sort (90) - : : +- ReusedExchange (89) - : +- * Sort (105) - : +- * Project (104) - : +- * Filter (103) - : +- * HashAggregate (102) - : +- * HashAggregate (101) - : +- * Project (100) - : +- * SortMergeJoin Inner (99) - : :- * Sort (96) - : : +- ReusedExchange (95) - : +- * Sort (98) - : +- ReusedExchange (97) + : +- * BroadcastHashJoin Inner BuildRight (107) + : :- SortMergeJoin LeftSemi (105) + : : :- * Sort (93) + : : : +- Exchange (92) + : : : +- * Project (91) + : : : +- SortMergeJoin LeftSemi (90) + : : : :- * Sort (87) + : : : : +- Exchange (86) + : : : : +- * Filter (85) + : : : : +- * ColumnarToRow (84) + : : : : +- Scan parquet default.web_sales (83) + : : : +- * Sort (89) + : : : +- ReusedExchange (88) + : : +- * Sort (104) + : : +- * Project (103) + : : +- * Filter (102) + : : +- * HashAggregate (101) + : : +- * HashAggregate (100) + : : +- * Project (99) + : : +- * SortMergeJoin Inner (98) + : : :- * Sort (95) + : : : +- ReusedExchange (94) + : : +- * Sort (97) + : : +- ReusedExchange (96) + : +- ReusedExchange (106) +- SortMergeJoin LeftSemi (123) :- * Sort (110) : +- ReusedExchange (109) @@ -131,367 +131,367 @@ TakeOrderedAndProject (130) +- ReusedExchange (113) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] - -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2000)) AND (d_moy#3 = 2)) AND isnotnull(d_date_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] - -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] - -(6) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +(1) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] -(8) Filter [codegen id : 2] -Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] -Condition : (isnotnull(cs_bill_customer_sk#6) AND isnotnull(cs_sold_date_sk#5)) +(3) Filter [codegen id : 1] +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(9) Exchange -Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] -Arguments: hashpartitioning(cs_item_sk#7, 5), true, [id=#10] +(4) Exchange +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +Arguments: hashpartitioning(cs_item_sk#3, 5), true, [id=#6] -(10) Sort [codegen id : 3] -Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] -Arguments: [cs_item_sk#7 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] +Arguments: [cs_item_sk#3 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#11, ss_item_sk#12] +(6) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#7, ss_item_sk#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#11, ss_item_sk#12] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_item_sk#8] -(13) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#11, ss_item_sk#12] -Condition : (isnotnull(ss_sold_date_sk#11) AND isnotnull(ss_item_sk#12)) +(8) Filter [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_item_sk#8] +Condition : (isnotnull(ss_sold_date_sk#7) AND isnotnull(ss_item_sk#8)) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_date#13, d_year#2] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_date#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#1, d_date#13, d_year#2] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_date#10, d_year#11] -(16) Filter [codegen id : 4] -Input [3]: [d_date_sk#1, d_date#13, d_year#2] -Condition : (d_year#2 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#1)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_date#10, d_year#11] +Condition : (d_year#11 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#9)) -(17) Project [codegen id : 4] -Output [2]: [d_date_sk#1, d_date#13] -Input [3]: [d_date_sk#1, d_date#13, d_year#2] +(12) Project [codegen id : 3] +Output [2]: [d_date_sk#9, d_date#10] +Input [3]: [d_date_sk#9, d_date#10, d_year#11] -(18) BroadcastExchange -Input [2]: [d_date_sk#1, d_date#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(13) BroadcastExchange +Input [2]: [d_date_sk#9, d_date#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(19) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#11] -Right keys [1]: [d_date_sk#1] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] Join condition: None -(20) Project [codegen id : 5] -Output [2]: [ss_item_sk#12, d_date#13] -Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, d_date_sk#1, d_date#13] +(15) Project [codegen id : 4] +Output [2]: [ss_item_sk#8, d_date#10] +Input [4]: [ss_sold_date_sk#7, ss_item_sk#8, d_date_sk#9, d_date#10] -(21) Exchange -Input [2]: [ss_item_sk#12, d_date#13] -Arguments: hashpartitioning(ss_item_sk#12, 5), true, [id=#15] +(16) Exchange +Input [2]: [ss_item_sk#8, d_date#10] +Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#13] -(22) Sort [codegen id : 6] -Input [2]: [ss_item_sk#12, d_date#13] -Arguments: [ss_item_sk#12 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 5] +Input [2]: [ss_item_sk#8, d_date#10] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 -(23) Scan parquet default.item -Output [2]: [i_item_sk#16, i_item_desc#17] +(18) Scan parquet default.item +Output [2]: [i_item_sk#14, i_item_desc#15] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct -(24) ColumnarToRow [codegen id : 7] -Input [2]: [i_item_sk#16, i_item_desc#17] +(19) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#14, i_item_desc#15] -(25) Filter [codegen id : 7] -Input [2]: [i_item_sk#16, i_item_desc#17] -Condition : isnotnull(i_item_sk#16) +(20) Filter [codegen id : 6] +Input [2]: [i_item_sk#14, i_item_desc#15] +Condition : isnotnull(i_item_sk#14) -(26) Exchange -Input [2]: [i_item_sk#16, i_item_desc#17] -Arguments: hashpartitioning(i_item_sk#16, 5), true, [id=#18] +(21) Exchange +Input [2]: [i_item_sk#14, i_item_desc#15] +Arguments: hashpartitioning(i_item_sk#14, 5), true, [id=#16] -(27) Sort [codegen id : 8] -Input [2]: [i_item_sk#16, i_item_desc#17] -Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 +(22) Sort [codegen id : 7] +Input [2]: [i_item_sk#14, i_item_desc#15] +Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 -(28) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_item_sk#12] -Right keys [1]: [i_item_sk#16] +(23) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#8] +Right keys [1]: [i_item_sk#14] Join condition: None -(29) Project [codegen id : 9] -Output [3]: [d_date#13, i_item_sk#16, i_item_desc#17] -Input [4]: [ss_item_sk#12, d_date#13, i_item_sk#16, i_item_desc#17] +(24) Project [codegen id : 8] +Output [3]: [d_date#10, i_item_sk#14, i_item_desc#15] +Input [4]: [ss_item_sk#8, d_date#10, i_item_sk#14, i_item_desc#15] -(30) HashAggregate [codegen id : 9] -Input [3]: [d_date#13, i_item_sk#16, i_item_desc#17] -Keys [3]: [substr(i_item_desc#17, 1, 30) AS substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13] +(25) HashAggregate [codegen id : 8] +Input [3]: [d_date#10, i_item_sk#14, i_item_desc#15] +Keys [3]: [substr(i_item_desc#15, 1, 30) AS substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#20] -Results [4]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13, count#21] +Aggregate Attributes [1]: [count#18] +Results [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19] -(31) HashAggregate [codegen id : 9] -Input [4]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13, count#21] -Keys [3]: [substr(i_item_desc#17, 1, 30)#19, i_item_sk#16, d_date#13] +(26) HashAggregate [codegen id : 8] +Input [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19] +Keys [3]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#22] -Results [2]: [i_item_sk#16 AS item_sk#23, count(1)#22 AS count(1)#24] +Aggregate Attributes [1]: [count(1)#20] +Results [2]: [i_item_sk#14 AS item_sk#21, count(1)#20 AS count(1)#22] -(32) Filter [codegen id : 9] -Input [2]: [item_sk#23, count(1)#24] -Condition : (count(1)#24 > 4) +(27) Filter [codegen id : 8] +Input [2]: [item_sk#21, count(1)#22] +Condition : (count(1)#22 > 4) -(33) Project [codegen id : 9] -Output [1]: [item_sk#23] -Input [2]: [item_sk#23, count(1)#24] +(28) Project [codegen id : 8] +Output [1]: [item_sk#21] +Input [2]: [item_sk#21, count(1)#22] -(34) Exchange -Input [1]: [item_sk#23] -Arguments: hashpartitioning(item_sk#23, 5), true, [id=#25] +(29) Exchange +Input [1]: [item_sk#21] +Arguments: hashpartitioning(item_sk#21, 5), true, [id=#23] -(35) Sort [codegen id : 10] -Input [1]: [item_sk#23] -Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 +(30) Sort [codegen id : 9] +Input [1]: [item_sk#21] +Arguments: [item_sk#21 ASC NULLS FIRST], false, 0 -(36) SortMergeJoin -Left keys [1]: [cs_item_sk#7] -Right keys [1]: [item_sk#23] +(31) SortMergeJoin +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [item_sk#21] Join condition: None -(37) Project [codegen id : 11] -Output [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] -Input [5]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_item_sk#7, cs_quantity#8, cs_list_price#9] +(32) Project [codegen id : 10] +Output [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5] -(38) Exchange -Input [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] -Arguments: hashpartitioning(cs_bill_customer_sk#6, 5), true, [id=#26] +(33) Exchange +Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] +Arguments: hashpartitioning(cs_bill_customer_sk#2, 5), true, [id=#24] -(39) Sort [codegen id : 12] -Input [4]: [cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] -Arguments: [cs_bill_customer_sk#6 ASC NULLS FIRST], false, 0 +(34) Sort [codegen id : 11] +Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] +Arguments: [cs_bill_customer_sk#2 ASC NULLS FIRST], false, 0 -(40) Scan parquet default.store_sales -Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +(35) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 13] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +(36) ColumnarToRow [codegen id : 12] +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -(42) Filter [codegen id : 13] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Condition : isnotnull(ss_customer_sk#27) +(37) Filter [codegen id : 12] +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Condition : isnotnull(ss_customer_sk#25) -(43) Exchange -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: hashpartitioning(ss_customer_sk#27, 5), true, [id=#30] +(38) Exchange +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#28] -(44) Sort [codegen id : 14] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 +(39) Sort [codegen id : 13] +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 -(45) Scan parquet default.customer -Output [1]: [c_customer_sk#31] +(40) Scan parquet default.customer +Output [1]: [c_customer_sk#29] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct -(46) ColumnarToRow [codegen id : 15] -Input [1]: [c_customer_sk#31] +(41) ColumnarToRow [codegen id : 14] +Input [1]: [c_customer_sk#29] -(47) Filter [codegen id : 15] -Input [1]: [c_customer_sk#31] -Condition : isnotnull(c_customer_sk#31) +(42) Filter [codegen id : 14] +Input [1]: [c_customer_sk#29] +Condition : isnotnull(c_customer_sk#29) -(48) Exchange -Input [1]: [c_customer_sk#31] -Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#32] +(43) Exchange +Input [1]: [c_customer_sk#29] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#30] -(49) Sort [codegen id : 16] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 15] +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 -(50) SortMergeJoin [codegen id : 17] -Left keys [1]: [ss_customer_sk#27] -Right keys [1]: [c_customer_sk#31] +(45) SortMergeJoin [codegen id : 16] +Left keys [1]: [ss_customer_sk#25] +Right keys [1]: [c_customer_sk#29] Join condition: None -(51) Project [codegen id : 17] -Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] - -(52) HashAggregate [codegen id : 17] -Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Keys [1]: [c_customer_sk#31] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#33, isEmpty#34] -Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] - -(53) HashAggregate [codegen id : 17] -Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] -Keys [1]: [c_customer_sk#31] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37] -Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] - -(54) Filter [codegen id : 17] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) - -(55) Project [codegen id : 17] -Output [1]: [c_customer_sk#31] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] - -(56) Sort [codegen id : 17] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 - -(57) SortMergeJoin -Left keys [1]: [cs_bill_customer_sk#6] -Right keys [1]: [c_customer_sk#31] +(46) Project [codegen id : 16] +Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] + +(47) HashAggregate [codegen id : 16] +Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Keys [1]: [c_customer_sk#29] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#31, isEmpty#32] +Results [3]: [c_customer_sk#29, sum#33, isEmpty#34] + +(48) HashAggregate [codegen id : 16] +Input [3]: [c_customer_sk#29, sum#33, isEmpty#34] +Keys [1]: [c_customer_sk#29] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35] +Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] + +(49) Filter [codegen id : 16] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) + +(50) Project [codegen id : 16] +Output [1]: [c_customer_sk#29] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] + +(51) Sort [codegen id : 16] +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin +Left keys [1]: [cs_bill_customer_sk#2] +Right keys [1]: [c_customer_sk#29] Join condition: None +(53) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#11, d_moy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 17] +Input [3]: [d_date_sk#9, d_year#11, d_moy#39] + +(55) Filter [codegen id : 17] +Input [3]: [d_date_sk#9, d_year#11, d_moy#39] +Condition : ((((isnotnull(d_year#11) AND isnotnull(d_moy#39)) AND (d_year#11 = 2000)) AND (d_moy#39 = 2)) AND isnotnull(d_date_sk#9)) + +(56) Project [codegen id : 17] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#11, d_moy#39] + +(57) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] + (58) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#5] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#9] Join condition: None (59) Project [codegen id : 18] -Output [3]: [cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] -Input [5]: [d_date_sk#1, cs_sold_date_sk#5, cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9] +Output [3]: [cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5] +Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5, d_date_sk#9] (60) Scan parquet default.customer -Output [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Output [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct (61) ColumnarToRow [codegen id : 19] -Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] (62) Filter [codegen id : 19] -Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] -Condition : isnotnull(c_customer_sk#31) +Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Condition : isnotnull(c_customer_sk#29) (63) Exchange -Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] -Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#43] +Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#43] (64) Sort [codegen id : 20] -Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 -(65) ReusedExchange [Reuses operator id: 43] -Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +(65) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] (66) Sort [codegen id : 22] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 -(67) ReusedExchange [Reuses operator id: 48] -Output [1]: [c_customer_sk#31] +(67) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#29] (68) Sort [codegen id : 24] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 (69) SortMergeJoin [codegen id : 25] -Left keys [1]: [ss_customer_sk#27] -Right keys [1]: [c_customer_sk#31] +Left keys [1]: [ss_customer_sk#25] +Right keys [1]: [c_customer_sk#29] Join condition: None (70) Project [codegen id : 25] -Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] (71) HashAggregate [codegen id : 25] -Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Keys [1]: [c_customer_sk#31] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#33, isEmpty#34] -Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Keys [1]: [c_customer_sk#29] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#31, isEmpty#32] +Results [3]: [c_customer_sk#29, sum#33, isEmpty#34] (72) HashAggregate [codegen id : 25] -Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] -Keys [1]: [c_customer_sk#31] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37] -Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] +Input [3]: [c_customer_sk#29, sum#33, isEmpty#34] +Keys [1]: [c_customer_sk#29] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35] +Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#35 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] (73) Filter [codegen id : 25] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) (74) Project [codegen id : 25] -Output [1]: [c_customer_sk#31 AS c_customer_sk#31#44] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#38] +Output [1]: [c_customer_sk#29 AS c_customer_sk#29#44] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#36] (75) Exchange -Input [1]: [c_customer_sk#31#44] -Arguments: hashpartitioning(c_customer_sk#31#44, 5), true, [id=#45] +Input [1]: [c_customer_sk#29#44] +Arguments: hashpartitioning(c_customer_sk#29#44, 5), true, [id=#45] (76) Sort [codegen id : 26] -Input [1]: [c_customer_sk#31#44] -Arguments: [c_customer_sk#31#44 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#29#44] +Arguments: [c_customer_sk#29#44 ASC NULLS FIRST], false, 0 (77) SortMergeJoin -Left keys [1]: [c_customer_sk#31] -Right keys [1]: [c_customer_sk#31#44] +Left keys [1]: [c_customer_sk#29] +Right keys [1]: [c_customer_sk#29#44] Join condition: None (78) SortMergeJoin [codegen id : 27] -Left keys [1]: [cs_bill_customer_sk#6] -Right keys [1]: [c_customer_sk#31] +Left keys [1]: [cs_bill_customer_sk#2] +Right keys [1]: [c_customer_sk#29] Join condition: None (79) Project [codegen id : 27] -Output [4]: [cs_quantity#8, cs_list_price#9, c_first_name#41, c_last_name#42] -Input [6]: [cs_bill_customer_sk#6, cs_quantity#8, cs_list_price#9, c_customer_sk#31, c_first_name#41, c_last_name#42] +Output [4]: [cs_quantity#4, cs_list_price#5, c_first_name#41, c_last_name#42] +Input [6]: [cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5, c_customer_sk#29, c_first_name#41, c_last_name#42] (80) HashAggregate [codegen id : 27] -Input [4]: [cs_quantity#8, cs_list_price#9, c_first_name#41, c_last_name#42] +Input [4]: [cs_quantity#4, cs_list_price#5, c_first_name#41, c_last_name#42] Keys [2]: [c_last_name#42, c_first_name#41] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#46, isEmpty#47] Results [4]: [c_last_name#42, c_first_name#41, sum#48, isEmpty#49] @@ -502,195 +502,195 @@ Arguments: hashpartitioning(c_last_name#42, c_first_name#41, 5), true, [id=#50] (82) HashAggregate [codegen id : 28] Input [4]: [c_last_name#42, c_first_name#41, sum#48, isEmpty#49] Keys [2]: [c_last_name#42, c_first_name#41] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#51] -Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#8 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#9 as decimal(12,2)))), DecimalType(18,2), true))#51 AS sales#52] - -(83) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#51] +Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#51 AS sales#52] -(84) Scan parquet default.web_sales +(83) Scan parquet default.web_sales Output [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(85) ColumnarToRow [codegen id : 30] +(84) ColumnarToRow [codegen id : 29] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -(86) Filter [codegen id : 30] +(85) Filter [codegen id : 29] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Condition : (isnotnull(ws_bill_customer_sk#55) AND isnotnull(ws_sold_date_sk#53)) -(87) Exchange +(86) Exchange Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: hashpartitioning(ws_item_sk#54, 5), true, [id=#58] -(88) Sort [codegen id : 31] +(87) Sort [codegen id : 30] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: [ws_item_sk#54 ASC NULLS FIRST], false, 0 -(89) ReusedExchange [Reuses operator id: 34] -Output [1]: [item_sk#23] +(88) ReusedExchange [Reuses operator id: 29] +Output [1]: [item_sk#21] -(90) Sort [codegen id : 38] -Input [1]: [item_sk#23] -Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 +(89) Sort [codegen id : 37] +Input [1]: [item_sk#21] +Arguments: [item_sk#21 ASC NULLS FIRST], false, 0 -(91) SortMergeJoin +(90) SortMergeJoin Left keys [1]: [ws_item_sk#54] -Right keys [1]: [item_sk#23] +Right keys [1]: [item_sk#21] Join condition: None -(92) Project [codegen id : 39] +(91) Project [codegen id : 38] Output [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Input [5]: [ws_sold_date_sk#53, ws_item_sk#54, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -(93) Exchange +(92) Exchange Input [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: hashpartitioning(ws_bill_customer_sk#55, 5), true, [id=#59] -(94) Sort [codegen id : 40] +(93) Sort [codegen id : 39] Input [4]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] Arguments: [ws_bill_customer_sk#55 ASC NULLS FIRST], false, 0 -(95) ReusedExchange [Reuses operator id: 43] -Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +(94) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -(96) Sort [codegen id : 42] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 +(95) Sort [codegen id : 41] +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 -(97) ReusedExchange [Reuses operator id: 48] -Output [1]: [c_customer_sk#31] +(96) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#29] -(98) Sort [codegen id : 44] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +(97) Sort [codegen id : 43] +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 -(99) SortMergeJoin [codegen id : 45] -Left keys [1]: [ss_customer_sk#27] -Right keys [1]: [c_customer_sk#31] +(98) SortMergeJoin [codegen id : 44] +Left keys [1]: [ss_customer_sk#25] +Right keys [1]: [c_customer_sk#29] Join condition: None -(100) Project [codegen id : 45] -Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +(99) Project [codegen id : 44] +Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] -(101) HashAggregate [codegen id : 45] -Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Keys [1]: [c_customer_sk#31] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +(100) HashAggregate [codegen id : 44] +Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Keys [1]: [c_customer_sk#29] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#60, isEmpty#61] -Results [3]: [c_customer_sk#31, sum#62, isEmpty#63] +Results [3]: [c_customer_sk#29, sum#62, isEmpty#63] -(102) HashAggregate [codegen id : 45] -Input [3]: [c_customer_sk#31, sum#62, isEmpty#63] -Keys [1]: [c_customer_sk#31] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64] -Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +(101) HashAggregate [codegen id : 44] +Input [3]: [c_customer_sk#29, sum#62, isEmpty#63] +Keys [1]: [c_customer_sk#29] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64] +Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] -(103) Filter [codegen id : 45] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) +(102) Filter [codegen id : 44] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) -(104) Project [codegen id : 45] -Output [1]: [c_customer_sk#31] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +(103) Project [codegen id : 44] +Output [1]: [c_customer_sk#29] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] -(105) Sort [codegen id : 45] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +(104) Sort [codegen id : 44] +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 -(106) SortMergeJoin +(105) SortMergeJoin Left keys [1]: [ws_bill_customer_sk#55] -Right keys [1]: [c_customer_sk#31] +Right keys [1]: [c_customer_sk#29] Join condition: None +(106) ReusedExchange [Reuses operator id: 57] +Output [1]: [d_date_sk#9] + (107) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#53] +Left keys [1]: [ws_sold_date_sk#53] +Right keys [1]: [d_date_sk#9] Join condition: None (108) Project [codegen id : 46] Output [3]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] -Input [5]: [d_date_sk#1, ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57] +Input [5]: [ws_sold_date_sk#53, ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, d_date_sk#9] (109) ReusedExchange [Reuses operator id: 63] -Output [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] +Output [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] (110) Sort [codegen id : 48] -Input [3]: [c_customer_sk#31, c_first_name#41, c_last_name#42] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#29, c_first_name#41, c_last_name#42] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 -(111) ReusedExchange [Reuses operator id: 43] -Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +(111) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] (112) Sort [codegen id : 50] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 -(113) ReusedExchange [Reuses operator id: 48] -Output [1]: [c_customer_sk#31] +(113) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#29] (114) Sort [codegen id : 52] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 (115) SortMergeJoin [codegen id : 53] -Left keys [1]: [ss_customer_sk#27] -Right keys [1]: [c_customer_sk#31] +Left keys [1]: [ss_customer_sk#25] +Right keys [1]: [c_customer_sk#29] Join condition: None (116) Project [codegen id : 53] -Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] (117) HashAggregate [codegen id : 53] -Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Keys [1]: [c_customer_sk#31] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Keys [1]: [c_customer_sk#29] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#60, isEmpty#61] -Results [3]: [c_customer_sk#31, sum#62, isEmpty#63] +Results [3]: [c_customer_sk#29, sum#62, isEmpty#63] (118) HashAggregate [codegen id : 53] -Input [3]: [c_customer_sk#31, sum#62, isEmpty#63] -Keys [1]: [c_customer_sk#31] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64] -Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +Input [3]: [c_customer_sk#29, sum#62, isEmpty#63] +Keys [1]: [c_customer_sk#29] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64] +Results [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#64 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] (119) Filter [codegen id : 53] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#39, [id=#40] as decimal(32,6)))), DecimalType(38,8), true))) +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#37, [id=#38] as decimal(32,6)))), DecimalType(38,8), true))) (120) Project [codegen id : 53] -Output [1]: [c_customer_sk#31 AS c_customer_sk#31#66] -Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#65] +Output [1]: [c_customer_sk#29 AS c_customer_sk#29#66] +Input [2]: [c_customer_sk#29, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#65] (121) Exchange -Input [1]: [c_customer_sk#31#66] -Arguments: hashpartitioning(c_customer_sk#31#66, 5), true, [id=#67] +Input [1]: [c_customer_sk#29#66] +Arguments: hashpartitioning(c_customer_sk#29#66, 5), true, [id=#67] (122) Sort [codegen id : 54] -Input [1]: [c_customer_sk#31#66] -Arguments: [c_customer_sk#31#66 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#29#66] +Arguments: [c_customer_sk#29#66 ASC NULLS FIRST], false, 0 (123) SortMergeJoin -Left keys [1]: [c_customer_sk#31] -Right keys [1]: [c_customer_sk#31#66] +Left keys [1]: [c_customer_sk#29] +Right keys [1]: [c_customer_sk#29#66] Join condition: None (124) SortMergeJoin [codegen id : 55] Left keys [1]: [ws_bill_customer_sk#55] -Right keys [1]: [c_customer_sk#31] +Right keys [1]: [c_customer_sk#29] Join condition: None (125) Project [codegen id : 55] Output [4]: [ws_quantity#56, ws_list_price#57, c_first_name#41, c_last_name#42] -Input [6]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, c_customer_sk#31, c_first_name#41, c_last_name#42] +Input [6]: [ws_bill_customer_sk#55, ws_quantity#56, ws_list_price#57, c_customer_sk#29, c_first_name#41, c_last_name#42] (126) HashAggregate [codegen id : 55] Input [4]: [ws_quantity#56, ws_list_price#57, c_first_name#41, c_last_name#42] @@ -718,7 +718,7 @@ Arguments: 100, [c_last_name#42 ASC NULLS FIRST, c_first_name#41 ASC NULLS FIRST ===== Subqueries ===== -Subquery:1 Hosting operator id = 54 Hosting Expression = Subquery scalar-subquery#39, [id=#40] +Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#37, [id=#38] * HashAggregate (154) +- Exchange (153) +- * HashAggregate (152) @@ -746,102 +746,102 @@ Subquery:1 Hosting operator id = 54 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Output [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (132) ColumnarToRow [codegen id : 2] -Input [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] +Input [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] (133) Filter [codegen id : 2] -Input [4]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Condition : (isnotnull(ss_customer_sk#27) AND isnotnull(ss_sold_date_sk#11)) +Input [4]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Condition : (isnotnull(ss_customer_sk#25) AND isnotnull(ss_sold_date_sk#7)) (134) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +Output [2]: [d_date_sk#9, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] ReadSchema: struct (135) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +Input [2]: [d_date_sk#9, d_year#11] (136) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : (d_year#2 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#1)) +Input [2]: [d_date_sk#9, d_year#11] +Condition : (d_year#11 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#9)) (137) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#2] +Output [1]: [d_date_sk#9] +Input [2]: [d_date_sk#9, d_year#11] (138) BroadcastExchange -Input [1]: [d_date_sk#1] +Input [1]: [d_date_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#75] (139) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#11] -Right keys [1]: [d_date_sk#1] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] Join condition: None (140) Project [codegen id : 2] -Output [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Input [5]: [ss_sold_date_sk#11, ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, d_date_sk#1] +Output [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, d_date_sk#9] (141) Exchange -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: hashpartitioning(ss_customer_sk#27, 5), true, [id=#76] +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#76] (142) Sort [codegen id : 3] -Input [3]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29] -Arguments: [ss_customer_sk#27 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] +Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0 (143) Scan parquet default.customer -Output [1]: [c_customer_sk#31] +Output [1]: [c_customer_sk#29] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk)] ReadSchema: struct (144) ColumnarToRow [codegen id : 4] -Input [1]: [c_customer_sk#31] +Input [1]: [c_customer_sk#29] (145) Filter [codegen id : 4] -Input [1]: [c_customer_sk#31] -Condition : isnotnull(c_customer_sk#31) +Input [1]: [c_customer_sk#29] +Condition : isnotnull(c_customer_sk#29) (146) Exchange -Input [1]: [c_customer_sk#31] -Arguments: hashpartitioning(c_customer_sk#31, 5), true, [id=#77] +Input [1]: [c_customer_sk#29] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#77] (147) Sort [codegen id : 5] -Input [1]: [c_customer_sk#31] -Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 +Input [1]: [c_customer_sk#29] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 (148) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#27] -Right keys [1]: [c_customer_sk#31] +Left keys [1]: [ss_customer_sk#25] +Right keys [1]: [c_customer_sk#29] Join condition: None (149) Project [codegen id : 6] -Output [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Input [4]: [ss_customer_sk#27, ss_quantity#28, ss_sales_price#29, c_customer_sk#31] +Output [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk#29] (150) HashAggregate [codegen id : 6] -Input [3]: [ss_quantity#28, ss_sales_price#29, c_customer_sk#31] -Keys [1]: [c_customer_sk#31] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] +Input [3]: [ss_quantity#26, ss_sales_price#27, c_customer_sk#29] +Keys [1]: [c_customer_sk#29] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] Aggregate Attributes [2]: [sum#78, isEmpty#79] -Results [3]: [c_customer_sk#31, sum#80, isEmpty#81] +Results [3]: [c_customer_sk#29, sum#80, isEmpty#81] (151) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#31, sum#80, isEmpty#81] -Keys [1]: [c_customer_sk#31] -Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#82] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#28 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#29 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] +Input [3]: [c_customer_sk#29, sum#80, isEmpty#81] +Keys [1]: [c_customer_sk#29] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#26 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#27 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] (152) HashAggregate [codegen id : 6] Input [1]: [csales#83] @@ -861,10 +861,10 @@ Functions [1]: [max(csales#83)] Aggregate Attributes [1]: [max(csales#83)#87] Results [1]: [max(csales#83)#87 AS tpcds_cmax#88] -Subquery:2 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] +Subquery:2 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] -Subquery:3 Hosting operator id = 103 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] +Subquery:3 Hosting operator id = 102 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] -Subquery:4 Hosting operator id = 119 Hosting Expression = ReusedSubquery Subquery scalar-subquery#39, [id=#40] +Subquery:4 Hosting operator id = 119 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt index c91cd4d02f430..e8891f032a091 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt @@ -11,39 +11,31 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter WholeStageCodegen (18) Project [cs_bill_customer_sk,cs_quantity,cs_list_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_year,d_moy,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [cs_bill_customer_sk,c_customer_sk] - WholeStageCodegen (12) + WholeStageCodegen (11) Sort [cs_bill_customer_sk] InputAdapter - Exchange [cs_bill_customer_sk] #3 - WholeStageCodegen (11) + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (10) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_quantity,cs_list_price] InputAdapter SortMergeJoin [cs_item_sk,item_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [cs_item_sk] InputAdapter - Exchange [cs_item_sk] #4 - WholeStageCodegen (2) + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) Filter [cs_bill_customer_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price] - WholeStageCodegen (10) + WholeStageCodegen (9) Sort [item_sk] InputAdapter - Exchange [item_sk] #5 - WholeStageCodegen (9) + Exchange [item_sk] #4 + WholeStageCodegen (8) Project [item_sk] Filter [count(1)] HashAggregate [substr(i_item_desc, 1, 30),i_item_sk,d_date,count] [count(1),item_sk,count(1),count] @@ -51,11 +43,11 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [d_date,i_item_sk,i_item_desc] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter - WholeStageCodegen (6) + WholeStageCodegen (5) Sort [ss_item_sk] InputAdapter - Exchange [ss_item_sk] #6 - WholeStageCodegen (5) + Exchange [ss_item_sk] #5 + WholeStageCodegen (4) Project [ss_item_sk,d_date] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk,ss_item_sk] @@ -63,24 +55,24 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (4) + BroadcastExchange #6 + WholeStageCodegen (3) Project [d_date_sk,d_date] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_year] InputAdapter - WholeStageCodegen (8) + WholeStageCodegen (7) Sort [i_item_sk] InputAdapter - Exchange [i_item_sk] #8 - WholeStageCodegen (7) + Exchange [i_item_sk] #7 + WholeStageCodegen (6) Filter [i_item_sk] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_desc] - WholeStageCodegen (17) + WholeStageCodegen (16) Sort [c_customer_sk] Project [c_customer_sk] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -88,7 +80,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (7) HashAggregate [max] [max(csales),tpcds_cmax,max] InputAdapter - Exchange #11 + Exchange #10 WholeStageCodegen (6) HashAggregate [csales] [max,max] HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] @@ -99,7 +91,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (3) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #12 + Exchange [ss_customer_sk] #11 WholeStageCodegen (2) Project [ss_customer_sk,ss_quantity,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -108,7 +100,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_quantity,ss_sales_price] InputAdapter - BroadcastExchange #13 + BroadcastExchange #12 WholeStageCodegen (1) Project [d_date_sk] Filter [d_year,d_date_sk] @@ -119,7 +111,7 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (5) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #14 + Exchange [c_customer_sk] #13 WholeStageCodegen (4) Filter [c_customer_sk] ColumnarToRow @@ -130,25 +122,33 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [ss_quantity,ss_sales_price,c_customer_sk] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (14) + WholeStageCodegen (13) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #9 - WholeStageCodegen (13) + Exchange [ss_customer_sk] #8 + WholeStageCodegen (12) Filter [ss_customer_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price] InputAdapter - WholeStageCodegen (16) + WholeStageCodegen (15) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #10 - WholeStageCodegen (15) + Exchange [c_customer_sk] #9 + WholeStageCodegen (14) Filter [c_customer_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (17) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] InputAdapter SortMergeJoin [c_customer_sk,c_customer_sk] WholeStageCodegen (20) @@ -176,12 +176,12 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (22) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 InputAdapter WholeStageCodegen (24) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #10 + ReusedExchange [c_customer_sk] #9 WholeStageCodegen (56) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] InputAdapter @@ -193,33 +193,31 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] InputAdapter WholeStageCodegen (46) Project [ws_bill_customer_sk,ws_quantity,ws_list_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] InputAdapter SortMergeJoin [ws_bill_customer_sk,c_customer_sk] - WholeStageCodegen (40) + WholeStageCodegen (39) Sort [ws_bill_customer_sk] InputAdapter Exchange [ws_bill_customer_sk] #18 - WholeStageCodegen (39) + WholeStageCodegen (38) Project [ws_sold_date_sk,ws_bill_customer_sk,ws_quantity,ws_list_price] InputAdapter SortMergeJoin [ws_item_sk,item_sk] - WholeStageCodegen (31) + WholeStageCodegen (30) Sort [ws_item_sk] InputAdapter Exchange [ws_item_sk] #19 - WholeStageCodegen (30) + WholeStageCodegen (29) Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price] - WholeStageCodegen (38) + WholeStageCodegen (37) Sort [item_sk] InputAdapter - ReusedExchange [item_sk] #5 - WholeStageCodegen (45) + ReusedExchange [item_sk] #4 + WholeStageCodegen (44) Sort [c_customer_sk] Project [c_customer_sk] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -229,15 +227,17 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] Project [ss_quantity,ss_sales_price,c_customer_sk] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter - WholeStageCodegen (42) + WholeStageCodegen (41) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 InputAdapter - WholeStageCodegen (44) + WholeStageCodegen (43) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #10 + ReusedExchange [c_customer_sk] #9 + InputAdapter + ReusedExchange [d_date_sk] #14 InputAdapter SortMergeJoin [c_customer_sk,c_customer_sk] WholeStageCodegen (48) @@ -260,9 +260,9 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] WholeStageCodegen (50) Sort [ss_customer_sk] InputAdapter - ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #9 + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 InputAdapter WholeStageCodegen (52) Sort [c_customer_sk] InputAdapter - ReusedExchange [c_customer_sk] #10 + ReusedExchange [c_customer_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt index 5ef9d39db59fb..ffcf6bd4f6d47 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt @@ -18,14 +18,14 @@ : : :- * Sort (11) : : : +- Exchange (10) : : : +- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : :- BroadcastExchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.item (1) - : : : +- * Filter (7) - : : : +- * ColumnarToRow (6) - : : : +- Scan parquet default.store_sales (5) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) : : +- * Sort (16) : : +- Exchange (15) : : +- * Filter (14) @@ -49,54 +49,54 @@ +- Scan parquet default.store_returns (34) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Condition : ((isnotnull(i_color#4) AND (i_color#4 = pale)) AND isnotnull(i_item_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -(4) BroadcastExchange -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] +(3) Filter [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) -(5) Scan parquet default.store_sales -Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +(4) Scan parquet default.item +Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -(6) ColumnarToRow -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Condition : ((isnotnull(i_color#9) AND (i_color#9 = pale)) AND isnotnull(i_item_sk#6)) -(7) Filter -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) +(7) BroadcastExchange +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#8] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (9) Project [codegen id : 2] -Output [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Input [11]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (10) Exchange -Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#13] +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#13] (11) Sort [codegen id : 3] -Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -121,13 +121,13 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_customer_sk#9] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#14] Join condition: None (18) Project [codegen id : 8] -Output [12]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [14]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (19) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] @@ -179,21 +179,21 @@ Input [5]: [s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country# Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#28] (30) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#10, c_birth_country#17] +Left keys [2]: [ss_store_sk#3, c_birth_country#17] Right keys [2]: [s_store_sk#19, upper(ca_country#27)] Join condition: None (31) Project [codegen id : 8] -Output [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Input [17]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] +Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] (32) Exchange -Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#29] +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#29] (33) Sort [codegen id : 9] -Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 (34) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -218,31 +218,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (40) Project [codegen id : 12] -Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (41) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] +Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#33] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] (42) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#35] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#35] (43) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#36] -Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#36,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#36] +Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#36,17,2) AS netpaid#37] (44) HashAggregate [codegen id : 13] Input [4]: [c_last_name#16, c_first_name#15, s_store_name#20, netpaid#37] @@ -296,15 +296,15 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer : : : :- * Sort (60) : : : : +- Exchange (59) : : : : +- * Project (58) - : : : : +- * BroadcastHashJoin Inner BuildLeft (57) - : : : : :- BroadcastExchange (53) - : : : : : +- * Project (52) - : : : : : +- * Filter (51) - : : : : : +- * ColumnarToRow (50) - : : : : : +- Scan parquet default.store (49) - : : : : +- * Filter (56) - : : : : +- * ColumnarToRow (55) - : : : : +- Scan parquet default.store_sales (54) + : : : : +- * BroadcastHashJoin Inner BuildRight (57) + : : : : :- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.store_sales (49) + : : : : +- BroadcastExchange (56) + : : : : +- * Project (55) + : : : : +- * Filter (54) + : : : : +- * ColumnarToRow (53) + : : : : +- Scan parquet default.store (52) : : : +- * Sort (65) : : : +- Exchange (64) : : : +- * Filter (63) @@ -327,97 +327,97 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (88) -(49) Scan parquet default.store +(49) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] + +(51) Filter [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(52) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(50) ColumnarToRow [codegen id : 1] +(53) ColumnarToRow [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(51) Filter [codegen id : 1] +(54) Filter [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Condition : (((isnotnull(s_market_id#21) AND (s_market_id#21 = 8)) AND isnotnull(s_store_sk#19)) AND isnotnull(s_zip#23)) -(52) Project [codegen id : 1] +(55) Project [codegen id : 1] Output [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(53) BroadcastExchange +(56) BroadcastExchange Input [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] -(54) Scan parquet default.store_sales -Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(55) ColumnarToRow -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] - -(56) Filter -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) - (57) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [s_store_sk#19] -Right keys [1]: [ss_store_sk#10] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#19] Join condition: None (58) Project [codegen id : 2] -Output [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Input [9]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] (59) Exchange -Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#49] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Arguments: hashpartitioning(ss_item_sk#1, 5), true, [id=#49] (60) Sort [codegen id : 3] -Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 (61) Scan parquet default.item -Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (62) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (63) Filter [codegen id : 4] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Condition : isnotnull(i_item_sk#1) +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Condition : isnotnull(i_item_sk#6) (64) Exchange -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#50] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#50] (65) Sort [codegen id : 5] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 (66) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#8] -Right keys [1]: [i_item_sk#1] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (67) Project [codegen id : 6] -Output [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Input [13]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (68) Exchange -Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#51] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#51] (69) Sort [codegen id : 7] -Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (70) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -442,20 +442,20 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (75) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_customer_sk#9] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#14] Join condition: None (76) Project [codegen id : 10] -Output [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [16]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [16]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (77) Exchange -Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: hashpartitioning(c_birth_country#17, s_zip#23, 5), true, [id=#53] (78) Sort [codegen id : 11] -Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: [c_birth_country#17 ASC NULLS FIRST, s_zip#23 ASC NULLS FIRST], false, 0 (79) Scan parquet default.customer_address @@ -486,16 +486,16 @@ Right keys [2]: [upper(ca_country#27), ca_zip#26] Join condition: None (85) Project [codegen id : 14] -Output [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [17]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] +Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [17]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] (86) Exchange -Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#55] +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#55] (87) Sort [codegen id : 15] -Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 (88) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -520,31 +520,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (93) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (94) Project [codegen id : 18] -Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (95) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] +Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] (96) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#59] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#59] (97) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#60] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#60,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#60] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#60,17,2) AS netpaid#37] (98) HashAggregate [codegen id : 19] Input [1]: [netpaid#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt index 8311b07f7525a..10f874f8f5543 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (14) - Project [s_store_name,s_state,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (11) @@ -29,7 +29,7 @@ WholeStageCodegen (14) InputAdapter Exchange [c_birth_country,s_zip] #13 WholeStageCodegen (10) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (7) @@ -37,7 +37,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #14 WholeStageCodegen (6) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (3) @@ -45,8 +45,12 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_item_sk] #15 WholeStageCodegen (2) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid] - BroadcastHashJoin [s_store_sk,ss_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -55,10 +59,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] @@ -117,9 +117,9 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #3 WholeStageCodegen (8) - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,s_store_name,s_state,ca_state] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (3) @@ -127,8 +127,12 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #4 WholeStageCodegen (2) - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -136,10 +140,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt index ae97fa1b7350b..73f36e3a9ca23 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt @@ -18,14 +18,14 @@ : : :- * Sort (11) : : : +- Exchange (10) : : : +- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : :- BroadcastExchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.item (1) - : : : +- * Filter (7) - : : : +- * ColumnarToRow (6) - : : : +- Scan parquet default.store_sales (5) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) : : +- * Sort (16) : : +- Exchange (15) : : +- * Filter (14) @@ -49,54 +49,54 @@ +- Scan parquet default.store_returns (34) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Condition : ((isnotnull(i_color#4) AND (i_color#4 = chiffon)) AND isnotnull(i_item_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] -(4) BroadcastExchange -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] +(3) Filter [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) -(5) Scan parquet default.store_sales -Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +(4) Scan parquet default.item +Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] -(6) ColumnarToRow -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Condition : ((isnotnull(i_color#9) AND (i_color#9 = chiffon)) AND isnotnull(i_item_sk#6)) -(7) Filter -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) +(7) BroadcastExchange +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#8] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (9) Project [codegen id : 2] -Output [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Input [11]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (10) Exchange -Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#13] +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#13] (11) Sort [codegen id : 3] -Input [10]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -121,13 +121,13 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 8] -Left keys [1]: [ss_customer_sk#9] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#14] Join condition: None (18) Project [codegen id : 8] -Output [12]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [14]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (19) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] @@ -179,21 +179,21 @@ Input [5]: [s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country# Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#28] (30) BroadcastHashJoin [codegen id : 8] -Left keys [2]: [ss_store_sk#10, c_birth_country#17] +Left keys [2]: [ss_store_sk#3, c_birth_country#17] Right keys [2]: [s_store_sk#19, upper(ca_country#27)] Join condition: None (31) Project [codegen id : 8] -Output [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Input [17]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] +Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Input [17]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#19, s_store_name#20, s_state#22, ca_state#25, ca_country#27] (32) Exchange -Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#29] +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#29] (33) Sort [codegen id : 9] -Input [13]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] -Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 (34) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -218,31 +218,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 12] -Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (40) Project [codegen id : 12] -Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, s_store_name#20, s_state#22, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (41) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] +Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#33] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] (42) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#35] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#35] (43) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#34] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#36] -Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#36,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#34] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#36] +Results [4]: [c_last_name#16, c_first_name#15, s_store_name#20, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#36,17,2) AS netpaid#37] (44) HashAggregate [codegen id : 13] Input [4]: [c_last_name#16, c_first_name#15, s_store_name#20, netpaid#37] @@ -296,15 +296,15 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer : : : :- * Sort (60) : : : : +- Exchange (59) : : : : +- * Project (58) - : : : : +- * BroadcastHashJoin Inner BuildLeft (57) - : : : : :- BroadcastExchange (53) - : : : : : +- * Project (52) - : : : : : +- * Filter (51) - : : : : : +- * ColumnarToRow (50) - : : : : : +- Scan parquet default.store (49) - : : : : +- * Filter (56) - : : : : +- * ColumnarToRow (55) - : : : : +- Scan parquet default.store_sales (54) + : : : : +- * BroadcastHashJoin Inner BuildRight (57) + : : : : :- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.store_sales (49) + : : : : +- BroadcastExchange (56) + : : : : +- * Project (55) + : : : : +- * Filter (54) + : : : : +- * ColumnarToRow (53) + : : : : +- Scan parquet default.store (52) : : : +- * Sort (65) : : : +- Exchange (64) : : : +- * Filter (63) @@ -327,97 +327,97 @@ Subquery:1 Hosting operator id = 47 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (88) -(49) Scan parquet default.store +(49) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] + +(51) Filter [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(52) Scan parquet default.store Output [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(50) ColumnarToRow [codegen id : 1] +(53) ColumnarToRow [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(51) Filter [codegen id : 1] +(54) Filter [codegen id : 1] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] Condition : (((isnotnull(s_market_id#21) AND (s_market_id#21 = 8)) AND isnotnull(s_store_sk#19)) AND isnotnull(s_zip#23)) -(52) Project [codegen id : 1] +(55) Project [codegen id : 1] Output [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Input [5]: [s_store_sk#19, s_store_name#20, s_market_id#21, s_state#22, s_zip#23] -(53) BroadcastExchange +(56) BroadcastExchange Input [4]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] -(54) Scan parquet default.store_sales -Output [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct - -(55) ColumnarToRow -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] - -(56) Filter -Input [5]: [ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] -Condition : (((isnotnull(ss_ticket_number#11) AND isnotnull(ss_item_sk#8)) AND isnotnull(ss_store_sk#10)) AND isnotnull(ss_customer_sk#9)) - (57) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [s_store_sk#19] -Right keys [1]: [ss_store_sk#10] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#19] Join condition: None (58) Project [codegen id : 2] -Output [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Input [9]: [s_store_sk#19, s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_store_sk#10, ss_ticket_number#11, ss_net_paid#12] +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, s_store_sk#19, s_store_name#20, s_state#22, s_zip#23] (59) Exchange -Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#49] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Arguments: hashpartitioning(ss_item_sk#1, 5), true, [id=#49] (60) Sort [codegen id : 3] -Input [7]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12] -Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 (61) Scan parquet default.item -Output [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Output [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_item_sk)] ReadSchema: struct (62) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (63) Filter [codegen id : 4] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Condition : isnotnull(i_item_sk#1) +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Condition : isnotnull(i_item_sk#6) (64) Exchange -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#50] +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(i_item_sk#6, 5), true, [id=#50] (65) Sort [codegen id : 5] -Input [6]: [i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +Input [6]: [i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 (66) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#8] -Right keys [1]: [i_item_sk#1] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (67) Project [codegen id : 6] -Output [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Input [13]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_item_sk#1, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_item_sk#6, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] (68) Exchange -Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#51] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#51] (69) Sort [codegen id : 7] -Input [12]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6] -Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (70) Scan parquet default.customer Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] @@ -442,20 +442,20 @@ Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#1 Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (75) SortMergeJoin [codegen id : 10] -Left keys [1]: [ss_customer_sk#9] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#14] Join condition: None (76) Project [codegen id : 10] -Output [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] -Input [16]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_customer_sk#9, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] +Output [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [16]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17] (77) Exchange -Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: hashpartitioning(c_birth_country#17, s_zip#23, 5), true, [id=#53] (78) Sort [codegen id : 11] -Input [14]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17] +Input [14]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17] Arguments: [c_birth_country#17 ASC NULLS FIRST, s_zip#23 ASC NULLS FIRST], false, 0 (79) Scan parquet default.customer_address @@ -486,16 +486,16 @@ Right keys [2]: [upper(ca_country#27), ca_zip#26] Join condition: None (85) Project [codegen id : 14] -Output [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [17]: [s_store_name#20, s_state#22, s_zip#23, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] +Output [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [17]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, s_zip#23, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, c_birth_country#17, ca_state#25, ca_zip#26, ca_country#27] (86) Exchange -Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: hashpartitioning(cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint), 5), true, [id=#55] +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint), 5), true, [id=#55] (87) Sort [codegen id : 15] -Input [13]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Arguments: [cast(ss_ticket_number#11 as bigint) ASC NULLS FIRST, cast(ss_item_sk#8 as bigint) ASC NULLS FIRST], false, 0 +Input [13]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#1 as bigint) ASC NULLS FIRST], false, 0 (88) Scan parquet default.store_returns Output [2]: [sr_item_sk#30, sr_ticket_number#31] @@ -520,31 +520,31 @@ Input [2]: [sr_item_sk#30, sr_ticket_number#31] Arguments: [sr_ticket_number#31 ASC NULLS FIRST, sr_item_sk#30 ASC NULLS FIRST], false, 0 (93) SortMergeJoin [codegen id : 18] -Left keys [2]: [cast(ss_ticket_number#11 as bigint), cast(ss_item_sk#8 as bigint)] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#1 as bigint)] Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (94) Project [codegen id : 18] -Output [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Input [15]: [s_store_name#20, s_state#22, ss_item_sk#8, ss_ticket_number#11, ss_net_paid#12, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] +Output [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Input [15]: [ss_item_sk#1, ss_ticket_number#4, ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25, sr_item_sk#30, sr_ticket_number#31] (95) HashAggregate [codegen id : 18] -Input [11]: [ss_net_paid#12, s_store_name#20, s_state#22, i_current_price#2, i_size#3, i_color#4, i_units#5, i_manager_id#6, c_first_name#15, c_last_name#16, ca_state#25] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#12))] +Input [11]: [ss_net_paid#5, s_store_name#20, s_state#22, i_current_price#7, i_size#8, i_color#9, i_units#10, i_manager_id#11, c_first_name#15, c_last_name#16, ca_state#25] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] +Results [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] (96) Exchange -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] -Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, 5), true, [id=#59] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, 5), true, [id=#59] (97) HashAggregate [codegen id : 19] -Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3, sum#58] -Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#4, i_current_price#2, i_manager_id#6, i_units#5, i_size#3] -Functions [1]: [sum(UnscaledValue(ss_net_paid#12))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#12))#60] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#12))#60,17,2) AS netpaid#37] +Input [11]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8, sum#58] +Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#20, ca_state#25, s_state#22, i_color#9, i_current_price#7, i_manager_id#11, i_units#10, i_size#8] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#60] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#60,17,2) AS netpaid#37] (98) HashAggregate [codegen id : 19] Input [1]: [netpaid#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt index 8311b07f7525a..10f874f8f5543 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (14) - Project [s_store_name,s_state,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] InputAdapter WholeStageCodegen (11) @@ -29,7 +29,7 @@ WholeStageCodegen (14) InputAdapter Exchange [c_birth_country,s_zip] #13 WholeStageCodegen (10) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (7) @@ -37,7 +37,7 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #14 WholeStageCodegen (6) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (3) @@ -45,8 +45,12 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_item_sk] #15 WholeStageCodegen (2) - Project [s_store_name,s_state,s_zip,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid] - BroadcastHashJoin [s_store_sk,ss_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -55,10 +59,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] @@ -117,9 +117,9 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #3 WholeStageCodegen (8) - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,s_store_name,s_state,ca_state] + Project [ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,s_store_name,s_state,ca_state] BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] SortMergeJoin [ss_customer_sk,c_customer_sk] InputAdapter WholeStageCodegen (3) @@ -127,8 +127,12 @@ WholeStageCodegen (14) InputAdapter Exchange [ss_customer_sk] #4 WholeStageCodegen (2) - Project [i_current_price,i_size,i_color,i_units,i_manager_id,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -136,10 +140,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] - Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt index 92c983ff55f71..2a366c86fb264 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (34) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.customer_demographics (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (25) -(1) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(1) Scan parquet default.catalog_sales +Output [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(2) ColumnarToRow [codegen id : 5] +Input [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -(3) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] -Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = M)) AND (cd_marital_status#3 = S)) AND (cd_education_status#4 = College)) AND isnotnull(cd_demo_sk#1)) +(3) Filter [codegen id : 5] +Input [8]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] +Condition : (((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_promo_sk#4)) -(4) Project [codegen id : 1] -Output [1]: [cd_demo_sk#1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [cd_demo_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(6) Scan parquet default.catalog_sales -Output [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = M)) AND (cd_marital_status#11 = S)) AND (cd_education_status#12 = College)) AND isnotnull(cd_demo_sk#9)) -(7) ColumnarToRow -Input [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#9] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(8) Filter -Input [8]: [cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -Condition : (((isnotnull(cs_bill_cdemo_sk#7) AND isnotnull(cs_sold_date_sk#6)) AND isnotnull(cs_item_sk#8)) AND isnotnull(cs_promo_sk#9)) +(8) BroadcastExchange +Input [1]: [cd_demo_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [cs_bill_cdemo_sk#7] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#9] Join condition: None (10) Project [codegen id : 5] -Output [7]: [cs_sold_date_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -Input [9]: [cd_demo_sk#1, cs_sold_date_sk#6, cs_bill_cdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] +Output [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] +Input [9]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cd_demo_sk#9] (11) Scan parquet default.promotion Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] @@ -103,13 +103,13 @@ Input [1]: [p_promo_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_promo_sk#9] +Left keys [1]: [cs_promo_sk#4] Right keys [1]: [p_promo_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [cs_sold_date_sk#6, cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -Input [8]: [cs_sold_date_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, p_promo_sk#14] +Output [6]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] +Input [8]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, p_promo_sk#14] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#18, d_year#19] @@ -134,13 +134,13 @@ Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_sold_date_sk#6] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#18] Join condition: None (24) Project [codegen id : 5] -Output [5]: [cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13] -Input [7]: [cs_sold_date_sk#6, cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, d_date_sk#18] +Output [5]: [cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] +Input [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, d_date_sk#18] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] @@ -161,18 +161,18 @@ Input [2]: [i_item_sk#21, i_item_id#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] (29) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_item_sk#8] +Left keys [1]: [cs_item_sk#3] Right keys [1]: [i_item_sk#21] Join condition: None (30) Project [codegen id : 5] -Output [5]: [cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_id#22] -Input [7]: [cs_item_sk#8, cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_sk#21, i_item_id#22] +Output [5]: [cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_id#22] +Input [7]: [cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_sk#21, i_item_id#22] (31) HashAggregate [codegen id : 5] -Input [5]: [cs_quantity#10, cs_list_price#11, cs_sales_price#12, cs_coupon_amt#13, i_item_id#22] +Input [5]: [cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, i_item_id#22] Keys [1]: [i_item_id#22] -Functions [4]: [partial_avg(cast(cs_quantity#10 as bigint)), partial_avg(UnscaledValue(cs_list_price#11)), partial_avg(UnscaledValue(cs_coupon_amt#13)), partial_avg(UnscaledValue(cs_sales_price#12))] +Functions [4]: [partial_avg(cast(cs_quantity#5 as bigint)), partial_avg(UnscaledValue(cs_list_price#6)), partial_avg(UnscaledValue(cs_coupon_amt#8)), partial_avg(UnscaledValue(cs_sales_price#7))] Aggregate Attributes [8]: [sum#24, count#25, sum#26, count#27, sum#28, count#29, sum#30, count#31] Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] @@ -183,9 +183,9 @@ Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] Keys [1]: [i_item_id#22] -Functions [4]: [avg(cast(cs_quantity#10 as bigint)), avg(UnscaledValue(cs_list_price#11)), avg(UnscaledValue(cs_coupon_amt#13)), avg(UnscaledValue(cs_sales_price#12))] -Aggregate Attributes [4]: [avg(cast(cs_quantity#10 as bigint))#41, avg(UnscaledValue(cs_list_price#11))#42, avg(UnscaledValue(cs_coupon_amt#13))#43, avg(UnscaledValue(cs_sales_price#12))#44] -Results [5]: [i_item_id#22, avg(cast(cs_quantity#10 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(cs_list_price#11))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(cs_coupon_amt#13))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(cs_sales_price#12))#44 / 100.0) as decimal(11,6)) AS agg4#48] +Functions [4]: [avg(cast(cs_quantity#5 as bigint)), avg(UnscaledValue(cs_list_price#6)), avg(UnscaledValue(cs_coupon_amt#8)), avg(UnscaledValue(cs_sales_price#7))] +Aggregate Attributes [4]: [avg(cast(cs_quantity#5 as bigint))#41, avg(UnscaledValue(cs_list_price#6))#42, avg(UnscaledValue(cs_coupon_amt#8))#43, avg(UnscaledValue(cs_sales_price#7))#44] +Results [5]: [i_item_id#22, avg(cast(cs_quantity#5 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(cs_list_price#6))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(cs_coupon_amt#8))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(cs_sales_price#7))#44 / 100.0) as decimal(11,6)) AS agg4#48] (34) TakeOrderedAndProject Input [5]: [i_item_id#22, agg1#45, agg2#46, agg3#47, agg4#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt index 1c1c3de006e36..d4ae376d5b425 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt @@ -12,7 +12,11 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] BroadcastHashJoin [cs_promo_sk,p_promo_sk] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] - BroadcastHashJoin [cd_demo_sk,cs_bill_cdemo_sk] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_sold_date_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,10 +25,6 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] - Filter [cs_bill_cdemo_sk,cs_sold_date_sk,cs_item_sk,cs_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt index 17afa02653c31..a949b93f3bcb0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt @@ -51,15 +51,15 @@ TakeOrderedAndProject (61) +- * Sort (55) +- Exchange (54) +- * Project (53) - +- * BroadcastHashJoin Inner BuildLeft (52) - :- BroadcastExchange (48) - : +- * Project (47) - : +- * Filter (46) - : +- * ColumnarToRow (45) - : +- Scan parquet default.date_dim (44) - +- * Filter (51) - +- * ColumnarToRow (50) - +- Scan parquet default.catalog_sales (49) + +- * BroadcastHashJoin Inner BuildRight (52) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- BroadcastExchange (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.date_dim (47) (1) Scan parquet default.store_sales @@ -251,72 +251,72 @@ Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, 5), true, [id=#31] Input [8]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25] Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST], false, 0 -(44) Scan parquet default.date_dim -Output [2]: [d_date_sk#32, d_year#33] +(44) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(45) ColumnarToRow [codegen id : 14] -Input [2]: [d_date_sk#32, d_year#33] +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] -(46) Filter [codegen id : 14] -Input [2]: [d_date_sk#32, d_year#33] -Condition : (d_year#33 IN (1999,2000,2001) AND isnotnull(d_date_sk#32)) +(46) Filter [codegen id : 15] +Input [4]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] +Condition : ((isnotnull(cs_bill_customer_sk#33) AND isnotnull(cs_item_sk#34)) AND isnotnull(cs_sold_date_sk#32)) -(47) Project [codegen id : 14] -Output [1]: [d_date_sk#32] -Input [2]: [d_date_sk#32, d_year#33] +(47) Scan parquet default.date_dim +Output [2]: [d_date_sk#36, d_year#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct -(48) BroadcastExchange -Input [1]: [d_date_sk#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] +(48) ColumnarToRow [codegen id : 14] +Input [2]: [d_date_sk#36, d_year#37] -(49) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +(49) Filter [codegen id : 14] +Input [2]: [d_date_sk#36, d_year#37] +Condition : (d_year#37 IN (1999,2000,2001) AND isnotnull(d_date_sk#36)) -(50) ColumnarToRow -Input [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +(50) Project [codegen id : 14] +Output [1]: [d_date_sk#36] +Input [2]: [d_date_sk#36, d_year#37] -(51) Filter -Input [4]: [cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -Condition : ((isnotnull(cs_bill_customer_sk#36) AND isnotnull(cs_item_sk#37)) AND isnotnull(cs_sold_date_sk#35)) +(51) BroadcastExchange +Input [1]: [d_date_sk#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] (52) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [d_date_sk#32] -Right keys [1]: [cs_sold_date_sk#35] +Left keys [1]: [cs_sold_date_sk#32] +Right keys [1]: [d_date_sk#36] Join condition: None (53) Project [codegen id : 15] -Output [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -Input [5]: [d_date_sk#32, cs_sold_date_sk#35, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Output [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] +Input [5]: [cs_sold_date_sk#32, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35, d_date_sk#36] (54) Exchange -Input [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -Arguments: hashpartitioning(cast(cs_bill_customer_sk#36 as bigint), cast(cs_item_sk#37 as bigint), 5), true, [id=#39] +Input [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] +Arguments: hashpartitioning(cast(cs_bill_customer_sk#33 as bigint), cast(cs_item_sk#34 as bigint), 5), true, [id=#39] (55) Sort [codegen id : 16] -Input [3]: [cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] -Arguments: [cast(cs_bill_customer_sk#36 as bigint) ASC NULLS FIRST, cast(cs_item_sk#37 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] +Arguments: [cast(cs_bill_customer_sk#33 as bigint) ASC NULLS FIRST, cast(cs_item_sk#34 as bigint) ASC NULLS FIRST], false, 0 (56) SortMergeJoin [codegen id : 17] Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] -Right keys [2]: [cast(cs_bill_customer_sk#36 as bigint), cast(cs_item_sk#37 as bigint)] +Right keys [2]: [cast(cs_bill_customer_sk#33 as bigint), cast(cs_item_sk#34 as bigint)] Join condition: None (57) Project [codegen id : 17] -Output [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#38, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] -Input [11]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25, cs_bill_customer_sk#36, cs_item_sk#37, cs_quantity#38] +Output [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#35, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] +Input [11]: [ss_quantity#6, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25, cs_bill_customer_sk#33, cs_item_sk#34, cs_quantity#35] (58) HashAggregate [codegen id : 17] -Input [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#38, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] +Input [7]: [ss_quantity#6, sr_return_quantity#25, cs_quantity#35, s_store_id#12, s_store_name#13, i_item_id#17, i_item_desc#18] Keys [4]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13] -Functions [3]: [partial_sum(cast(ss_quantity#6 as bigint)), partial_sum(cast(sr_return_quantity#25 as bigint)), partial_sum(cast(cs_quantity#38 as bigint))] +Functions [3]: [partial_sum(cast(ss_quantity#6 as bigint)), partial_sum(cast(sr_return_quantity#25 as bigint)), partial_sum(cast(cs_quantity#35 as bigint))] Aggregate Attributes [3]: [sum#40, sum#41, sum#42] Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum#43, sum#44, sum#45] @@ -327,9 +327,9 @@ Arguments: hashpartitioning(i_item_id#17, i_item_desc#18, s_store_id#12, s_store (60) HashAggregate [codegen id : 18] Input [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum#43, sum#44, sum#45] Keys [4]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13] -Functions [3]: [sum(cast(ss_quantity#6 as bigint)), sum(cast(sr_return_quantity#25 as bigint)), sum(cast(cs_quantity#38 as bigint))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#6 as bigint))#47, sum(cast(sr_return_quantity#25 as bigint))#48, sum(cast(cs_quantity#38 as bigint))#49] -Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum(cast(ss_quantity#6 as bigint))#47 AS store_sales_quantity#50, sum(cast(sr_return_quantity#25 as bigint))#48 AS store_returns_quantity#51, sum(cast(cs_quantity#38 as bigint))#49 AS catalog_sales_quantity#52] +Functions [3]: [sum(cast(ss_quantity#6 as bigint)), sum(cast(sr_return_quantity#25 as bigint)), sum(cast(cs_quantity#35 as bigint))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#6 as bigint))#47, sum(cast(sr_return_quantity#25 as bigint))#48, sum(cast(cs_quantity#35 as bigint))#49] +Results [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, sum(cast(ss_quantity#6 as bigint))#47 AS store_sales_quantity#50, sum(cast(sr_return_quantity#25 as bigint))#48 AS store_returns_quantity#51, sum(cast(cs_quantity#35 as bigint))#49 AS catalog_sales_quantity#52] (61) TakeOrderedAndProject Input [7]: [i_item_id#17, i_item_desc#18, s_store_id#12, s_store_name#13, store_sales_quantity#50, store_returns_quantity#51, catalog_sales_quantity#52] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt index fc05544f906d0..ea91af9e8f755 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt @@ -89,7 +89,11 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales Exchange [cs_bill_customer_sk,cs_item_sk] #10 WholeStageCodegen (15) Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] InputAdapter BroadcastExchange #11 WholeStageCodegen (14) @@ -98,7 +102,3 @@ TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt index 2886f8143fdf1..afe7c682b55e8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,128), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] -Condition : ((isnotnull(i_manufact_id#4) AND (i_manufact_id#4 = 128)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manufact_id#4] +(4) Scan parquet default.item +Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,128), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] +Condition : ((isnotnull(i_manufact_id#7) AND (i_manufact_id#7 = 128)) AND isnotnull(i_item_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manufact_id#7] -(8) Filter -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Input [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] -Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS sum_agg#19] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum_agg#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, sum_agg#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt index 95a9f0c0b7e30..3412ecfeea026 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt index 2f4a32b68716f..c338e5ce6f5d5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt @@ -1,333 +1,333 @@ == Physical Plan == TakeOrderedAndProject (59) +- * Project (58) - +- * BroadcastHashJoin Inner BuildLeft (57) - :- BroadcastExchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.customer (6) - +- * Project (56) - +- * BroadcastHashJoin Inner BuildRight (55) - :- * Filter (34) - : +- * HashAggregate (33) - : +- Exchange (32) - : +- * HashAggregate (31) - : +- * Project (30) - : +- * SortMergeJoin Inner (29) - : :- * Sort (23) - : : +- Exchange (22) - : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildLeft (20) - : : :- BroadcastExchange (16) - : : : +- * Project (15) - : : : +- * Filter (14) - : : : +- * ColumnarToRow (13) - : : : +- Scan parquet default.date_dim (12) - : : +- * Filter (19) - : : +- * ColumnarToRow (18) - : : +- Scan parquet default.web_returns (17) - : +- * Sort (28) - : +- Exchange (27) - : +- * Filter (26) - : +- * ColumnarToRow (25) - : +- Scan parquet default.customer_address (24) - +- BroadcastExchange (54) - +- * Filter (53) - +- * HashAggregate (52) - +- Exchange (51) - +- * HashAggregate (50) - +- * HashAggregate (49) - +- Exchange (48) - +- * HashAggregate (47) - +- * Project (46) - +- * SortMergeJoin Inner (45) - :- * Sort (42) - : +- Exchange (41) - : +- * Project (40) - : +- * BroadcastHashJoin Inner BuildLeft (39) - : :- ReusedExchange (35) - : +- * Filter (38) - : +- * ColumnarToRow (37) - : +- Scan parquet default.web_returns (36) - +- * Sort (44) - +- ReusedExchange (43) - - -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#2] + +- * BroadcastHashJoin Inner BuildRight (57) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Filter (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_returns (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer_address (13) + : +- BroadcastExchange (43) + : +- * Filter (42) + : +- * HashAggregate (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- * HashAggregate (38) + : +- Exchange (37) + : +- * HashAggregate (36) + : +- * Project (35) + : +- * SortMergeJoin Inner (34) + : :- * Sort (31) + : : +- Exchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.web_returns (24) + : : +- ReusedExchange (27) + : +- * Sort (33) + : +- ReusedExchange (32) + +- BroadcastExchange (56) + +- * Project (55) + +- * BroadcastHashJoin Inner BuildRight (54) + :- * Filter (48) + : +- * ColumnarToRow (47) + : +- Scan parquet default.customer (46) + +- BroadcastExchange (53) + +- * Project (52) + +- * Filter (51) + +- * ColumnarToRow (50) + +- Scan parquet default.customer_address (49) + + +(1) Scan parquet default.web_returns +Output [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] +(2) ColumnarToRow [codegen id : 2] +Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -(3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] -Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = GA)) AND isnotnull(ca_address_sk#1)) +(3) Filter [codegen id : 2] +Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Condition : ((isnotnull(wr_returned_date_sk#1) AND isnotnull(wr_returning_addr_sk#3)) AND isnotnull(wr_returning_customer_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#1] -Input [2]: [ca_address_sk#1, ca_state#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_year#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [ca_address_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] -(6) Scan parquet default.customer -Output [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] +Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2002)) AND isnotnull(d_date_sk#5)) -(7) ColumnarToRow -Input [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_year#6] -(8) Filter -Input [14]: [c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#6] +Left keys [1]: [wr_returned_date_sk#1] +Right keys [1]: [cast(d_date_sk#5 as bigint)] Join condition: None (10) Project [codegen id : 2] -Output [13]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -Input [15]: [ca_address_sk#1, c_customer_sk#4, c_customer_id#5, c_current_addr_sk#6, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] +Output [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Input [5]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, d_date_sk#5] + +(11) Exchange +Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Arguments: hashpartitioning(wr_returning_addr_sk#3, 5), true, [id=#8] -(11) BroadcastExchange -Input [13]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +(12) Sort [codegen id : 3] +Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Arguments: [wr_returning_addr_sk#3 ASC NULLS FIRST], false, 0 -(12) Scan parquet default.date_dim -Output [2]: [d_date_sk#19, d_year#20] +(13) Scan parquet default.customer_address +Output [2]: [ca_address_sk#9, ca_state#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct -(13) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#19, d_year#20] +(14) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#9, ca_state#10] -(14) Filter [codegen id : 3] -Input [2]: [d_date_sk#19, d_year#20] -Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2002)) AND isnotnull(d_date_sk#19)) +(15) Filter [codegen id : 4] +Input [2]: [ca_address_sk#9, ca_state#10] +Condition : (isnotnull(ca_address_sk#9) AND isnotnull(ca_state#10)) -(15) Project [codegen id : 3] -Output [1]: [d_date_sk#19] -Input [2]: [d_date_sk#19, d_year#20] +(16) Exchange +Input [2]: [ca_address_sk#9, ca_state#10] +Arguments: hashpartitioning(cast(ca_address_sk#9 as bigint), 5), true, [id=#11] -(16) BroadcastExchange -Input [1]: [d_date_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] +(17) Sort [codegen id : 5] +Input [2]: [ca_address_sk#9, ca_state#10] +Arguments: [cast(ca_address_sk#9 as bigint) ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [wr_returning_addr_sk#3] +Right keys [1]: [cast(ca_address_sk#9 as bigint)] +Join condition: None -(17) Scan parquet default.web_returns -Output [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +(19) Project [codegen id : 6] +Output [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] +Input [5]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, ca_address_sk#9, ca_state#10] + +(20) HashAggregate [codegen id : 6] +Input [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] +Keys [2]: [wr_returning_customer_sk#2, ca_state#10] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#4))] +Aggregate Attributes [1]: [sum#12] +Results [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] + +(21) Exchange +Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] +Arguments: hashpartitioning(wr_returning_customer_sk#2, ca_state#10, 5), true, [id=#14] + +(22) HashAggregate [codegen id : 17] +Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#13] +Keys [2]: [wr_returning_customer_sk#2, ca_state#10] +Functions [1]: [sum(UnscaledValue(wr_return_amt#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#4))#15] +Results [3]: [wr_returning_customer_sk#2 AS ctr_customer_sk#16, ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#4))#15,17,2) AS ctr_total_return#18] + +(23) Filter [codegen id : 17] +Input [3]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18] +Condition : isnotnull(ctr_total_return#18) + +(24) Scan parquet default.web_returns +Output [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] +PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk)] ReadSchema: struct -(18) ColumnarToRow -Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] - -(19) Filter -Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Condition : ((isnotnull(wr_returned_date_sk#22) AND isnotnull(wr_returning_addr_sk#24)) AND isnotnull(wr_returning_customer_sk#23)) +(25) ColumnarToRow [codegen id : 8] +Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] -(20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cast(d_date_sk#19 as bigint)] -Right keys [1]: [wr_returned_date_sk#22] -Join condition: None - -(21) Project [codegen id : 4] -Output [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Input [5]: [d_date_sk#19, wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +(26) Filter [codegen id : 8] +Input [4]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Condition : (isnotnull(wr_returned_date_sk#1) AND isnotnull(wr_returning_addr_sk#3)) -(22) Exchange -Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Arguments: hashpartitioning(wr_returning_addr_sk#24, 5), true, [id=#26] +(27) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] -(23) Sort [codegen id : 5] -Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Arguments: [wr_returning_addr_sk#24 ASC NULLS FIRST], false, 0 +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [wr_returned_date_sk#1] +Right keys [1]: [cast(d_date_sk#5 as bigint)] +Join condition: None -(24) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] -ReadSchema: struct +(29) Project [codegen id : 8] +Output [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Input [5]: [wr_returned_date_sk#1, wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, d_date_sk#5] -(25) ColumnarToRow [codegen id : 6] -Input [2]: [ca_address_sk#1, ca_state#2] +(30) Exchange +Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Arguments: hashpartitioning(wr_returning_addr_sk#3, 5), true, [id=#19] -(26) Filter [codegen id : 6] -Input [2]: [ca_address_sk#1, ca_state#2] -Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_state#2)) +(31) Sort [codegen id : 9] +Input [3]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4] +Arguments: [wr_returning_addr_sk#3 ASC NULLS FIRST], false, 0 -(27) Exchange -Input [2]: [ca_address_sk#1, ca_state#2] -Arguments: hashpartitioning(cast(ca_address_sk#1 as bigint), 5), true, [id=#27] +(32) ReusedExchange [Reuses operator id: 16] +Output [2]: [ca_address_sk#9, ca_state#10] -(28) Sort [codegen id : 7] -Input [2]: [ca_address_sk#1, ca_state#2] -Arguments: [cast(ca_address_sk#1 as bigint) ASC NULLS FIRST], false, 0 +(33) Sort [codegen id : 11] +Input [2]: [ca_address_sk#9, ca_state#10] +Arguments: [cast(ca_address_sk#9 as bigint) ASC NULLS FIRST], false, 0 -(29) SortMergeJoin [codegen id : 8] -Left keys [1]: [wr_returning_addr_sk#24] -Right keys [1]: [cast(ca_address_sk#1 as bigint)] +(34) SortMergeJoin [codegen id : 12] +Left keys [1]: [wr_returning_addr_sk#3] +Right keys [1]: [cast(ca_address_sk#9 as bigint)] Join condition: None -(30) Project [codegen id : 8] -Output [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] -Input [5]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25, ca_address_sk#1, ca_state#2] - -(31) HashAggregate [codegen id : 8] -Input [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] -Keys [2]: [wr_returning_customer_sk#23, ca_state#2] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#25))] -Aggregate Attributes [1]: [sum#28] -Results [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] - -(32) Exchange -Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] -Arguments: hashpartitioning(wr_returning_customer_sk#23, ca_state#2, 5), true, [id=#30] - -(33) HashAggregate -Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#29] -Keys [2]: [wr_returning_customer_sk#23, ca_state#2] -Functions [1]: [sum(UnscaledValue(wr_return_amt#25))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#25))#31] -Results [3]: [wr_returning_customer_sk#23 AS ctr_customer_sk#32, ca_state#2 AS ctr_state#33, MakeDecimal(sum(UnscaledValue(wr_return_amt#25))#31,17,2) AS ctr_total_return#34] - -(34) Filter -Input [3]: [ctr_customer_sk#32, ctr_state#33, ctr_total_return#34] -Condition : isnotnull(ctr_total_return#34) - -(35) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#19] - -(36) Scan parquet default.web_returns -Output [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +(35) Project [codegen id : 12] +Output [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] +Input [5]: [wr_returning_customer_sk#2, wr_returning_addr_sk#3, wr_return_amt#4, ca_address_sk#9, ca_state#10] + +(36) HashAggregate [codegen id : 12] +Input [3]: [wr_returning_customer_sk#2, wr_return_amt#4, ca_state#10] +Keys [2]: [wr_returning_customer_sk#2, ca_state#10] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#4))] +Aggregate Attributes [1]: [sum#20] +Results [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] + +(37) Exchange +Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] +Arguments: hashpartitioning(wr_returning_customer_sk#2, ca_state#10, 5), true, [id=#22] + +(38) HashAggregate [codegen id : 13] +Input [3]: [wr_returning_customer_sk#2, ca_state#10, sum#21] +Keys [2]: [wr_returning_customer_sk#2, ca_state#10] +Functions [1]: [sum(UnscaledValue(wr_return_amt#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#4))#23] +Results [2]: [ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#4))#23,17,2) AS ctr_total_return#18] + +(39) HashAggregate [codegen id : 13] +Input [2]: [ctr_state#17, ctr_total_return#18] +Keys [1]: [ctr_state#17] +Functions [1]: [partial_avg(ctr_total_return#18)] +Aggregate Attributes [2]: [sum#24, count#25] +Results [3]: [ctr_state#17, sum#26, count#27] + +(40) Exchange +Input [3]: [ctr_state#17, sum#26, count#27] +Arguments: hashpartitioning(ctr_state#17, 5), true, [id=#28] + +(41) HashAggregate [codegen id : 14] +Input [3]: [ctr_state#17, sum#26, count#27] +Keys [1]: [ctr_state#17] +Functions [1]: [avg(ctr_total_return#18)] +Aggregate Attributes [1]: [avg(ctr_total_return#18)#29] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#18)#29) * 1.200000), DecimalType(24,7), true) AS (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17 AS ctr_state#17#31] + +(42) Filter [codegen id : 14] +Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] +Condition : isnotnull((CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30) + +(43) BroadcastExchange +Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#32] + +(44) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ctr_state#17] +Right keys [1]: [ctr_state#17#31] +Join condition: (cast(ctr_total_return#18 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30) + +(45) Project [codegen id : 17] +Output [2]: [ctr_customer_sk#16, ctr_total_return#18] +Input [5]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#30, ctr_state#17#31] + +(46) Scan parquet default.customer +Output [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -PushedFilters: [IsNotNull(wr_returned_date_sk), IsNotNull(wr_returning_addr_sk)] -ReadSchema: struct - -(37) ColumnarToRow -Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(38) Filter -Input [4]: [wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Condition : (isnotnull(wr_returned_date_sk#22) AND isnotnull(wr_returning_addr_sk#24)) +(47) ColumnarToRow [codegen id : 16] +Input [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] -(39) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cast(d_date_sk#19 as bigint)] -Right keys [1]: [wr_returned_date_sk#22] -Join condition: None +(48) Filter [codegen id : 16] +Input [14]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +Condition : (isnotnull(c_customer_sk#33) AND isnotnull(c_current_addr_sk#35)) -(40) Project [codegen id : 10] -Output [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Input [5]: [d_date_sk#19, wr_returned_date_sk#22, wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] +(49) Scan parquet default.customer_address +Output [2]: [ca_address_sk#9, ca_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct -(41) Exchange -Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Arguments: hashpartitioning(wr_returning_addr_sk#24, 5), true, [id=#35] +(50) ColumnarToRow [codegen id : 15] +Input [2]: [ca_address_sk#9, ca_state#10] -(42) Sort [codegen id : 11] -Input [3]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25] -Arguments: [wr_returning_addr_sk#24 ASC NULLS FIRST], false, 0 +(51) Filter [codegen id : 15] +Input [2]: [ca_address_sk#9, ca_state#10] +Condition : ((isnotnull(ca_state#10) AND (ca_state#10 = GA)) AND isnotnull(ca_address_sk#9)) -(43) ReusedExchange [Reuses operator id: 27] -Output [2]: [ca_address_sk#1, ca_state#2] +(52) Project [codegen id : 15] +Output [1]: [ca_address_sk#9] +Input [2]: [ca_address_sk#9, ca_state#10] -(44) Sort [codegen id : 13] -Input [2]: [ca_address_sk#1, ca_state#2] -Arguments: [cast(ca_address_sk#1 as bigint) ASC NULLS FIRST], false, 0 +(53) BroadcastExchange +Input [1]: [ca_address_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#47] -(45) SortMergeJoin [codegen id : 14] -Left keys [1]: [wr_returning_addr_sk#24] -Right keys [1]: [cast(ca_address_sk#1 as bigint)] +(54) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [c_current_addr_sk#35] +Right keys [1]: [ca_address_sk#9] Join condition: None -(46) Project [codegen id : 14] -Output [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] -Input [5]: [wr_returning_customer_sk#23, wr_returning_addr_sk#24, wr_return_amt#25, ca_address_sk#1, ca_state#2] - -(47) HashAggregate [codegen id : 14] -Input [3]: [wr_returning_customer_sk#23, wr_return_amt#25, ca_state#2] -Keys [2]: [wr_returning_customer_sk#23, ca_state#2] -Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#25))] -Aggregate Attributes [1]: [sum#36] -Results [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] - -(48) Exchange -Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] -Arguments: hashpartitioning(wr_returning_customer_sk#23, ca_state#2, 5), true, [id=#38] - -(49) HashAggregate [codegen id : 15] -Input [3]: [wr_returning_customer_sk#23, ca_state#2, sum#37] -Keys [2]: [wr_returning_customer_sk#23, ca_state#2] -Functions [1]: [sum(UnscaledValue(wr_return_amt#25))] -Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#25))#39] -Results [2]: [ca_state#2 AS ctr_state#33, MakeDecimal(sum(UnscaledValue(wr_return_amt#25))#39,17,2) AS ctr_total_return#34] - -(50) HashAggregate [codegen id : 15] -Input [2]: [ctr_state#33, ctr_total_return#34] -Keys [1]: [ctr_state#33] -Functions [1]: [partial_avg(ctr_total_return#34)] -Aggregate Attributes [2]: [sum#40, count#41] -Results [3]: [ctr_state#33, sum#42, count#43] - -(51) Exchange -Input [3]: [ctr_state#33, sum#42, count#43] -Arguments: hashpartitioning(ctr_state#33, 5), true, [id=#44] - -(52) HashAggregate [codegen id : 16] -Input [3]: [ctr_state#33, sum#42, count#43] -Keys [1]: [ctr_state#33] -Functions [1]: [avg(ctr_total_return#34)] -Aggregate Attributes [1]: [avg(ctr_total_return#34)#45] -Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#34)#45) * 1.200000), DecimalType(24,7), true) AS (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33 AS ctr_state#33#47] - -(53) Filter [codegen id : 16] -Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] -Condition : isnotnull((CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46) - -(54) BroadcastExchange -Input [2]: [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#48] - -(55) BroadcastHashJoin -Left keys [1]: [ctr_state#33] -Right keys [1]: [ctr_state#33#47] -Join condition: (cast(ctr_total_return#34 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46) - -(56) Project -Output [2]: [ctr_customer_sk#32, ctr_total_return#34] -Input [5]: [ctr_customer_sk#32, ctr_state#33, ctr_total_return#34, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#46, ctr_state#33#47] +(55) Project [codegen id : 16] +Output [13]: [c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +Input [15]: [c_customer_sk#33, c_customer_id#34, c_current_addr_sk#35, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ca_address_sk#9] + +(56) BroadcastExchange +Input [13]: [c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] (57) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [cast(c_customer_sk#4 as bigint)] -Right keys [1]: [ctr_customer_sk#32] +Left keys [1]: [ctr_customer_sk#16] +Right keys [1]: [cast(c_customer_sk#33 as bigint)] Join condition: None (58) Project [codegen id : 17] -Output [13]: [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] -Input [15]: [c_customer_sk#4, c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_customer_sk#32, ctr_total_return#34] +Output [13]: [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] +Input [15]: [ctr_customer_sk#16, ctr_total_return#18, c_customer_sk#33, c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46] (59) TakeOrderedAndProject -Input [13]: [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] -Arguments: 100, [c_customer_id#5 ASC NULLS FIRST, c_salutation#7 ASC NULLS FIRST, c_first_name#8 ASC NULLS FIRST, c_last_name#9 ASC NULLS FIRST, c_preferred_cust_flag#10 ASC NULLS FIRST, c_birth_day#11 ASC NULLS FIRST, c_birth_month#12 ASC NULLS FIRST, c_birth_year#13 ASC NULLS FIRST, c_birth_country#14 ASC NULLS FIRST, c_login#15 ASC NULLS FIRST, c_email_address#16 ASC NULLS FIRST, c_last_review_date#17 ASC NULLS FIRST, ctr_total_return#34 ASC NULLS FIRST], [c_customer_id#5, c_salutation#7, c_first_name#8, c_last_name#9, c_preferred_cust_flag#10, c_birth_day#11, c_birth_month#12, c_birth_year#13, c_birth_country#14, c_login#15, c_email_address#16, c_last_review_date#17, ctr_total_return#34] +Input [13]: [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] +Arguments: 100, [c_customer_id#34 ASC NULLS FIRST, c_salutation#36 ASC NULLS FIRST, c_first_name#37 ASC NULLS FIRST, c_last_name#38 ASC NULLS FIRST, c_preferred_cust_flag#39 ASC NULLS FIRST, c_birth_day#40 ASC NULLS FIRST, c_birth_month#41 ASC NULLS FIRST, c_birth_year#42 ASC NULLS FIRST, c_birth_country#43 ASC NULLS FIRST, c_login#44 ASC NULLS FIRST, c_email_address#45 ASC NULLS FIRST, c_last_review_date#46 ASC NULLS FIRST, ctr_total_return#18 ASC NULLS FIRST], [c_customer_id#34, c_salutation#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_day#40, c_birth_month#41, c_birth_year#42, c_birth_country#43, c_login#44, c_email_address#45, c_last_review_date#46, ctr_total_return#18] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt index a1aee58c44020..4a53f2266fb26 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt @@ -1,96 +1,96 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] WholeStageCodegen (17) Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] - BroadcastHashJoin [c_customer_sk,ctr_customer_sk] - InputAdapter - BroadcastExchange #1 - WholeStageCodegen (2) - Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [ctr_customer_sk,c_customer_sk] Project [ctr_customer_sk,ctr_total_return] BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] Filter [ctr_total_return] HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_customer_sk,ctr_state,ctr_total_return,sum] InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #3 - WholeStageCodegen (8) + Exchange [wr_returning_customer_sk,ca_state] #1 + WholeStageCodegen (6) HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] Project [wr_returning_customer_sk,wr_return_amt,ca_state] SortMergeJoin [wr_returning_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (3) Sort [wr_returning_addr_sk] InputAdapter - Exchange [wr_returning_addr_sk] #4 - WholeStageCodegen (4) + Exchange [wr_returning_addr_sk] #2 + WholeStageCodegen (2) Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - BroadcastHashJoin [d_date_sk,wr_returned_date_sk] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returned_date_sk,wr_returning_addr_sk,wr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) + BroadcastExchange #3 + WholeStageCodegen (1) Project [d_date_sk] Filter [d_year,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [wr_returned_date_sk,wr_returning_addr_sk,wr_returning_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (5) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #6 - WholeStageCodegen (6) + Exchange [ca_address_sk] #4 + WholeStageCodegen (4) Filter [ca_address_sk,ca_state] ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (16) + BroadcastExchange #5 + WholeStageCodegen (14) Filter [(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6))),ctr_state,sum,count] InputAdapter - Exchange [ctr_state] #8 - WholeStageCodegen (15) + Exchange [ctr_state] #6 + WholeStageCodegen (13) HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] InputAdapter - Exchange [wr_returning_customer_sk,ca_state] #9 - WholeStageCodegen (14) + Exchange [wr_returning_customer_sk,ca_state] #7 + WholeStageCodegen (12) HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] Project [wr_returning_customer_sk,wr_return_amt,ca_state] SortMergeJoin [wr_returning_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (11) + WholeStageCodegen (9) Sort [wr_returning_addr_sk] InputAdapter - Exchange [wr_returning_addr_sk] #10 - WholeStageCodegen (10) + Exchange [wr_returning_addr_sk] #8 + WholeStageCodegen (8) Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] - BroadcastHashJoin [d_date_sk,wr_returned_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #5 + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] Filter [wr_returned_date_sk,wr_returning_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_returned_date_sk,wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter - WholeStageCodegen (13) + WholeStageCodegen (11) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_state] #6 + ReusedExchange [ca_address_sk,ca_state] #4 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (16) + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (15) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt index a861008bedd79..9f123c4044cc8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt @@ -2,137 +2,137 @@ * Sort (119) +- Exchange (118) +- * Project (117) - +- * BroadcastHashJoin Inner BuildLeft (116) - :- BroadcastExchange (64) - : +- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Project (42) - : : +- * BroadcastHashJoin Inner BuildRight (41) - : : :- * HashAggregate (21) - : : : +- Exchange (20) - : : : +- * HashAggregate (19) - : : : +- * Project (18) - : : : +- * SortMergeJoin Inner (17) - : : : :- * Sort (11) - : : : : +- Exchange (10) - : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.date_dim (4) - : : : +- * Sort (16) - : : : +- Exchange (15) - : : : +- * Filter (14) - : : : +- * ColumnarToRow (13) - : : : +- Scan parquet default.customer_address (12) - : : +- BroadcastExchange (40) - : : +- * HashAggregate (39) - : : +- Exchange (38) - : : +- * HashAggregate (37) - : : +- * Project (36) - : : +- * SortMergeJoin Inner (35) - : : :- * Sort (32) - : : : +- Exchange (31) - : : : +- * Project (30) - : : : +- * BroadcastHashJoin Inner BuildLeft (29) - : : : :- BroadcastExchange (25) - : : : : +- * Filter (24) - : : : : +- * ColumnarToRow (23) - : : : : +- Scan parquet default.date_dim (22) - : : : +- * Filter (28) - : : : +- * ColumnarToRow (27) - : : : +- Scan parquet default.web_sales (26) - : : +- * Sort (34) - : : +- ReusedExchange (33) - : +- BroadcastExchange (61) - : +- * HashAggregate (60) - : +- Exchange (59) - : +- * HashAggregate (58) - : +- * Project (57) - : +- * SortMergeJoin Inner (56) - : :- * Sort (53) - : : +- Exchange (52) - : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildLeft (50) - : : :- BroadcastExchange (46) - : : : +- * Filter (45) - : : : +- * ColumnarToRow (44) - : : : +- Scan parquet default.date_dim (43) - : : +- * Filter (49) - : : +- * ColumnarToRow (48) - : : +- Scan parquet default.web_sales (47) - : +- * Sort (55) - : +- ReusedExchange (54) - +- * Project (115) - +- * BroadcastHashJoin Inner BuildRight (114) - :- * Project (97) - : +- * BroadcastHashJoin Inner BuildRight (96) - : :- * HashAggregate (79) - : : +- Exchange (78) - : : +- * HashAggregate (77) - : : +- * Project (76) - : : +- * SortMergeJoin Inner (75) - : : :- * Sort (72) - : : : +- Exchange (71) - : : : +- * Project (70) - : : : +- * BroadcastHashJoin Inner BuildLeft (69) - : : : :- ReusedExchange (65) - : : : +- * Filter (68) - : : : +- * ColumnarToRow (67) - : : : +- Scan parquet default.store_sales (66) - : : +- * Sort (74) - : : +- ReusedExchange (73) - : +- BroadcastExchange (95) - : +- * HashAggregate (94) - : +- Exchange (93) - : +- * HashAggregate (92) - : +- * Project (91) - : +- * SortMergeJoin Inner (90) - : :- * Sort (87) - : : +- Exchange (86) - : : +- * Project (85) - : : +- * BroadcastHashJoin Inner BuildLeft (84) - : : :- ReusedExchange (80) - : : +- * Filter (83) - : : +- * ColumnarToRow (82) - : : +- Scan parquet default.store_sales (81) - : +- * Sort (89) - : +- ReusedExchange (88) - +- BroadcastExchange (113) - +- * HashAggregate (112) - +- Exchange (111) - +- * HashAggregate (110) - +- * Project (109) - +- * SortMergeJoin Inner (108) - :- * Sort (105) - : +- Exchange (104) - : +- * Project (103) - : +- * BroadcastHashJoin Inner BuildLeft (102) - : :- ReusedExchange (98) - : +- * Filter (101) - : +- * ColumnarToRow (100) - : +- Scan parquet default.store_sales (99) - +- * Sort (107) - +- ReusedExchange (106) - - -(1) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] + +- * BroadcastHashJoin Inner BuildRight (116) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Project (42) + : : +- * BroadcastHashJoin Inner BuildRight (41) + : : :- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer_address (12) + : : +- BroadcastExchange (40) + : : +- * HashAggregate (39) + : : +- Exchange (38) + : : +- * HashAggregate (37) + : : +- * Project (36) + : : +- * SortMergeJoin Inner (35) + : : :- * Sort (32) + : : : +- Exchange (31) + : : : +- * Project (30) + : : : +- * BroadcastHashJoin Inner BuildRight (29) + : : : :- * Filter (24) + : : : : +- * ColumnarToRow (23) + : : : : +- Scan parquet default.store_sales (22) + : : : +- BroadcastExchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.date_dim (25) + : : +- * Sort (34) + : : +- ReusedExchange (33) + : +- BroadcastExchange (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (45) + : : : +- * ColumnarToRow (44) + : : : +- Scan parquet default.store_sales (43) + : : +- BroadcastExchange (49) + : : +- * Filter (48) + : : +- * ColumnarToRow (47) + : : +- Scan parquet default.date_dim (46) + : +- * Sort (55) + : +- ReusedExchange (54) + +- BroadcastExchange (115) + +- * Project (114) + +- * BroadcastHashJoin Inner BuildRight (113) + :- * Project (96) + : +- * BroadcastHashJoin Inner BuildRight (95) + : :- * HashAggregate (78) + : : +- Exchange (77) + : : +- * HashAggregate (76) + : : +- * Project (75) + : : +- * SortMergeJoin Inner (74) + : : :- * Sort (71) + : : : +- Exchange (70) + : : : +- * Project (69) + : : : +- * BroadcastHashJoin Inner BuildRight (68) + : : : :- * Filter (66) + : : : : +- * ColumnarToRow (65) + : : : : +- Scan parquet default.web_sales (64) + : : : +- ReusedExchange (67) + : : +- * Sort (73) + : : +- ReusedExchange (72) + : +- BroadcastExchange (94) + : +- * HashAggregate (93) + : +- Exchange (92) + : +- * HashAggregate (91) + : +- * Project (90) + : +- * SortMergeJoin Inner (89) + : :- * Sort (86) + : : +- Exchange (85) + : : +- * Project (84) + : : +- * BroadcastHashJoin Inner BuildRight (83) + : : :- * Filter (81) + : : : +- * ColumnarToRow (80) + : : : +- Scan parquet default.web_sales (79) + : : +- ReusedExchange (82) + : +- * Sort (88) + : +- ReusedExchange (87) + +- BroadcastExchange (112) + +- * HashAggregate (111) + +- Exchange (110) + +- * HashAggregate (109) + +- * Project (108) + +- * SortMergeJoin Inner (107) + :- * Sort (104) + : +- Exchange (103) + : +- * Project (102) + : +- * BroadcastHashJoin Inner BuildRight (101) + : :- * Filter (99) + : : +- * ColumnarToRow (98) + : : +- Scan parquet default.web_sales (97) + : +- ReusedExchange (100) + +- * Sort (106) + +- ReusedExchange (105) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] (3) Filter [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) (4) Scan parquet default.date_dim Output [3]: [d_date_sk#4, d_year#5, d_qoy#6] @@ -153,21 +153,21 @@ Input [3]: [d_date_sk#4, d_year#5, d_qoy#6] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] -Input [6]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3, d_date_sk#4, d_year#5, d_qoy#6] +Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] +Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#4, d_year#5, d_qoy#6] (10) Exchange -Input [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] -Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#8] +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] +Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#8] (11) Sort [codegen id : 3] -Input [4]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6] -Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6] +Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer_address Output [2]: [ca_address_sk#9, ca_county#10] @@ -192,18 +192,18 @@ Input [2]: [ca_address_sk#9, ca_county#10] Arguments: [ca_address_sk#9 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_bill_addr_sk#2] +Left keys [1]: [ss_addr_sk#2] Right keys [1]: [ca_address_sk#9] Join condition: None (18) Project [codegen id : 6] -Output [4]: [ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] -Input [6]: [ws_bill_addr_sk#2, ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_address_sk#9, ca_county#10] +Output [4]: [ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] +Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_address_sk#9, ca_county#10] (19) HashAggregate [codegen id : 6] -Input [4]: [ws_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] +Input [4]: [ss_ext_sales_price#3, d_year#5, d_qoy#6, ca_county#10] Keys [3]: [ca_county#10, d_qoy#6, d_year#5] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#12] Results [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] @@ -211,61 +211,61 @@ Results [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Input [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Arguments: hashpartitioning(ca_county#10, d_qoy#6, d_year#5, 5), true, [id=#14] -(21) HashAggregate [codegen id : 21] +(21) HashAggregate [codegen id : 42] Input [4]: [ca_county#10, d_qoy#6, d_year#5, sum#13] Keys [3]: [ca_county#10, d_qoy#6, d_year#5] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#15] -Results [2]: [ca_county#10, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#15,17,2) AS web_sales#16] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#15] +Results [2]: [ca_county#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#15,17,2) AS store_sales#16] -(22) Scan parquet default.date_dim +(22) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 8] +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] + +(24) Filter [codegen id : 8] +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) + +(25) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_year#18, d_qoy#19] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(23) ColumnarToRow [codegen id : 7] +(26) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] -(24) Filter [codegen id : 7] +(27) Filter [codegen id : 7] Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] -Condition : ((((isnotnull(d_qoy#19) AND isnotnull(d_year#18)) AND (d_qoy#19 = 1)) AND (d_year#18 = 2000)) AND isnotnull(d_date_sk#17)) +Condition : ((((isnotnull(d_qoy#19) AND isnotnull(d_year#18)) AND (d_qoy#19 = 3)) AND (d_year#18 = 2000)) AND isnotnull(d_date_sk#17)) -(25) BroadcastExchange +(28) BroadcastExchange Input [3]: [d_date_sk#17, d_year#18, d_qoy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(26) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct - -(27) ColumnarToRow -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] - -(28) Filter -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) - (29) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [d_date_sk#17] -Right keys [1]: [ws_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#17] Join condition: None (30) Project [codegen id : 8] -Output [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Input [6]: [d_date_sk#17, d_year#18, d_qoy#19, ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] +Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#17, d_year#18, d_qoy#19] (31) Exchange -Input [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#21] +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] +Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#21] (32) Sort [codegen id : 9] -Input [4]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19] +Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 (33) ReusedExchange [Reuses operator id: 15] Output [2]: [ca_address_sk#22, ca_county#23] @@ -275,18 +275,18 @@ Input [2]: [ca_address_sk#22, ca_county#23] Arguments: [ca_address_sk#22 ASC NULLS FIRST], false, 0 (35) SortMergeJoin [codegen id : 12] -Left keys [1]: [ws_bill_addr_sk#2] +Left keys [1]: [ss_addr_sk#2] Right keys [1]: [ca_address_sk#22] Join condition: None (36) Project [codegen id : 12] -Output [4]: [ws_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] -Input [6]: [d_year#18, d_qoy#19, ws_bill_addr_sk#2, ws_ext_sales_price#3, ca_address_sk#22, ca_county#23] +Output [4]: [ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] +Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_address_sk#22, ca_county#23] (37) HashAggregate [codegen id : 12] -Input [4]: [ws_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] +Input [4]: [ss_ext_sales_price#3, d_year#18, d_qoy#19, ca_county#23] Keys [3]: [ca_county#23, d_qoy#19, d_year#18] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#24] Results [4]: [ca_county#23, d_qoy#19, d_year#18, sum#25] @@ -297,71 +297,71 @@ Arguments: hashpartitioning(ca_county#23, d_qoy#19, d_year#18, 5), true, [id=#26 (39) HashAggregate [codegen id : 13] Input [4]: [ca_county#23, d_qoy#19, d_year#18, sum#25] Keys [3]: [ca_county#23, d_qoy#19, d_year#18] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#27] -Results [2]: [ca_county#23, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#27,17,2) AS web_sales#28] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#27] +Results [2]: [ca_county#23, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#27,17,2) AS store_sales#28] (40) BroadcastExchange -Input [2]: [ca_county#23, web_sales#28] +Input [2]: [ca_county#23, store_sales#28] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] -(41) BroadcastHashJoin [codegen id : 21] +(41) BroadcastHashJoin [codegen id : 42] Left keys [1]: [ca_county#10] Right keys [1]: [ca_county#23] Join condition: None -(42) Project [codegen id : 21] -Output [3]: [web_sales#16, ca_county#23, web_sales#28] -Input [4]: [ca_county#10, web_sales#16, ca_county#23, web_sales#28] +(42) Project [codegen id : 42] +Output [3]: [ca_county#10, store_sales#16, store_sales#28] +Input [4]: [ca_county#10, store_sales#16, ca_county#23, store_sales#28] -(43) Scan parquet default.date_dim +(43) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 15] +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] + +(45) Filter [codegen id : 15] +Input [3]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#2)) + +(46) Scan parquet default.date_dim Output [3]: [d_date_sk#30, d_year#31, d_qoy#32] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(44) ColumnarToRow [codegen id : 14] +(47) ColumnarToRow [codegen id : 14] Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] -(45) Filter [codegen id : 14] +(48) Filter [codegen id : 14] Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] -Condition : ((((isnotnull(d_qoy#32) AND isnotnull(d_year#31)) AND (d_qoy#32 = 3)) AND (d_year#31 = 2000)) AND isnotnull(d_date_sk#30)) +Condition : ((((isnotnull(d_qoy#32) AND isnotnull(d_year#31)) AND (d_qoy#32 = 1)) AND (d_year#31 = 2000)) AND isnotnull(d_date_sk#30)) -(46) BroadcastExchange +(49) BroadcastExchange Input [3]: [d_date_sk#30, d_year#31, d_qoy#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] -(47) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] -ReadSchema: struct - -(48) ColumnarToRow -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] - -(49) Filter -Input [3]: [ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_bill_addr_sk#2)) - (50) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [d_date_sk#30] -Right keys [1]: [ws_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#30] Join condition: None (51) Project [codegen id : 15] -Output [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Input [6]: [d_date_sk#30, d_year#31, d_qoy#32, ws_sold_date_sk#1, ws_bill_addr_sk#2, ws_ext_sales_price#3] +Output [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] +Input [6]: [ss_sold_date_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, d_date_sk#30, d_year#31, d_qoy#32] (52) Exchange -Input [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_bill_addr_sk#2, 5), true, [id=#34] +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] +Arguments: hashpartitioning(ss_addr_sk#2, 5), true, [id=#34] (53) Sort [codegen id : 16] -Input [4]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3] -Arguments: [ws_bill_addr_sk#2 ASC NULLS FIRST], false, 0 +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32] +Arguments: [ss_addr_sk#2 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] Output [2]: [ca_address_sk#35, ca_county#36] @@ -371,18 +371,18 @@ Input [2]: [ca_address_sk#35, ca_county#36] Arguments: [ca_address_sk#35 ASC NULLS FIRST], false, 0 (56) SortMergeJoin [codegen id : 19] -Left keys [1]: [ws_bill_addr_sk#2] +Left keys [1]: [ss_addr_sk#2] Right keys [1]: [ca_address_sk#35] Join condition: None (57) Project [codegen id : 19] -Output [4]: [ws_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] -Input [6]: [d_year#31, d_qoy#32, ws_bill_addr_sk#2, ws_ext_sales_price#3, ca_address_sk#35, ca_county#36] +Output [4]: [ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] +Input [6]: [ss_addr_sk#2, ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_address_sk#35, ca_county#36] (58) HashAggregate [codegen id : 19] -Input [4]: [ws_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] +Input [4]: [ss_ext_sales_price#3, d_year#31, d_qoy#32, ca_county#36] Keys [3]: [ca_county#36, d_qoy#32, d_year#31] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#37] Results [4]: [ca_county#36, d_qoy#32, d_year#31, sum#38] @@ -393,271 +393,271 @@ Arguments: hashpartitioning(ca_county#36, d_qoy#32, d_year#31, 5), true, [id=#39 (60) HashAggregate [codegen id : 20] Input [4]: [ca_county#36, d_qoy#32, d_year#31, sum#38] Keys [3]: [ca_county#36, d_qoy#32, d_year#31] -Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#40] -Results [2]: [ca_county#36, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#40,17,2) AS web_sales#41] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#40] +Results [3]: [ca_county#36, d_year#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#40,17,2) AS store_sales#41] (61) BroadcastExchange -Input [2]: [ca_county#36, web_sales#41] +Input [3]: [ca_county#36, d_year#31, store_sales#41] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] -(62) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ca_county#23] +(62) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ca_county#10] Right keys [1]: [ca_county#36] Join condition: None -(63) Project [codegen id : 21] -Output [4]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41] -Input [5]: [web_sales#16, ca_county#23, web_sales#28, ca_county#36, web_sales#41] +(63) Project [codegen id : 42] +Output [5]: [store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41] +Input [6]: [ca_county#10, store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41] -(64) BroadcastExchange -Input [4]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#43] - -(65) ReusedExchange [Reuses operator id: 7] -Output [3]: [d_date_sk#44, d_year#45, d_qoy#46] - -(66) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(64) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct -(67) ColumnarToRow -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(65) ColumnarToRow [codegen id : 22] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -(68) Filter -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) +(66) Filter [codegen id : 22] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) -(69) BroadcastHashJoin [codegen id : 23] -Left keys [1]: [d_date_sk#44] -Right keys [1]: [ss_sold_date_sk#47] +(67) ReusedExchange [Reuses operator id: 49] +Output [3]: [d_date_sk#46, d_year#47, d_qoy#48] + +(68) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#43] +Right keys [1]: [d_date_sk#46] Join condition: None -(70) Project [codegen id : 23] -Output [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] -Input [6]: [d_date_sk#44, d_year#45, d_qoy#46, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(69) Project [codegen id : 22] +Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] +Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#46, d_year#47, d_qoy#48] -(71) Exchange -Input [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#50] +(70) Exchange +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] +Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#49] -(72) Sort [codegen id : 24] -Input [4]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 +(71) Sort [codegen id : 23] +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48] +Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 -(73) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#51, ca_county#52] +(72) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#50, ca_county#51] -(74) Sort [codegen id : 26] -Input [2]: [ca_address_sk#51, ca_county#52] -Arguments: [ca_address_sk#51 ASC NULLS FIRST], false, 0 +(73) Sort [codegen id : 25] +Input [2]: [ca_address_sk#50, ca_county#51] +Arguments: [ca_address_sk#50 ASC NULLS FIRST], false, 0 -(75) SortMergeJoin [codegen id : 27] -Left keys [1]: [ss_addr_sk#48] -Right keys [1]: [ca_address_sk#51] +(74) SortMergeJoin [codegen id : 26] +Left keys [1]: [ws_bill_addr_sk#44] +Right keys [1]: [ca_address_sk#50] Join condition: None -(76) Project [codegen id : 27] -Output [4]: [ss_ext_sales_price#49, d_year#45, d_qoy#46, ca_county#52] -Input [6]: [d_year#45, d_qoy#46, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#51, ca_county#52] - -(77) HashAggregate [codegen id : 27] -Input [4]: [ss_ext_sales_price#49, d_year#45, d_qoy#46, ca_county#52] -Keys [3]: [ca_county#52, d_qoy#46, d_year#45] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum#53] -Results [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] - -(78) Exchange -Input [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] -Arguments: hashpartitioning(ca_county#52, d_qoy#46, d_year#45, 5), true, [id=#55] - -(79) HashAggregate -Input [4]: [ca_county#52, d_qoy#46, d_year#45, sum#54] -Keys [3]: [ca_county#52, d_qoy#46, d_year#45] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#56] -Results [2]: [ca_county#52, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#56,17,2) AS store_sales#57] - -(80) ReusedExchange [Reuses operator id: 46] -Output [3]: [d_date_sk#58, d_year#59, d_qoy#60] - -(81) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(75) Project [codegen id : 26] +Output [4]: [ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_county#51] +Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_address_sk#50, ca_county#51] + +(76) HashAggregate [codegen id : 26] +Input [4]: [ws_ext_sales_price#45, d_year#47, d_qoy#48, ca_county#51] +Keys [3]: [ca_county#51, d_qoy#48, d_year#47] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum#52] +Results [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] + +(77) Exchange +Input [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] +Arguments: hashpartitioning(ca_county#51, d_qoy#48, d_year#47, 5), true, [id=#54] + +(78) HashAggregate [codegen id : 41] +Input [4]: [ca_county#51, d_qoy#48, d_year#47, sum#53] +Keys [3]: [ca_county#51, d_qoy#48, d_year#47] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#55] +Results [2]: [ca_county#51, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#55,17,2) AS web_sales#56] + +(79) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(80) ColumnarToRow [codegen id : 28] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -(82) ColumnarToRow -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(81) Filter [codegen id : 28] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) -(83) Filter -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) +(82) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#57, d_year#58, d_qoy#59] -(84) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [d_date_sk#58] -Right keys [1]: [ss_sold_date_sk#47] +(83) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#43] +Right keys [1]: [d_date_sk#57] Join condition: None -(85) Project [codegen id : 29] -Output [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] -Input [6]: [d_date_sk#58, d_year#59, d_qoy#60, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(84) Project [codegen id : 28] +Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] +Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#57, d_year#58, d_qoy#59] -(86) Exchange -Input [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#61] +(85) Exchange +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] +Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#60] -(87) Sort [codegen id : 30] -Input [4]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 +(86) Sort [codegen id : 29] +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59] +Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 -(88) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#62, ca_county#63] +(87) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#61, ca_county#62] -(89) Sort [codegen id : 32] -Input [2]: [ca_address_sk#62, ca_county#63] -Arguments: [ca_address_sk#62 ASC NULLS FIRST], false, 0 +(88) Sort [codegen id : 31] +Input [2]: [ca_address_sk#61, ca_county#62] +Arguments: [ca_address_sk#61 ASC NULLS FIRST], false, 0 -(90) SortMergeJoin [codegen id : 33] -Left keys [1]: [ss_addr_sk#48] -Right keys [1]: [ca_address_sk#62] +(89) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_addr_sk#44] +Right keys [1]: [ca_address_sk#61] Join condition: None -(91) Project [codegen id : 33] -Output [4]: [ss_ext_sales_price#49, d_year#59, d_qoy#60, ca_county#63] -Input [6]: [d_year#59, d_qoy#60, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#62, ca_county#63] - -(92) HashAggregate [codegen id : 33] -Input [4]: [ss_ext_sales_price#49, d_year#59, d_qoy#60, ca_county#63] -Keys [3]: [ca_county#63, d_qoy#60, d_year#59] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum#64] -Results [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] - -(93) Exchange -Input [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] -Arguments: hashpartitioning(ca_county#63, d_qoy#60, d_year#59, 5), true, [id=#66] - -(94) HashAggregate [codegen id : 34] -Input [4]: [ca_county#63, d_qoy#60, d_year#59, sum#65] -Keys [3]: [ca_county#63, d_qoy#60, d_year#59] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#67] -Results [2]: [ca_county#63, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#67,17,2) AS store_sales#68] - -(95) BroadcastExchange -Input [2]: [ca_county#63, store_sales#68] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#69] - -(96) BroadcastHashJoin -Left keys [1]: [ca_county#52] -Right keys [1]: [ca_county#63] +(90) Project [codegen id : 32] +Output [4]: [ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_county#62] +Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_address_sk#61, ca_county#62] + +(91) HashAggregate [codegen id : 32] +Input [4]: [ws_ext_sales_price#45, d_year#58, d_qoy#59, ca_county#62] +Keys [3]: [ca_county#62, d_qoy#59, d_year#58] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum#63] +Results [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] + +(92) Exchange +Input [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] +Arguments: hashpartitioning(ca_county#62, d_qoy#59, d_year#58, 5), true, [id=#65] + +(93) HashAggregate [codegen id : 33] +Input [4]: [ca_county#62, d_qoy#59, d_year#58, sum#64] +Keys [3]: [ca_county#62, d_qoy#59, d_year#58] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#66] +Results [2]: [ca_county#62, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#66,17,2) AS web_sales#67] + +(94) BroadcastExchange +Input [2]: [ca_county#62, web_sales#67] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#68] + +(95) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ca_county#51] +Right keys [1]: [ca_county#62] Join condition: None -(97) Project -Output [3]: [ca_county#52, store_sales#57, store_sales#68] -Input [4]: [ca_county#52, store_sales#57, ca_county#63, store_sales#68] +(96) Project [codegen id : 41] +Output [3]: [ca_county#51, web_sales#56, web_sales#67] +Input [4]: [ca_county#51, web_sales#56, ca_county#62, web_sales#67] -(98) ReusedExchange [Reuses operator id: 25] -Output [3]: [d_date_sk#70, d_year#71, d_qoy#72] - -(99) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(97) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(98) ColumnarToRow [codegen id : 35] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] -(100) ColumnarToRow -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(99) Filter [codegen id : 35] +Input [3]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45] +Condition : (isnotnull(ws_sold_date_sk#43) AND isnotnull(ws_bill_addr_sk#44)) -(101) Filter -Input [3]: [ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] -Condition : (isnotnull(ss_sold_date_sk#47) AND isnotnull(ss_addr_sk#48)) +(100) ReusedExchange [Reuses operator id: 28] +Output [3]: [d_date_sk#69, d_year#70, d_qoy#71] -(102) BroadcastHashJoin [codegen id : 36] -Left keys [1]: [d_date_sk#70] -Right keys [1]: [ss_sold_date_sk#47] +(101) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ws_sold_date_sk#43] +Right keys [1]: [d_date_sk#69] Join condition: None -(103) Project [codegen id : 36] -Output [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] -Input [6]: [d_date_sk#70, d_year#71, d_qoy#72, ss_sold_date_sk#47, ss_addr_sk#48, ss_ext_sales_price#49] +(102) Project [codegen id : 35] +Output [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] +Input [6]: [ws_sold_date_sk#43, ws_bill_addr_sk#44, ws_ext_sales_price#45, d_date_sk#69, d_year#70, d_qoy#71] -(104) Exchange -Input [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: hashpartitioning(ss_addr_sk#48, 5), true, [id=#73] +(103) Exchange +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] +Arguments: hashpartitioning(ws_bill_addr_sk#44, 5), true, [id=#72] -(105) Sort [codegen id : 37] -Input [4]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49] -Arguments: [ss_addr_sk#48 ASC NULLS FIRST], false, 0 +(104) Sort [codegen id : 36] +Input [4]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71] +Arguments: [ws_bill_addr_sk#44 ASC NULLS FIRST], false, 0 -(106) ReusedExchange [Reuses operator id: 15] -Output [2]: [ca_address_sk#74, ca_county#75] +(105) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#73, ca_county#74] -(107) Sort [codegen id : 39] -Input [2]: [ca_address_sk#74, ca_county#75] -Arguments: [ca_address_sk#74 ASC NULLS FIRST], false, 0 +(106) Sort [codegen id : 38] +Input [2]: [ca_address_sk#73, ca_county#74] +Arguments: [ca_address_sk#73 ASC NULLS FIRST], false, 0 -(108) SortMergeJoin [codegen id : 40] -Left keys [1]: [ss_addr_sk#48] -Right keys [1]: [ca_address_sk#74] +(107) SortMergeJoin [codegen id : 39] +Left keys [1]: [ws_bill_addr_sk#44] +Right keys [1]: [ca_address_sk#73] Join condition: None -(109) Project [codegen id : 40] -Output [4]: [ss_ext_sales_price#49, d_year#71, d_qoy#72, ca_county#75] -Input [6]: [d_year#71, d_qoy#72, ss_addr_sk#48, ss_ext_sales_price#49, ca_address_sk#74, ca_county#75] - -(110) HashAggregate [codegen id : 40] -Input [4]: [ss_ext_sales_price#49, d_year#71, d_qoy#72, ca_county#75] -Keys [3]: [ca_county#75, d_qoy#72, d_year#71] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum#76] -Results [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] - -(111) Exchange -Input [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] -Arguments: hashpartitioning(ca_county#75, d_qoy#72, d_year#71, 5), true, [id=#78] - -(112) HashAggregate [codegen id : 41] -Input [4]: [ca_county#75, d_qoy#72, d_year#71, sum#77] -Keys [3]: [ca_county#75, d_qoy#72, d_year#71] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#49))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#49))#79] -Results [3]: [ca_county#75, d_year#71, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#49))#79,17,2) AS store_sales#80] - -(113) BroadcastExchange -Input [3]: [ca_county#75, d_year#71, store_sales#80] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#81] - -(114) BroadcastHashJoin -Left keys [1]: [ca_county#52] -Right keys [1]: [ca_county#75] +(108) Project [codegen id : 39] +Output [4]: [ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_county#74] +Input [6]: [ws_bill_addr_sk#44, ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_address_sk#73, ca_county#74] + +(109) HashAggregate [codegen id : 39] +Input [4]: [ws_ext_sales_price#45, d_year#70, d_qoy#71, ca_county#74] +Keys [3]: [ca_county#74, d_qoy#71, d_year#70] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum#75] +Results [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] + +(110) Exchange +Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] +Arguments: hashpartitioning(ca_county#74, d_qoy#71, d_year#70, 5), true, [id=#77] + +(111) HashAggregate [codegen id : 40] +Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] +Keys [3]: [ca_county#74, d_qoy#71, d_year#70] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#45))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#45))#78] +Results [2]: [ca_county#74, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#45))#78,17,2) AS web_sales#79] + +(112) BroadcastExchange +Input [2]: [ca_county#74, web_sales#79] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#80] + +(113) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ca_county#51] +Right keys [1]: [ca_county#74] Join condition: None -(115) Project -Output [5]: [store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] -Input [6]: [ca_county#52, store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] +(114) Project [codegen id : 41] +Output [4]: [ca_county#51, web_sales#56, web_sales#67, web_sales#79] +Input [5]: [ca_county#51, web_sales#56, web_sales#67, ca_county#74, web_sales#79] + +(115) BroadcastExchange +Input [4]: [ca_county#51, web_sales#56, web_sales#67, web_sales#79] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#81] (116) BroadcastHashJoin [codegen id : 42] -Left keys [1]: [ca_county#23] -Right keys [1]: [ca_county#75] -Join condition: ((CASE WHEN (web_sales#28 > 0.00) THEN CheckOverflow((promote_precision(web_sales#16) / promote_precision(web_sales#28)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#80 > 0.00) THEN CheckOverflow((promote_precision(store_sales#57) / promote_precision(store_sales#80)), DecimalType(37,20), true) ELSE null END) AND (CASE WHEN (web_sales#16 > 0.00) THEN CheckOverflow((promote_precision(web_sales#41) / promote_precision(web_sales#16)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#57 > 0.00) THEN CheckOverflow((promote_precision(store_sales#68) / promote_precision(store_sales#57)), DecimalType(37,20), true) ELSE null END)) +Left keys [1]: [ca_county#36] +Right keys [1]: [ca_county#51] +Join condition: ((CASE WHEN (web_sales#56 > 0.00) THEN CheckOverflow((promote_precision(web_sales#67) / promote_precision(web_sales#56)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#41 > 0.00) THEN CheckOverflow((promote_precision(store_sales#16) / promote_precision(store_sales#41)), DecimalType(37,20), true) ELSE null END) AND (CASE WHEN (web_sales#67 > 0.00) THEN CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#67)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#16 > 0.00) THEN CheckOverflow((promote_precision(store_sales#28) / promote_precision(store_sales#16)), DecimalType(37,20), true) ELSE null END)) (117) Project [codegen id : 42] -Output [6]: [ca_county#75, d_year#71, CheckOverflow((promote_precision(web_sales#16) / promote_precision(web_sales#28)), DecimalType(37,20), true) AS web_q1_q2_increase#82, CheckOverflow((promote_precision(store_sales#57) / promote_precision(store_sales#80)), DecimalType(37,20), true) AS store_q1_q2_increase#83, CheckOverflow((promote_precision(web_sales#41) / promote_precision(web_sales#16)), DecimalType(37,20), true) AS web_q2_q3_increase#84, CheckOverflow((promote_precision(store_sales#68) / promote_precision(store_sales#57)), DecimalType(37,20), true) AS store_q2_q3_increase#85] -Input [9]: [web_sales#16, ca_county#23, web_sales#28, web_sales#41, store_sales#57, store_sales#68, ca_county#75, d_year#71, store_sales#80] +Output [6]: [ca_county#36, d_year#31, CheckOverflow((promote_precision(web_sales#67) / promote_precision(web_sales#56)), DecimalType(37,20), true) AS web_q1_q2_increase#82, CheckOverflow((promote_precision(store_sales#16) / promote_precision(store_sales#41)), DecimalType(37,20), true) AS store_q1_q2_increase#83, CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#67)), DecimalType(37,20), true) AS web_q2_q3_increase#84, CheckOverflow((promote_precision(store_sales#28) / promote_precision(store_sales#16)), DecimalType(37,20), true) AS store_q2_q3_increase#85] +Input [9]: [store_sales#16, store_sales#28, ca_county#36, d_year#31, store_sales#41, ca_county#51, web_sales#56, web_sales#67, web_sales#79] (118) Exchange -Input [6]: [ca_county#75, d_year#71, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] -Arguments: rangepartitioning(ca_county#75 ASC NULLS FIRST, 5), true, [id=#86] +Input [6]: [ca_county#36, d_year#31, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] +Arguments: rangepartitioning(ca_county#36 ASC NULLS FIRST, 5), true, [id=#86] (119) Sort [codegen id : 43] -Input [6]: [ca_county#75, d_year#71, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] -Arguments: [ca_county#75 ASC NULLS FIRST], true, 0 +Input [6]: [ca_county#36, d_year#31, web_q1_q2_increase#82, store_q1_q2_increase#83, web_q2_q3_increase#84, store_q2_q3_increase#85] +Arguments: [ca_county#36 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt index a6c9b3d2e8f74..c7b69500ed8a6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt @@ -5,26 +5,134 @@ WholeStageCodegen (43) WholeStageCodegen (42) Project [ca_county,d_year,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] BroadcastHashJoin [ca_county,ca_county,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] + Project [store_sales,store_sales,ca_county,d_year,store_sales] + BroadcastHashJoin [ca_county,ca_county] + Project [ca_county,store_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county] + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #2 + WholeStageCodegen (6) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #3 + WholeStageCodegen (2) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (5) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_county] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (13) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #7 + WholeStageCodegen (12) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #8 + WholeStageCodegen (8) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (11) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (20) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #11 + WholeStageCodegen (19) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (16) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #12 + WholeStageCodegen (15) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (14) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (18) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 InputAdapter - BroadcastExchange #2 - WholeStageCodegen (21) - Project [web_sales,ca_county,web_sales,web_sales] + BroadcastExchange #14 + WholeStageCodegen (41) + Project [ca_county,web_sales,web_sales,web_sales] BroadcastHashJoin [ca_county,ca_county] - Project [web_sales,ca_county,web_sales] + Project [ca_county,web_sales,web_sales] BroadcastHashJoin [ca_county,ca_county] HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #3 - WholeStageCodegen (6) + Exchange [ca_county,d_qoy,d_year] #15 + WholeStageCodegen (26) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (3) + WholeStageCodegen (23) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #4 - WholeStageCodegen (2) + Exchange [ws_bill_addr_sk] #16 + WholeStageCodegen (22) Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk] @@ -32,175 +140,67 @@ WholeStageCodegen (43) InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + ReusedExchange [d_date_sk,d_year,d_qoy] #13 InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (25) Sort [ca_address_sk] InputAdapter - Exchange [ca_address_sk] #6 - WholeStageCodegen (4) - Filter [ca_address_sk,ca_county] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + ReusedExchange [ca_address_sk,ca_county] #5 InputAdapter - BroadcastExchange #7 - WholeStageCodegen (13) + BroadcastExchange #17 + WholeStageCodegen (33) HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #8 - WholeStageCodegen (12) + Exchange [ca_county,d_qoy,d_year] #18 + WholeStageCodegen (32) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (9) + WholeStageCodegen (29) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #9 - WholeStageCodegen (8) - Project [d_year,d_qoy,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (7) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Exchange [ws_bill_addr_sk] #19 + WholeStageCodegen (28) + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #4 InputAdapter - WholeStageCodegen (11) + WholeStageCodegen (31) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_county] #6 + ReusedExchange [ca_address_sk,ca_county] #5 InputAdapter - BroadcastExchange #11 - WholeStageCodegen (20) + BroadcastExchange #20 + WholeStageCodegen (40) HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] InputAdapter - Exchange [ca_county,d_qoy,d_year] #12 - WholeStageCodegen (19) + Exchange [ca_county,d_qoy,d_year] #21 + WholeStageCodegen (39) HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,d_year,d_qoy,ca_county] SortMergeJoin [ws_bill_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (16) + WholeStageCodegen (36) Sort [ws_bill_addr_sk] InputAdapter - Exchange [ws_bill_addr_sk] #13 - WholeStageCodegen (15) - Project [d_year,d_qoy,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - BroadcastExchange #14 - WholeStageCodegen (14) - Filter [d_qoy,d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Exchange [ws_bill_addr_sk] #22 + WholeStageCodegen (35) + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_addr_sk,ws_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #9 InputAdapter - WholeStageCodegen (18) + WholeStageCodegen (38) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_county] #6 - Project [store_sales,store_sales,ca_county,d_year,store_sales] - BroadcastHashJoin [ca_county,ca_county] - Project [ca_county,store_sales,store_sales] - BroadcastHashJoin [ca_county,ca_county] - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #15 - WholeStageCodegen (27) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (24) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #16 - WholeStageCodegen (23) - Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #5 - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - WholeStageCodegen (26) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_county] #6 - InputAdapter - BroadcastExchange #17 - WholeStageCodegen (34) - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #18 - WholeStageCodegen (33) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (30) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #19 - WholeStageCodegen (29) - Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #14 - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - WholeStageCodegen (32) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_county] #6 - InputAdapter - BroadcastExchange #20 - WholeStageCodegen (41) - HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] - InputAdapter - Exchange [ca_county,d_qoy,d_year] #21 - WholeStageCodegen (40) - HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] - Project [ss_ext_sales_price,d_year,d_qoy,ca_county] - SortMergeJoin [ss_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (37) - Sort [ss_addr_sk] - InputAdapter - Exchange [ss_addr_sk] #22 - WholeStageCodegen (36) - Project [d_year,d_qoy,ss_addr_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #10 - Filter [ss_sold_date_sk,ss_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_addr_sk,ss_ext_sales_price] - InputAdapter - WholeStageCodegen (39) - Sort [ca_address_sk] - InputAdapter - ReusedExchange [ca_address_sk,ca_county] #6 + ReusedExchange [ca_address_sk,ca_county] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt index 944b4e7d1f0eb..7affdeabd6f7f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt @@ -6,168 +6,168 @@ CollectLimit (31) : +- * BroadcastHashJoin Inner BuildLeft (26) : :- BroadcastExchange (22) : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildRight (20) - : : :- * Filter (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- BroadcastExchange (19) - : : +- * Project (18) - : : +- * Filter (17) - : : +- * ColumnarToRow (16) - : : +- Scan parquet default.item (15) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (19) + : : +- * HashAggregate (18) + : : +- Exchange (17) + : : +- * HashAggregate (16) + : : +- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) : +- * Filter (25) : +- * ColumnarToRow (24) : +- Scan parquet default.catalog_sales (23) +- ReusedExchange (28) -(1) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +(1) Scan parquet default.item +Output [2]: [i_item_sk#1, i_manufact_id#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(3) Filter [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] +Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 977)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [i_item_sk#1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(5) BroadcastExchange +Input [1]: [i_item_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] -(3) Filter [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] -Condition : (isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#2)) +(8) Filter [codegen id : 3] +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +Condition : (isnotnull(cs_sold_date_sk#4) AND isnotnull(cs_item_sk#5)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] +(9) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_date#8] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(10) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#7, d_date#8] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10983)) AND (d_date#5 <= 11073)) AND isnotnull(d_date_sk#4)) +(11) Filter [codegen id : 2] +Input [2]: [d_date_sk#7, d_date#8] +Condition : (((isnotnull(d_date#8) AND (d_date#8 >= 10983)) AND (d_date#8 <= 11073)) AND isnotnull(d_date_sk#7)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_date#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(13) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#4] +Right keys [1]: [d_date_sk#7] Join condition: None -(10) Project [codegen id : 2] -Output [2]: [cs_item_sk#2, cs_ext_discount_amt#3] -Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3, d_date_sk#4] - -(11) HashAggregate [codegen id : 2] -Input [2]: [cs_item_sk#2, cs_ext_discount_amt#3] -Keys [1]: [cs_item_sk#2] -Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#3))] -Aggregate Attributes [2]: [sum#7, count#8] -Results [3]: [cs_item_sk#2, sum#9, count#10] - -(12) Exchange -Input [3]: [cs_item_sk#2, sum#9, count#10] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#11] - -(13) HashAggregate [codegen id : 4] -Input [3]: [cs_item_sk#2, sum#9, count#10] -Keys [1]: [cs_item_sk#2] -Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#3))] -Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#3))#12] -Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#3))#12 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2 AS cs_item_sk#2#14] - -(14) Filter [codegen id : 4] -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2#14] -Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13) - -(15) Scan parquet default.item -Output [2]: [i_item_sk#15, i_manufact_id#16] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] -ReadSchema: struct +(15) Project [codegen id : 3] +Output [2]: [cs_item_sk#5, cs_ext_discount_amt#6] +Input [4]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6, d_date_sk#7] -(16) ColumnarToRow [codegen id : 3] -Input [2]: [i_item_sk#15, i_manufact_id#16] +(16) HashAggregate [codegen id : 3] +Input [2]: [cs_item_sk#5, cs_ext_discount_amt#6] +Keys [1]: [cs_item_sk#5] +Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#6))] +Aggregate Attributes [2]: [sum#10, count#11] +Results [3]: [cs_item_sk#5, sum#12, count#13] -(17) Filter [codegen id : 3] -Input [2]: [i_item_sk#15, i_manufact_id#16] -Condition : ((isnotnull(i_manufact_id#16) AND (i_manufact_id#16 = 977)) AND isnotnull(i_item_sk#15)) +(17) Exchange +Input [3]: [cs_item_sk#5, sum#12, count#13] +Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#14] -(18) Project [codegen id : 3] -Output [1]: [i_item_sk#15] -Input [2]: [i_item_sk#15, i_manufact_id#16] +(18) HashAggregate +Input [3]: [cs_item_sk#5, sum#12, count#13] +Keys [1]: [cs_item_sk#5] +Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#6))] +Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#6))#15] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#6))#15 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5 AS cs_item_sk#5#17] -(19) BroadcastExchange -Input [1]: [i_item_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +(19) Filter +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5#17] +Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16) (20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_item_sk#2#14] -Right keys [1]: [i_item_sk#15] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#5#17] Join condition: None (21) Project [codegen id : 4] -Output [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] -Input [3]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, cs_item_sk#2#14, i_item_sk#15] +Output [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16] +Input [3]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_item_sk#5#17] (22) BroadcastExchange -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#18] +Input [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] (23) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_ext_discount_amt), IsNotNull(cs_sold_date_sk)] ReadSchema: struct (24) ColumnarToRow -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] (25) Filter -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] -Condition : ((isnotnull(cs_item_sk#2) AND isnotnull(cs_ext_discount_amt#3)) AND isnotnull(cs_sold_date_sk#1)) +Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] +Condition : ((isnotnull(cs_item_sk#5) AND isnotnull(cs_ext_discount_amt#6)) AND isnotnull(cs_sold_date_sk#4)) (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [i_item_sk#15] -Right keys [1]: [cs_item_sk#2] -Join condition: (cast(cs_ext_discount_amt#3 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13) +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#5] +Join condition: (cast(cs_ext_discount_amt#6 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16) (27) Project [codegen id : 6] -Output [1]: [cs_sold_date_sk#1] -Input [5]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15, cs_sold_date_sk#1, cs_item_sk#2, cs_ext_discount_amt#3] +Output [1]: [cs_sold_date_sk#4] +Input [5]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))#16, cs_sold_date_sk#4, cs_item_sk#5, cs_ext_discount_amt#6] -(28) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#4] +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] (29) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [cs_sold_date_sk#4] +Right keys [1]: [d_date_sk#7] Join condition: None (30) Project [codegen id : 6] Output [1]: [1 AS excess discount amount #19] -Input [2]: [cs_sold_date_sk#1, d_date_sk#4] +Input [2]: [cs_sold_date_sk#4, d_date_sk#7] (31) CollectLimit Input [1]: [excess discount amount #19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt index 5ad4046dc24fc..03fa18228b7c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt @@ -7,13 +7,21 @@ CollectLimit InputAdapter BroadcastExchange #1 WholeStageCodegen (4) - Project [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6))),i_item_sk] - BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [i_item_sk,(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))] + BroadcastHashJoin [i_item_sk,cs_item_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] Filter [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6)))] HashAggregate [cs_item_sk,sum,count] [avg(UnscaledValue(cs_ext_discount_amt)),(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(cs_ext_discount_amt) AS DECIMAL(11,6))),cs_item_sk,sum,count] InputAdapter - Exchange [cs_item_sk] #2 - WholeStageCodegen (2) + Exchange [cs_item_sk] #3 + WholeStageCodegen (3) HashAggregate [cs_item_sk,cs_ext_discount_amt] [sum,count,sum,count] Project [cs_item_sk,cs_ext_discount_amt] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -22,24 +30,16 @@ CollectLimit InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_discount_amt] InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) + BroadcastExchange #4 + WholeStageCodegen (2) Project [d_date_sk] Filter [d_date,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (3) - Project [i_item_sk] - Filter [i_manufact_id,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_manufact_id] Filter [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_discount_amt] InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [d_date_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt index c1f82167a806c..8185680b58670 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (67) : :- * Project (22) : : +- * BroadcastHashJoin Inner BuildRight (21) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (20) : : +- * BroadcastHashJoin LeftSemi BuildRight (19) : : :- * Filter (13) @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildLeft (37) - : : : :- ReusedExchange (33) - : : : +- * Filter (36) - : : : +- * ColumnarToRow (35) - : : : +- Scan parquet default.catalog_sales (34) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,59 +59,59 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildLeft (52) - : : :- ReusedExchange (48) - : : +- * Filter (51) - : : +- * ColumnarToRow (50) - : : +- Scan parquet default.web_sales (49) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) : +- ReusedExchange (54) +- ReusedExchange (57) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 1998)) AND (d_moy#3 = 5)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 5] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 1998)) AND (d_moy#7 = 5)) AND isnotnull(d_date_sk#5)) -(7) ColumnarToRow -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(8) Filter -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] -Condition : ((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_addr_sk#7)) AND isnotnull(ss_item_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (10) Project [codegen id : 5] -Output [3]: [ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] -Input [5]: [d_date_sk#1, ss_sold_date_sk#5, ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8] +Output [3]: [ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4, d_date_sk#5] (11) Scan parquet default.item Output [2]: [i_item_sk#9, i_manufact_id#10] @@ -159,13 +159,13 @@ Input [2]: [i_item_sk#9, i_manufact_id#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#6] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#9] Join condition: None (22) Project [codegen id : 5] -Output [3]: [ss_addr_sk#7, ss_ext_sales_price#8, i_manufact_id#10] -Input [5]: [ss_item_sk#6, ss_addr_sk#7, ss_ext_sales_price#8, i_item_sk#9, i_manufact_id#10] +Output [3]: [ss_addr_sk#3, ss_ext_sales_price#4, i_manufact_id#10] +Input [5]: [ss_item_sk#2, ss_addr_sk#3, ss_ext_sales_price#4, i_item_sk#9, i_manufact_id#10] (23) Scan parquet default.customer_address Output [2]: [ca_address_sk#15, ca_gmt_offset#16] @@ -190,18 +190,18 @@ Input [1]: [ca_address_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_addr_sk#7] +Left keys [1]: [ss_addr_sk#3] Right keys [1]: [ca_address_sk#15] Join condition: None (29) Project [codegen id : 5] -Output [2]: [ss_ext_sales_price#8, i_manufact_id#10] -Input [4]: [ss_addr_sk#7, ss_ext_sales_price#8, i_manufact_id#10, ca_address_sk#15] +Output [2]: [ss_ext_sales_price#4, i_manufact_id#10] +Input [4]: [ss_addr_sk#3, ss_ext_sales_price#4, i_manufact_id#10, ca_address_sk#15] (30) HashAggregate [codegen id : 5] -Input [2]: [ss_ext_sales_price#8, i_manufact_id#10] +Input [2]: [ss_ext_sales_price#4, i_manufact_id#10] Keys [1]: [i_manufact_id#10] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [1]: [sum#18] Results [2]: [i_manufact_id#10, sum#19] @@ -212,35 +212,35 @@ Arguments: hashpartitioning(i_manufact_id#10, 5), true, [id=#20] (32) HashAggregate [codegen id : 6] Input [2]: [i_manufact_id#10, sum#19] Keys [1]: [i_manufact_id#10] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#21] -Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#21,17,2) AS total_sales#22] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] +Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] -(33) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(34) Scan parquet default.catalog_sales +(33) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(35) ColumnarToRow +(34) ColumnarToRow [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(36) Filter +(35) Filter [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#23] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#5] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [d_date_sk#1, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] (39) ReusedExchange [Reuses operator id: 20] Output [2]: [i_item_sk#9, i_manufact_id#10] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(49) Scan parquet default.web_sales +(48) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(50) ColumnarToRow +(49) ColumnarToRow [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(51) Filter +(50) Filter [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#32] +Left keys [1]: [ws_sold_date_sk#32] +Right keys [1]: [d_date_sk#5] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [d_date_sk#1, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] +Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] (54) ReusedExchange [Reuses operator id: 20] Output [2]: [i_item_sk#9, i_manufact_id#10] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt index 1a3bea00f7f84..410def2466e1a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt @@ -18,7 +18,11 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [ss_addr_sk,ss_ext_sales_price,i_manufact_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -27,10 +31,6 @@ TakeOrderedAndProject [total_sales,i_manufact_id] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [ss_sold_date_sk,ss_addr_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (3) @@ -66,13 +66,13 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [cs_bill_addr_sk,cs_ext_sales_price,i_manufact_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_manufact_id] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [total_sales,i_manufact_id] Project [ws_bill_addr_sk,ws_ext_sales_price,i_manufact_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_manufact_id] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt index 3bdcad4b34967..01f6c35a2178d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt @@ -9,51 +9,51 @@ TakeOrderedAndProject (60) : +- Exchange (48) : +- * Project (47) : +- * SortMergeJoin Inner (46) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) + : :- * Sort (40) + : : +- Exchange (39) + : : +- * Project (38) + : : +- * Filter (37) + : : +- SortMergeJoin ExistenceJoin(exists#1) (36) + : : :- SortMergeJoin ExistenceJoin(exists#2) (27) + : : : :- SortMergeJoin LeftSemi (18) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (17) + : : : : +- Exchange (16) + : : : : +- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.catalog_sales (28) + : : +- ReusedExchange (31) : +- * Sort (45) : +- Exchange (44) - : +- * Project (43) - : +- * Filter (42) - : +- SortMergeJoin ExistenceJoin(exists#1) (41) - : :- SortMergeJoin ExistenceJoin(exists#2) (32) - : : :- SortMergeJoin LeftSemi (23) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.customer (6) - : : : +- * Sort (22) - : : : +- Exchange (21) - : : : +- * Project (20) - : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : :- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store_sales (11) - : : : +- BroadcastExchange (18) - : : : +- * Project (17) - : : : +- * Filter (16) - : : : +- * ColumnarToRow (15) - : : : +- Scan parquet default.date_dim (14) - : : +- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_sales (24) - : : +- ReusedExchange (27) - : +- * Sort (40) - : +- Exchange (39) - : +- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.catalog_sales (33) - : +- ReusedExchange (36) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.customer_address (41) +- * Sort (54) +- Exchange (53) +- * Filter (52) @@ -61,218 +61,218 @@ TakeOrderedAndProject (60) +- Scan parquet default.customer_demographics (50) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#3, ca_state#4] +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_state#4] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] (3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_state#4] -Condition : isnotnull(ca_address_sk#3) +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) (4) Exchange -Input [2]: [ca_address_sk#3, ca_state#4] -Arguments: hashpartitioning(ca_address_sk#3, 5), true, [id=#5] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] (5) Sort [codegen id : 2] -Input [2]: [ca_address_sk#3, ca_state#4] -Arguments: [ca_address_sk#3 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.customer -Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] -ReadSchema: struct - -(7) ColumnarToRow [codegen id : 3] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] - -(8) Filter [codegen id : 3] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) - -(9) Exchange -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 -(10) Sort [codegen id : 4] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 - -(11) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(6) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -(13) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -Condition : isnotnull(ss_sold_date_sk#10) +(8) Filter [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +Condition : isnotnull(ss_sold_date_sk#7) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -(16) Filter [codegen id : 5] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -Condition : ((((isnotnull(d_year#13) AND isnotnull(d_qoy#14)) AND (d_year#13 = 2002)) AND (d_qoy#14 < 4)) AND isnotnull(d_date_sk#12)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) -(17) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -(18) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(13) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(19) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#10] -Right keys [1]: [d_date_sk#12] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] Join condition: None -(20) Project [codegen id : 6] -Output [1]: [ss_customer_sk#11] -Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] +(15) Project [codegen id : 4] +Output [1]: [ss_customer_sk#8] +Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] -(21) Exchange -Input [1]: [ss_customer_sk#11] -Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] +(16) Exchange +Input [1]: [ss_customer_sk#8] +Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] -(22) Sort [codegen id : 7] -Input [1]: [ss_customer_sk#11] -Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#8] +Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 -(23) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ss_customer_sk#11] +(18) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#8] Join condition: None -(24) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(19) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 9] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -(26) Filter [codegen id : 9] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -Condition : isnotnull(ws_sold_date_sk#17) +(21) Filter [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +Condition : isnotnull(ws_sold_date_sk#14) -(27) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(28) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ws_sold_date_sk#17] -Right keys [1]: [d_date_sk#12] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#9] Join condition: None -(29) Project [codegen id : 9] -Output [1]: [ws_bill_customer_sk#18] -Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] -(30) Exchange -Input [1]: [ws_bill_customer_sk#18] -Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] +(25) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] -(31) Sort [codegen id : 10] -Input [1]: [ws_bill_customer_sk#18] -Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 8] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 -(32) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ws_bill_customer_sk#18] +(27) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] Join condition: None -(33) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(28) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 12] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(29) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -(35) Filter [codegen id : 12] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -Condition : isnotnull(cs_sold_date_sk#20) +(30) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +Condition : isnotnull(cs_sold_date_sk#17) -(36) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(31) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(37) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cs_sold_date_sk#20] -Right keys [1]: [d_date_sk#12] +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#9] Join condition: None +(33) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] + +(34) Exchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] + +(35) Sort [codegen id : 11] +Input [1]: [cs_ship_customer_sk#18] +Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] +Join condition: None + +(37) Filter [codegen id : 12] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + (38) Project [codegen id : 12] -Output [1]: [cs_ship_customer_sk#21] -Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] (39) Exchange -Input [1]: [cs_ship_customer_sk#21] -Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#20] (40) Sort [codegen id : 13] -Input [1]: [cs_ship_customer_sk#21] -Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [cs_ship_customer_sk#21] -Join condition: None +(41) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_state#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(42) Filter [codegen id : 14] -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] -Condition : (exists#2 OR exists#1) +(42) ColumnarToRow [codegen id : 14] +Input [2]: [ca_address_sk#21, ca_state#22] -(43) Project [codegen id : 14] -Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +(43) Filter [codegen id : 14] +Input [2]: [ca_address_sk#21, ca_state#22] +Condition : isnotnull(ca_address_sk#21) (44) Exchange -Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: hashpartitioning(c_current_addr_sk#8, 5), true, [id=#23] +Input [2]: [ca_address_sk#21, ca_state#22] +Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] (45) Sort [codegen id : 15] -Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: [c_current_addr_sk#8 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#21, ca_state#22] +Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 (46) SortMergeJoin [codegen id : 16] -Left keys [1]: [ca_address_sk#3] -Right keys [1]: [c_current_addr_sk#8] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#21] Join condition: None (47) Project [codegen id : 16] -Output [2]: [ca_state#4, c_current_cdemo_sk#7] -Input [4]: [ca_address_sk#3, ca_state#4, c_current_cdemo_sk#7, c_current_addr_sk#8] +Output [2]: [c_current_cdemo_sk#4, ca_state#22] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#21, ca_state#22] (48) Exchange -Input [2]: [ca_state#4, c_current_cdemo_sk#7] -Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#24] +Input [2]: [c_current_cdemo_sk#4, ca_state#22] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#24] (49) Sort [codegen id : 17] -Input [2]: [ca_state#4, c_current_cdemo_sk#7] -Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#4, ca_state#22] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 (50) Scan parquet default.customer_demographics Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] @@ -297,33 +297,33 @@ Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, Arguments: [cd_demo_sk#25 ASC NULLS FIRST], false, 0 (55) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_current_cdemo_sk#7] +Left keys [1]: [c_current_cdemo_sk#4] Right keys [1]: [cd_demo_sk#25] Join condition: None (56) Project [codegen id : 20] -Output [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Input [8]: [ca_state#4, c_current_cdemo_sk#7, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [c_current_cdemo_sk#4, ca_state#22, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (57) HashAggregate [codegen id : 20] -Input [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [partial_count(1), partial_min(cd_dep_count#28), partial_max(cd_dep_count#28), partial_avg(cast(cd_dep_count#28 as bigint)), partial_min(cd_dep_employed_count#29), partial_max(cd_dep_employed_count#29), partial_avg(cast(cd_dep_employed_count#29 as bigint)), partial_min(cd_dep_college_count#30), partial_max(cd_dep_college_count#30), partial_avg(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [13]: [count#32, min#33, max#34, sum#35, count#36, min#37, max#38, sum#39, count#40, min#41, max#42, sum#43, count#44] -Results [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Results [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] (58) Exchange -Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] -Arguments: hashpartitioning(ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] +Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Arguments: hashpartitioning(ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] (59) HashAggregate [codegen id : 21] -Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] -Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [count(1), min(cd_dep_count#28), max(cd_dep_count#28), avg(cast(cd_dep_count#28 as bigint)), min(cd_dep_employed_count#29), max(cd_dep_employed_count#29), avg(cast(cd_dep_employed_count#29 as bigint)), min(cd_dep_college_count#30), max(cd_dep_college_count#30), avg(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [10]: [count(1)#59, min(cd_dep_count#28)#60, max(cd_dep_count#28)#61, avg(cast(cd_dep_count#28 as bigint))#62, min(cd_dep_employed_count#29)#63, max(cd_dep_employed_count#29)#64, avg(cast(cd_dep_employed_count#29 as bigint))#65, min(cd_dep_college_count#30)#66, max(cd_dep_college_count#30)#67, avg(cast(cd_dep_college_count#30 as bigint))#68] -Results [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, count(1)#59 AS cnt1#69, min(cd_dep_count#28)#60 AS min(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, avg(cast(cd_dep_count#28 as bigint))#62 AS avg(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, min(cd_dep_employed_count#29)#63 AS min(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, avg(cast(cd_dep_employed_count#29 as bigint))#65 AS avg(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, min(cd_dep_college_count#30)#66 AS min(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, avg(cast(cd_dep_college_count#30 as bigint))#68 AS avg(cd_dep_college_count)#80, cd_dep_count#28 AS aggOrder#81] +Results [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, count(1)#59 AS cnt1#69, min(cd_dep_count#28)#60 AS min(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, avg(cast(cd_dep_count#28 as bigint))#62 AS avg(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, min(cd_dep_employed_count#29)#63 AS min(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, avg(cast(cd_dep_employed_count#29 as bigint))#65 AS avg(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, min(cd_dep_college_count#30)#66 AS min(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, avg(cast(cd_dep_college_count#30 as bigint))#68 AS avg(cd_dep_college_count)#80, cd_dep_count#28 AS aggOrder#81] (60) TakeOrderedAndProject -Input [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80, aggOrder#81] -Arguments: 100, [ca_state#4 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, aggOrder#81 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#4, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80] +Input [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80, aggOrder#81] +Arguments: 100, [ca_state#22 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, aggOrder#81 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#22, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt index 30367d56188ce..7c40dfcf8133a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt @@ -13,44 +13,34 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (16) - Project [ca_state,c_current_cdemo_sk] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (2) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #3 - WholeStageCodegen (1) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - WholeStageCodegen (15) + WholeStageCodegen (13) Sort [c_current_addr_sk] InputAdapter - Exchange [c_current_addr_sk] #4 - WholeStageCodegen (14) + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (12) Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (4) + WholeStageCodegen (2) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (3) + Exchange [c_customer_sk] #4 + WholeStageCodegen (1) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (7) + WholeStageCodegen (5) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #6 - WholeStageCodegen (6) + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -58,18 +48,18 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (5) + BroadcastExchange #6 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_qoy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - WholeStageCodegen (10) + WholeStageCodegen (8) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #8 - WholeStageCodegen (9) + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (7) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -77,12 +67,12 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #7 - WholeStageCodegen (13) + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (11) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #9 - WholeStageCodegen (12) + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (10) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -90,7 +80,17 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_empl InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (15) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (14) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter WholeStageCodegen (19) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt index 47b1df54175b7..d6dfb6e7785c1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt @@ -156,7 +156,7 @@ Input [5]: [i_category#16, i_class#17, spark_grouping_id#18, sum#21, sum#22] Keys [3]: [i_category#16, i_class#17, spark_grouping_id#18] Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#24, sum(UnscaledValue(ss_ext_sales_price#4))#25] -Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS gross_margin#26, i_category#16, i_class#17, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS lochierarchy#27, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS _w1#28, CASE WHEN (cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint) = 0) THEN i_category#16 END AS _w2#29, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS _w3#30] +Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS gross_margin#26, i_category#16, i_class#17, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS lochierarchy#27, (cast((shiftright(spark_grouping_id#18, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint)) AS _w1#28, CASE WHEN (cast(cast((shiftright(spark_grouping_id#18, 0) & 1) as tinyint) as int) = 0) THEN i_category#16 END AS _w2#29, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#24,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#25,17,2))), DecimalType(37,20), true) AS _w3#30] (28) Exchange Input [7]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, _w1#28, _w2#29, _w3#30] @@ -176,5 +176,5 @@ Input [8]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, _w1#28, (32) TakeOrderedAndProject Input [5]: [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] -Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (lochierarchy#27 = 0) THEN i_category#16 END ASC NULLS FIRST, rank_within_parent#32 ASC NULLS FIRST], [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] +Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#27 as int) = 0) THEN i_category#16 END ASC NULLS FIRST, rank_within_parent#32 ASC NULLS FIRST], [gross_margin#26, i_category#16, i_class#17, lochierarchy#27, rank_within_parent#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt index b1dac8c03761f..a6b76c7618123 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt @@ -10,16 +10,16 @@ TakeOrderedAndProject (31) : +- * Project (18) : +- * BroadcastHashJoin Inner BuildRight (17) : :- * Project (11) - : : +- * BroadcastHashJoin Inner BuildRight (10) - : : :- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (9) - : : +- * Project (8) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.item (5) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.inventory (6) : +- BroadcastExchange (16) : +- * Project (15) : +- * Filter (14) @@ -32,54 +32,54 @@ TakeOrderedAndProject (31) +- Scan parquet default.catalog_sales (21) -(1) Scan parquet default.inventory -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 3] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -(3) Filter [codegen id : 3] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -Condition : ((((isnotnull(inv_quantity_on_hand#3) AND (inv_quantity_on_hand#3 >= 100)) AND (inv_quantity_on_hand#3 <= 500)) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 68.00)) AND (cast(i_current_price#4 as decimal(12,2)) <= 98.00)) AND i_manufact_id#5 IN (677,940,694,808)) AND isnotnull(i_item_sk#1)) -(4) Project [codegen id : 3] -Output [2]: [inv_date_sk#1, inv_item_sk#2] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(4) Project [codegen id : 1] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -(5) Scan parquet default.item -Output [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] -ReadSchema: struct +(5) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(6) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +(6) Scan parquet default.inventory +Output [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(7) Filter [codegen id : 1] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -Condition : ((((isnotnull(i_current_price#7) AND (i_current_price#7 >= 68.00)) AND (cast(i_current_price#7 as decimal(12,2)) <= 98.00)) AND i_manufact_id#8 IN (677,940,694,808)) AND isnotnull(i_item_sk#4)) +(7) ColumnarToRow +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] -(8) Project [codegen id : 1] -Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +(8) Filter +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +Condition : ((((isnotnull(inv_quantity_on_hand#9) AND (inv_quantity_on_hand#9 >= 100)) AND (inv_quantity_on_hand#9 <= 500)) AND isnotnull(inv_item_sk#8)) AND isnotnull(inv_date_sk#7)) -(9) BroadcastExchange -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(9) Project +Output [2]: [inv_date_sk#7, inv_item_sk#8] +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] (10) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#8] Join condition: None (11) Project [codegen id : 3] -Output [5]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [6]: [inv_date_sk#1, inv_item_sk#2, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, inv_item_sk#8] (12) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_date#11] @@ -104,21 +104,21 @@ Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (17) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] +Left keys [1]: [inv_date_sk#7] Right keys [1]: [d_date_sk#10] Join condition: None (18) Project [codegen id : 3] -Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [6]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, d_date_sk#10] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, d_date_sk#10] (19) Exchange -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: hashpartitioning(i_item_sk#4, 5), true, [id=#13] +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#13] (20) Sort [codegen id : 4] -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: [i_item_sk#4 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 (21) Scan parquet default.catalog_sales Output [1]: [cs_item_sk#14] @@ -143,33 +143,33 @@ Input [1]: [cs_item_sk#14] Arguments: [cs_item_sk#14 ASC NULLS FIRST], false, 0 (26) SortMergeJoin [codegen id : 7] -Left keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] Right keys [1]: [cs_item_sk#14] Join condition: None (27) Project [codegen id : 7] -Output [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, cs_item_sk#14] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, cs_item_sk#14] (28) HashAggregate [codegen id : 7] -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] (29) Exchange -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: hashpartitioning(i_item_id#5, i_item_desc#6, i_current_price#7, 5), true, [id=#16] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), true, [id=#16] (30) HashAggregate [codegen id : 8] -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] (31) TakeOrderedAndProject -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: 100, [i_item_id#5 ASC NULLS FIRST], [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt index 2b10f1c0d7bdf..0fc9d748fa1b1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt @@ -15,13 +15,8 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] WholeStageCodegen (3) Project [i_item_sk,i_item_id,i_item_desc,i_current_price] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,i_item_sk,i_item_id,i_item_desc,i_current_price] - BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_date_sk,inv_item_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -30,6 +25,11 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + Project [inv_date_sk,inv_item_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt index 4578dc82e436b..92b9c26825e51 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt @@ -43,11 +43,11 @@ CollectLimit (68) : :- * Sort (29) : : +- Exchange (28) : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildLeft (26) - : : :- ReusedExchange (22) - : : +- * Filter (25) - : : +- * ColumnarToRow (24) - : : +- Scan parquet default.catalog_sales (23) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Filter (24) + : : : +- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (25) : +- * Sort (31) : +- ReusedExchange (30) +- * Sort (56) @@ -60,11 +60,11 @@ CollectLimit (68) :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildLeft (44) - : :- ReusedExchange (40) - : +- * Filter (43) - : +- * ColumnarToRow (42) - : +- Scan parquet default.web_sales (41) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Filter (42) + : : +- * ColumnarToRow (41) + : : +- Scan parquet default.web_sales (40) + : +- ReusedExchange (43) +- * Sort (49) +- ReusedExchange (48) @@ -161,39 +161,39 @@ Arguments: hashpartitioning(coalesce(c_last_name#10, ), isnull(c_last_name#10), Input [3]: [d_date#4, c_first_name#9, c_last_name#10] Arguments: [coalesce(c_last_name#10, ) ASC NULLS FIRST, isnull(c_last_name#10) ASC NULLS FIRST, coalesce(c_first_name#9, ) ASC NULLS FIRST, isnull(c_first_name#9) ASC NULLS FIRST, coalesce(d_date#4, 0) ASC NULLS FIRST, isnull(d_date#4) ASC NULLS FIRST], false, 0 -(22) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#13, d_date#14] - -(23) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +(22) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_customer_sk)] ReadSchema: struct -(24) ColumnarToRow -Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +(23) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] + +(24) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] +Condition : (isnotnull(cs_sold_date_sk#13) AND isnotnull(cs_bill_customer_sk#14)) -(25) Filter -Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] -Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_bill_customer_sk#16)) +(25) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#15, d_date#16] (26) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_date_sk#13] -Right keys [1]: [cs_sold_date_sk#15] +Left keys [1]: [cs_sold_date_sk#13] +Right keys [1]: [d_date_sk#15] Join condition: None (27) Project [codegen id : 9] -Output [2]: [d_date#14, cs_bill_customer_sk#16] -Input [4]: [d_date_sk#13, d_date#14, cs_sold_date_sk#15, cs_bill_customer_sk#16] +Output [2]: [cs_bill_customer_sk#14, d_date#16] +Input [4]: [cs_sold_date_sk#13, cs_bill_customer_sk#14, d_date_sk#15, d_date#16] (28) Exchange -Input [2]: [d_date#14, cs_bill_customer_sk#16] -Arguments: hashpartitioning(cs_bill_customer_sk#16, 5), true, [id=#17] +Input [2]: [cs_bill_customer_sk#14, d_date#16] +Arguments: hashpartitioning(cs_bill_customer_sk#14, 5), true, [id=#17] (29) Sort [codegen id : 10] -Input [2]: [d_date#14, cs_bill_customer_sk#16] -Arguments: [cs_bill_customer_sk#16 ASC NULLS FIRST], false, 0 +Input [2]: [cs_bill_customer_sk#14, d_date#16] +Arguments: [cs_bill_customer_sk#14 ASC NULLS FIRST], false, 0 (30) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] @@ -203,78 +203,78 @@ Input [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 (32) SortMergeJoin [codegen id : 13] -Left keys [1]: [cs_bill_customer_sk#16] +Left keys [1]: [cs_bill_customer_sk#14] Right keys [1]: [c_customer_sk#18] Join condition: None (33) Project [codegen id : 13] -Output [3]: [c_last_name#20, c_first_name#19, d_date#14] -Input [5]: [d_date#14, cs_bill_customer_sk#16, c_customer_sk#18, c_first_name#19, c_last_name#20] +Output [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [5]: [cs_bill_customer_sk#14, d_date#16, c_customer_sk#18, c_first_name#19, c_last_name#20] (34) HashAggregate [codegen id : 13] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#14] +Results [3]: [c_last_name#20, c_first_name#19, d_date#16] (35) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#14, 5), true, [id=#21] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#16, 5), true, [id=#21] (36) HashAggregate [codegen id : 14] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#14] +Results [3]: [c_last_name#20, c_first_name#19, d_date#16] (37) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14), 5), true, [id=#22] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16), 5), true, [id=#22] (38) Sort [codegen id : 15] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#14, 0) ASC NULLS FIRST, isnull(d_date#14) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#16, 0) ASC NULLS FIRST, isnull(d_date#16) ASC NULLS FIRST], false, 0 (39) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14)] +Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16)] Join condition: None -(40) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#23, d_date#24] - -(41) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +(40) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(42) ColumnarToRow -Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +(41) ColumnarToRow [codegen id : 17] +Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] + +(42) Filter [codegen id : 17] +Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] +Condition : (isnotnull(ws_sold_date_sk#23) AND isnotnull(ws_bill_customer_sk#24)) -(43) Filter -Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] -Condition : (isnotnull(ws_sold_date_sk#25) AND isnotnull(ws_bill_customer_sk#26)) +(43) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#25, d_date#26] (44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#23] -Right keys [1]: [ws_sold_date_sk#25] +Left keys [1]: [ws_sold_date_sk#23] +Right keys [1]: [d_date_sk#25] Join condition: None (45) Project [codegen id : 17] -Output [2]: [d_date#24, ws_bill_customer_sk#26] -Input [4]: [d_date_sk#23, d_date#24, ws_sold_date_sk#25, ws_bill_customer_sk#26] +Output [2]: [ws_bill_customer_sk#24, d_date#26] +Input [4]: [ws_sold_date_sk#23, ws_bill_customer_sk#24, d_date_sk#25, d_date#26] (46) Exchange -Input [2]: [d_date#24, ws_bill_customer_sk#26] -Arguments: hashpartitioning(ws_bill_customer_sk#26, 5), true, [id=#27] +Input [2]: [ws_bill_customer_sk#24, d_date#26] +Arguments: hashpartitioning(ws_bill_customer_sk#24, 5), true, [id=#27] (47) Sort [codegen id : 18] -Input [2]: [d_date#24, ws_bill_customer_sk#26] -Arguments: [ws_bill_customer_sk#26 ASC NULLS FIRST], false, 0 +Input [2]: [ws_bill_customer_sk#24, d_date#26] +Arguments: [ws_bill_customer_sk#24 ASC NULLS FIRST], false, 0 (48) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] @@ -284,43 +284,43 @@ Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 21] -Left keys [1]: [ws_bill_customer_sk#26] +Left keys [1]: [ws_bill_customer_sk#24] Right keys [1]: [c_customer_sk#28] Join condition: None (51) Project [codegen id : 21] -Output [3]: [c_last_name#30, c_first_name#29, d_date#24] -Input [5]: [d_date#24, ws_bill_customer_sk#26, c_customer_sk#28, c_first_name#29, c_last_name#30] +Output [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [5]: [ws_bill_customer_sk#24, d_date#26, c_customer_sk#28, c_first_name#29, c_last_name#30] (52) HashAggregate [codegen id : 21] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#24] +Results [3]: [c_last_name#30, c_first_name#29, d_date#26] (53) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#24, 5), true, [id=#31] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#26, 5), true, [id=#31] (54) HashAggregate [codegen id : 22] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#24] +Results [3]: [c_last_name#30, c_first_name#29, d_date#26] (55) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24), 5), true, [id=#32] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26), 5), true, [id=#32] (56) Sort [codegen id : 23] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#24, 0) ASC NULLS FIRST, isnull(d_date#24) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#26, 0) ASC NULLS FIRST, isnull(d_date#26) ASC NULLS FIRST], false, 0 (57) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24)] +Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26)] Join condition: None (58) HashAggregate [codegen id : 24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt index dd8b4a458cdb5..5bcd7dbb93022 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt @@ -72,14 +72,14 @@ CollectLimit InputAdapter Exchange [cs_bill_customer_sk] #9 WholeStageCodegen (9) - Project [d_date,cs_bill_customer_sk] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] @@ -103,14 +103,14 @@ CollectLimit InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (17) - Project [d_date,ws_bill_customer_sk] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (20) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt index e4308f5f22fa4..3cf87e9bf2eaf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.inventory (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -43,63 +43,63 @@ :- * Project (42) : +- * BroadcastHashJoin Inner BuildRight (41) : :- * Project (39) - : : +- * BroadcastHashJoin Inner BuildLeft (38) - : : :- BroadcastExchange (34) - : : : +- * Project (33) - : : : +- * Filter (32) - : : : +- * ColumnarToRow (31) - : : : +- Scan parquet default.date_dim (30) - : : +- * Filter (37) - : : +- * ColumnarToRow (36) - : : +- Scan parquet default.inventory (35) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.inventory (30) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) : +- ReusedExchange (40) +- ReusedExchange (43) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 1)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) -(4) Project [codegen id : 1] -Output [2]: [d_date_sk#1, d_moy#3] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [d_date_sk#1, d_moy#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(6) Scan parquet default.inventory -Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 2001)) AND (d_moy#7 = 1)) AND isnotnull(d_date_sk#5)) -(7) ColumnarToRow -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_moy#7] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(8) Filter -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_moy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [inv_date_sk#5] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Input [6]: [d_date_sk#1, d_moy#3, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7] +Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5, d_moy#7] (11) Scan parquet default.item Output [1]: [i_item_sk#9] @@ -120,13 +120,13 @@ Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_item_sk#6] +Left keys [1]: [inv_item_sk#2] Right keys [1]: [i_item_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] -Input [5]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] +Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] +Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#11, w_warehouse_name#12] @@ -147,121 +147,121 @@ Input [2]: [w_warehouse_sk#11, w_warehouse_name#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#7] +Left keys [1]: [inv_warehouse_sk#3] Right keys [1]: [w_warehouse_sk#11] Join condition: None (22) Project [codegen id : 4] -Output [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] -Input [6]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] +Output [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] +Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] (23) HashAggregate [codegen id : 4] -Input [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] +Input [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] Aggregate Attributes [5]: [n#14, avg#15, m2#16, sum#17, count#18] -Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] (24) Exchange -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] -Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, 5), true, [id=#24] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, 5), true, [id=#24] (25) HashAggregate [codegen id : 5] -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#25, avg(cast(inv_quantity_on_hand#8 as bigint))#26] -Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stddev_samp(cast(inv_quantity_on_hand#8 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#8 as bigint))#26 AS mean#28] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#25, avg(cast(inv_quantity_on_hand#4 as bigint))#26] +Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stddev_samp(cast(inv_quantity_on_hand#4 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#4 as bigint))#26 AS mean#28] (26) Filter [codegen id : 5] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] Condition : (CASE WHEN (mean#28 = 0.0) THEN 0.0 ELSE (stdev#27 / mean#28) END > 1.0) (27) Project [codegen id : 5] -Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] +Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] (28) Exchange -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] Arguments: hashpartitioning(i_item_sk#9, w_warehouse_sk#11, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] Arguments: [i_item_sk#9 ASC NULLS FIRST, w_warehouse_sk#11 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.date_dim +(30) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] + +(32) Filter [codegen id : 10] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) + +(33) Scan parquet default.date_dim Output [3]: [d_date_sk#31, d_year#32, d_moy#33] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] ReadSchema: struct -(31) ColumnarToRow [codegen id : 7] +(34) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(32) Filter [codegen id : 7] +(35) Filter [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] Condition : ((((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2001)) AND (d_moy#33 = 2)) AND isnotnull(d_date_sk#31)) -(33) Project [codegen id : 7] +(36) Project [codegen id : 7] Output [2]: [d_date_sk#31, d_moy#33] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(34) BroadcastExchange +(37) BroadcastExchange Input [2]: [d_date_sk#31, d_moy#33] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] -(35) Scan parquet default.inventory -Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(36) ColumnarToRow -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] - -(37) Filter -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) - (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [d_date_sk#31] -Right keys [1]: [inv_date_sk#5] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#31] Join condition: None (39) Project [codegen id : 10] -Output [4]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Input [6]: [d_date_sk#31, d_moy#33, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33] +Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#31, d_moy#33] (40) ReusedExchange [Reuses operator id: 14] Output [1]: [i_item_sk#35] (41) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_item_sk#6] +Left keys [1]: [inv_item_sk#2] Right keys [1]: [i_item_sk#35] Join condition: None (42) Project [codegen id : 10] -Output [4]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] -Input [5]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] +Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] +Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] (43) ReusedExchange [Reuses operator id: 20] Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_warehouse_sk#7] +Left keys [1]: [inv_warehouse_sk#3] Right keys [1]: [w_warehouse_sk#36] Join condition: None (45) Project [codegen id : 10] -Output [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] -Input [6]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] +Output [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] (46) HashAggregate [codegen id : 10] -Input [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] Aggregate Attributes [5]: [n#38, avg#39, m2#40, sum#41, count#42] Results [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] @@ -272,9 +272,9 @@ Arguments: hashpartitioning(w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35 (48) HashAggregate [codegen id : 11] Input [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#49, avg(cast(inv_quantity_on_hand#8 as bigint))#50] -Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#8 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#8 as bigint))#50 AS mean#52] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#49, avg(cast(inv_quantity_on_hand#4 as bigint))#50] +Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#4 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#4 as bigint))#50 AS mean#52] (49) Filter [codegen id : 11] Input [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stdev#51, mean#52] @@ -298,10 +298,10 @@ Right keys [2]: [i_item_sk#35, w_warehouse_sk#36] Join condition: None (54) Exchange -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] (55) Sort [codegen id : 14] -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt index a8d142814a64a..c0f519d2ec83b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt @@ -19,10 +19,14 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [d_date_sk,inv_date_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) @@ -64,10 +64,14 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [d_date_sk,inv_date_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #9 WholeStageCodegen (7) @@ -76,10 +80,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt index 584c982ffe0de..b73801a52bb37 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.inventory (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -43,63 +43,63 @@ :- * Project (42) : +- * BroadcastHashJoin Inner BuildRight (41) : :- * Project (39) - : : +- * BroadcastHashJoin Inner BuildLeft (38) - : : :- BroadcastExchange (34) - : : : +- * Project (33) - : : : +- * Filter (32) - : : : +- * ColumnarToRow (31) - : : : +- Scan parquet default.date_dim (30) - : : +- * Filter (37) - : : +- * ColumnarToRow (36) - : : +- Scan parquet default.inventory (35) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.inventory (30) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) : +- ReusedExchange (40) +- ReusedExchange (43) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 1)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) -(4) Project [codegen id : 1] -Output [2]: [d_date_sk#1, d_moy#3] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_moy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [2]: [d_date_sk#1, d_moy#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(6) Scan parquet default.inventory -Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +Condition : ((((isnotnull(d_year#6) AND isnotnull(d_moy#7)) AND (d_year#6 = 2001)) AND (d_moy#7 = 1)) AND isnotnull(d_date_sk#5)) -(7) ColumnarToRow -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_moy#7] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(8) Filter -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_moy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [inv_date_sk#5] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (10) Project [codegen id : 4] -Output [4]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Input [6]: [d_date_sk#1, d_moy#3, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7] +Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5, d_moy#7] (11) Scan parquet default.item Output [1]: [i_item_sk#9] @@ -120,13 +120,13 @@ Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_item_sk#6] +Left keys [1]: [inv_item_sk#2] Right keys [1]: [i_item_sk#9] Join condition: None (16) Project [codegen id : 4] -Output [4]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] -Input [5]: [d_moy#3, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9] +Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] +Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9] (17) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#11, w_warehouse_name#12] @@ -147,121 +147,121 @@ Input [2]: [w_warehouse_sk#11, w_warehouse_name#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [inv_warehouse_sk#7] +Left keys [1]: [inv_warehouse_sk#3] Right keys [1]: [w_warehouse_sk#11] Join condition: None (22) Project [codegen id : 4] -Output [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] -Input [6]: [d_moy#3, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] +Output [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] +Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#7, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12] (23) HashAggregate [codegen id : 4] -Input [5]: [inv_quantity_on_hand#8, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#3] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] +Input [5]: [inv_quantity_on_hand#4, i_item_sk#9, w_warehouse_sk#11, w_warehouse_name#12, d_moy#7] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] Aggregate Attributes [5]: [n#14, avg#15, m2#16, sum#17, count#18] -Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] +Results [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] (24) Exchange -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] -Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, 5), true, [id=#24] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Arguments: hashpartitioning(w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, 5), true, [id=#24] (25) HashAggregate [codegen id : 5] -Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3, n#19, avg#20, m2#21, sum#22, count#23] -Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#3] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#25, avg(cast(inv_quantity_on_hand#8 as bigint))#26] -Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stddev_samp(cast(inv_quantity_on_hand#8 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#8 as bigint))#26 AS mean#28] +Input [9]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7, n#19, avg#20, m2#21, sum#22, count#23] +Keys [4]: [w_warehouse_name#12, w_warehouse_sk#11, i_item_sk#9, d_moy#7] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#25, avg(cast(inv_quantity_on_hand#4 as bigint))#26] +Results [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stddev_samp(cast(inv_quantity_on_hand#4 as double))#25 AS stdev#27, avg(cast(inv_quantity_on_hand#4 as bigint))#26 AS mean#28] (26) Filter [codegen id : 5] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] Condition : ((CASE WHEN (mean#28 = 0.0) THEN 0.0 ELSE (stdev#27 / mean#28) END > 1.0) AND (CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END > 1.5)) (27) Project [codegen id : 5] -Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, stdev#27, mean#28] +Output [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, CASE WHEN (mean#28 = 0.0) THEN null ELSE (stdev#27 / mean#28) END AS cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, stdev#27, mean#28] (28) Exchange -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] Arguments: hashpartitioning(i_item_sk#9, w_warehouse_sk#11, 5), true, [id=#30] (29) Sort [codegen id : 6] -Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29] +Input [5]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29] Arguments: [i_item_sk#9 ASC NULLS FIRST, w_warehouse_sk#11 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.date_dim +(30) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] + +(32) Filter [codegen id : 10] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_item_sk#2) AND isnotnull(inv_warehouse_sk#3)) AND isnotnull(inv_date_sk#1)) + +(33) Scan parquet default.date_dim Output [3]: [d_date_sk#31, d_year#32, d_moy#33] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] ReadSchema: struct -(31) ColumnarToRow [codegen id : 7] +(34) ColumnarToRow [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(32) Filter [codegen id : 7] +(35) Filter [codegen id : 7] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] Condition : ((((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2001)) AND (d_moy#33 = 2)) AND isnotnull(d_date_sk#31)) -(33) Project [codegen id : 7] +(36) Project [codegen id : 7] Output [2]: [d_date_sk#31, d_moy#33] Input [3]: [d_date_sk#31, d_year#32, d_moy#33] -(34) BroadcastExchange +(37) BroadcastExchange Input [2]: [d_date_sk#31, d_moy#33] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] -(35) Scan parquet default.inventory -Output [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct - -(36) ColumnarToRow -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] - -(37) Filter -Input [4]: [inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Condition : ((isnotnull(inv_item_sk#6) AND isnotnull(inv_warehouse_sk#7)) AND isnotnull(inv_date_sk#5)) - (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [d_date_sk#31] -Right keys [1]: [inv_date_sk#5] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#31] Join condition: None (39) Project [codegen id : 10] -Output [4]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] -Input [6]: [d_date_sk#31, d_moy#33, inv_date_sk#5, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8] +Output [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33] +Input [6]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#31, d_moy#33] (40) ReusedExchange [Reuses operator id: 14] Output [1]: [i_item_sk#35] (41) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_item_sk#6] +Left keys [1]: [inv_item_sk#2] Right keys [1]: [i_item_sk#35] Join condition: None (42) Project [codegen id : 10] -Output [4]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] -Input [5]: [d_moy#33, inv_item_sk#6, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35] +Output [4]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] +Input [5]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35] (43) ReusedExchange [Reuses operator id: 20] Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [inv_warehouse_sk#7] +Left keys [1]: [inv_warehouse_sk#3] Right keys [1]: [w_warehouse_sk#36] Join condition: None (45) Project [codegen id : 10] -Output [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] -Input [6]: [d_moy#33, inv_warehouse_sk#7, inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] +Output [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [6]: [inv_warehouse_sk#3, inv_quantity_on_hand#4, d_moy#33, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37] (46) HashAggregate [codegen id : 10] -Input [5]: [inv_quantity_on_hand#8, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] +Input [5]: [inv_quantity_on_hand#4, i_item_sk#35, w_warehouse_sk#36, w_warehouse_name#37, d_moy#33] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#8 as double)), partial_avg(cast(inv_quantity_on_hand#8 as bigint))] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#4 as double)), partial_avg(cast(inv_quantity_on_hand#4 as bigint))] Aggregate Attributes [5]: [n#38, avg#39, m2#40, sum#41, count#42] Results [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] @@ -272,9 +272,9 @@ Arguments: hashpartitioning(w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35 (48) HashAggregate [codegen id : 11] Input [9]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33, n#43, avg#44, m2#45, sum#46, count#47] Keys [4]: [w_warehouse_name#37, w_warehouse_sk#36, i_item_sk#35, d_moy#33] -Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double)), avg(cast(inv_quantity_on_hand#8 as bigint))] -Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#8 as double))#49, avg(cast(inv_quantity_on_hand#8 as bigint))#50] -Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#8 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#8 as bigint))#50 AS mean#52] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double)), avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#4 as double))#49, avg(cast(inv_quantity_on_hand#4 as bigint))#50] +Results [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stddev_samp(cast(inv_quantity_on_hand#4 as double))#49 AS stdev#51, avg(cast(inv_quantity_on_hand#4 as bigint))#50 AS mean#52] (49) Filter [codegen id : 11] Input [5]: [w_warehouse_sk#36, i_item_sk#35, d_moy#33, stdev#51, mean#52] @@ -298,10 +298,10 @@ Right keys [2]: [i_item_sk#35, w_warehouse_sk#36] Join condition: None (54) Exchange -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: rangepartitioning(w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST, 5), true, [id=#55] (55) Sort [codegen id : 14] -Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#3, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] -Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 +Input [10]: [w_warehouse_sk#11, i_item_sk#9, d_moy#7, mean#28, cov#29, w_warehouse_sk#36, i_item_sk#35, d_moy#33, mean#52, cov#53] +Arguments: [w_warehouse_sk#11 ASC NULLS FIRST, i_item_sk#9 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, mean#28 ASC NULLS FIRST, cov#29 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, mean#52 ASC NULLS FIRST, cov#53 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt index a8d142814a64a..c0f519d2ec83b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt @@ -19,10 +19,14 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [d_date_sk,inv_date_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) @@ -64,10 +64,14 @@ WholeStageCodegen (14) HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [d_moy,inv_warehouse_sk,inv_quantity_on_hand,i_item_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [d_moy,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [d_date_sk,inv_date_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #9 WholeStageCodegen (7) @@ -76,10 +80,6 @@ WholeStageCodegen (14) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt index 09e62b1343c50..fb5e991043bf8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt @@ -20,14 +20,14 @@ TakeOrderedAndProject (126) : : : : : :- * Sort (11) : : : : : : +- Exchange (10) : : : : : : +- * Project (9) - : : : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : : : :- BroadcastExchange (4) - : : : : : : : +- * Filter (3) - : : : : : : : +- * ColumnarToRow (2) - : : : : : : : +- Scan parquet default.date_dim (1) - : : : : : : +- * Filter (7) - : : : : : : +- * ColumnarToRow (6) - : : : : : : +- Scan parquet default.store_sales (5) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.date_dim (4) : : : : : +- * Sort (16) : : : : : +- Exchange (15) : : : : : +- * Filter (14) @@ -43,14 +43,14 @@ TakeOrderedAndProject (126) : : : : :- * Sort (35) : : : : : +- Exchange (34) : : : : : +- * Project (33) - : : : : : +- * BroadcastHashJoin Inner BuildLeft (32) - : : : : : :- BroadcastExchange (28) - : : : : : : +- * Filter (27) - : : : : : : +- * ColumnarToRow (26) - : : : : : : +- Scan parquet default.date_dim (25) - : : : : : +- * Filter (31) - : : : : : +- * ColumnarToRow (30) - : : : : : +- Scan parquet default.store_sales (29) + : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : :- * Filter (27) + : : : : : : +- * ColumnarToRow (26) + : : : : : : +- Scan parquet default.store_sales (25) + : : : : : +- BroadcastExchange (31) + : : : : : +- * Filter (30) + : : : : : +- * ColumnarToRow (29) + : : : : : +- Scan parquet default.date_dim (28) : : : : +- * Sort (37) : : : : +- ReusedExchange (36) : : : +- * Sort (64) @@ -65,11 +65,11 @@ TakeOrderedAndProject (126) : : : :- * Sort (53) : : : : +- Exchange (52) : : : : +- * Project (51) - : : : : +- * BroadcastHashJoin Inner BuildLeft (50) - : : : : :- ReusedExchange (46) - : : : : +- * Filter (49) - : : : : +- * ColumnarToRow (48) - : : : : +- Scan parquet default.catalog_sales (47) + : : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : : :- * Filter (48) + : : : : : +- * ColumnarToRow (47) + : : : : : +- Scan parquet default.catalog_sales (46) + : : : : +- ReusedExchange (49) : : : +- * Sort (55) : : : +- ReusedExchange (54) : : +- * Sort (83) @@ -101,11 +101,11 @@ TakeOrderedAndProject (126) : :- * Sort (93) : : +- Exchange (92) : : +- * Project (91) - : : +- * BroadcastHashJoin Inner BuildLeft (90) - : : :- ReusedExchange (86) - : : +- * Filter (89) - : : +- * ColumnarToRow (88) - : : +- Scan parquet default.web_sales (87) + : : +- * BroadcastHashJoin Inner BuildRight (90) + : : :- * Filter (88) + : : : +- * ColumnarToRow (87) + : : : +- Scan parquet default.web_sales (86) + : : +- ReusedExchange (89) : +- * Sort (95) : +- ReusedExchange (94) +- * Sort (123) @@ -127,54 +127,54 @@ TakeOrderedAndProject (126) +- ReusedExchange (115) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(1) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] -(4) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] +(3) Filter [codegen id : 2] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(5) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(6) ColumnarToRow -Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] -(7) Filter -Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#7, d_year#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (9) Project [codegen id : 2] -Output [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Input [8]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8] (10) Exchange -Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#10] +Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#10] (11) Sort [codegen id : 3] -Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] @@ -199,31 +199,31 @@ Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#11] Join condition: None (18) Project [codegen id : 6] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] -Input [14]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (19) HashAggregate [codegen id : 6] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#20, isEmpty#21] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] (20) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#24] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#24] (21) HashAggregate [codegen id : 7] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#22, isEmpty#23] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25] -Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25] +Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27] (22) Filter [codegen id : 7] Input [2]: [customer_id#26, year_total#27] @@ -237,54 +237,54 @@ Arguments: hashpartitioning(customer_id#26, 5), true, [id=#28] Input [2]: [customer_id#26, year_total#27] Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(25) Scan parquet default.store_sales +Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] + +(27) Filter [codegen id : 10] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] ReadSchema: struct -(26) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#7, d_year#8] -(27) Filter [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND isnotnull(d_date_sk#1)) +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2002)) AND isnotnull(d_date_sk#7)) -(28) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] +(31) BroadcastExchange +Input [2]: [d_date_sk#7, d_year#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] -(29) Scan parquet default.store_sales -Output [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(30) ColumnarToRow -Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] - -(31) Filter -Input [6]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) - (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (33) Project [codegen id : 10] -Output [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Input [8]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] +Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8] (34) Exchange -Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#30] +Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30] (35) Sort [codegen id : 11] -Input [6]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] @@ -294,31 +294,31 @@ Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#11] Join condition: None (39) Project [codegen id : 14] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] -Input [14]: [d_year#2, ss_customer_sk#5, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (40) HashAggregate [codegen id : 14] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_ext_list_price#9, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#31, isEmpty#32] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] (41) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#35] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#35] (42) HashAggregate [codegen id : 15] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#33, isEmpty#34] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36] -Results [8]: [c_customer_id#12 AS customer_id#37, c_first_name#13 AS customer_first_name#38, c_last_name#14 AS customer_last_name#39, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#40, c_birth_country#16 AS customer_birth_country#41, c_login#17 AS customer_login#42, c_email_address#18 AS customer_email_address#43, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#9 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#8 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#6 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#7 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36 AS year_total#44] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36] +Results [8]: [c_customer_id#12 AS customer_id#37, c_first_name#13 AS customer_first_name#38, c_last_name#14 AS customer_last_name#39, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#40, c_birth_country#16 AS customer_birth_country#41, c_login#17 AS customer_login#42, c_email_address#18 AS customer_email_address#43, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36 AS year_total#44] (43) Exchange Input [8]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44] @@ -333,38 +333,38 @@ Left keys [1]: [customer_id#26] Right keys [1]: [customer_id#37] Join condition: None -(46) ReusedExchange [Reuses operator id: 4] -Output [2]: [d_date_sk#1, d_year#2] - -(47) Scan parquet default.catalog_sales +(46) Scan parquet default.catalog_sales Output [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow +(47) ColumnarToRow [codegen id : 19] Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] -(49) Filter +(48) Filter [codegen id : 19] Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46)) +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#7, d_year#8] + (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#46] +Left keys [1]: [cs_sold_date_sk#46] +Right keys [1]: [d_date_sk#7] Join condition: None (51) Project [codegen id : 19] -Output [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] -Input [8]: [d_date_sk#1, d_year#2, cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] +Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8] (52) Exchange -Input [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#52] (53) Sort [codegen id : 20] -Input [6]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -380,23 +380,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (57) Project [codegen id : 23] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] -Input [14]: [d_year#2, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (58) HashAggregate [codegen id : 23] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#53, isEmpty#54] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] (59) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#57] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#57] (60) HashAggregate [codegen id : 24] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#55, isEmpty#56] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58] Results [2]: [c_customer_id#12 AS customer_id#59, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58 AS year_total#60] @@ -440,24 +440,24 @@ Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51] Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46)) -(70) ReusedExchange [Reuses operator id: 28] -Output [2]: [d_date_sk#1, d_year#2] +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#7, d_year#8] (71) BroadcastHashJoin [codegen id : 28] Left keys [1]: [cs_sold_date_sk#46] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (72) Project [codegen id : 28] -Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] -Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#1, d_year#2] +Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8] (73) Exchange -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#64] (74) Sort [codegen id : 29] -Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] +Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -473,23 +473,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (78) Project [codegen id : 32] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] -Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (79) HashAggregate [codegen id : 32] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#65, isEmpty#66] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] (80) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#69] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#69] (81) HashAggregate [codegen id : 33] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#67, isEmpty#68] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70] Results [2]: [c_customer_id#12 AS customer_id#71, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70 AS year_total#72] @@ -511,38 +511,38 @@ Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promot Output [10]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72] Input [13]: [customer_id#26, year_total#27, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44, year_total#62, customer_id#71, year_total#72] -(86) ReusedExchange [Reuses operator id: 4] -Output [2]: [d_date_sk#1, d_year#2] - -(87) Scan parquet default.web_sales +(86) Scan parquet default.web_sales Output [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(88) ColumnarToRow +(87) ColumnarToRow [codegen id : 37] Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] -(89) Filter +(88) Filter [codegen id : 37] Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74)) +(89) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#7, d_year#8] + (90) BroadcastHashJoin [codegen id : 37] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#74] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#7] Join condition: None (91) Project [codegen id : 37] -Output [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] -Input [8]: [d_date_sk#1, d_year#2, ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] +Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8] (92) Exchange -Input [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#80] (93) Sort [codegen id : 38] -Input [6]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 (94) ReusedExchange [Reuses operator id: 15] @@ -558,23 +558,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (97) Project [codegen id : 41] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] -Input [14]: [d_year#2, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (98) HashAggregate [codegen id : 41] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#81, isEmpty#82] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] (99) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#85] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#85] (100) HashAggregate [codegen id : 42] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#83, isEmpty#84] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86] Results [2]: [c_customer_id#12 AS customer_id#87, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86 AS year_total#88] @@ -618,24 +618,24 @@ Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79] Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74)) -(110) ReusedExchange [Reuses operator id: 28] -Output [2]: [d_date_sk#1, d_year#2] +(110) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#7, d_year#8] (111) BroadcastHashJoin [codegen id : 46] Left keys [1]: [ws_sold_date_sk#74] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (112) Project [codegen id : 46] -Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] -Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#1, d_year#2] +Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8] (113) Exchange -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#92] (114) Sort [codegen id : 47] -Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 (115) ReusedExchange [Reuses operator id: 15] @@ -651,23 +651,23 @@ Right keys [1]: [c_customer_sk#11] Join condition: None (118) Project [codegen id : 50] -Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] -Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] +Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18] (119) HashAggregate [codegen id : 50] -Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#2] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [2]: [sum#93, isEmpty#94] -Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] +Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] (120) Exchange -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] -Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, 5), true, [id=#97] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] +Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#97] (121) HashAggregate [codegen id : 51] -Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2, sum#95, isEmpty#96] -Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#2] +Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96] +Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98] Results [2]: [c_customer_id#12 AS customer_id#99, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98 AS year_total#100] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt index b15e0b75a7108..1a497cb6c89c0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt @@ -37,8 +37,12 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -46,10 +50,6 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -79,8 +79,12 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ss_customer_sk] #8 WholeStageCodegen (10) - Project [d_year,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -88,10 +92,6 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] InputAdapter WholeStageCodegen (13) Sort [c_customer_sk] @@ -118,14 +118,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [cs_bill_customer_sk] #12 WholeStageCodegen (19) - Project [d_year,cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + Project [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_bill_customer_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] @@ -184,14 +184,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ws_bill_customer_sk] #18 WholeStageCodegen (37) - Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (40) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt index 70a0962e16962..c55f264a9d858 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (35) :- * Project (25) : +- * BroadcastHashJoin Inner BuildRight (24) : :- * Project (19) - : : +- * BroadcastHashJoin Inner BuildLeft (18) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.item (1) - : : +- * Project (17) - : : +- SortMergeJoin LeftOuter (16) - : : :- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_sales (6) - : : +- * Sort (15) - : : +- Exchange (14) - : : +- * Filter (13) - : : +- * ColumnarToRow (12) - : : +- Scan parquet default.catalog_returns (11) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (12) + : : : +- SortMergeJoin LeftOuter (11) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_returns (6) + : : +- BroadcastExchange (17) + : : +- * Project (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.item (13) : +- BroadcastExchange (23) : +- * Filter (22) : +- * ColumnarToRow (21) @@ -36,89 +36,89 @@ TakeOrderedAndProject (35) +- Scan parquet default.warehouse (26) -(1) Scan parquet default.item -Output [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +(1) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] (3) Filter [codegen id : 1] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] -Condition : (((isnotnull(i_current_price#3) AND (i_current_price#3 >= 0.99)) AND (i_current_price#3 <= 1.49)) AND isnotnull(i_item_sk#1)) +Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] +Condition : ((isnotnull(cs_warehouse_sk#2) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_sold_date_sk#1)) -(4) Project [codegen id : 1] -Output [2]: [i_item_sk#1, i_item_id#2] -Input [3]: [i_item_sk#1, i_item_id#2, i_current_price#3] +(4) Exchange +Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] +Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#6] -(5) BroadcastExchange -Input [2]: [i_item_sk#1, i_item_id#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) Sort [codegen id : 2] +Input [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5] +Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] +(6) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] -(8) Filter [codegen id : 2] -Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] -Condition : ((isnotnull(cs_warehouse_sk#6) AND isnotnull(cs_item_sk#7)) AND isnotnull(cs_sold_date_sk#5)) +(8) Filter [codegen id : 3] +Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +Condition : (isnotnull(cr_order_number#8) AND isnotnull(cr_item_sk#7)) (9) Exchange -Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] -Arguments: hashpartitioning(cs_order_number#8, cs_item_sk#7, 5), true, [id=#10] +Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +Arguments: hashpartitioning(cr_order_number#8, cr_item_sk#7, 5), true, [id=#10] -(10) Sort [codegen id : 3] -Input [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9] -Arguments: [cs_order_number#8 ASC NULLS FIRST, cs_item_sk#7 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 4] +Input [3]: [cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] +Arguments: [cr_order_number#8 ASC NULLS FIRST, cr_item_sk#7 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.catalog_returns -Output [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +(11) SortMergeJoin +Left keys [2]: [cs_order_number#4, cs_item_sk#3] +Right keys [2]: [cr_order_number#8, cr_item_sk#7] +Join condition: None -(12) ColumnarToRow [codegen id : 4] -Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +(12) Project [codegen id : 8] +Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_sales_price#5, cr_refunded_cash#9] +Input [8]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_order_number#4, cs_sales_price#5, cr_item_sk#7, cr_order_number#8, cr_refunded_cash#9] -(13) Filter [codegen id : 4] -Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] -Condition : (isnotnull(cr_order_number#12) AND isnotnull(cr_item_sk#11)) +(13) Scan parquet default.item +Output [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) Exchange -Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] -Arguments: hashpartitioning(cr_order_number#12, cr_item_sk#11, 5), true, [id=#14] +(14) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] -(15) Sort [codegen id : 5] -Input [3]: [cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] -Arguments: [cr_order_number#12 ASC NULLS FIRST, cr_item_sk#11 ASC NULLS FIRST], false, 0 +(15) Filter [codegen id : 5] +Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] +Condition : (((isnotnull(i_current_price#13) AND (i_current_price#13 >= 0.99)) AND (i_current_price#13 <= 1.49)) AND isnotnull(i_item_sk#11)) -(16) SortMergeJoin -Left keys [2]: [cs_order_number#8, cs_item_sk#7] -Right keys [2]: [cr_order_number#12, cr_item_sk#11] -Join condition: None +(16) Project [codegen id : 5] +Output [2]: [i_item_sk#11, i_item_id#12] +Input [3]: [i_item_sk#11, i_item_id#12, i_current_price#13] -(17) Project -Output [5]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_sales_price#9, cr_refunded_cash#13] -Input [8]: [cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_order_number#8, cs_sales_price#9, cr_item_sk#11, cr_order_number#12, cr_refunded_cash#13] +(17) BroadcastExchange +Input [2]: [i_item_sk#11, i_item_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (18) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [cs_item_sk#7] +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [i_item_sk#11] Join condition: None (19) Project [codegen id : 8] -Output [5]: [i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13] -Input [7]: [i_item_sk#1, i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_item_sk#7, cs_sales_price#9, cr_refunded_cash#13] +Output [5]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12] +Input [7]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_item_sk#3, cs_sales_price#5, cr_refunded_cash#9, i_item_sk#11, i_item_id#12] (20) Scan parquet default.date_dim Output [2]: [d_date_sk#15, d_date#16] @@ -139,13 +139,13 @@ Input [2]: [d_date_sk#15, d_date#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (24) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_sold_date_sk#5] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#15] Join condition: None (25) Project [codegen id : 8] -Output [5]: [i_item_id#2, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date#16] -Input [7]: [i_item_id#2, cs_sold_date_sk#5, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date_sk#15, d_date#16] +Output [5]: [cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date#16] +Input [7]: [cs_sold_date_sk#1, cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date_sk#15, d_date#16] (26) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#18, w_state#19] @@ -166,33 +166,33 @@ Input [2]: [w_warehouse_sk#18, w_state#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] (30) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [cs_warehouse_sk#6] +Left keys [1]: [cs_warehouse_sk#2] Right keys [1]: [w_warehouse_sk#18] Join condition: None (31) Project [codegen id : 8] -Output [5]: [cs_sales_price#9, cr_refunded_cash#13, w_state#19, i_item_id#2, d_date#16] -Input [7]: [i_item_id#2, cs_warehouse_sk#6, cs_sales_price#9, cr_refunded_cash#13, d_date#16, w_warehouse_sk#18, w_state#19] +Output [5]: [cs_sales_price#5, cr_refunded_cash#9, w_state#19, i_item_id#12, d_date#16] +Input [7]: [cs_warehouse_sk#2, cs_sales_price#5, cr_refunded_cash#9, i_item_id#12, d_date#16, w_warehouse_sk#18, w_state#19] (32) HashAggregate [codegen id : 8] -Input [5]: [cs_sales_price#9, cr_refunded_cash#13, w_state#19, i_item_id#2, d_date#16] -Keys [2]: [w_state#19, i_item_id#2] -Functions [2]: [partial_sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Input [5]: [cs_sales_price#5, cr_refunded_cash#9, w_state#19, i_item_id#12, d_date#16] +Keys [2]: [w_state#19, i_item_id#12] +Functions [2]: [partial_sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] Aggregate Attributes [4]: [sum#21, isEmpty#22, sum#23, isEmpty#24] -Results [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] +Results [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] (33) Exchange -Input [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] -Arguments: hashpartitioning(w_state#19, i_item_id#2, 5), true, [id=#29] +Input [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] +Arguments: hashpartitioning(w_state#19, i_item_id#12, 5), true, [id=#29] (34) HashAggregate [codegen id : 9] -Input [6]: [w_state#19, i_item_id#2, sum#25, isEmpty#26, sum#27, isEmpty#28] -Keys [2]: [w_state#19, i_item_id#2] -Functions [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] -Aggregate Attributes [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31] -Results [4]: [w_state#19, i_item_id#2, sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30 AS sales_before#32, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#9 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31 AS sales_after#33] +Input [6]: [w_state#19, i_item_id#12, sum#25, isEmpty#26, sum#27, isEmpty#28] +Keys [2]: [w_state#19, i_item_id#12] +Functions [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31] +Results [4]: [w_state#19, i_item_id#12, sum(CASE WHEN (d_date#16 < 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#30 AS sales_before#32, sum(CASE WHEN (d_date#16 >= 11027) THEN CheckOverflow((promote_precision(cast(cs_sales_price#5 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#9 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#31 AS sales_after#33] (35) TakeOrderedAndProject -Input [4]: [w_state#19, i_item_id#2, sales_before#32, sales_after#33] -Arguments: 100, [w_state#19 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST], [w_state#19, i_item_id#2, sales_before#32, sales_after#33] +Input [4]: [w_state#19, i_item_id#12, sales_before#32, sales_after#33] +Arguments: 100, [w_state#19 ASC NULLS FIRST, i_item_id#12 ASC NULLS FIRST], [w_state#19, i_item_id#12, sales_before#32, sales_after#33] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt index 09fa8a15c8a33..6e976ada38863 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt @@ -7,39 +7,39 @@ TakeOrderedAndProject [w_state,i_item_id,sales_before,sales_after] HashAggregate [w_state,i_item_id,d_date,cs_sales_price,cr_refunded_cash] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Project [cs_sales_price,cr_refunded_cash,w_state,i_item_id,d_date] BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] - Project [i_item_id,cs_warehouse_sk,cs_sales_price,cr_refunded_cash,d_date] + Project [cs_warehouse_sk,cs_sales_price,cr_refunded_cash,i_item_id,d_date] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [i_item_id,cs_sold_date_sk,cs_warehouse_sk,cs_sales_price,cr_refunded_cash] - BroadcastHashJoin [i_item_sk,cs_item_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - Project [i_item_sk,i_item_id] - Filter [i_current_price,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + Project [cs_sold_date_sk,cs_warehouse_sk,cs_sales_price,cr_refunded_cash,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_sold_date_sk,cs_warehouse_sk,cs_item_sk,cs_sales_price,cr_refunded_cash] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #3 - WholeStageCodegen (2) + Exchange [cs_order_number,cs_item_sk] #2 + WholeStageCodegen (1) Filter [cs_warehouse_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_warehouse_sk,cs_item_sk,cs_order_number,cs_sales_price] - WholeStageCodegen (5) + WholeStageCodegen (4) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #4 - WholeStageCodegen (4) + Exchange [cr_order_number,cr_item_sk] #3 + WholeStageCodegen (3) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] InputAdapter BroadcastExchange #5 WholeStageCodegen (6) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt index e96072f2a05cb..dfd840a823327 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] -Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [3]: [i_item_sk#1, i_category_id#2, i_category#3] -Input [4]: [i_item_sk#1, i_category_id#2, i_category#3, i_manager_id#4] +(4) Scan parquet default.item +Output [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [3]: [i_item_sk#1, i_category_id#2, i_category#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] +Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 1)) AND isnotnull(i_item_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#4, i_category_id#5, i_category#6] +Input [4]: [i_item_sk#4, i_category_id#5, i_category#6, i_manager_id#7] -(8) Filter -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [3]: [i_item_sk#4, i_category_id#5, i_category#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [4]: [i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_ext_sales_price#8] -Input [6]: [i_item_sk#1, i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_category_id#5, i_category#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_category_id#5, i_category#6] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,33 +90,33 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#8, i_category_id#2, i_category#3] -Input [6]: [i_category_id#2, i_category#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#3, i_category_id#5, i_category#6] +Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_category_id#5, i_category#6, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#8, i_category_id#2, i_category#3] -Keys [3]: [d_year#10, i_category_id#2, i_category#3] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Input [4]: [d_year#10, ss_ext_sales_price#3, i_category_id#5, i_category#6] +Keys [3]: [d_year#10, i_category_id#5, i_category#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] +Results [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] (19) Exchange -Input [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] -Arguments: hashpartitioning(d_year#10, i_category_id#2, i_category#3, 5), true, [id=#15] +Input [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] +Arguments: hashpartitioning(d_year#10, i_category_id#5, i_category#6, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_category_id#2, i_category#3, sum#14] -Keys [3]: [d_year#10, i_category_id#2, i_category#3] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] -Results [4]: [d_year#10, i_category_id#2, i_category#3, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS sum(ss_ext_sales_price)#17] +Input [4]: [d_year#10, i_category_id#5, i_category#6, sum#14] +Keys [3]: [d_year#10, i_category_id#5, i_category#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [4]: [d_year#10, i_category_id#5, i_category#6, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS sum(ss_ext_sales_price)#17] (21) TakeOrderedAndProject -Input [4]: [d_year#10, i_category_id#2, i_category#3, sum(ss_ext_sales_price)#17] -Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#10 ASC NULLS FIRST, i_category_id#2 ASC NULLS FIRST, i_category#3 ASC NULLS FIRST], [d_year#10, i_category_id#2, i_category#3, sum(ss_ext_sales_price)#17] +Input [4]: [d_year#10, i_category_id#5, i_category#6, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#10 ASC NULLS FIRST, i_category_id#5 ASC NULLS FIRST, i_category#6 ASC NULLS FIRST], [d_year#10, i_category_id#5, i_category#6, sum(ss_ext_sales_price)#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt index 5ed955903554f..1ad7df6bb984a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_category_id,i_category] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_category_id,i_category,ss_sold_date_sk,ss_ext_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_category_id,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt index fb925640dc42e..952873e60626e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.store (11) -(1) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] - -(3) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) - -(4) Scan parquet default.date_dim -Output [3]: [d_date_sk#4, d_year#5, d_day_name#6] +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] -(6) Filter [codegen id : 1] -Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] -Condition : ((isnotnull(d_year#5) AND (d_year#5 = 2000)) AND isnotnull(d_date_sk#4)) +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_day_name#3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_day_name#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [d_date_sk#4, d_day_name#6] -Input [3]: [d_date_sk#4, d_year#5, d_day_name#6] +(7) ColumnarToRow +Input [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] -(8) BroadcastExchange -Input [2]: [d_date_sk#4, d_day_name#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(8) Filter +Input [3]: [ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] +Condition : (isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#6)) (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#5] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ss_store_sk#2, ss_sales_price#3, d_day_name#6] -Input [5]: [ss_sold_date_sk#1, ss_store_sk#2, ss_sales_price#3, d_date_sk#4, d_day_name#6] +Output [3]: [d_day_name#3, ss_store_sk#6, ss_sales_price#7] +Input [5]: [d_date_sk#1, d_day_name#3, ss_sold_date_sk#5, ss_store_sk#6, ss_sales_price#7] (11) Scan parquet default.store Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] @@ -90,18 +90,18 @@ Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#2] +Left keys [1]: [ss_store_sk#6] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_day_name#6, ss_sales_price#3, s_store_id#9, s_store_name#10] -Input [6]: [ss_store_sk#2, ss_sales_price#3, d_day_name#6, s_store_sk#8, s_store_id#9, s_store_name#10] +Output [4]: [d_day_name#3, ss_sales_price#7, s_store_id#9, s_store_name#10] +Input [6]: [d_day_name#3, ss_store_sk#6, ss_sales_price#7, s_store_sk#8, s_store_id#9, s_store_name#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_day_name#6, ss_sales_price#3, s_store_id#9, s_store_name#10] +Input [4]: [d_day_name#3, ss_sales_price#7, s_store_id#9, s_store_name#10] Keys [2]: [s_store_name#10, s_store_id#9] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))] Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] Results [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] @@ -112,9 +112,9 @@ Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), true, [id=#27] (20) HashAggregate [codegen id : 4] Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] Keys [2]: [s_store_name#10, s_store_id#9] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))#34] -Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday) THEN ss_sales_price#3 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday) THEN ss_sales_price#3 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday) THEN ss_sales_price#3 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#3 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday) THEN ss_sales_price#3 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday) THEN ss_sales_price#3 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday) THEN ss_sales_price#3 ELSE null END))#34,17,2) AS sat_sales#41] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))#34] +Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday) THEN ss_sales_price#7 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday) THEN ss_sales_price#7 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday) THEN ss_sales_price#7 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#7 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday) THEN ss_sales_price#7 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday) THEN ss_sales_price#7 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday) THEN ss_sales_price#7 ELSE null END))#34,17,2) AS sat_sales#41] (21) TakeOrderedAndProject Input [9]: [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt index f921628d04e13..a366ea3d4696a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt @@ -7,12 +7,8 @@ TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] Project [d_day_name,ss_sales_price,s_store_id,s_store_name] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_store_sk,ss_sales_price,d_day_name] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_sales_price] + Project [d_day_name,ss_store_sk,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,6 +17,10 @@ TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt index 525cfbd65b66c..54e117e6cac10 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (46) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.web_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -34,12 +34,12 @@ TakeOrderedAndProject (46) : : +- Exchange (22) : : +- * Filter (21) : : +- * ColumnarToRow (20) - : : +- Scan parquet default.customer_address (19) + : : +- Scan parquet default.customer (19) : +- * Sort (28) : +- Exchange (27) : +- * Filter (26) : +- * ColumnarToRow (25) - : +- Scan parquet default.customer (24) + : +- Scan parquet default.customer_address (24) +- BroadcastExchange (39) +- * Project (38) +- * Filter (37) @@ -47,50 +47,50 @@ TakeOrderedAndProject (46) +- Scan parquet default.item (35) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#2, d_year#3, d_qoy#4] +(1) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] -Condition : ((((isnotnull(d_qoy#4) AND isnotnull(d_year#3)) AND (d_qoy#4 = 2)) AND (d_year#3 = 2001)) AND isnotnull(d_date_sk#2)) +(3) Filter [codegen id : 3] +Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] +Condition : ((isnotnull(ws_bill_customer_sk#4) AND isnotnull(ws_sold_date_sk#2)) AND isnotnull(ws_item_sk#3)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#2] -Input [3]: [d_date_sk#2, d_year#3, d_qoy#4] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_qoy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] -(6) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] +Condition : ((((isnotnull(d_qoy#8) AND isnotnull(d_year#7)) AND (d_qoy#8 = 2)) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_qoy#8] -(8) Filter -Input [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] -Condition : ((isnotnull(ws_bill_customer_sk#8) AND isnotnull(ws_sold_date_sk#6)) AND isnotnull(ws_item_sk#7)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#2] -Right keys [1]: [ws_sold_date_sk#6] +Left keys [1]: [ws_sold_date_sk#2] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] -Input [5]: [d_date_sk#2, ws_sold_date_sk#6, ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9] +Output [3]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5] +Input [5]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, d_date_sk#6] (11) Scan parquet default.item Output [2]: [i_item_sk#10, i_item_id#11] @@ -111,91 +111,91 @@ Input [2]: [i_item_sk#10, i_item_id#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ws_item_sk#7] +Left keys [1]: [ws_item_sk#3] Right keys [1]: [i_item_sk#10] Join condition: None (16) Project [codegen id : 3] -Output [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] -Input [5]: [ws_item_sk#7, ws_bill_customer_sk#8, ws_sales_price#9, i_item_sk#10, i_item_id#11] +Output [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] +Input [5]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, i_item_sk#10, i_item_id#11] (17) Exchange -Input [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] -Arguments: hashpartitioning(ws_bill_customer_sk#8, 5), true, [id=#13] +Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] +Arguments: hashpartitioning(ws_bill_customer_sk#4, 5), true, [id=#13] (18) Sort [codegen id : 4] -Input [3]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11] -Arguments: [ws_bill_customer_sk#8 ASC NULLS FIRST], false, 0 +Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11] +Arguments: [ws_bill_customer_sk#4 ASC NULLS FIRST], false, 0 -(19) Scan parquet default.customer_address -Output [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] +(19) Scan parquet default.customer +Output [2]: [c_customer_sk#14, c_current_addr_sk#15] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] +Input [2]: [c_customer_sk#14, c_current_addr_sk#15] (21) Filter [codegen id : 5] -Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] -Condition : isnotnull(ca_address_sk#14) +Input [2]: [c_customer_sk#14, c_current_addr_sk#15] +Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_current_addr_sk#15)) (22) Exchange -Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] -Arguments: hashpartitioning(ca_address_sk#14, 5), true, [id=#17] +Input [2]: [c_customer_sk#14, c_current_addr_sk#15] +Arguments: hashpartitioning(c_current_addr_sk#15, 5), true, [id=#16] (23) Sort [codegen id : 6] -Input [3]: [ca_address_sk#14, ca_city#15, ca_zip#16] -Arguments: [ca_address_sk#14 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#14, c_current_addr_sk#15] +Arguments: [c_current_addr_sk#15 ASC NULLS FIRST], false, 0 -(24) Scan parquet default.customer -Output [2]: [c_customer_sk#18, c_current_addr_sk#19] +(24) Scan parquet default.customer_address +Output [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (25) ColumnarToRow [codegen id : 7] -Input [2]: [c_customer_sk#18, c_current_addr_sk#19] +Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] (26) Filter [codegen id : 7] -Input [2]: [c_customer_sk#18, c_current_addr_sk#19] -Condition : (isnotnull(c_customer_sk#18) AND isnotnull(c_current_addr_sk#19)) +Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] +Condition : isnotnull(ca_address_sk#17) (27) Exchange -Input [2]: [c_customer_sk#18, c_current_addr_sk#19] -Arguments: hashpartitioning(c_current_addr_sk#19, 5), true, [id=#20] +Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] +Arguments: hashpartitioning(ca_address_sk#17, 5), true, [id=#20] (28) Sort [codegen id : 8] -Input [2]: [c_customer_sk#18, c_current_addr_sk#19] -Arguments: [c_current_addr_sk#19 ASC NULLS FIRST], false, 0 +Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19] +Arguments: [ca_address_sk#17 ASC NULLS FIRST], false, 0 (29) SortMergeJoin [codegen id : 9] -Left keys [1]: [ca_address_sk#14] -Right keys [1]: [c_current_addr_sk#19] +Left keys [1]: [c_current_addr_sk#15] +Right keys [1]: [ca_address_sk#17] Join condition: None (30) Project [codegen id : 9] -Output [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] -Input [5]: [ca_address_sk#14, ca_city#15, ca_zip#16, c_customer_sk#18, c_current_addr_sk#19] +Output [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] +Input [5]: [c_customer_sk#14, c_current_addr_sk#15, ca_address_sk#17, ca_city#18, ca_zip#19] (31) Exchange -Input [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] -Arguments: hashpartitioning(c_customer_sk#18, 5), true, [id=#21] +Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] +Arguments: hashpartitioning(c_customer_sk#14, 5), true, [id=#21] (32) Sort [codegen id : 10] -Input [3]: [ca_city#15, ca_zip#16, c_customer_sk#18] -Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 +Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19] +Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 (33) SortMergeJoin [codegen id : 12] -Left keys [1]: [ws_bill_customer_sk#8] -Right keys [1]: [c_customer_sk#18] +Left keys [1]: [ws_bill_customer_sk#4] +Right keys [1]: [c_customer_sk#14] Join condition: None (34) Project [codegen id : 12] -Output [4]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11] -Input [6]: [ws_bill_customer_sk#8, ws_sales_price#9, i_item_id#11, ca_city#15, ca_zip#16, c_customer_sk#18] +Output [4]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11] +Input [6]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11, c_customer_sk#14, ca_city#18, ca_zip#19] (35) Scan parquet default.item Output [2]: [i_item_sk#10, i_item_id#11] @@ -225,32 +225,32 @@ Right keys [1]: [i_item_id#11#22] Join condition: None (41) Filter [codegen id : 12] -Input [5]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11, exists#1] -Condition : (substr(ca_zip#16, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) +Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1] +Condition : (substr(ca_zip#19, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) (42) Project [codegen id : 12] -Output [3]: [ws_sales_price#9, ca_city#15, ca_zip#16] -Input [5]: [ws_sales_price#9, ca_city#15, ca_zip#16, i_item_id#11, exists#1] +Output [3]: [ws_sales_price#5, ca_city#18, ca_zip#19] +Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1] (43) HashAggregate [codegen id : 12] -Input [3]: [ws_sales_price#9, ca_city#15, ca_zip#16] -Keys [2]: [ca_zip#16, ca_city#15] -Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#9))] +Input [3]: [ws_sales_price#5, ca_city#18, ca_zip#19] +Keys [2]: [ca_zip#19, ca_city#18] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#5))] Aggregate Attributes [1]: [sum#24] -Results [3]: [ca_zip#16, ca_city#15, sum#25] +Results [3]: [ca_zip#19, ca_city#18, sum#25] (44) Exchange -Input [3]: [ca_zip#16, ca_city#15, sum#25] -Arguments: hashpartitioning(ca_zip#16, ca_city#15, 5), true, [id=#26] +Input [3]: [ca_zip#19, ca_city#18, sum#25] +Arguments: hashpartitioning(ca_zip#19, ca_city#18, 5), true, [id=#26] (45) HashAggregate [codegen id : 13] -Input [3]: [ca_zip#16, ca_city#15, sum#25] -Keys [2]: [ca_zip#16, ca_city#15] -Functions [1]: [sum(UnscaledValue(ws_sales_price#9))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#9))#27] -Results [3]: [ca_zip#16, ca_city#15, MakeDecimal(sum(UnscaledValue(ws_sales_price#9))#27,17,2) AS sum(ws_sales_price)#28] +Input [3]: [ca_zip#19, ca_city#18, sum#25] +Keys [2]: [ca_zip#19, ca_city#18] +Functions [1]: [sum(UnscaledValue(ws_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#5))#27] +Results [3]: [ca_zip#19, ca_city#18, MakeDecimal(sum(UnscaledValue(ws_sales_price#5))#27,17,2) AS sum(ws_sales_price)#28] (46) TakeOrderedAndProject -Input [3]: [ca_zip#16, ca_city#15, sum(ws_sales_price)#28] -Arguments: 100, [ca_zip#16 ASC NULLS FIRST, ca_city#15 ASC NULLS FIRST], [ca_zip#16, ca_city#15, sum(ws_sales_price)#28] +Input [3]: [ca_zip#19, ca_city#18, sum(ws_sales_price)#28] +Arguments: 100, [ca_zip#19 ASC NULLS FIRST, ca_city#18 ASC NULLS FIRST], [ca_zip#19, ca_city#18, sum(ws_sales_price)#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt index b2ab550915e7b..0e9662bb6aca5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt @@ -19,7 +19,11 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] Project [ws_bill_customer_sk,ws_sales_price,i_item_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk,ws_bill_customer_sk,ws_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk,ws_sold_date_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,10 +32,6 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - Filter [ws_bill_customer_sk,ws_sold_date_sk,ws_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -45,28 +45,28 @@ TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] InputAdapter Exchange [c_customer_sk] #5 WholeStageCodegen (9) - Project [ca_city,ca_zip,c_customer_sk] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_customer_sk,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter WholeStageCodegen (6) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #6 + Exchange [c_current_addr_sk] #6 WholeStageCodegen (5) - Filter [ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (8) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #7 + Exchange [ca_address_sk] #7 WholeStageCodegen (7) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] InputAdapter BroadcastExchange #8 WholeStageCodegen (11) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt index 7c4cc7c030a93..d4c3d754860b1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt @@ -10,12 +10,12 @@ TakeOrderedAndProject (51) : : +- Exchange (4) : : +- * Filter (3) : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) + : : +- Scan parquet default.customer (1) : +- * Sort (10) : +- Exchange (9) : +- * Filter (8) : +- * ColumnarToRow (7) - : +- Scan parquet default.customer (6) + : +- Scan parquet default.customer_address (6) +- * Sort (48) +- Exchange (47) +- * HashAggregate (46) @@ -52,66 +52,66 @@ TakeOrderedAndProject (51) +- ReusedExchange (41) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_city#2] +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_city#2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] (3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_city#2] -Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_city#2)) +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) (4) Exchange -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#3] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#5] (5) Sort [codegen id : 2] -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.customer -Output [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +(6) Scan parquet default.customer_address +Output [2]: [ca_address_sk#6, ca_city#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Input [2]: [ca_address_sk#6, ca_city#7] (8) Filter [codegen id : 3] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5)) +Input [2]: [ca_address_sk#6, ca_city#7] +Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) (9) Exchange -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#8] +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: hashpartitioning(ca_address_sk#6, 5), true, [id=#8] (10) Sort [codegen id : 4] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 (11) SortMergeJoin [codegen id : 5] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#5] +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#6] Join condition: None (12) Project [codegen id : 5] -Output [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Input [6]: [ca_address_sk#1, ca_city#2, c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] (13) Exchange -Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#9] +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#9] (14) Sort [codegen id : 6] -Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 (15) Scan parquet default.store_sales Output [8]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] @@ -228,35 +228,35 @@ Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#29] Input [5]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17] Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 -(41) ReusedExchange [Reuses operator id: 4] -Output [2]: [ca_address_sk#1, ca_city#2] +(41) ReusedExchange [Reuses operator id: 9] +Output [2]: [ca_address_sk#6, ca_city#7] (42) Sort [codegen id : 13] -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_addr_sk#13] -Right keys [1]: [ca_address_sk#1] +Right keys [1]: [ca_address_sk#6] Join condition: None (44) Project [codegen id : 14] -Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#2] -Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#1, ca_city#2] +Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#7] +Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_address_sk#6, ca_city#7] (45) HashAggregate [codegen id : 14] -Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#2] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2] +Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_coupon_amt#16, ss_net_profit#17, ca_city#7] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#16)), partial_sum(UnscaledValue(ss_net_profit#17))] Aggregate Attributes [2]: [sum#30, sum#31] -Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2, sum#32, sum#33] +Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#32, sum#33] (46) HashAggregate [codegen id : 14] -Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2, sum#32, sum#33] -Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#2] +Input [6]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#32, sum#33] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] Functions [2]: [sum(UnscaledValue(ss_coupon_amt#16)), sum(UnscaledValue(ss_net_profit#17))] Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#16))#34, sum(UnscaledValue(ss_net_profit#17))#35] -Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#2 AS bought_city#36, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#34,17,2) AS amt#37, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#35,17,2) AS profit#38] +Results [5]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#7 AS bought_city#36, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#16))#34,17,2) AS amt#37, MakeDecimal(sum(UnscaledValue(ss_net_profit#17))#35,17,2) AS profit#38] (47) Exchange Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] @@ -267,15 +267,15 @@ Input [5]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, prof Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_customer_sk#4] +Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#11] -Join condition: NOT (ca_city#2 = bought_city#36) +Join condition: NOT (ca_city#7 = bought_city#36) (50) Project [codegen id : 16] -Output [7]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] -Input [9]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] +Output [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Input [9]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#36, amt#37, profit#38] (51) TakeOrderedAndProject -Input [7]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] -Arguments: 100, [c_last_name#7 ASC NULLS FIRST, c_first_name#6 ASC NULLS FIRST, ca_city#2 ASC NULLS FIRST, bought_city#36 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#7, c_first_name#6, ca_city#2, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Input [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, c_first_name#3 ASC NULLS FIRST, ca_city#7 ASC NULLS FIRST, bought_city#36 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#36, ss_ticket_number#15, amt#37, profit#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt index 3180c9af5fd7f..5eef8b789842c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt @@ -8,28 +8,28 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (5) - Project [ca_city,c_customer_sk,c_first_name,c_last_name] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_customer_sk,c_first_name,c_last_name,ca_city] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter WholeStageCodegen (2) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #2 + Exchange [c_current_addr_sk] #2 WholeStageCodegen (1) - Filter [ca_address_sk,ca_city] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (4) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #3 + Exchange [ca_address_sk] #3 WholeStageCodegen (3) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + Scan parquet default.customer_address [ca_address_sk,ca_city] InputAdapter WholeStageCodegen (15) Sort [ss_customer_sk] @@ -84,4 +84,4 @@ TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_nu WholeStageCodegen (13) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #2 + ReusedExchange [ca_address_sk,ca_city] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt index 3eaf2b725858d..741ee50f800ec 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt @@ -10,14 +10,14 @@ TakeOrderedAndProject (35) : +- * Project (15) : +- * BroadcastHashJoin Inner BuildRight (14) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : :- BroadcastExchange (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.store_sales (5) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (13) : +- * Filter (12) : +- * ColumnarToRow (11) @@ -25,57 +25,57 @@ TakeOrderedAndProject (35) +- * Sort (29) +- Exchange (28) +- * Project (27) - +- * BroadcastHashJoin Inner BuildLeft (26) - :- BroadcastExchange (22) - : +- * Project (21) - : +- * Filter (20) - : +- * ColumnarToRow (19) - : +- Scan parquet default.date_dim (18) - +- * Filter (25) - +- * ColumnarToRow (24) - +- Scan parquet default.store_returns (23) - - -(1) Scan parquet default.date_dim -Output [1]: [d_date_sk#1] + +- * BroadcastHashJoin Inner BuildRight (26) + :- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store_returns (18) + +- BroadcastExchange (25) + +- * Project (24) + +- * Filter (23) + +- * ColumnarToRow (22) + +- Scan parquet default.date_dim (21) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [1]: [d_date_sk#1] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [1]: [d_date_sk#1] -Condition : isnotnull(d_date_sk#1) +(2) ColumnarToRow [codegen id : 3] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] -(4) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#2] +(3) Filter [codegen id : 3] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] +Condition : ((((isnotnull(ss_ticket_number#5) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_sold_date_sk#1)) -(5) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +(4) Scan parquet default.date_dim +Output [1]: [d_date_sk#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [d_date_sk#6] -(6) ColumnarToRow -Input [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +(6) Filter [codegen id : 1] +Input [1]: [d_date_sk#6] +Condition : isnotnull(d_date_sk#6) -(7) Filter -Input [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] -Condition : ((((isnotnull(ss_ticket_number#7) AND isnotnull(ss_item_sk#4)) AND isnotnull(ss_customer_sk#5)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_sold_date_sk#3)) +(7) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#3] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (9) Project [codegen id : 3] -Output [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] -Input [6]: [d_date_sk#1, ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7] +Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] (10) Scan parquet default.store Output [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] @@ -96,88 +96,88 @@ Input [11]: [s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#6] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#8] Join condition: None (15) Project [codegen id : 3] -Output [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [16]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ticket_number#7, s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Output [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [16]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#8, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] (16) Exchange -Input [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: hashpartitioning(cast(ss_ticket_number#7 as bigint), cast(ss_item_sk#4 as bigint), cast(ss_customer_sk#5 as bigint), 5), true, [id=#20] +Input [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Arguments: hashpartitioning(cast(ss_ticket_number#5 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_customer_sk#3 as bigint), 5), true, [id=#20] (17) Sort [codegen id : 4] -Input [14]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Arguments: [cast(ss_ticket_number#7 as bigint) ASC NULLS FIRST, cast(ss_item_sk#4 as bigint) ASC NULLS FIRST, cast(ss_customer_sk#5 as bigint) ASC NULLS FIRST], false, 0 +Input [14]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Arguments: [cast(ss_ticket_number#5 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST, cast(ss_customer_sk#3 as bigint) ASC NULLS FIRST], false, 0 -(18) Scan parquet default.date_dim -Output [3]: [d_date_sk#21, d_year#22, d_moy#23] +(18) Scan parquet default.store_returns +Output [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct -(19) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +(19) ColumnarToRow [codegen id : 6] +Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] -(20) Filter [codegen id : 5] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] -Condition : ((((isnotnull(d_year#22) AND isnotnull(d_moy#23)) AND (d_year#22 = 2001)) AND (d_moy#23 = 8)) AND isnotnull(d_date_sk#21)) +(20) Filter [codegen id : 6] +Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] +Condition : (((isnotnull(sr_ticket_number#24) AND isnotnull(sr_item_sk#22)) AND isnotnull(sr_customer_sk#23)) AND isnotnull(sr_returned_date_sk#21)) -(21) Project [codegen id : 5] -Output [1]: [d_date_sk#21] -Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +(21) Scan parquet default.date_dim +Output [3]: [d_date_sk#25, d_year#26, d_moy#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] +ReadSchema: struct -(22) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] +(22) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] -(23) Scan parquet default.store_returns -Output [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct +(23) Filter [codegen id : 5] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +Condition : ((((isnotnull(d_year#26) AND isnotnull(d_moy#27)) AND (d_year#26 = 2001)) AND (d_moy#27 = 8)) AND isnotnull(d_date_sk#25)) -(24) ColumnarToRow -Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +(24) Project [codegen id : 5] +Output [1]: [d_date_sk#25] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] -(25) Filter -Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -Condition : (((isnotnull(sr_ticket_number#28) AND isnotnull(sr_item_sk#26)) AND isnotnull(sr_customer_sk#27)) AND isnotnull(sr_returned_date_sk#25)) +(25) BroadcastExchange +Input [1]: [d_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cast(d_date_sk#21 as bigint)] -Right keys [1]: [sr_returned_date_sk#25] +Left keys [1]: [sr_returned_date_sk#21] +Right keys [1]: [cast(d_date_sk#25 as bigint)] Join condition: None (27) Project [codegen id : 6] -Output [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -Input [5]: [d_date_sk#21, sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Output [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] +Input [5]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, d_date_sk#25] (28) Exchange -Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -Arguments: hashpartitioning(sr_ticket_number#28, sr_item_sk#26, sr_customer_sk#27, 5), true, [id=#29] +Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] +Arguments: hashpartitioning(sr_ticket_number#24, sr_item_sk#22, sr_customer_sk#23, 5), true, [id=#29] (29) Sort [codegen id : 7] -Input [4]: [sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] -Arguments: [sr_ticket_number#28 ASC NULLS FIRST, sr_item_sk#26 ASC NULLS FIRST, sr_customer_sk#27 ASC NULLS FIRST], false, 0 +Input [4]: [sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] +Arguments: [sr_ticket_number#24 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_customer_sk#23 ASC NULLS FIRST], false, 0 (30) SortMergeJoin [codegen id : 8] -Left keys [3]: [cast(ss_ticket_number#7 as bigint), cast(ss_item_sk#4 as bigint), cast(ss_customer_sk#5 as bigint)] -Right keys [3]: [sr_ticket_number#28, sr_item_sk#26, sr_customer_sk#27] +Left keys [3]: [cast(ss_ticket_number#5 as bigint), cast(ss_item_sk#2 as bigint), cast(ss_customer_sk#3 as bigint)] +Right keys [3]: [sr_ticket_number#24, sr_item_sk#22, sr_customer_sk#23] Join condition: None (31) Project [codegen id : 8] -Output [12]: [ss_sold_date_sk#3, sr_returned_date_sk#25, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Input [18]: [ss_sold_date_sk#3, ss_item_sk#4, ss_customer_sk#5, ss_ticket_number#7, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sr_returned_date_sk#25, sr_item_sk#26, sr_customer_sk#27, sr_ticket_number#28] +Output [12]: [ss_sold_date_sk#1, sr_returned_date_sk#21, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [18]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#5, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sr_returned_date_sk#21, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24] (32) HashAggregate [codegen id : 8] -Input [12]: [ss_sold_date_sk#3, sr_returned_date_sk#25, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] +Input [12]: [ss_sold_date_sk#1, sr_returned_date_sk#21, s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [partial_sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] +Functions [5]: [partial_sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] Aggregate Attributes [5]: [sum#30, sum#31, sum#32, sum#33, sum#34] Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#35, sum#36, sum#37, sum#38, sum#39] @@ -188,9 +188,9 @@ Arguments: hashpartitioning(s_store_name#9, s_company_id#10, s_street_number#11, (34) HashAggregate [codegen id : 9] Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum#35, sum#36, sum#37, sum#38, sum#39] Keys [10]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18] -Functions [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] -Aggregate Attributes [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45] -Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41 AS 30 days #46, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 30) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42 AS 31 - 60 days #47, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 60) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43 AS 61 - 90 days #48, sum(cast(CASE WHEN (((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 90) AND ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44 AS 91 - 120 days #49, sum(cast(CASE WHEN ((sr_returned_date_sk#25 - cast(ss_sold_date_sk#3 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45 AS >120 days #50] +Functions [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))] +Aggregate Attributes [5]: [sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45] +Results [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 30) THEN 1 ELSE 0 END as bigint))#41 AS 30 days #46, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 30) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 60)) THEN 1 ELSE 0 END as bigint))#42 AS 31 - 60 days #47, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 60) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 90)) THEN 1 ELSE 0 END as bigint))#43 AS 61 - 90 days #48, sum(cast(CASE WHEN (((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 90) AND ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) <= 120)) THEN 1 ELSE 0 END as bigint))#44 AS 91 - 120 days #49, sum(cast(CASE WHEN ((sr_returned_date_sk#21 - cast(ss_sold_date_sk#1 as bigint)) > 120) THEN 1 ELSE 0 END as bigint))#45 AS >120 days #50] (35) TakeOrderedAndProject Input [15]: [s_store_name#9, s_company_id#10, s_street_number#11, s_street_name#12, s_street_type#13, s_suite_number#14, s_city#15, s_county#16, s_state#17, s_zip#18, 30 days #46, 31 - 60 days #47, 61 - 90 days #48, 91 - 120 days #49, >120 days #50] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt index c2a83cc988752..be11a69176810 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt @@ -16,7 +16,11 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -24,10 +28,6 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk] - Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -42,7 +42,11 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s Exchange [sr_ticket_number,sr_item_sk,sr_customer_sk] #5 WholeStageCodegen (6) Project [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] - BroadcastHashJoin [d_date_sk,sr_returned_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_ticket_number,sr_item_sk,sr_customer_sk,sr_returned_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] InputAdapter BroadcastExchange #6 WholeStageCodegen (5) @@ -51,7 +55,3 @@ TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [sr_ticket_number,sr_item_sk,sr_customer_sk,sr_returned_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_customer_sk,sr_ticket_number] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt index 4d30585e76aa1..d7a8c103285cb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] -Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(4) Scan parquet default.item +Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 1)) AND isnotnull(i_item_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -(8) Filter -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [2]: [d_date_sk#9, d_year#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Input [6]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9, d_year#10] +Output [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9, d_year#10] (18) HashAggregate [codegen id : 3] -Input [4]: [d_year#10, ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Input [4]: [d_year#10, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] +Results [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] (19) Exchange -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Arguments: hashpartitioning(d_year#10, i_brand#3, i_brand_id#2, 5), true, [id=#15] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Arguments: hashpartitioning(d_year#10, i_brand#6, i_brand_id#5, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [4]: [d_year#10, i_brand#3, i_brand_id#2, sum#14] -Keys [3]: [d_year#10, i_brand#3, i_brand_id#2] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] -Results [4]: [d_year#10, i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS ext_price#19] +Input [4]: [d_year#10, i_brand#6, i_brand_id#5, sum#14] +Keys [3]: [d_year#10, i_brand#6, i_brand_id#5] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [4]: [d_year#10, i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [4]: [d_year#10, brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt index 0237860edb955..8ed500d84390c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [d_year,ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt index a59cb55a4436c..f8a6d7de0c4ea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.item (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] -(3) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,reference,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) -(4) Scan parquet default.item -Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,reference,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manufact_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] -(5) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manufact_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(6) Filter [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] -Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,reference,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [i_item_sk#5, i_manufact_id#9] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manufact_id#9] +(7) ColumnarToRow +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -(8) BroadcastExchange -Input [2]: [i_item_sk#5, i_manufact_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(8) Filter +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Condition : ((isnotnull(ss_item_sk#12) AND isnotnull(ss_sold_date_sk#11)) AND isnotnull(ss_store_sk#13)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#12] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manufact_id#9] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manufact_id#9] +Output [4]: [i_manufact_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] +Input [6]: [i_item_sk#1, i_manufact_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#13] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manufact_id#9] -Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manufact_id#9, s_store_sk#15] +Output [3]: [i_manufact_id#5, ss_sold_date_sk#11, ss_sales_price#14] +Input [5]: [i_manufact_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_qoy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_qoy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#11] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manufact_id#9, ss_sales_price#4, d_qoy#19] -Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manufact_id#9, d_date_sk#17, d_qoy#19] +Output [3]: [i_manufact_id#5, ss_sales_price#14, d_qoy#19] +Input [5]: [i_manufact_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_qoy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manufact_id#9, ss_sales_price#4, d_qoy#19] -Keys [2]: [i_manufact_id#9, d_qoy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] +Input [3]: [i_manufact_id#5, ss_sales_price#14, d_qoy#19] +Keys [2]: [i_manufact_id#5, d_qoy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manufact_id#9, d_qoy#19, sum#22] +Results [3]: [i_manufact_id#5, d_qoy#19, sum#22] (25) Exchange -Input [3]: [i_manufact_id#9, d_qoy#19, sum#22] -Arguments: hashpartitioning(i_manufact_id#9, d_qoy#19, 5), true, [id=#23] +Input [3]: [i_manufact_id#5, d_qoy#19, sum#22] +Arguments: hashpartitioning(i_manufact_id#5, d_qoy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manufact_id#9, d_qoy#19, sum#22] -Keys [2]: [i_manufact_id#9, d_qoy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] -Results [3]: [i_manufact_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] +Input [3]: [i_manufact_id#5, d_qoy#19, sum#22] +Keys [2]: [i_manufact_id#5, d_qoy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] +Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manufact_id#9, 5), true, [id=#27] +Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manufact_id#5, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] -Arguments: [i_manufact_id#9 ASC NULLS FIRST], false, 0 +Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] +Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manufact_id#9, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manufact_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#28], [i_manufact_id#9] +Input [3]: [i_manufact_id#5, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#28], [i_manufact_id#5] (30) Filter [codegen id : 7] -Input [4]: [i_manufact_id#9, sum_sales#25, _w0#26, avg_quarterly_sales#28] +Input [4]: [i_manufact_id#5, sum_sales#25, _w0#26, avg_quarterly_sales#28] Condition : (CASE WHEN (avg_quarterly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_quarterly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] -Input [4]: [i_manufact_id#9, sum_sales#25, _w0#26, avg_quarterly_sales#28] +Output [3]: [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] +Input [4]: [i_manufact_id#5, sum_sales#25, _w0#26, avg_quarterly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] -Arguments: 100, [avg_quarterly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST, i_manufact_id#9 ASC NULLS FIRST], [i_manufact_id#9, sum_sales#25, avg_quarterly_sales#28] +Input [3]: [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] +Arguments: 100, [avg_quarterly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#25, avg_quarterly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt index d5025aba81f39..ca187424ad900 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt @@ -16,14 +16,10 @@ TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] Project [i_manufact_id,ss_sales_price,d_qoy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_sales_price,i_manufact_id] + Project [i_manufact_id,ss_sold_date_sk,ss_sales_price] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manufact_id] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + Project [i_manufact_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -32,6 +28,10 @@ TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt index 9ad695c84ff3c..a1257cd292e48 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt @@ -6,15 +6,15 @@ TakeOrderedAndProject (21) +- * Project (17) +- * BroadcastHashJoin Inner BuildRight (16) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) +- BroadcastExchange (15) +- * Project (14) +- * Filter (13) @@ -22,50 +22,50 @@ TakeOrderedAndProject (21) +- Scan parquet default.date_dim (11) -(1) Scan parquet default.item -Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,28), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] -Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 28)) AND isnotnull(i_item_sk#1)) +(3) Filter [codegen id : 3] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +(4) Scan parquet default.item +Output [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,28), IsNotNull(i_item_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] +Condition : ((isnotnull(i_manager_id#7) AND (i_manager_id#7 = 28)) AND isnotnull(i_item_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Input [4]: [i_item_sk#4, i_brand_id#5, i_brand#6, i_manager_id#7] -(8) Filter -Input [3]: [ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] -Condition : (isnotnull(ss_sold_date_sk#6) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [3]: [i_item_sk#4, i_brand_id#5, i_brand#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#4] Join condition: None (10) Project [codegen id : 3] -Output [4]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_item_sk#7, ss_ext_sales_price#8] +Output [4]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#4, i_brand_id#5, i_brand#6] (11) Scan parquet default.date_dim Output [3]: [d_date_sk#9, d_year#10, d_moy#11] @@ -90,31 +90,31 @@ Input [1]: [d_date_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#9] Join condition: None (17) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Input [5]: [i_brand_id#2, i_brand#3, ss_sold_date_sk#6, ss_ext_sales_price#8, d_date_sk#9] +Output [3]: [ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Input [5]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_brand_id#5, i_brand#6, d_date_sk#9] (18) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#8, i_brand_id#2, i_brand#3] -Keys [2]: [i_brand#3, i_brand_id#2] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Input [3]: [ss_ext_sales_price#3, i_brand_id#5, i_brand#6] +Keys [2]: [i_brand#6, i_brand_id#5] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#13] -Results [3]: [i_brand#3, i_brand_id#2, sum#14] +Results [3]: [i_brand#6, i_brand_id#5, sum#14] (19) Exchange -Input [3]: [i_brand#3, i_brand_id#2, sum#14] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, 5), true, [id=#15] +Input [3]: [i_brand#6, i_brand_id#5, sum#14] +Arguments: hashpartitioning(i_brand#6, i_brand_id#5, 5), true, [id=#15] (20) HashAggregate [codegen id : 4] -Input [3]: [i_brand#3, i_brand_id#2, sum#14] -Keys [2]: [i_brand#3, i_brand_id#2] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#16] -Results [3]: [i_brand_id#2 AS brand_id#17, i_brand#3 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#16,17,2) AS ext_price#19] +Input [3]: [i_brand#6, i_brand_id#5, sum#14] +Keys [2]: [i_brand#6, i_brand_id#5] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16] +Results [3]: [i_brand_id#5 AS brand_id#17, i_brand#6 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS ext_price#19] (21) TakeOrderedAndProject Input [3]: [brand_id#17, brand#18, ext_price#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt index 1258d6a6ba680..b0d0e0d809441 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt @@ -7,8 +7,12 @@ TakeOrderedAndProject [ext_price,brand_id,brand] HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_brand_id,i_brand] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_brand_id,i_brand,ss_sold_date_sk,ss_ext_sales_price] - BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_sold_date_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -17,10 +21,6 @@ TakeOrderedAndProject [ext_price,brand_id,brand] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] - Filter [ss_sold_date_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt index 478aec51a91ae..d0d64721100c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildLeft (37) - : : : :- ReusedExchange (33) - : : : +- * Filter (36) - : : : +- * ColumnarToRow (35) - : : : +- Scan parquet default.catalog_sales (34) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,11 +59,11 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildLeft (52) - : : :- ReusedExchange (48) - : : +- * Filter (51) - : : +- * ColumnarToRow (50) - : : +- Scan parquet default.web_sales (49) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) : +- ReusedExchange (54) +- ReusedExchange (57) @@ -216,31 +216,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] -(33) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - -(34) Scan parquet default.catalog_sales +(33) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(35) ColumnarToRow +(34) ColumnarToRow [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(36) Filter +(35) Filter [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_date_sk#5] -Right keys [1]: [cs_sold_date_sk#23] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#5] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [d_date_sk#5, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] (39) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - -(49) Scan parquet default.web_sales +(48) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(50) ColumnarToRow +(49) ColumnarToRow [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(51) Filter +(50) Filter [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#5] -Right keys [1]: [ws_sold_date_sk#32] +Left keys [1]: [ws_sold_date_sk#32] +Right keys [1]: [d_date_sk#5] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [d_date_sk#5, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] +Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt index e31ddf0e7f8e7..5825c6f6e757a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt @@ -66,13 +66,13 @@ TakeOrderedAndProject [total_sales,i_item_id] Project [cs_item_sk,cs_ext_sales_price] BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [total_sales,i_item_id] Project [ws_item_sk,ws_ext_sales_price] BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt index 7ec2dbff4bc0f..9ed3db41b547c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt @@ -24,14 +24,14 @@ TakeOrderedAndProject (58) : : : +- * Project (15) : : : +- * BroadcastHashJoin Inner BuildRight (14) : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : :- BroadcastExchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (7) - : : : : +- * ColumnarToRow (6) - : : : : +- Scan parquet default.catalog_sales (5) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- BroadcastExchange (13) : : : +- * Filter (12) : : : +- * ColumnarToRow (11) @@ -59,46 +59,46 @@ TakeOrderedAndProject (58) +- ReusedExchange (49) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.catalog_sales +Output [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((d_year#2 = 1999) OR ((d_year#2 = 1998) AND (d_moy#3 = 12))) OR ((d_year#2 = 2000) AND (d_moy#3 = 1))) AND isnotnull(d_date_sk#1)) +(2) ColumnarToRow [codegen id : 3] +Input [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] -(4) BroadcastExchange -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] +(3) Filter [codegen id : 3] +Input [4]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4] +Condition : ((isnotnull(cs_item_sk#3) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_call_center_sk#2)) -(5) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_moy#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_call_center_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] -(6) ColumnarToRow -Input [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +Condition : ((((d_year#6 = 1999) OR ((d_year#6 = 1998) AND (d_moy#7 = 12))) OR ((d_year#6 = 2000) AND (d_moy#7 = 1))) AND isnotnull(d_date_sk#5)) -(7) Filter -Input [4]: [cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] -Condition : ((isnotnull(cs_item_sk#7) AND isnotnull(cs_sold_date_sk#5)) AND isnotnull(cs_call_center_sk#6)) +(7) BroadcastExchange +Input [3]: [d_date_sk#5, d_year#6, d_moy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#5] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (9) Project [codegen id : 3] -Output [5]: [d_year#2, d_moy#3, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] -Input [7]: [d_date_sk#1, d_year#2, d_moy#3, cs_sold_date_sk#5, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8] +Output [5]: [cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7] +Input [7]: [cs_sold_date_sk#1, cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_date_sk#5, d_year#6, d_moy#7] (10) Scan parquet default.call_center Output [2]: [cc_call_center_sk#9, cc_name#10] @@ -119,21 +119,21 @@ Input [2]: [cc_call_center_sk#9, cc_name#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_call_center_sk#6] +Left keys [1]: [cs_call_center_sk#2] Right keys [1]: [cc_call_center_sk#9] Join condition: None (15) Project [codegen id : 3] -Output [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] -Input [7]: [d_year#2, d_moy#3, cs_call_center_sk#6, cs_item_sk#7, cs_sales_price#8, cc_call_center_sk#9, cc_name#10] +Output [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] +Input [7]: [cs_call_center_sk#2, cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_call_center_sk#9, cc_name#10] (16) Exchange -Input [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] -Arguments: hashpartitioning(cs_item_sk#7, 5), true, [id=#12] +Input [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] +Arguments: hashpartitioning(cs_item_sk#3, 5), true, [id=#12] (17) Sort [codegen id : 4] -Input [5]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10] -Arguments: [cs_item_sk#7 ASC NULLS FIRST], false, 0 +Input [5]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] +Arguments: [cs_item_sk#3 ASC NULLS FIRST], false, 0 (18) Scan parquet default.item Output [3]: [i_item_sk#13, i_brand#14, i_category#15] @@ -158,70 +158,70 @@ Input [3]: [i_item_sk#13, i_brand#14, i_category#15] Arguments: [i_item_sk#13 ASC NULLS FIRST], false, 0 (23) SortMergeJoin [codegen id : 7] -Left keys [1]: [cs_item_sk#7] +Left keys [1]: [cs_item_sk#3] Right keys [1]: [i_item_sk#13] Join condition: None (24) Project [codegen id : 7] -Output [6]: [i_brand#14, i_category#15, cs_sales_price#8, d_year#2, d_moy#3, cc_name#10] -Input [8]: [d_year#2, d_moy#3, cs_item_sk#7, cs_sales_price#8, cc_name#10, i_item_sk#13, i_brand#14, i_category#15] +Output [6]: [i_brand#14, i_category#15, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] +Input [8]: [cs_item_sk#3, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10, i_item_sk#13, i_brand#14, i_category#15] (25) HashAggregate [codegen id : 7] -Input [6]: [i_brand#14, i_category#15, cs_sales_price#8, d_year#2, d_moy#3, cc_name#10] -Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3] -Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#8))] +Input [6]: [i_brand#14, i_category#15, cs_sales_price#4, d_year#6, d_moy#7, cc_name#10] +Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#4))] Aggregate Attributes [1]: [sum#17] -Results [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] +Results [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] (26) Exchange -Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] -Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, 5), true, [id=#19] +Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] +Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, 5), true, [id=#19] (27) HashAggregate [codegen id : 8] -Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum#18] -Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3] -Functions [1]: [sum(UnscaledValue(cs_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#8))#20] -Results [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#20,17,2) AS _w0#22] +Input [6]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum#18] +Keys [5]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7] +Functions [1]: [sum(UnscaledValue(cs_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#4))#20] +Results [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#20,17,2) AS _w0#22] (28) Exchange -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] -Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#2, 5), true, [id=#23] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] +Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, d_year#6, 5), true, [id=#23] (29) Sort [codegen id : 9] -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] -Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST], false, 0 +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] +Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST], false, 0 (30) Window -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22] -Arguments: [avg(_w0#22) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#2, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#15, i_brand#14, cc_name#10, d_year#2] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22] +Arguments: [avg(_w0#22) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#6, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#15, i_brand#14, cc_name#10, d_year#6] (31) Project [codegen id : 10] -Output [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, _w0#22, avg_monthly_sales#24] +Output [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, _w0#22, avg_monthly_sales#24] (32) Exchange -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, 5), true, [id=#25] (33) Sort [codegen id : 11] -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] -Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST], false, 0 +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] +Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST], false, 0 (34) Window -Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24] -Arguments: [rank(d_year#2, d_moy#3) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#15, i_brand#14, cc_name#10], [d_year#2 ASC NULLS FIRST, d_moy#3 ASC NULLS FIRST] +Input [7]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24] +Arguments: [rank(d_year#6, d_moy#7) windowspecdefinition(i_category#15, i_brand#14, cc_name#10, d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#15, i_brand#14, cc_name#10], [d_year#6 ASC NULLS FIRST, d_moy#7 ASC NULLS FIRST] (35) Filter [codegen id : 12] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] -Condition : (((((isnotnull(d_year#2) AND isnotnull(avg_monthly_sales#24)) AND (d_year#2 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CASE WHEN (avg_monthly_sales#24 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000)) AND isnotnull(rn#26)) +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] +Condition : (((((isnotnull(d_year#6) AND isnotnull(avg_monthly_sales#24)) AND (d_year#6 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CASE WHEN (avg_monthly_sales#24 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000)) AND isnotnull(rn#26)) (36) Exchange -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] Arguments: hashpartitioning(i_category#15, i_brand#14, cc_name#10, rn#26, 5), true, [id=#27] (37) Sort [codegen id : 13] -Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26] +Input [8]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26] Arguments: [i_category#15 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST, rn#26 ASC NULLS FIRST], false, 0 (38) ReusedExchange [Reuses operator id: 26] @@ -230,9 +230,9 @@ Output [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum#33] (39) HashAggregate [codegen id : 21] Input [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum#33] Keys [5]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32] -Functions [1]: [sum(UnscaledValue(cs_sales_price#8))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#8))#34] -Results [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, MakeDecimal(sum(UnscaledValue(cs_sales_price#8))#34,17,2) AS sum_sales#35] +Functions [1]: [sum(UnscaledValue(cs_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#4))#34] +Results [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, MakeDecimal(sum(UnscaledValue(cs_sales_price#4))#34,17,2) AS sum_sales#35] (40) Exchange Input [6]: [i_category#28, i_brand#29, cc_name#30, d_year#31, d_moy#32, sum_sales#35] @@ -268,8 +268,8 @@ Right keys [4]: [i_category#28, i_brand#29, cc_name#30, (rn#37 + 1)] Join condition: None (48) Project [codegen id : 25] -Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] -Input [13]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#28, i_brand#29, cc_name#30, sum_sales#35, rn#37] +Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] +Input [13]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#28, i_brand#29, cc_name#30, sum_sales#35, rn#37] (49) ReusedExchange [Reuses operator id: 40] Output [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] @@ -304,10 +304,10 @@ Right keys [4]: [i_category#39, i_brand#40, cc_name#41, (rn#45 - 1)] Join condition: None (57) Project [codegen id : 37] -Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] -Input [14]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Output [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] +Input [14]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] (58) TakeOrderedAndProject -Input [9]: [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] -Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST], [i_category#15, i_brand#14, cc_name#10, d_year#2, d_moy#3, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Input [9]: [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#10 ASC NULLS FIRST], [i_category#15, i_brand#14, cc_name#10, d_year#6, d_moy#7, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt index c8ef671fcf865..852e1b085054d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt @@ -41,10 +41,14 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_ InputAdapter Exchange [cs_item_sk] #5 WholeStageCodegen (3) - Project [d_year,d_moy,cs_item_sk,cs_sales_price,cc_name] + Project [cs_item_sk,cs_sales_price,d_year,d_moy,cc_name] BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] - Project [d_year,d_moy,cs_call_center_sk,cs_item_sk,cs_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + Project [cs_call_center_sk,cs_item_sk,cs_sales_price,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_sold_date_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_call_center_sk,cs_item_sk,cs_sales_price] InputAdapter BroadcastExchange #6 WholeStageCodegen (1) @@ -52,10 +56,6 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [cs_item_sk,cs_sold_date_sk,cs_call_center_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_call_center_sk,cs_item_sk,cs_sales_price] InputAdapter BroadcastExchange #7 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt index 9cfbea65c847b..675cff99ad729 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt @@ -43,12 +43,12 @@ TakeOrderedAndProject (50) : +- Exchange (32) : +- * Filter (31) : +- * ColumnarToRow (30) - : +- Scan parquet default.customer (29) + : +- Scan parquet default.customer_address (29) +- * Sort (38) +- Exchange (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.customer_address (34) + +- Scan parquet default.customer (34) (1) Scan parquet default.store_sales @@ -180,93 +180,93 @@ Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#22] Input [1]: [ss_customer_sk#3] Arguments: [ss_customer_sk#3 ASC NULLS FIRST], false, 0 -(29) Scan parquet default.customer -Output [2]: [c_customer_sk#23, c_current_addr_sk#24] +(29) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_state#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct (30) ColumnarToRow [codegen id : 7] -Input [2]: [c_customer_sk#23, c_current_addr_sk#24] +Input [2]: [ca_address_sk#23, ca_state#24] (31) Filter [codegen id : 7] -Input [2]: [c_customer_sk#23, c_current_addr_sk#24] -Condition : (isnotnull(c_current_addr_sk#24) AND isnotnull(c_customer_sk#23)) +Input [2]: [ca_address_sk#23, ca_state#24] +Condition : isnotnull(ca_address_sk#23) (32) Exchange -Input [2]: [c_customer_sk#23, c_current_addr_sk#24] -Arguments: hashpartitioning(c_current_addr_sk#24, 5), true, [id=#25] +Input [2]: [ca_address_sk#23, ca_state#24] +Arguments: hashpartitioning(ca_address_sk#23, 5), true, [id=#25] (33) Sort [codegen id : 8] -Input [2]: [c_customer_sk#23, c_current_addr_sk#24] -Arguments: [c_current_addr_sk#24 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#23, ca_state#24] +Arguments: [ca_address_sk#23 ASC NULLS FIRST], false, 0 -(34) Scan parquet default.customer_address -Output [2]: [ca_address_sk#26, ca_state#27] +(34) Scan parquet default.customer +Output [2]: [c_customer_sk#26, c_current_addr_sk#27] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct (35) ColumnarToRow [codegen id : 9] -Input [2]: [ca_address_sk#26, ca_state#27] +Input [2]: [c_customer_sk#26, c_current_addr_sk#27] (36) Filter [codegen id : 9] -Input [2]: [ca_address_sk#26, ca_state#27] -Condition : isnotnull(ca_address_sk#26) +Input [2]: [c_customer_sk#26, c_current_addr_sk#27] +Condition : (isnotnull(c_current_addr_sk#27) AND isnotnull(c_customer_sk#26)) (37) Exchange -Input [2]: [ca_address_sk#26, ca_state#27] -Arguments: hashpartitioning(ca_address_sk#26, 5), true, [id=#28] +Input [2]: [c_customer_sk#26, c_current_addr_sk#27] +Arguments: hashpartitioning(c_current_addr_sk#27, 5), true, [id=#28] (38) Sort [codegen id : 10] -Input [2]: [ca_address_sk#26, ca_state#27] -Arguments: [ca_address_sk#26 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#26, c_current_addr_sk#27] +Arguments: [c_current_addr_sk#27 ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 11] -Left keys [1]: [c_current_addr_sk#24] -Right keys [1]: [ca_address_sk#26] +Left keys [1]: [ca_address_sk#23] +Right keys [1]: [c_current_addr_sk#27] Join condition: None (40) Project [codegen id : 11] -Output [2]: [c_customer_sk#23, ca_state#27] -Input [4]: [c_customer_sk#23, c_current_addr_sk#24, ca_address_sk#26, ca_state#27] +Output [2]: [ca_state#24, c_customer_sk#26] +Input [4]: [ca_address_sk#23, ca_state#24, c_customer_sk#26, c_current_addr_sk#27] (41) Exchange -Input [2]: [c_customer_sk#23, ca_state#27] -Arguments: hashpartitioning(c_customer_sk#23, 5), true, [id=#29] +Input [2]: [ca_state#24, c_customer_sk#26] +Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#29] (42) Sort [codegen id : 12] -Input [2]: [c_customer_sk#23, ca_state#27] -Arguments: [c_customer_sk#23 ASC NULLS FIRST], false, 0 +Input [2]: [ca_state#24, c_customer_sk#26] +Arguments: [c_customer_sk#26 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 13] Left keys [1]: [ss_customer_sk#3] -Right keys [1]: [c_customer_sk#23] +Right keys [1]: [c_customer_sk#26] Join condition: None (44) Project [codegen id : 13] -Output [1]: [ca_state#27] -Input [3]: [ss_customer_sk#3, c_customer_sk#23, ca_state#27] +Output [1]: [ca_state#24] +Input [3]: [ss_customer_sk#3, ca_state#24, c_customer_sk#26] (45) HashAggregate [codegen id : 13] -Input [1]: [ca_state#27] -Keys [1]: [ca_state#27] +Input [1]: [ca_state#24] +Keys [1]: [ca_state#24] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#30] -Results [2]: [ca_state#27, count#31] +Results [2]: [ca_state#24, count#31] (46) Exchange -Input [2]: [ca_state#27, count#31] -Arguments: hashpartitioning(ca_state#27, 5), true, [id=#32] +Input [2]: [ca_state#24, count#31] +Arguments: hashpartitioning(ca_state#24, 5), true, [id=#32] (47) HashAggregate [codegen id : 14] -Input [2]: [ca_state#27, count#31] -Keys [1]: [ca_state#27] +Input [2]: [ca_state#24, count#31] +Keys [1]: [ca_state#24] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#33] -Results [3]: [ca_state#27 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36] +Results [3]: [ca_state#24 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36] (48) Filter [codegen id : 14] Input [3]: [state#34, cnt#35, count(1)#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt index 4422c8de3ff9d..73d42163240f0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt @@ -71,25 +71,25 @@ TakeOrderedAndProject [cnt,state] InputAdapter Exchange [c_customer_sk] #8 WholeStageCodegen (11) - Project [c_customer_sk,ca_state] - SortMergeJoin [c_current_addr_sk,ca_address_sk] + Project [ca_state,c_customer_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] InputAdapter WholeStageCodegen (8) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #9 + Exchange [ca_address_sk] #9 WholeStageCodegen (7) - Filter [c_current_addr_sk,c_customer_sk] + Filter [ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter WholeStageCodegen (10) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #10 + Exchange [c_current_addr_sk] #10 WholeStageCodegen (9) - Filter [ca_address_sk] + Filter [c_current_addr_sk,c_customer_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt index 41439a5679f77..f838f8f1a18af 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt @@ -44,11 +44,11 @@ TakeOrderedAndProject (67) : :- * Project (41) : : +- * BroadcastHashJoin Inner BuildRight (40) : : :- * Project (38) - : : : +- * BroadcastHashJoin Inner BuildLeft (37) - : : : :- ReusedExchange (33) - : : : +- * Filter (36) - : : : +- * ColumnarToRow (35) - : : : +- Scan parquet default.catalog_sales (34) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) : : +- ReusedExchange (39) : +- ReusedExchange (42) +- * HashAggregate (62) @@ -59,11 +59,11 @@ TakeOrderedAndProject (67) :- * Project (56) : +- * BroadcastHashJoin Inner BuildRight (55) : :- * Project (53) - : : +- * BroadcastHashJoin Inner BuildLeft (52) - : : :- ReusedExchange (48) - : : +- * Filter (51) - : : +- * ColumnarToRow (50) - : : +- Scan parquet default.web_sales (49) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) : +- ReusedExchange (54) +- ReusedExchange (57) @@ -216,31 +216,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#21] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#21,17,2) AS total_sales#22] -(33) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - -(34) Scan parquet default.catalog_sales +(33) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] ReadSchema: struct -(35) ColumnarToRow +(34) ColumnarToRow [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -(36) Filter +(35) Filter [codegen id : 11] Input [4]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] Condition : ((isnotnull(cs_sold_date_sk#23) AND isnotnull(cs_bill_addr_sk#24)) AND isnotnull(cs_item_sk#25)) +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_date_sk#5] -Right keys [1]: [cs_sold_date_sk#23] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#5] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] -Input [5]: [d_date_sk#5, cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_sold_date_sk#23, cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, d_date_sk#5] (39) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#30] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#30,17,2) AS total_sales#31] -(48) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#5] - -(49) Scan parquet default.web_sales +(48) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(50) ColumnarToRow +(49) ColumnarToRow [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -(51) Filter +(50) Filter [codegen id : 17] Input [4]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] Condition : ((isnotnull(ws_sold_date_sk#32) AND isnotnull(ws_bill_addr_sk#34)) AND isnotnull(ws_item_sk#33)) +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + (52) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#5] -Right keys [1]: [ws_sold_date_sk#32] +Left keys [1]: [ws_sold_date_sk#32] +Right keys [1]: [d_date_sk#5] Join condition: None (53) Project [codegen id : 17] Output [3]: [ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] -Input [5]: [d_date_sk#5, ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35] +Input [5]: [ws_sold_date_sk#32, ws_item_sk#33, ws_bill_addr_sk#34, ws_ext_sales_price#35, d_date_sk#5] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [ca_address_sk#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt index 3ff7b49a2246a..fb9e4e50775dd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt @@ -66,13 +66,13 @@ TakeOrderedAndProject [i_item_id,total_sales] Project [cs_item_sk,cs_ext_sales_price] BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter @@ -88,13 +88,13 @@ TakeOrderedAndProject [i_item_id,total_sales] Project [ws_item_sk,ws_ext_sales_price] BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_addr_sk,ws_item_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [ca_address_sk] #4 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt index 20e9e1c3c9af7..58a60763b2b57 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt @@ -60,11 +60,11 @@ TakeOrderedAndProject (69) : :- * Project (56) : : +- * BroadcastHashJoin Inner BuildRight (55) : : :- * Project (53) - : : : +- * BroadcastHashJoin Inner BuildLeft (52) - : : : :- ReusedExchange (48) - : : : +- * Filter (51) - : : : +- * ColumnarToRow (50) - : : : +- Scan parquet default.store_sales (49) + : : : +- * BroadcastHashJoin Inner BuildRight (52) + : : : :- * Filter (50) + : : : : +- * ColumnarToRow (49) + : : : : +- Scan parquet default.store_sales (48) + : : : +- ReusedExchange (51) : : +- ReusedExchange (54) : +- ReusedExchange (57) +- ReusedExchange (60) @@ -284,31 +284,31 @@ Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#31] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#31,17,2) AS promotions#32] -(48) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#7] - -(49) Scan parquet default.store_sales +(48) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(50) ColumnarToRow +(49) ColumnarToRow [codegen id : 14] Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -(51) Filter +(50) Filter [codegen id : 14] Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_item_sk#2)) +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + (52) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [d_date_sk#7] -Right keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (53) Project [codegen id : 14] Output [4]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [6]: [d_date_sk#7, ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, d_date_sk#7] (54) ReusedExchange [Reuses operator id: 15] Output [1]: [i_item_sk#11] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt index 7d24485855de2..87f2b3ae03746 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt @@ -86,13 +86,13 @@ TakeOrderedAndProject [promotions,total,(CAST((CAST(CAST(promotions AS DECIMAL(1 Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_store_sk,ss_sold_date_sk,ss_customer_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [i_item_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt index 0268ebf5a5c60..7de8d8780ad42 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (32) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildRight (9) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (8) - : : +- * Project (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.item (4) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.date_dim (17) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,refernece,self-help])),In(i_brand, [scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9]))), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -(3) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books,Children,Electronics) AND i_class#3 IN (personal,portable,refernece,self-help)) AND i_brand#2 IN (scholaramalgamalg #6,scholaramalgamalg #7,exportiunivamalg #8,scholaramalgamalg #8)) OR ((i_category#4 IN (Women,Music,Men) AND i_class#3 IN (accessories,classical,fragrances,pants)) AND i_brand#2 IN (amalgimporto #9,edu packscholar #9,exportiimporto #9,importoamalg #9))) AND isnotnull(i_item_sk#1)) -(4) Scan parquet default.item -Output [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [Or(And(And(In(i_category, [Books,Children,Electronics]),In(i_class, [personal,portable,refernece,self-help])),In(i_brand, [scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12])),And(And(In(i_category, [Women,Music,Men]),In(i_class, [accessories,classical,fragrances,pants])),In(i_brand, [amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13]))), IsNotNull(i_item_sk)] -ReadSchema: struct +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] -(5) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manager_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(6) Filter [codegen id : 1] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] -Condition : ((((i_category#8 IN (Books,Children,Electronics) AND i_class#7 IN (personal,portable,refernece,self-help)) AND i_brand#6 IN (scholaramalgamalg #10,scholaramalgamalg #11,exportiunivamalg #12,scholaramalgamalg #12)) OR ((i_category#8 IN (Women,Music,Men) AND i_class#7 IN (accessories,classical,fragrances,pants)) AND i_brand#6 IN (amalgimporto #13,edu packscholar #13,exportiimporto #13,importoamalg #13))) AND isnotnull(i_item_sk#5)) +(6) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [2]: [i_item_sk#5, i_manager_id#9] -Input [5]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8, i_manager_id#9] +(7) ColumnarToRow +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] -(8) BroadcastExchange -Input [2]: [i_item_sk#5, i_manager_id#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(8) Filter +Input [4]: [ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] +Condition : ((isnotnull(ss_item_sk#12) AND isnotnull(ss_sold_date_sk#11)) AND isnotnull(ss_store_sk#13)) (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#12] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9] -Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_manager_id#9] +Output [4]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_sold_date_sk#11, ss_item_sk#12, ss_store_sk#13, ss_sales_price#14] (11) Scan parquet default.store Output [1]: [s_store_sk#15] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#15] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#13] Right keys [1]: [s_store_sk#15] Join condition: None (16) Project [codegen id : 4] -Output [3]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9] -Input [5]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_manager_id#9, s_store_sk#15] +Output [3]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14] +Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_store_sk#13, ss_sales_price#14, s_store_sk#15] (17) Scan parquet default.date_dim Output [3]: [d_date_sk#17, d_month_seq#18, d_moy#19] @@ -128,53 +128,53 @@ Input [2]: [d_date_sk#17, d_moy#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#11] Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 4] -Output [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] -Input [5]: [ss_sold_date_sk#1, ss_sales_price#4, i_manager_id#9, d_date_sk#17, d_moy#19] +Output [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] +Input [5]: [i_manager_id#5, ss_sold_date_sk#11, ss_sales_price#14, d_date_sk#17, d_moy#19] (24) HashAggregate [codegen id : 4] -Input [3]: [i_manager_id#9, ss_sales_price#4, d_moy#19] -Keys [2]: [i_manager_id#9, d_moy#19] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] +Input [3]: [i_manager_id#5, ss_sales_price#14, d_moy#19] +Keys [2]: [i_manager_id#5, d_moy#19] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))] Aggregate Attributes [1]: [sum#21] -Results [3]: [i_manager_id#9, d_moy#19, sum#22] +Results [3]: [i_manager_id#5, d_moy#19, sum#22] (25) Exchange -Input [3]: [i_manager_id#9, d_moy#19, sum#22] -Arguments: hashpartitioning(i_manager_id#9, d_moy#19, 5), true, [id=#23] +Input [3]: [i_manager_id#5, d_moy#19, sum#22] +Arguments: hashpartitioning(i_manager_id#5, d_moy#19, 5), true, [id=#23] (26) HashAggregate [codegen id : 5] -Input [3]: [i_manager_id#9, d_moy#19, sum#22] -Keys [2]: [i_manager_id#9, d_moy#19] -Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#24] -Results [3]: [i_manager_id#9, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#24,17,2) AS _w0#26] +Input [3]: [i_manager_id#5, d_moy#19, sum#22] +Keys [2]: [i_manager_id#5, d_moy#19] +Functions [1]: [sum(UnscaledValue(ss_sales_price#14))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#24] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS sum_sales#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#24,17,2) AS _w0#26] (27) Exchange -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: hashpartitioning(i_manager_id#9, 5), true, [id=#27] +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: hashpartitioning(i_manager_id#5, 5), true, [id=#27] (28) Sort [codegen id : 6] -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: [i_manager_id#9 ASC NULLS FIRST], false, 0 +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 (29) Window -Input [3]: [i_manager_id#9, sum_sales#25, _w0#26] -Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#9] +Input [3]: [i_manager_id#5, sum_sales#25, _w0#26] +Arguments: [avg(_w0#26) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#28], [i_manager_id#5] (30) Filter [codegen id : 7] -Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] +Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] Condition : (CASE WHEN (avg_monthly_sales#28 > 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#25 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#28 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (31) Project [codegen id : 7] -Output [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] -Input [4]: [i_manager_id#9, sum_sales#25, _w0#26, avg_monthly_sales#28] +Output [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Input [4]: [i_manager_id#5, sum_sales#25, _w0#26, avg_monthly_sales#28] (32) TakeOrderedAndProject -Input [3]: [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] -Arguments: 100, [i_manager_id#9 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#9, sum_sales#25, avg_monthly_sales#28] +Input [3]: [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#28 ASC NULLS FIRST, sum_sales#25 ASC NULLS FIRST], [i_manager_id#5, sum_sales#25, avg_monthly_sales#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt index 16010fe2f5ac3..9ae026f0f750d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt @@ -16,14 +16,10 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] Project [i_manager_id,ss_sales_price,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_sales_price,i_manager_id] + Project [i_manager_id,ss_sold_date_sk,ss_sales_price] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_manager_id] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + Project [i_manager_id,ss_sold_date_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -32,6 +28,10 @@ TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt index 23ddb3de42ae5..24a142c70d774 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt @@ -7,34 +7,34 @@ TakeOrderedAndProject (45) : +- * Project (35) : +- * BroadcastHashJoin Inner BuildRight (34) : :- * Project (29) - : : +- * BroadcastHashJoin Inner BuildLeft (28) - : : :- BroadcastExchange (17) - : : : +- * HashAggregate (16) - : : : +- Exchange (15) - : : : +- * HashAggregate (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.store_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- * Filter (27) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (27) : : +- * HashAggregate (26) : : +- Exchange (25) : : +- * HashAggregate (24) - : : +- * Project (23) - : : +- * BroadcastHashJoin Inner BuildRight (22) - : : :- * Filter (20) - : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.store_sales (18) - : : +- ReusedExchange (21) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_sales (15) + : : +- ReusedExchange (18) : +- BroadcastExchange (33) : +- * Filter (32) : +- * ColumnarToRow (31) @@ -50,7 +50,7 @@ TakeOrderedAndProject (45) Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct (2) ColumnarToRow [codegen id : 2] @@ -58,7 +58,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] (3) Filter [codegen id : 2] Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#5, d_month_seq#6] @@ -102,91 +102,91 @@ Results [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Arguments: hashpartitioning(ss_store_sk#3, ss_item_sk#2, 5), true, [id=#10] -(13) HashAggregate [codegen id : 3] +(13) HashAggregate [codegen id : 8] Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9] Keys [2]: [ss_store_sk#3, ss_item_sk#2] Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#11] -Results [2]: [ss_store_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] - -(14) HashAggregate [codegen id : 3] -Input [2]: [ss_store_sk#3, revenue#12] -Keys [1]: [ss_store_sk#3] -Functions [1]: [partial_avg(revenue#12)] -Aggregate Attributes [2]: [sum#13, count#14] -Results [3]: [ss_store_sk#3, sum#15, count#16] - -(15) Exchange -Input [3]: [ss_store_sk#3, sum#15, count#16] -Arguments: hashpartitioning(ss_store_sk#3, 5), true, [id=#17] - -(16) HashAggregate [codegen id : 4] -Input [3]: [ss_store_sk#3, sum#15, count#16] -Keys [1]: [ss_store_sk#3] -Functions [1]: [avg(revenue#12)] -Aggregate Attributes [1]: [avg(revenue#12)#18] -Results [2]: [ss_store_sk#3, avg(revenue#12)#18 AS ave#19] - -(17) BroadcastExchange -Input [2]: [ss_store_sk#3, ave#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] - -(18) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +Results [3]: [ss_store_sk#3, ss_item_sk#2, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#11,17,2) AS revenue#12] + +(14) Filter [codegen id : 8] +Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] +Condition : isnotnull(revenue#12) + +(15) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] ReadSchema: struct -(19) ColumnarToRow [codegen id : 6] -Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] +(16) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] -(20) Filter [codegen id : 6] -Input [4]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Condition : ((isnotnull(ss_sold_date_sk#21) AND isnotnull(ss_store_sk#23)) AND isnotnull(ss_item_sk#22)) +(17) Filter [codegen id : 4] +Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Condition : (isnotnull(ss_sold_date_sk#13) AND isnotnull(ss_store_sk#15)) -(21) ReusedExchange [Reuses operator id: 8] +(18) ReusedExchange [Reuses operator id: 8] Output [1]: [d_date_sk#5] -(22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#21] +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] Right keys [1]: [d_date_sk#5] Join condition: None -(23) Project [codegen id : 6] -Output [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Input [5]: [ss_sold_date_sk#21, ss_item_sk#22, ss_store_sk#23, ss_sales_price#24, d_date_sk#5] - -(24) HashAggregate [codegen id : 6] -Input [3]: [ss_item_sk#22, ss_store_sk#23, ss_sales_price#24] -Keys [2]: [ss_store_sk#23, ss_item_sk#22] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#24))] -Aggregate Attributes [1]: [sum#25] -Results [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] +(20) Project [codegen id : 4] +Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Input [5]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, d_date_sk#5] + +(21) HashAggregate [codegen id : 4] +Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum#17] +Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] + +(22) Exchange +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] +Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), true, [id=#19] + +(23) HashAggregate [codegen id : 5] +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#20] +Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#20,17,2) AS revenue#21] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ss_store_sk#15, revenue#21] +Keys [1]: [ss_store_sk#15] +Functions [1]: [partial_avg(revenue#21)] +Aggregate Attributes [2]: [sum#22, count#23] +Results [3]: [ss_store_sk#15, sum#24, count#25] (25) Exchange -Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] -Arguments: hashpartitioning(ss_store_sk#23, ss_item_sk#22, 5), true, [id=#27] +Input [3]: [ss_store_sk#15, sum#24, count#25] +Arguments: hashpartitioning(ss_store_sk#15, 5), true, [id=#26] -(26) HashAggregate -Input [3]: [ss_store_sk#23, ss_item_sk#22, sum#26] -Keys [2]: [ss_store_sk#23, ss_item_sk#22] -Functions [1]: [sum(UnscaledValue(ss_sales_price#24))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#24))#28] -Results [3]: [ss_store_sk#23, ss_item_sk#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#24))#28,17,2) AS revenue#29] +(26) HashAggregate [codegen id : 6] +Input [3]: [ss_store_sk#15, sum#24, count#25] +Keys [1]: [ss_store_sk#15] +Functions [1]: [avg(revenue#21)] +Aggregate Attributes [1]: [avg(revenue#21)#27] +Results [2]: [ss_store_sk#15, avg(revenue#21)#27 AS ave#28] -(27) Filter -Input [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] -Condition : isnotnull(revenue#29) +(27) BroadcastExchange +Input [2]: [ss_store_sk#15, ave#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (28) BroadcastHashJoin [codegen id : 8] Left keys [1]: [ss_store_sk#3] -Right keys [1]: [ss_store_sk#23] -Join condition: (cast(revenue#29 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#19)), DecimalType(23,7), true)) +Right keys [1]: [ss_store_sk#15] +Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true)) (29) Project [codegen id : 8] -Output [3]: [ss_store_sk#23, ss_item_sk#22, revenue#29] -Input [5]: [ss_store_sk#3, ave#19, ss_store_sk#23, ss_item_sk#22, revenue#29] +Output [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12] +Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, ss_store_sk#15, ave#28] (30) Scan parquet default.store Output [2]: [s_store_sk#30, s_store_name#31] @@ -207,21 +207,21 @@ Input [2]: [s_store_sk#30, s_store_name#31] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (34) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ss_store_sk#23] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#30] Join condition: None (35) Project [codegen id : 8] -Output [3]: [ss_item_sk#22, revenue#29, s_store_name#31] -Input [5]: [ss_store_sk#23, ss_item_sk#22, revenue#29, s_store_sk#30, s_store_name#31] +Output [3]: [ss_item_sk#2, revenue#12, s_store_name#31] +Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, s_store_sk#30, s_store_name#31] (36) Exchange -Input [3]: [ss_item_sk#22, revenue#29, s_store_name#31] -Arguments: hashpartitioning(ss_item_sk#22, 5), true, [id=#33] +Input [3]: [ss_item_sk#2, revenue#12, s_store_name#31] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#33] (37) Sort [codegen id : 9] -Input [3]: [ss_item_sk#22, revenue#29, s_store_name#31] -Arguments: [ss_item_sk#22 ASC NULLS FIRST], false, 0 +Input [3]: [ss_item_sk#2, revenue#12, s_store_name#31] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 (38) Scan parquet default.item Output [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] @@ -246,15 +246,15 @@ Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#3 Arguments: [i_item_sk#34 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 12] -Left keys [1]: [ss_item_sk#22] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#34] Join condition: None (44) Project [codegen id : 12] -Output [6]: [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Input [8]: [ss_item_sk#22, revenue#29, s_store_name#31, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Output [6]: [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [8]: [ss_item_sk#2, revenue#12, s_store_name#31, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38] (45) TakeOrderedAndProject -Input [6]: [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] -Arguments: 100, [s_store_name#31 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#31, i_item_desc#35, revenue#29, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Input [6]: [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] +Arguments: 100, [s_store_name#31 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#31, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt index 8131f63d8b98e..9fc7b97cf6240 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt @@ -12,18 +12,38 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_item_sk,revenue] BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #2 - WholeStageCodegen (4) + BroadcastExchange #4 + WholeStageCodegen (6) HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] InputAdapter - Exchange [ss_store_sk] #3 - WholeStageCodegen (3) + Exchange [ss_store_sk] #5 + WholeStageCodegen (5) HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] InputAdapter - Exchange [ss_store_sk,ss_item_sk] #4 - WholeStageCodegen (2) + Exchange [ss_store_sk,ss_item_sk] #6 + WholeStageCodegen (4) HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] Project [ss_item_sk,ss_store_sk,ss_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -32,27 +52,7 @@ TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholes InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] - Filter [revenue] - HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] - InputAdapter - Exchange [ss_store_sk,ss_item_sk] #6 - WholeStageCodegen (6) - HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] - Project [ss_item_sk,ss_store_sk,ss_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] - InputAdapter - ReusedExchange [d_date_sk] #5 + ReusedExchange [d_date_sk] #3 InputAdapter BroadcastExchange #7 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt index beef51bc58bbc..0ba0d4c16f75a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt @@ -15,15 +15,15 @@ TakeOrderedAndProject (34) : +- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.store_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (14) : +- * Filter (13) : +- * ColumnarToRow (12) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (19) -(1) Scan parquet default.date_dim -Output [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] +(2) ColumnarToRow [codegen id : 3] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] -(3) Filter [codegen id : 1] -Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] -Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5] +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [4]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5] -Input [5]: [d_date_sk#1, d_month_seq#2, d_year#3, d_moy#4, d_qoy#5] +(4) Scan parquet default.date_dim +Output [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [4]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(5) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] +(7) Project [codegen id : 1] +Output [4]: [d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] +Input [5]: [d_date_sk#6, d_month_seq#7, d_year#8, d_moy#9, d_qoy#10] -(8) Filter -Input [5]: [ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] -Condition : ((isnotnull(ss_sold_date_sk#7) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#8)) +(8) BroadcastExchange +Input [4]: [d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#7] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 3] -Output [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] -Input [9]: [d_date_sk#1, d_year#3, d_moy#4, d_qoy#5, ss_sold_date_sk#7, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11] +Output [7]: [ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_date_sk#6, d_year#8, d_moy#9, d_qoy#10] (11) Scan parquet default.store Output [2]: [s_store_sk#12, s_store_id#13] @@ -99,21 +99,21 @@ Input [2]: [s_store_sk#12, s_store_id#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#9] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#12] Join condition: None (16) Project [codegen id : 3] -Output [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] -Input [9]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_store_sk#9, ss_quantity#10, ss_sales_price#11, s_store_sk#12, s_store_id#13] +Output [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] +Input [9]: [ss_item_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_sk#12, s_store_id#13] (17) Exchange -Input [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] -Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#15] +Input [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#15] (18) Sort [codegen id : 4] -Input [7]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13] -Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 +Input [7]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] @@ -138,22 +138,22 @@ Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name# Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#8] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#16] Join condition: None (25) Project [codegen id : 7] -Output [10]: [ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13] -Input [12]: [d_year#3, d_moy#4, d_qoy#5, ss_item_sk#8, ss_quantity#10, ss_sales_price#11, s_store_id#13, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Output [10]: [ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13] +Input [12]: [ss_item_sk#2, ss_quantity#4, ss_sales_price#5, d_year#8, d_moy#9, d_qoy#10, s_store_id#13, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] (26) Expand [codegen id : 7] -Input [10]: [ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13] -Arguments: [List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, s_store_id#13, 0), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, d_moy#4, null, 1), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, d_qoy#5, null, null, 3), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#3, null, null, null, 7), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, i_product_name#20, null, null, null, null, 15), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, i_brand#17, null, null, null, null, null, 31), List(ss_quantity#10, ss_sales_price#11, i_category#19, i_class#18, null, null, null, null, null, null, 63), List(ss_quantity#10, ss_sales_price#11, i_category#19, null, null, null, null, null, null, null, 127), List(ss_quantity#10, ss_sales_price#11, null, null, null, null, null, null, null, null, 255)], [ss_quantity#10, ss_sales_price#11, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Input [10]: [ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13] +Arguments: [List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, 0), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, d_moy#9, null, 1), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, d_qoy#10, null, null, 3), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#8, null, null, null, 7), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, i_product_name#20, null, null, null, null, 15), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, i_brand#17, null, null, null, null, null, 31), List(ss_quantity#4, ss_sales_price#5, i_category#19, i_class#18, null, null, null, null, null, null, 63), List(ss_quantity#4, ss_sales_price#5, i_category#19, null, null, null, null, null, null, null, 127), List(ss_quantity#4, ss_sales_price#5, null, null, null, null, null, null, null, null, 255)], [ss_quantity#4, ss_sales_price#5, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] (27) HashAggregate [codegen id : 7] -Input [11]: [ss_quantity#10, ss_sales_price#11, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Input [11]: [ss_quantity#4, ss_sales_price#5, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] -Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] Aggregate Attributes [2]: [sum#31, isEmpty#32] Results [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] @@ -164,9 +164,9 @@ Arguments: hashpartitioning(i_category#22, i_class#23, i_brand#24, i_product_nam (29) HashAggregate [codegen id : 8] Input [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] -Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] -Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36] -Results [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#11 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#10 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36 AS sumsales#37] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36] +Results [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36 AS sumsales#37] (30) Exchange Input [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt index 607b55c2dac09..185701fbc38df 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt @@ -22,10 +22,14 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ InputAdapter Exchange [ss_item_sk] #3 WholeStageCodegen (3) - Project [d_year,d_moy,d_qoy,ss_item_sk,ss_quantity,ss_sales_price,s_store_id] + Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [d_year,d_moy,d_qoy,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -34,10 +38,6 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt index 46516ec86f9bf..b3dc146e26e38 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt @@ -10,12 +10,12 @@ TakeOrderedAndProject (51) : : +- Exchange (4) : : +- * Filter (3) : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) + : : +- Scan parquet default.customer (1) : +- * Sort (10) : +- Exchange (9) : +- * Filter (8) : +- * ColumnarToRow (7) - : +- Scan parquet default.customer (6) + : +- Scan parquet default.customer_address (6) +- * Sort (48) +- Exchange (47) +- * HashAggregate (46) @@ -29,15 +29,15 @@ TakeOrderedAndProject (51) : :- * Project (31) : : +- * BroadcastHashJoin Inner BuildRight (30) : : :- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildLeft (23) - : : : :- BroadcastExchange (19) - : : : : +- * Project (18) - : : : : +- * Filter (17) - : : : : +- * ColumnarToRow (16) - : : : : +- Scan parquet default.date_dim (15) - : : : +- * Filter (22) - : : : +- * ColumnarToRow (21) - : : : +- Scan parquet default.store_sales (20) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (17) + : : : : +- * ColumnarToRow (16) + : : : : +- Scan parquet default.store_sales (15) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.date_dim (18) : : +- BroadcastExchange (29) : : +- * Project (28) : : +- * Filter (27) @@ -52,111 +52,111 @@ TakeOrderedAndProject (51) +- ReusedExchange (41) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_city#2] +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_city#2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] (3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_city#2] -Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_city#2)) +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) (4) Exchange -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#3] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), true, [id=#5] (5) Sort [codegen id : 2] -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 -(6) Scan parquet default.customer -Output [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +(6) Scan parquet default.customer_address +Output [2]: [ca_address_sk#6, ca_city#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Input [2]: [ca_address_sk#6, ca_city#7] (8) Filter [codegen id : 3] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5)) +Input [2]: [ca_address_sk#6, ca_city#7] +Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) (9) Exchange -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#8] +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: hashpartitioning(ca_address_sk#6, 5), true, [id=#8] (10) Sort [codegen id : 4] -Input [4]: [c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] -Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 (11) SortMergeJoin [codegen id : 5] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#5] +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#6] Join condition: None (12) Project [codegen id : 5] -Output [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Input [6]: [ca_address_sk#1, ca_city#2, c_customer_sk#4, c_current_addr_sk#5, c_first_name#6, c_last_name#7] +Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] (13) Exchange -Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#9] +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#9] (14) Sort [codegen id : 6] -Input [4]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7] -Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 -(15) Scan parquet default.date_dim -Output [3]: [d_date_sk#10, d_year#11, d_dom#12] +(15) Scan parquet default.store_sales +Output [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(16) ColumnarToRow [codegen id : 7] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +(16) ColumnarToRow [codegen id : 10] +Input [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] -(17) Filter [codegen id : 7] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] -Condition : ((((isnotnull(d_dom#12) AND (d_dom#12 >= 1)) AND (d_dom#12 <= 2)) AND d_year#11 IN (1999,2000,2001)) AND isnotnull(d_date_sk#10)) +(17) Filter [codegen id : 10] +Input [9]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Condition : ((((isnotnull(ss_sold_date_sk#10) AND isnotnull(ss_store_sk#14)) AND isnotnull(ss_hdemo_sk#12)) AND isnotnull(ss_addr_sk#13)) AND isnotnull(ss_customer_sk#11)) -(18) Project [codegen id : 7] -Output [1]: [d_date_sk#10] -Input [3]: [d_date_sk#10, d_year#11, d_dom#12] +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#19, d_year#20, d_dom#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct -(19) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(19) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#19, d_year#20, d_dom#21] -(20) Scan parquet default.store_sales -Output [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +(20) Filter [codegen id : 7] +Input [3]: [d_date_sk#19, d_year#20, d_dom#21] +Condition : ((((isnotnull(d_dom#21) AND (d_dom#21 >= 1)) AND (d_dom#21 <= 2)) AND d_year#20 IN (1999,2000,2001)) AND isnotnull(d_date_sk#19)) -(21) ColumnarToRow -Input [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +(21) Project [codegen id : 7] +Output [1]: [d_date_sk#19] +Input [3]: [d_date_sk#19, d_year#20, d_dom#21] -(22) Filter -Input [9]: [ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Condition : ((((isnotnull(ss_sold_date_sk#14) AND isnotnull(ss_store_sk#18)) AND isnotnull(ss_hdemo_sk#16)) AND isnotnull(ss_addr_sk#17)) AND isnotnull(ss_customer_sk#15)) +(22) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (23) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [ss_sold_date_sk#14] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#19] Join condition: None (24) Project [codegen id : 10] -Output [8]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Input [10]: [d_date_sk#10, ss_sold_date_sk#14, ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] +Output [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Input [10]: [ss_sold_date_sk#10, ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, d_date_sk#19] (25) Scan parquet default.store Output [2]: [s_store_sk#23, s_city#24] @@ -181,13 +181,13 @@ Input [1]: [s_store_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (30) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_store_sk#18] +Left keys [1]: [ss_store_sk#14] Right keys [1]: [s_store_sk#23] Join condition: None (31) Project [codegen id : 10] -Output [7]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Input [9]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_store_sk#18, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, s_store_sk#23] +Output [7]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Input [9]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_store_sk#14, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, s_store_sk#23] (32) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] @@ -212,70 +212,70 @@ Input [1]: [hd_demo_sk#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (37) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ss_hdemo_sk#16] +Left keys [1]: [ss_hdemo_sk#12] Right keys [1]: [hd_demo_sk#26] Join condition: None (38) Project [codegen id : 10] -Output [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Input [8]: [ss_customer_sk#15, ss_hdemo_sk#16, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, hd_demo_sk#26] +Output [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Input [8]: [ss_customer_sk#11, ss_hdemo_sk#12, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, hd_demo_sk#26] (39) Exchange -Input [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Arguments: hashpartitioning(ss_addr_sk#17, 5), true, [id=#30] +Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Arguments: hashpartitioning(ss_addr_sk#13, 5), true, [id=#30] (40) Sort [codegen id : 11] -Input [6]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22] -Arguments: [ss_addr_sk#17 ASC NULLS FIRST], false, 0 +Input [6]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18] +Arguments: [ss_addr_sk#13 ASC NULLS FIRST], false, 0 -(41) ReusedExchange [Reuses operator id: 4] -Output [2]: [ca_address_sk#1, ca_city#2] +(41) ReusedExchange [Reuses operator id: 9] +Output [2]: [ca_address_sk#6, ca_city#7] (42) Sort [codegen id : 13] -Input [2]: [ca_address_sk#1, ca_city#2] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 (43) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_addr_sk#17] -Right keys [1]: [ca_address_sk#1] +Left keys [1]: [ss_addr_sk#13] +Right keys [1]: [ca_address_sk#6] Join condition: None (44) Project [codegen id : 14] -Output [7]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_city#2] -Input [8]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_address_sk#1, ca_city#2] +Output [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_city#7] +Input [8]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_address_sk#6, ca_city#7] (45) HashAggregate [codegen id : 14] -Input [7]: [ss_customer_sk#15, ss_addr_sk#17, ss_ticket_number#19, ss_ext_sales_price#20, ss_ext_list_price#21, ss_ext_tax#22, ca_city#2] -Keys [4]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2] -Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#20)), partial_sum(UnscaledValue(ss_ext_list_price#21)), partial_sum(UnscaledValue(ss_ext_tax#22))] +Input [7]: [ss_customer_sk#11, ss_addr_sk#13, ss_ticket_number#15, ss_ext_sales_price#16, ss_ext_list_price#17, ss_ext_tax#18, ca_city#7] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#16)), partial_sum(UnscaledValue(ss_ext_list_price#17)), partial_sum(UnscaledValue(ss_ext_tax#18))] Aggregate Attributes [3]: [sum#31, sum#32, sum#33] -Results [7]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2, sum#34, sum#35, sum#36] +Results [7]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#34, sum#35, sum#36] (46) HashAggregate [codegen id : 14] -Input [7]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2, sum#34, sum#35, sum#36] -Keys [4]: [ss_ticket_number#19, ss_customer_sk#15, ss_addr_sk#17, ca_city#2] -Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#20)), sum(UnscaledValue(ss_ext_list_price#21)), sum(UnscaledValue(ss_ext_tax#22))] -Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#20))#37, sum(UnscaledValue(ss_ext_list_price#21))#38, sum(UnscaledValue(ss_ext_tax#22))#39] -Results [6]: [ss_ticket_number#19, ss_customer_sk#15, ca_city#2 AS bought_city#40, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#20))#37,17,2) AS extended_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#21))#38,17,2) AS list_price#42, MakeDecimal(sum(UnscaledValue(ss_ext_tax#22))#39,17,2) AS extended_tax#43] +Input [7]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7, sum#34, sum#35, sum#36] +Keys [4]: [ss_ticket_number#15, ss_customer_sk#11, ss_addr_sk#13, ca_city#7] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#16)), sum(UnscaledValue(ss_ext_list_price#17)), sum(UnscaledValue(ss_ext_tax#18))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#16))#37, sum(UnscaledValue(ss_ext_list_price#17))#38, sum(UnscaledValue(ss_ext_tax#18))#39] +Results [6]: [ss_ticket_number#15, ss_customer_sk#11, ca_city#7 AS bought_city#40, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#16))#37,17,2) AS extended_price#41, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#17))#38,17,2) AS list_price#42, MakeDecimal(sum(UnscaledValue(ss_ext_tax#18))#39,17,2) AS extended_tax#43] (47) Exchange -Input [6]: [ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] -Arguments: hashpartitioning(ss_customer_sk#15, 5), true, [id=#44] +Input [6]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#44] (48) Sort [codegen id : 15] -Input [6]: [ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] -Arguments: [ss_customer_sk#15 ASC NULLS FIRST], false, 0 +Input [6]: [ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 16] -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [ss_customer_sk#15] -Join condition: NOT (ca_city#2 = bought_city#40) +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#11] +Join condition: NOT (ca_city#7 = bought_city#40) (50) Project [codegen id : 16] -Output [8]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] -Input [10]: [ca_city#2, c_customer_sk#4, c_first_name#6, c_last_name#7, ss_ticket_number#19, ss_customer_sk#15, bought_city#40, extended_price#41, list_price#42, extended_tax#43] +Output [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] +Input [10]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#15, ss_customer_sk#11, bought_city#40, extended_price#41, list_price#42, extended_tax#43] (51) TakeOrderedAndProject -Input [8]: [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] -Arguments: 100, [c_last_name#7 ASC NULLS FIRST, ss_ticket_number#19 ASC NULLS FIRST], [c_last_name#7, c_first_name#6, ca_city#2, bought_city#40, ss_ticket_number#19, extended_price#41, extended_tax#43, list_price#42] +Input [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, ss_ticket_number#15 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#40, ss_ticket_number#15, extended_price#41, extended_tax#43, list_price#42] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt index c4d3c5ab96d48..64672d38be957 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt @@ -8,28 +8,28 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (5) - Project [ca_city,c_customer_sk,c_first_name,c_last_name] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_customer_sk,c_first_name,c_last_name,ca_city] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter WholeStageCodegen (2) - Sort [ca_address_sk] + Sort [c_current_addr_sk] InputAdapter - Exchange [ca_address_sk] #2 + Exchange [c_current_addr_sk] #2 WholeStageCodegen (1) - Filter [ca_address_sk,ca_city] + Filter [c_customer_sk,c_current_addr_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] InputAdapter WholeStageCodegen (4) - Sort [c_current_addr_sk] + Sort [ca_address_sk] InputAdapter - Exchange [c_current_addr_sk] #3 + Exchange [ca_address_sk] #3 WholeStageCodegen (3) - Filter [c_customer_sk,c_current_addr_sk] + Filter [ca_address_sk,ca_city] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + Scan parquet default.customer_address [ca_address_sk,ca_city] InputAdapter WholeStageCodegen (15) Sort [ss_customer_sk] @@ -51,7 +51,11 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] InputAdapter BroadcastExchange #6 WholeStageCodegen (7) @@ -60,10 +64,6 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] InputAdapter BroadcastExchange #7 WholeStageCodegen (8) @@ -84,4 +84,4 @@ TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_ WholeStageCodegen (13) Sort [ca_address_sk] InputAdapter - ReusedExchange [ca_address_sk,ca_city] #2 + ReusedExchange [ca_address_sk,ca_city] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt index c6cd40fe3341e..10867c980b22a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt @@ -7,249 +7,249 @@ TakeOrderedAndProject (54) +- * BroadcastHashJoin Inner BuildLeft (49) :- BroadcastExchange (45) : +- * Project (44) - : +- * BroadcastHashJoin Inner BuildLeft (43) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) - : +- * Project (42) - : +- SortMergeJoin LeftAnti (41) - : :- SortMergeJoin LeftAnti (32) - : : :- SortMergeJoin LeftSemi (23) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.customer (6) - : : : +- * Sort (22) - : : : +- Exchange (21) - : : : +- * Project (20) - : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : :- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store_sales (11) - : : : +- BroadcastExchange (18) - : : : +- * Project (17) - : : : +- * Filter (16) - : : : +- * ColumnarToRow (15) - : : : +- Scan parquet default.date_dim (14) - : : +- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_sales (24) - : : +- ReusedExchange (27) - : +- * Sort (40) - : +- Exchange (39) - : +- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.catalog_sales (33) - : +- ReusedExchange (36) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (37) + : : +- SortMergeJoin LeftAnti (36) + : : :- SortMergeJoin LeftAnti (27) + : : : :- SortMergeJoin LeftSemi (18) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (17) + : : : : +- Exchange (16) + : : : : +- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.catalog_sales (28) + : : +- ReusedExchange (31) + : +- BroadcastExchange (42) + : +- * Project (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer_address (38) +- * Filter (48) +- * ColumnarToRow (47) +- Scan parquet default.customer_demographics (46) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] - -(3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] -Condition : (ca_state#2 IN (KY,GA,NM) AND isnotnull(ca_address_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#1] -Input [2]: [ca_address_sk#1, ca_state#2] - -(5) BroadcastExchange -Input [1]: [ca_address_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] - -(6) Scan parquet default.customer -Output [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(8) Filter [codegen id : 2] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Condition : (isnotnull(c_current_addr_sk#6) AND isnotnull(c_current_cdemo_sk#5)) +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) -(9) Exchange -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Arguments: hashpartitioning(c_customer_sk#4, 5), true, [id=#7] +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#4] -(10) Sort [codegen id : 3] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] -Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#8, ss_customer_sk#9] +(6) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#5, ss_customer_sk#6] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 5] -Input [2]: [ss_sold_date_sk#8, ss_customer_sk#9] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6] -(13) Filter [codegen id : 5] -Input [2]: [ss_sold_date_sk#8, ss_customer_sk#9] -Condition : isnotnull(ss_sold_date_sk#8) +(8) Filter [codegen id : 4] +Input [2]: [ss_sold_date_sk#5, ss_customer_sk#6] +Condition : isnotnull(ss_sold_date_sk#5) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(16) Filter [codegen id : 4] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#12)) AND (d_year#11 = 2001)) AND (d_moy#12 >= 4)) AND (d_moy#12 <= 6)) AND isnotnull(d_date_sk#10)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 6)) AND isnotnull(d_date_sk#7)) -(17) Project [codegen id : 4] -Output [1]: [d_date_sk#10] -Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(18) BroadcastExchange -Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(13) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(19) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#8] -Right keys [1]: [d_date_sk#10] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] Join condition: None -(20) Project [codegen id : 5] -Output [1]: [ss_customer_sk#9] -Input [3]: [ss_sold_date_sk#8, ss_customer_sk#9, d_date_sk#10] +(15) Project [codegen id : 4] +Output [1]: [ss_customer_sk#6] +Input [3]: [ss_sold_date_sk#5, ss_customer_sk#6, d_date_sk#7] -(21) Exchange -Input [1]: [ss_customer_sk#9] -Arguments: hashpartitioning(ss_customer_sk#9, 5), true, [id=#14] +(16) Exchange +Input [1]: [ss_customer_sk#6] +Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#11] -(22) Sort [codegen id : 6] -Input [1]: [ss_customer_sk#9] -Arguments: [ss_customer_sk#9 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#6] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 -(23) SortMergeJoin -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [ss_customer_sk#9] +(18) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#6] Join condition: None -(24) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] +(19) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 8] -Input [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -(26) Filter [codegen id : 8] -Input [2]: [ws_sold_date_sk#15, ws_bill_customer_sk#16] -Condition : isnotnull(ws_sold_date_sk#15) +(21) Filter [codegen id : 7] +Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +Condition : isnotnull(ws_sold_date_sk#12) -(27) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#10] +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(28) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [ws_sold_date_sk#15] -Right keys [1]: [d_date_sk#10] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#12] +Right keys [1]: [d_date_sk#7] Join condition: None -(29) Project [codegen id : 8] -Output [1]: [ws_bill_customer_sk#16] -Input [3]: [ws_sold_date_sk#15, ws_bill_customer_sk#16, d_date_sk#10] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#13] +Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] -(30) Exchange -Input [1]: [ws_bill_customer_sk#16] -Arguments: hashpartitioning(ws_bill_customer_sk#16, 5), true, [id=#17] +(25) Exchange +Input [1]: [ws_bill_customer_sk#13] +Arguments: hashpartitioning(ws_bill_customer_sk#13, 5), true, [id=#14] -(31) Sort [codegen id : 9] -Input [1]: [ws_bill_customer_sk#16] -Arguments: [ws_bill_customer_sk#16 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 8] +Input [1]: [ws_bill_customer_sk#13] +Arguments: [ws_bill_customer_sk#13 ASC NULLS FIRST], false, 0 -(32) SortMergeJoin -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [ws_bill_customer_sk#16] +(27) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ws_bill_customer_sk#13] Join condition: None -(33) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] +(28) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 11] -Input [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] +(29) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -(35) Filter [codegen id : 11] -Input [2]: [cs_sold_date_sk#18, cs_ship_customer_sk#19] -Condition : isnotnull(cs_sold_date_sk#18) +(30) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +Condition : isnotnull(cs_sold_date_sk#15) -(36) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#10] +(31) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_sold_date_sk#18] -Right keys [1]: [d_date_sk#10] +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#15] +Right keys [1]: [d_date_sk#7] Join condition: None -(38) Project [codegen id : 11] -Output [1]: [cs_ship_customer_sk#19] -Input [3]: [cs_sold_date_sk#18, cs_ship_customer_sk#19, d_date_sk#10] +(33) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#16] +Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#7] -(39) Exchange -Input [1]: [cs_ship_customer_sk#19] -Arguments: hashpartitioning(cs_ship_customer_sk#19, 5), true, [id=#20] +(34) Exchange +Input [1]: [cs_ship_customer_sk#16] +Arguments: hashpartitioning(cs_ship_customer_sk#16, 5), true, [id=#17] -(40) Sort [codegen id : 12] -Input [1]: [cs_ship_customer_sk#19] -Arguments: [cs_ship_customer_sk#19 ASC NULLS FIRST], false, 0 +(35) Sort [codegen id : 11] +Input [1]: [cs_ship_customer_sk#16] +Arguments: [cs_ship_customer_sk#16 ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [1]: [c_customer_sk#4] -Right keys [1]: [cs_ship_customer_sk#19] +(36) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [cs_ship_customer_sk#16] Join condition: None -(42) Project -Output [2]: [c_current_cdemo_sk#5, c_current_addr_sk#6] -Input [3]: [c_customer_sk#4, c_current_cdemo_sk#5, c_current_addr_sk#6] +(37) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(38) Scan parquet default.customer_address +Output [2]: [ca_address_sk#18, ca_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 12] +Input [2]: [ca_address_sk#18, ca_state#19] + +(40) Filter [codegen id : 12] +Input [2]: [ca_address_sk#18, ca_state#19] +Condition : (ca_state#19 IN (KY,GA,NM) AND isnotnull(ca_address_sk#18)) + +(41) Project [codegen id : 12] +Output [1]: [ca_address_sk#18] +Input [2]: [ca_address_sk#18, ca_state#19] + +(42) BroadcastExchange +Input [1]: [ca_address_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (43) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#6] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#18] Join condition: None (44) Project [codegen id : 13] -Output [1]: [c_current_cdemo_sk#5] -Input [3]: [ca_address_sk#1, c_current_cdemo_sk#5, c_current_addr_sk#6] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18] (45) BroadcastExchange -Input [1]: [c_current_cdemo_sk#5] +Input [1]: [c_current_cdemo_sk#2] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (46) Scan parquet default.customer_demographics @@ -267,13 +267,13 @@ Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_stat Condition : isnotnull(cd_demo_sk#22) (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [c_current_cdemo_sk#5] +Left keys [1]: [c_current_cdemo_sk#2] Right keys [1]: [cd_demo_sk#22] Join condition: None (50) Project [codegen id : 14] Output [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] -Input [7]: [c_current_cdemo_sk#5, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] +Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] (51) HashAggregate [codegen id : 14] Input [5]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt index d1e125dcbbca2..beca1370f3716 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt @@ -11,34 +11,26 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha BroadcastExchange #2 WholeStageCodegen (13) Project [c_current_cdemo_sk] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] Project [c_current_cdemo_sk,c_current_addr_sk] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #4 - WholeStageCodegen (2) + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (6) + WholeStageCodegen (5) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #5 - WholeStageCodegen (5) + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -46,18 +38,18 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (4) + BroadcastExchange #5 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_moy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - WholeStageCodegen (9) + WholeStageCodegen (8) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #7 - WholeStageCodegen (8) + Exchange [ws_bill_customer_sk] #6 + WholeStageCodegen (7) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -65,12 +57,12 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (12) + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (11) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #8 - WholeStageCodegen (11) + Exchange [cs_ship_customer_sk] #7 + WholeStageCodegen (10) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -78,7 +70,15 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #6 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (12) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt index 1347c207cb6f7..38576c0adde4b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (34) : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.customer_demographics (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -35,50 +35,50 @@ TakeOrderedAndProject (34) +- Scan parquet default.item (25) -(1) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(1) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -(3) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] -Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = M)) AND (cd_marital_status#3 = S)) AND (cd_education_status#4 = College)) AND isnotnull(cd_demo_sk#1)) +(3) Filter [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_promo_sk#4)) -(4) Project [codegen id : 1] -Output [1]: [cd_demo_sk#1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College), IsNotNull(cd_demo_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [cd_demo_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(6) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = M)) AND (cd_marital_status#11 = S)) AND (cd_education_status#12 = College)) AND isnotnull(cd_demo_sk#9)) -(7) ColumnarToRow -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#9] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(8) Filter -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_item_sk#7)) AND isnotnull(ss_promo_sk#9)) +(8) BroadcastExchange +Input [1]: [cd_demo_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [ss_cdemo_sk#8] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#9] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] (11) Scan parquet default.promotion Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] @@ -103,13 +103,13 @@ Input [1]: [p_promo_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_promo_sk#9] +Left keys [1]: [ss_promo_sk#4] Right keys [1]: [p_promo_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_promo_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, p_promo_sk#14] +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, p_promo_sk#14] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#18, d_year#19] @@ -134,13 +134,13 @@ Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#18] Join condition: None (24) Project [codegen id : 5] -Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#18] +Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#18] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] @@ -161,18 +161,18 @@ Input [2]: [i_item_sk#21, i_item_id#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] (29) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#21] Join condition: None (30) Project [codegen id : 5] -Output [5]: [ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_id#22] -Input [7]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#21, i_item_id#22] +Output [5]: [ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_id#22] +Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#21, i_item_id#22] (31) HashAggregate [codegen id : 5] -Input [5]: [ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_id#22] +Input [5]: [ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_id#22] Keys [1]: [i_item_id#22] -Functions [4]: [partial_avg(cast(ss_quantity#10 as bigint)), partial_avg(UnscaledValue(ss_list_price#11)), partial_avg(UnscaledValue(ss_coupon_amt#13)), partial_avg(UnscaledValue(ss_sales_price#12))] +Functions [4]: [partial_avg(cast(ss_quantity#5 as bigint)), partial_avg(UnscaledValue(ss_list_price#6)), partial_avg(UnscaledValue(ss_coupon_amt#8)), partial_avg(UnscaledValue(ss_sales_price#7))] Aggregate Attributes [8]: [sum#24, count#25, sum#26, count#27, sum#28, count#29, sum#30, count#31] Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] @@ -183,9 +183,9 @@ Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] Keys [1]: [i_item_id#22] -Functions [4]: [avg(cast(ss_quantity#10 as bigint)), avg(UnscaledValue(ss_list_price#11)), avg(UnscaledValue(ss_coupon_amt#13)), avg(UnscaledValue(ss_sales_price#12))] -Aggregate Attributes [4]: [avg(cast(ss_quantity#10 as bigint))#41, avg(UnscaledValue(ss_list_price#11))#42, avg(UnscaledValue(ss_coupon_amt#13))#43, avg(UnscaledValue(ss_sales_price#12))#44] -Results [5]: [i_item_id#22, avg(cast(ss_quantity#10 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(ss_list_price#11))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(ss_coupon_amt#13))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(ss_sales_price#12))#44 / 100.0) as decimal(11,6)) AS agg4#48] +Functions [4]: [avg(cast(ss_quantity#5 as bigint)), avg(UnscaledValue(ss_list_price#6)), avg(UnscaledValue(ss_coupon_amt#8)), avg(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [4]: [avg(cast(ss_quantity#5 as bigint))#41, avg(UnscaledValue(ss_list_price#6))#42, avg(UnscaledValue(ss_coupon_amt#8))#43, avg(UnscaledValue(ss_sales_price#7))#44] +Results [5]: [i_item_id#22, avg(cast(ss_quantity#5 as bigint))#41 AS agg1#45, cast((avg(UnscaledValue(ss_list_price#6))#42 / 100.0) as decimal(11,6)) AS agg2#46, cast((avg(UnscaledValue(ss_coupon_amt#8))#43 / 100.0) as decimal(11,6)) AS agg3#47, cast((avg(UnscaledValue(ss_sales_price#7))#44 / 100.0) as decimal(11,6)) AS agg4#48] (34) TakeOrderedAndProject Input [5]: [i_item_id#22, agg1#45, agg2#46, agg3#47, agg4#48] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt index 0c5aab87ff745..d78afa9979777 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt @@ -12,7 +12,11 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_promo_sk,p_promo_sk] Project [ss_sold_date_sk,ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_sold_date_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,10 +25,6 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] - Filter [ss_cdemo_sk,ss_sold_date_sk,ss_item_sk,ss_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt index 853ec4daef5cb..00f691230ff69 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (47) +- * Project (38) +- * BroadcastHashJoin Inner BuildRight (37) :- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- BroadcastExchange (36) +- * BroadcastHashJoin LeftSemi BuildRight (35) :- * Filter (13) @@ -37,61 +37,61 @@ TakeOrderedAndProject (47) +- * Project (25) +- * BroadcastHashJoin Inner BuildRight (24) :- * Project (19) - : +- * BroadcastHashJoin Inner BuildLeft (18) - : :- ReusedExchange (14) - : +- * Filter (17) - : +- * ColumnarToRow (16) - : +- Scan parquet default.store_sales (15) + : +- * BroadcastHashJoin Inner BuildRight (18) + : :- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.store_sales (14) + : +- ReusedExchange (17) +- BroadcastExchange (23) +- * Filter (22) +- * ColumnarToRow (21) +- Scan parquet default.store (20) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_month_seq#2] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] +(2) ColumnarToRow [codegen id : 9] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] -Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 9] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_month_seq#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_month_seq#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] +Condition : (((isnotnull(d_month_seq#5) AND (d_month_seq#5 >= 1200)) AND (d_month_seq#5 <= 1211)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_month_seq#5] -(8) Filter -Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] -Condition : (isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_store_sk#5)) +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] (9) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 9] -Output [2]: [ss_store_sk#5, ss_net_profit#6] -Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +Output [2]: [ss_store_sk#2, ss_net_profit#3] +Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3, d_date_sk#4] (11) Scan parquet default.store Output [3]: [s_store_sk#7, s_county#8, s_state#9] @@ -107,31 +107,31 @@ Input [3]: [s_store_sk#7, s_county#8, s_state#9] Input [3]: [s_store_sk#7, s_county#8, s_state#9] Condition : isnotnull(s_store_sk#7) -(14) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(15) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +(14) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(16) ColumnarToRow -Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +(15) ColumnarToRow [codegen id : 4] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] + +(16) Filter [codegen id : 4] +Input [3]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(17) Filter -Input [3]: [ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] -Condition : (isnotnull(ss_store_sk#5) AND isnotnull(ss_sold_date_sk#4)) +(17) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#4] (18) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (19) Project [codegen id : 4] -Output [2]: [ss_store_sk#5, ss_net_profit#6] -Input [4]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_net_profit#6] +Output [2]: [ss_store_sk#2, ss_net_profit#3] +Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_net_profit#3, d_date_sk#4] (20) Scan parquet default.store Output [2]: [s_store_sk#7, s_state#9] @@ -152,18 +152,18 @@ Input [2]: [s_store_sk#7, s_state#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] (24) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#5] +Left keys [1]: [ss_store_sk#2] Right keys [1]: [s_store_sk#7] Join condition: None (25) Project [codegen id : 4] -Output [2]: [ss_net_profit#6, s_state#9] -Input [4]: [ss_store_sk#5, ss_net_profit#6, s_store_sk#7, s_state#9] +Output [2]: [ss_net_profit#3, s_state#9] +Input [4]: [ss_store_sk#2, ss_net_profit#3, s_store_sk#7, s_state#9] (26) HashAggregate [codegen id : 4] -Input [2]: [ss_net_profit#6, s_state#9] +Input [2]: [ss_net_profit#3, s_state#9] Keys [1]: [s_state#9] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#6))] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] Aggregate Attributes [1]: [sum#11] Results [2]: [s_state#9, sum#12] @@ -174,9 +174,9 @@ Arguments: hashpartitioning(s_state#9, 5), true, [id=#13] (28) HashAggregate [codegen id : 5] Input [2]: [s_state#9, sum#12] Keys [1]: [s_state#9] -Functions [1]: [sum(UnscaledValue(ss_net_profit#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#6))#14] -Results [3]: [s_state#9 AS s_state#15, s_state#9, MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#14,17,2) AS _w2#16] +Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#14] +Results [3]: [s_state#9 AS s_state#15, s_state#9, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#14,17,2) AS _w2#16] (29) Exchange Input [3]: [s_state#15, s_state#9, _w2#16] @@ -212,22 +212,22 @@ Input [3]: [s_store_sk#7, s_county#8, s_state#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] (37) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_store_sk#5] +Left keys [1]: [ss_store_sk#2] Right keys [1]: [s_store_sk#7] Join condition: None (38) Project [codegen id : 9] -Output [3]: [ss_net_profit#6, s_state#9, s_county#8] -Input [5]: [ss_store_sk#5, ss_net_profit#6, s_store_sk#7, s_county#8, s_state#9] +Output [3]: [ss_net_profit#3, s_state#9, s_county#8] +Input [5]: [ss_store_sk#2, ss_net_profit#3, s_store_sk#7, s_county#8, s_state#9] (39) Expand [codegen id : 9] -Input [3]: [ss_net_profit#6, s_state#9, s_county#8] -Arguments: [List(ss_net_profit#6, s_state#9, s_county#8, 0), List(ss_net_profit#6, s_state#9, null, 1), List(ss_net_profit#6, null, null, 3)], [ss_net_profit#6, s_state#21, s_county#22, spark_grouping_id#23] +Input [3]: [ss_net_profit#3, s_state#9, s_county#8] +Arguments: [List(ss_net_profit#3, s_state#9, s_county#8, 0), List(ss_net_profit#3, s_state#9, null, 1), List(ss_net_profit#3, null, null, 3)], [ss_net_profit#3, s_state#21, s_county#22, spark_grouping_id#23] (40) HashAggregate [codegen id : 9] -Input [4]: [ss_net_profit#6, s_state#21, s_county#22, spark_grouping_id#23] +Input [4]: [ss_net_profit#3, s_state#21, s_county#22, spark_grouping_id#23] Keys [3]: [s_state#21, s_county#22, spark_grouping_id#23] -Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#6))] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#3))] Aggregate Attributes [1]: [sum#24] Results [4]: [s_state#21, s_county#22, spark_grouping_id#23, sum#25] @@ -238,9 +238,9 @@ Arguments: hashpartitioning(s_state#21, s_county#22, spark_grouping_id#23, 5), t (42) HashAggregate [codegen id : 10] Input [4]: [s_state#21, s_county#22, spark_grouping_id#23, sum#25] Keys [3]: [s_state#21, s_county#22, spark_grouping_id#23] -Functions [1]: [sum(UnscaledValue(ss_net_profit#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#6))#27] -Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#27,17,2) AS total_sum#28, s_state#21, s_county#22, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS lochierarchy#29, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS _w1#30, CASE WHEN (cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#6))#27,17,2) AS _w3#32] +Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#27] +Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS total_sum#28, s_state#21, s_county#22, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS lochierarchy#29, (cast((shiftright(spark_grouping_id#23, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint)) AS _w1#30, CASE WHEN (cast(cast((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) as int) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS _w3#32] (43) Exchange Input [7]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, _w1#30, _w2#31, _w3#32] @@ -260,5 +260,5 @@ Input [8]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, _w1#30, _w2# (47) TakeOrderedAndProject Input [5]: [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] -Arguments: 100, [lochierarchy#29 DESC NULLS LAST, CASE WHEN (lochierarchy#29 = 0) THEN s_state#21 END ASC NULLS FIRST, rank_within_parent#34 ASC NULLS FIRST], [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] +Arguments: 100, [lochierarchy#29 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#29 as int) = 0) THEN s_state#21 END ASC NULLS FIRST, rank_within_parent#34 ASC NULLS FIRST], [total_sum#28, s_state#21, s_county#22, lochierarchy#29, rank_within_parent#34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt index 4eea3f30cde01..ae76771689231 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt @@ -17,7 +17,11 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count Project [ss_net_profit,s_state,s_county] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -26,10 +30,6 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (8) @@ -58,13 +58,13 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count Project [ss_net_profit,s_state] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_store_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_net_profit] + InputAdapter + ReusedExchange [d_date_sk] #3 InputAdapter BroadcastExchange #8 WholeStageCodegen (3) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt index 2ea6d93e428c3..3f8106c96379a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt @@ -49,26 +49,26 @@ TakeOrderedAndProject (79) : : : : +- Scan parquet default.item (26) : : : +- BroadcastExchange (43) : : : +- * Project (42) - : : : +- * BroadcastHashJoin Inner BuildRight (41) - : : : :- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.date_dim (33) - : : : +- BroadcastExchange (40) - : : : +- * Project (39) - : : : +- * Filter (38) - : : : +- * ColumnarToRow (37) - : : : +- Scan parquet default.date_dim (36) + : : : +- * BroadcastHashJoin Inner BuildLeft (41) + : : : :- BroadcastExchange (37) + : : : : +- * Project (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.date_dim (38) : : +- * Sort (58) : : +- Exchange (57) : : +- * Project (56) - : : +- * BroadcastHashJoin Inner BuildLeft (55) - : : :- BroadcastExchange (51) - : : : +- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.warehouse (48) - : : +- * Filter (54) - : : +- * ColumnarToRow (53) - : : +- Scan parquet default.inventory (52) + : : +- * BroadcastHashJoin Inner BuildRight (55) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.inventory (48) + : : +- BroadcastExchange (54) + : : +- * Filter (53) + : : +- * ColumnarToRow (52) + : : +- Scan parquet default.warehouse (51) : +- BroadcastExchange (64) : +- * Filter (63) : +- * ColumnarToRow (62) @@ -223,128 +223,128 @@ Output [7]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, Input [8]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_sk#19, i_item_desc#20] (33) Scan parquet default.date_dim -Output [2]: [d_date_sk#22, d_week_seq#23] +Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct -(34) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#22, d_week_seq#23] +(34) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -(35) Filter [codegen id : 9] -Input [2]: [d_date_sk#22, d_week_seq#23] -Condition : (isnotnull(d_week_seq#23) AND isnotnull(d_date_sk#22)) +(35) Filter [codegen id : 8] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 1999)) AND isnotnull(d_date_sk#22)) AND isnotnull(d_week_seq#24)) AND isnotnull(d_date#23)) -(36) Scan parquet default.date_dim -Output [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] -ReadSchema: struct +(36) Project [codegen id : 8] +Output [3]: [d_date_sk#22, d_date#23, d_week_seq#24] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -(37) ColumnarToRow [codegen id : 8] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +(37) BroadcastExchange +Input [3]: [d_date_sk#22, d_date#23, d_week_seq#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#26] -(38) Filter [codegen id : 8] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -Condition : ((((isnotnull(d_year#27) AND (d_year#27 = 1999)) AND isnotnull(d_date_sk#24)) AND isnotnull(d_week_seq#26)) AND isnotnull(d_date#25)) +(38) Scan parquet default.date_dim +Output [2]: [d_date_sk#27, d_week_seq#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(39) Project [codegen id : 8] -Output [3]: [d_date_sk#24, d_date#25, d_week_seq#26] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +(39) ColumnarToRow +Input [2]: [d_date_sk#27, d_week_seq#28] -(40) BroadcastExchange -Input [3]: [d_date_sk#24, d_date#25, d_week_seq#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#28] +(40) Filter +Input [2]: [d_date_sk#27, d_week_seq#28] +Condition : (isnotnull(d_week_seq#28) AND isnotnull(d_date_sk#27)) (41) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_week_seq#23] -Right keys [1]: [d_week_seq#26] +Left keys [1]: [d_week_seq#24] +Right keys [1]: [d_week_seq#28] Join condition: None (42) Project [codegen id : 9] -Output [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] -Input [5]: [d_date_sk#22, d_week_seq#23, d_date_sk#24, d_date#25, d_week_seq#26] +Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Input [5]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27, d_week_seq#28] (43) BroadcastExchange -Input [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#29] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#24] -Join condition: (d_date#16 > d_date#25 + 5 days) +Right keys [1]: [d_date_sk#22] +Join condition: (d_date#16 > d_date#23 + 5 days) (45) Project [codegen id : 10] -Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] (46) Exchange -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#22, 5), true, [id=#30] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#27, 5), true, [id=#30] (47) Sort [codegen id : 11] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#22 ASC NULLS FIRST], false, 0 +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#27 ASC NULLS FIRST], false, 0 -(48) Scan parquet default.warehouse -Output [2]: [w_warehouse_sk#31, w_warehouse_name#32] +(48) Scan parquet default.inventory +Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct - -(49) ColumnarToRow [codegen id : 12] -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(50) Filter [codegen id : 12] -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] -Condition : isnotnull(w_warehouse_sk#31) +(49) ColumnarToRow [codegen id : 13] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -(51) BroadcastExchange -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] +(50) Filter [codegen id : 13] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] +Condition : (((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) AND isnotnull(inv_date_sk#31)) -(52) Scan parquet default.inventory -Output [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +(51) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#35, w_warehouse_name#36] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -(53) ColumnarToRow -Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +(53) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +Condition : isnotnull(w_warehouse_sk#35) -(54) Filter -Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] -Condition : (((isnotnull(inv_quantity_on_hand#37) AND isnotnull(inv_item_sk#35)) AND isnotnull(inv_warehouse_sk#36)) AND isnotnull(inv_date_sk#34)) +(54) BroadcastExchange +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] (55) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [w_warehouse_sk#31] -Right keys [1]: [inv_warehouse_sk#36] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#35] Join condition: None (56) Project [codegen id : 13] -Output [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Input [6]: [w_warehouse_sk#31, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Input [6]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, w_warehouse_sk#35, w_warehouse_name#36] (57) Exchange -Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Arguments: hashpartitioning(inv_item_sk#35, inv_date_sk#34, 5), true, [id=#38] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#31, 5), true, [id=#38] (58) Sort [codegen id : 14] -Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Arguments: [inv_item_sk#35 ASC NULLS FIRST, inv_date_sk#34 ASC NULLS FIRST], false, 0 +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#31 ASC NULLS FIRST], false, 0 (59) SortMergeJoin [codegen id : 16] -Left keys [2]: [cs_item_sk#5, d_date_sk#22] -Right keys [2]: [inv_item_sk#35, inv_date_sk#34] -Join condition: (inv_quantity_on_hand#37 < cs_quantity#8) +Left keys [2]: [cs_item_sk#5, d_date_sk#27] +Right keys [2]: [inv_item_sk#32, inv_date_sk#31] +Join condition: (inv_quantity_on_hand#34 < cs_quantity#8) (60) Project [codegen id : 16] -Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_date_sk#22, d_week_seq#26, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27, inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] (61) Scan parquet default.promotion Output [1]: [p_promo_sk#39] @@ -370,15 +370,15 @@ Right keys [1]: [p_promo_sk#39] Join condition: None (66) Project [codegen id : 16] -Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, p_promo_sk#39] +Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, p_promo_sk#39] (67) Exchange -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] Arguments: hashpartitioning(cs_item_sk#5, cs_order_number#7, 5), true, [id=#41] (68) Sort [codegen id : 17] -Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] Arguments: [cs_item_sk#5 ASC NULLS FIRST, cs_order_number#7 ASC NULLS FIRST], false, 0 (69) Scan parquet default.catalog_returns @@ -409,28 +409,28 @@ Right keys [2]: [cr_item_sk#42, cr_order_number#43] Join condition: None (75) Project [codegen id : 20] -Output [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, cr_item_sk#42, cr_order_number#43] +Output [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, cr_item_sk#42, cr_order_number#43] (76) HashAggregate [codegen id : 20] -Input [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] +Input [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#45] -Results [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Results [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] (77) Exchange -Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] -Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#32, d_week_seq#26, 5), true, [id=#47] +Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#36, d_week_seq#24, 5), true, [id=#47] (78) HashAggregate [codegen id : 21] -Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] -Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] +Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#48] -Results [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] +Results [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] (79) TakeOrderedAndProject -Input [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] -Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#32 ASC NULLS FIRST, d_week_seq#26 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] +Input [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#36 ASC NULLS FIRST, d_week_seq#24 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt index 0737895f81551..918508787c4b0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt @@ -23,7 +23,7 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter Exchange [cs_item_sk,d_date_sk] #3 WholeStageCodegen (10) - Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_date_sk,d_week_seq] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,d_date,i_item_desc] SortMergeJoin [cs_item_sk,i_item_sk] @@ -79,12 +79,8 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter BroadcastExchange #9 WholeStageCodegen (9) - Project [d_date_sk,d_date_sk,d_date,d_week_seq] + Project [d_date_sk,d_date,d_week_seq,d_date_sk] BroadcastHashJoin [d_week_seq,d_week_seq] - Filter [d_week_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -93,14 +89,22 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter WholeStageCodegen (14) Sort [inv_item_sk,inv_date_sk] InputAdapter Exchange [inv_item_sk,inv_date_sk] #11 WholeStageCodegen (13) - Project [w_warehouse_name,inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [w_warehouse_sk,inv_warehouse_sk] + Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #12 WholeStageCodegen (12) @@ -108,10 +112,6 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] - Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #13 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt index c7ed017ee3634..4af604ca3f65f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_dom#3] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -Condition : ((((isnotnull(d_dom#3) AND (d_dom#3 >= 1)) AND (d_dom#3 <= 2)) AND d_year#2 IN (1999,2000,2001)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +Condition : ((((isnotnull(d_dom#8) AND (d_dom#8 >= 1)) AND (d_dom#8 <= 2)) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(8) Filter -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Condition : (((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#8] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] -Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] +Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] +Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#7] +Left keys [1]: [ss_hdemo_sk#3] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#6, ss_ticket_number#9] -Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] +Output [2]: [ss_customer_sk#2, ss_ticket_number#5] +Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#6, ss_ticket_number#9] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [2]: [ss_customer_sk#2, ss_ticket_number#5] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] (26) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] Condition : ((cnt#22 >= 1) AND (cnt#22 <= 5)) (29) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#6] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] -Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] Arguments: rangepartitioning(cnt#22 DESC NULLS LAST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] Arguments: [cnt#22 DESC NULLS LAST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt index 1bbf07c5f1ae7..af8527f155c8e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt @@ -22,7 +22,11 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt index 3017e69904f99..7b55fa470c616 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt @@ -61,11 +61,11 @@ TakeOrderedAndProject (86) : :- * Sort (53) : : +- Exchange (52) : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildLeft (50) - : : :- ReusedExchange (46) - : : +- * Filter (49) - : : +- * ColumnarToRow (48) - : : +- Scan parquet default.web_sales (47) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) : +- * Sort (55) : +- ReusedExchange (54) +- * Sort (83) @@ -78,11 +78,11 @@ TakeOrderedAndProject (86) :- * Sort (74) : +- Exchange (73) : +- * Project (72) - : +- * BroadcastHashJoin Inner BuildLeft (71) - : :- ReusedExchange (67) - : +- * Filter (70) - : +- * ColumnarToRow (69) - : +- Scan parquet default.web_sales (68) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) +- * Sort (76) +- ReusedExchange (75) @@ -293,38 +293,38 @@ Left keys [1]: [customer_id#17] Right keys [1]: [customer_id#26] Join condition: None -(46) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#4, d_year#5] - -(47) Scan parquet default.web_sales +(46) Scan parquet default.web_sales Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow +(47) ColumnarToRow [codegen id : 19] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(49) Filter +(48) Filter [codegen id : 19] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#4, d_year#5] + (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [d_date_sk#4] -Right keys [1]: [ws_sold_date_sk#31] +Left keys [1]: [ws_sold_date_sk#31] +Right keys [1]: [d_date_sk#4] Join condition: None (51) Project [codegen id : 19] -Output [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] -Input [5]: [d_date_sk#4, d_year#5, ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] (52) Exchange -Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#34] (53) Sort [codegen id : 20] -Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -341,7 +341,7 @@ Join condition: None (57) Project [codegen id : 23] Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (58) HashAggregate [codegen id : 23] Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] @@ -386,38 +386,38 @@ Join condition: None Output [7]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42] Input [8]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, customer_id#41, year_total#42] -(67) ReusedExchange [Reuses operator id: 31] -Output [2]: [d_date_sk#4, d_year#5] - -(68) Scan parquet default.web_sales +(67) Scan parquet default.web_sales Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(69) ColumnarToRow +(68) ColumnarToRow [codegen id : 28] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(70) Filter +(69) Filter [codegen id : 28] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#4, d_year#5] + (71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [d_date_sk#4] -Right keys [1]: [ws_sold_date_sk#31] +Left keys [1]: [ws_sold_date_sk#31] +Right keys [1]: [d_date_sk#4] Join condition: None (72) Project [codegen id : 28] -Output [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] -Input [5]: [d_date_sk#4, d_year#5, ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] (73) Exchange -Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#44] (74) Sort [codegen id : 29] -Input [3]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -434,7 +434,7 @@ Join condition: None (78) Project [codegen id : 32] Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] -Input [7]: [d_year#5, ws_bill_customer_sk#32, ws_net_paid#33, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (79) HashAggregate [codegen id : 32] Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt index 362a14659d67e..c8cfa693e88ba 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt @@ -110,14 +110,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [d_year,ws_bill_customer_sk,ws_net_paid] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_net_paid] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] @@ -142,14 +142,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [ws_bill_customer_sk] #15 WholeStageCodegen (28) - Project [d_year,ws_bill_customer_sk,ws_net_paid] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #9 + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_net_paid] + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 InputAdapter WholeStageCodegen (31) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt index 50f65d7896b57..10e9cbba93b13 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt @@ -7,14 +7,14 @@ TakeOrderedAndProject (44) :- * Project (15) : +- * BroadcastHashJoin Inner BuildRight (14) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : :- BroadcastExchange (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.store_sales (5) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (13) : +- * Filter (12) : +- * ColumnarToRow (11) @@ -23,68 +23,68 @@ TakeOrderedAndProject (44) : +- * BroadcastHashJoin Inner BuildLeft (29) : :- BroadcastExchange (25) : : +- * Project (24) - : : +- * BroadcastHashJoin Inner BuildRight (23) - : : :- * Filter (18) - : : : +- * ColumnarToRow (17) - : : : +- Scan parquet default.date_dim (16) - : : +- BroadcastExchange (22) - : : +- * Filter (21) - : : +- * ColumnarToRow (20) - : : +- Scan parquet default.web_sales (19) + : : +- * BroadcastHashJoin Inner BuildLeft (23) + : : :- BroadcastExchange (19) + : : : +- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.web_sales (16) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.date_dim (20) : +- * Filter (28) : +- * ColumnarToRow (27) : +- Scan parquet default.item (26) +- * Project (39) +- * BroadcastHashJoin Inner BuildRight (38) :- * Project (36) - : +- * BroadcastHashJoin Inner BuildLeft (35) - : :- ReusedExchange (31) - : +- * Filter (34) - : +- * ColumnarToRow (33) - : +- Scan parquet default.catalog_sales (32) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Filter (33) + : : +- * ColumnarToRow (32) + : : +- Scan parquet default.catalog_sales (31) + : +- ReusedExchange (34) +- ReusedExchange (37) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] -Condition : isnotnull(d_date_sk#1) +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] -(4) BroadcastExchange -Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] +(3) Filter [codegen id : 3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4] +Condition : ((isnull(ss_store_sk#3) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_sold_date_sk#1)) -(5) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] -(6) ColumnarToRow -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : isnotnull(d_date_sk#5) -(7) Filter -Input [4]: [ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] -Condition : ((isnull(ss_store_sk#7) AND isnotnull(ss_item_sk#6)) AND isnotnull(ss_sold_date_sk#5)) +(7) BroadcastExchange +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] (8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (9) Project [codegen id : 3] -Output [5]: [d_year#2, d_qoy#3, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] -Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, ss_sold_date_sk#5, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Output [5]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_year#6, d_qoy#7] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_date_sk#5, d_year#6, d_qoy#7] (10) Scan parquet default.item Output [2]: [i_item_sk#9, i_category#10] @@ -105,58 +105,58 @@ Input [2]: [i_item_sk#9, i_category#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_item_sk#6] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#9] Join condition: None (15) Project [codegen id : 3] -Output [6]: [store AS channel#12, ss_store_sk#7 AS col_name#13, d_year#2, d_qoy#3, i_category#10, ss_ext_sales_price#8 AS ext_sales_price#14] -Input [7]: [d_year#2, d_qoy#3, ss_item_sk#6, ss_store_sk#7, ss_ext_sales_price#8, i_item_sk#9, i_category#10] - -(16) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk)] -ReadSchema: struct +Output [6]: [store AS channel#12, ss_store_sk#3 AS col_name#13, d_year#6, d_qoy#7, i_category#10, ss_ext_sales_price#4 AS ext_sales_price#14] +Input [7]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] -(17) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] - -(18) Filter [codegen id : 5] -Input [3]: [d_date_sk#1, d_year#2, d_qoy#3] -Condition : isnotnull(d_date_sk#1) - -(19) Scan parquet default.web_sales +(16) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNull(ws_ship_customer_sk), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(20) ColumnarToRow [codegen id : 4] +(17) ColumnarToRow [codegen id : 4] Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] -(21) Filter [codegen id : 4] +(18) Filter [codegen id : 4] Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Condition : ((isnull(ws_ship_customer_sk#17) AND isnotnull(ws_item_sk#16)) AND isnotnull(ws_sold_date_sk#15)) -(22) BroadcastExchange +(19) BroadcastExchange Input [4]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] +(20) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(22) Filter +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : isnotnull(d_date_sk#5) + (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#15] +Left keys [1]: [ws_sold_date_sk#15] +Right keys [1]: [d_date_sk#5] Join condition: None (24) Project [codegen id : 5] -Output [5]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] -Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] +Output [5]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7] +Input [7]: [ws_sold_date_sk#15, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_date_sk#5, d_year#6, d_qoy#7] (25) BroadcastExchange -Input [5]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#20] +Input [5]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (26) Scan parquet default.item Output [2]: [i_item_sk#9, i_category#10] @@ -178,34 +178,34 @@ Right keys [1]: [i_item_sk#9] Join condition: None (30) Project [codegen id : 6] -Output [6]: [web AS channel#21, ws_ship_customer_sk#17 AS col_name#22, d_year#2, d_qoy#3, i_category#10, ws_ext_sales_price#18 AS ext_sales_price#23] -Input [7]: [d_year#2, d_qoy#3, ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, i_item_sk#9, i_category#10] - -(31) ReusedExchange [Reuses operator id: 4] -Output [3]: [d_date_sk#1, d_year#2, d_qoy#3] +Output [6]: [web AS channel#21, ws_ship_customer_sk#17 AS col_name#22, d_year#6, d_qoy#7, i_category#10, ws_ext_sales_price#18 AS ext_sales_price#23] +Input [7]: [ws_item_sk#16, ws_ship_customer_sk#17, ws_ext_sales_price#18, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] -(32) Scan parquet default.catalog_sales +(31) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNull(cs_ship_addr_sk), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(33) ColumnarToRow +(32) ColumnarToRow [codegen id : 9] Input [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] -(34) Filter +(33) Filter [codegen id : 9] Input [4]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] Condition : ((isnull(cs_ship_addr_sk#25) AND isnotnull(cs_item_sk#26)) AND isnotnull(cs_sold_date_sk#24)) +(34) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] + (35) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#24] +Left keys [1]: [cs_sold_date_sk#24] +Right keys [1]: [d_date_sk#5] Join condition: None (36) Project [codegen id : 9] -Output [5]: [d_year#2, d_qoy#3, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] -Input [7]: [d_date_sk#1, d_year#2, d_qoy#3, cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27] +Output [5]: [cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_year#6, d_qoy#7] +Input [7]: [cs_sold_date_sk#24, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_date_sk#5, d_year#6, d_qoy#7] (37) ReusedExchange [Reuses operator id: 13] Output [2]: [i_item_sk#9, i_category#10] @@ -216,30 +216,30 @@ Right keys [1]: [i_item_sk#9] Join condition: None (39) Project [codegen id : 9] -Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#2, d_qoy#3, i_category#10, cs_ext_sales_price#27 AS ext_sales_price#30] -Input [7]: [d_year#2, d_qoy#3, cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, i_item_sk#9, i_category#10] +Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#6, d_qoy#7, i_category#10, cs_ext_sales_price#27 AS ext_sales_price#30] +Input [7]: [cs_ship_addr_sk#25, cs_item_sk#26, cs_ext_sales_price#27, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] (40) Union (41) HashAggregate [codegen id : 10] -Input [6]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, ext_sales_price#14] -Keys [5]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10] +Input [6]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, ext_sales_price#14] +Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] Aggregate Attributes [2]: [count#31, sum#32] -Results [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] +Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] (42) Exchange -Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] -Arguments: hashpartitioning(channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, 5), true, [id=#35] +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] +Arguments: hashpartitioning(channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, 5), true, [id=#35] (43) HashAggregate [codegen id : 11] -Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count#33, sum#34] -Keys [5]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10] +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#33, sum#34] +Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] Aggregate Attributes [2]: [count(1)#36, sum(UnscaledValue(ext_sales_price#14))#37] -Results [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, count(1)#36 AS sales_cnt#38, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#37,17,2) AS sales_amt#39] +Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count(1)#36 AS sales_cnt#38, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#37,17,2) AS sales_amt#39] (44) TakeOrderedAndProject -Input [7]: [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, sales_cnt#38, sales_amt#39] -Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#2 ASC NULLS FIRST, d_qoy#3 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#2, d_qoy#3, i_category#10, sales_cnt#38, sales_amt#39] +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#38, sales_amt#39] +Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_qoy#7 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#38, sales_amt#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt index 26fdfadec3718..2da0d94f91e7c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt @@ -10,8 +10,12 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [d_year,d_qoy,ss_item_sk,ss_store_sk,ss_ext_sales_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -19,10 +23,6 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - Filter [ss_store_sk,ss_item_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -36,12 +36,8 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ InputAdapter BroadcastExchange #4 WholeStageCodegen (5) - Project [d_year,d_qoy,ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - Filter [d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Project [ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (4) @@ -49,6 +45,10 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] Filter [i_item_sk] ColumnarToRow InputAdapter @@ -56,13 +56,13 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (9) Project [cs_ship_addr_sk,d_year,d_qoy,i_category,cs_ext_sales_price] BroadcastHashJoin [cs_item_sk,i_item_sk] - Project [d_year,d_qoy,cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year,d_qoy] #2 + Project [cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_ship_addr_sk,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #2 InputAdapter ReusedExchange [i_item_sk,i_category] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt index 653499f9e5cc2..e6b88348e4d68 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt @@ -13,15 +13,15 @@ TakeOrderedAndProject (91) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -33,11 +33,11 @@ TakeOrderedAndProject (91) : +- * Project (28) : +- * BroadcastHashJoin Inner BuildRight (27) : :- * Project (25) - : : +- * BroadcastHashJoin Inner BuildLeft (24) - : : :- ReusedExchange (20) - : : +- * Filter (23) - : : +- * ColumnarToRow (22) - : : +- Scan parquet default.store_returns (21) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.store_returns (20) + : : +- ReusedExchange (23) : +- ReusedExchange (26) :- * Project (55) : +- BroadcastNestedLoopJoin Inner BuildRight (54) @@ -92,50 +92,50 @@ TakeOrderedAndProject (91) +- ReusedExchange (77) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_date#2] +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-03), LessThanOrEqual(d_date,2000-09-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] -Condition : (((isnotnull(d_date#2) AND (d_date#2 >= 11172)) AND (d_date#2 <= 11202)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 3] +Input [4]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Condition : (isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_date#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_date#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-03), LessThanOrEqual(d_date,2000-09-02), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_date#6] -(6) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_date#6] +Condition : (((isnotnull(d_date#6) AND (d_date#6 >= 11172)) AND (d_date#6 <= 11202)) AND isnotnull(d_date_sk#5)) -(7) ColumnarToRow -Input [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_date#6] -(8) Filter -Input [4]: [ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] -Condition : (isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_store_sk#5)) +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (10) Project [codegen id : 3] -Output [3]: [ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] -Input [5]: [d_date_sk#1, ss_sold_date_sk#4, ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7] +Output [3]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Input [5]: [ss_sold_date_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, d_date_sk#5] (11) Scan parquet default.store Output [1]: [s_store_sk#8] @@ -156,18 +156,18 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [ss_store_sk#5] +Left keys [1]: [ss_store_sk#2] Right keys [1]: [s_store_sk#8] Join condition: None (16) Project [codegen id : 3] -Output [3]: [ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] -Input [4]: [ss_store_sk#5, ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] +Output [3]: [ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] +Input [4]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] (17) HashAggregate [codegen id : 3] -Input [3]: [ss_ext_sales_price#6, ss_net_profit#7, s_store_sk#8] +Input [3]: [ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#8] Keys [1]: [s_store_sk#8] -Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#3)), partial_sum(UnscaledValue(ss_net_profit#4))] Aggregate Attributes [2]: [sum#10, sum#11] Results [3]: [s_store_sk#8, sum#12, sum#13] @@ -178,78 +178,78 @@ Arguments: hashpartitioning(s_store_sk#8, 5), true, [id=#14] (19) HashAggregate [codegen id : 8] Input [3]: [s_store_sk#8, sum#12, sum#13] Keys [1]: [s_store_sk#8] -Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_net_profit#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#6))#15, sum(UnscaledValue(ss_net_profit#7))#16] -Results [3]: [s_store_sk#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#15,17,2) AS sales#17, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#16,17,2) AS profit#18] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#3)), sum(UnscaledValue(ss_net_profit#4))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#3))#15, sum(UnscaledValue(ss_net_profit#4))#16] +Results [3]: [s_store_sk#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#15,17,2) AS sales#17, MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#16,17,2) AS profit#18] -(20) ReusedExchange [Reuses operator id: 14] -Output [1]: [s_store_sk#19] - -(21) Scan parquet default.store_returns -Output [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] +(20) Scan parquet default.store_returns +Output [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] Batched: true Location [not included in comparison]/{warehouse_dir}/store_returns] PushedFilters: [IsNotNull(sr_returned_date_sk), IsNotNull(sr_store_sk)] ReadSchema: struct -(22) ColumnarToRow -Input [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] +(21) ColumnarToRow [codegen id : 6] +Input [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] + +(22) Filter [codegen id : 6] +Input [4]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Condition : (isnotnull(sr_returned_date_sk#19) AND isnotnull(sr_store_sk#20)) -(23) Filter -Input [4]: [sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] -Condition : (isnotnull(sr_returned_date_sk#20) AND isnotnull(sr_store_sk#21)) +(23) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#23] (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cast(s_store_sk#19 as bigint)] -Right keys [1]: [sr_store_sk#21] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [cast(s_store_sk#23 as bigint)] Join condition: None (25) Project [codegen id : 6] -Output [4]: [s_store_sk#19, sr_returned_date_sk#20, sr_return_amt#22, sr_net_loss#23] -Input [5]: [s_store_sk#19, sr_returned_date_sk#20, sr_store_sk#21, sr_return_amt#22, sr_net_loss#23] +Output [4]: [sr_returned_date_sk#19, sr_return_amt#21, sr_net_loss#22, s_store_sk#23] +Input [5]: [sr_returned_date_sk#19, sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#23] -(26) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +(26) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sr_returned_date_sk#20] -Right keys [1]: [cast(d_date_sk#1 as bigint)] +Left keys [1]: [sr_returned_date_sk#19] +Right keys [1]: [cast(d_date_sk#5 as bigint)] Join condition: None (28) Project [codegen id : 6] -Output [3]: [sr_return_amt#22, sr_net_loss#23, s_store_sk#19] -Input [5]: [s_store_sk#19, sr_returned_date_sk#20, sr_return_amt#22, sr_net_loss#23, d_date_sk#1] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#23] +Input [5]: [sr_returned_date_sk#19, sr_return_amt#21, sr_net_loss#22, s_store_sk#23, d_date_sk#5] (29) HashAggregate [codegen id : 6] -Input [3]: [sr_return_amt#22, sr_net_loss#23, s_store_sk#19] -Keys [1]: [s_store_sk#19] -Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#22)), partial_sum(UnscaledValue(sr_net_loss#23))] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#23] +Keys [1]: [s_store_sk#23] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] Aggregate Attributes [2]: [sum#24, sum#25] -Results [3]: [s_store_sk#19, sum#26, sum#27] +Results [3]: [s_store_sk#23, sum#26, sum#27] (30) Exchange -Input [3]: [s_store_sk#19, sum#26, sum#27] -Arguments: hashpartitioning(s_store_sk#19, 5), true, [id=#28] +Input [3]: [s_store_sk#23, sum#26, sum#27] +Arguments: hashpartitioning(s_store_sk#23, 5), true, [id=#28] (31) HashAggregate [codegen id : 7] -Input [3]: [s_store_sk#19, sum#26, sum#27] -Keys [1]: [s_store_sk#19] -Functions [2]: [sum(UnscaledValue(sr_return_amt#22)), sum(UnscaledValue(sr_net_loss#23))] -Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#22))#29, sum(UnscaledValue(sr_net_loss#23))#30] -Results [3]: [s_store_sk#19, MakeDecimal(sum(UnscaledValue(sr_return_amt#22))#29,17,2) AS returns#31, MakeDecimal(sum(UnscaledValue(sr_net_loss#23))#30,17,2) AS profit_loss#32] +Input [3]: [s_store_sk#23, sum#26, sum#27] +Keys [1]: [s_store_sk#23] +Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#29, sum(UnscaledValue(sr_net_loss#22))#30] +Results [3]: [s_store_sk#23, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#29,17,2) AS returns#31, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#30,17,2) AS profit_loss#32] (32) BroadcastExchange -Input [3]: [s_store_sk#19, returns#31, profit_loss#32] +Input [3]: [s_store_sk#23, returns#31, profit_loss#32] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33] (33) BroadcastHashJoin [codegen id : 8] Left keys [1]: [s_store_sk#8] -Right keys [1]: [s_store_sk#19] +Right keys [1]: [s_store_sk#23] Join condition: None (34) Project [codegen id : 8] Output [5]: [sales#17, coalesce(returns#31, 0.00) AS returns#34, CheckOverflow((promote_precision(cast(profit#18 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#32, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#35, store channel AS channel#36, s_store_sk#8 AS id#37] -Input [6]: [s_store_sk#8, sales#17, profit#18, s_store_sk#19, returns#31, profit_loss#32] +Input [6]: [s_store_sk#8, sales#17, profit#18, s_store_sk#23, returns#31, profit_loss#32] (35) Scan parquet default.catalog_sales Output [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] @@ -265,17 +265,17 @@ Input [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_ Input [4]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] Condition : isnotnull(cs_sold_date_sk#38) -(38) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +(38) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] (39) BroadcastHashJoin [codegen id : 10] Left keys [1]: [cs_sold_date_sk#38] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (40) Project [codegen id : 10] Output [3]: [cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] -Input [5]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41, d_date_sk#1] +Input [5]: [cs_sold_date_sk#38, cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41, d_date_sk#5] (41) HashAggregate [codegen id : 10] Input [3]: [cs_call_center_sk#39, cs_ext_sales_price#40, cs_net_profit#41] @@ -309,17 +309,17 @@ Input [3]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53] Input [3]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53] Condition : isnotnull(cr_returned_date_sk#51) -(47) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +(47) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] (48) BroadcastHashJoin [codegen id : 13] Left keys [1]: [cr_returned_date_sk#51] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (49) Project [codegen id : 13] Output [2]: [cr_return_amount#52, cr_net_loss#53] -Input [4]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53, d_date_sk#1] +Input [4]: [cr_returned_date_sk#51, cr_return_amount#52, cr_net_loss#53, d_date_sk#5] (50) HashAggregate [codegen id : 13] Input [2]: [cr_return_amount#52, cr_net_loss#53] @@ -364,17 +364,17 @@ Input [4]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net Input [4]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70] Condition : (isnotnull(ws_sold_date_sk#67) AND isnotnull(ws_web_page_sk#68)) -(59) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +(59) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] (60) BroadcastHashJoin [codegen id : 18] Left keys [1]: [ws_sold_date_sk#67] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None (61) Project [codegen id : 18] Output [3]: [ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70] -Input [5]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70, d_date_sk#1] +Input [5]: [ws_sold_date_sk#67, ws_web_page_sk#68, ws_ext_sales_price#69, ws_net_profit#70, d_date_sk#5] (62) Scan parquet default.web_page Output [1]: [wp_web_page_sk#71] @@ -447,17 +447,17 @@ Join condition: None Output [4]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] Input [5]: [wr_returned_date_sk#82, wr_web_page_sk#83, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] -(77) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] +(77) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] (78) BroadcastHashJoin [codegen id : 21] Left keys [1]: [wr_returned_date_sk#82] -Right keys [1]: [cast(d_date_sk#1 as bigint)] +Right keys [1]: [cast(d_date_sk#5 as bigint)] Join condition: None (79) Project [codegen id : 21] Output [3]: [wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] -Input [5]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86, d_date_sk#1] +Input [5]: [wr_returned_date_sk#82, wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86, d_date_sk#5] (80) HashAggregate [codegen id : 21] Input [3]: [wr_return_amt#84, wr_net_loss#85, wp_web_page_sk#86] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt index f61f8aa5456a4..6840f4367260f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt @@ -19,7 +19,11 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ss_ext_sales_price,ss_net_profit,s_store_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -28,10 +32,6 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] - Filter [ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -49,14 +49,14 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] Project [sr_return_amt,sr_net_loss,s_store_sk] BroadcastHashJoin [sr_returned_date_sk,d_date_sk] - Project [s_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] - BroadcastHashJoin [s_store_sk,sr_store_sk] - InputAdapter - ReusedExchange [s_store_sk] #4 + Project [sr_returned_date_sk,sr_return_amt,sr_net_loss,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] Filter [sr_returned_date_sk,sr_store_sk] ColumnarToRow InputAdapter Scan parquet default.store_returns [sr_returned_date_sk,sr_store_sk,sr_return_amt,sr_net_loss] + InputAdapter + ReusedExchange [s_store_sk] #4 InputAdapter ReusedExchange [d_date_sk] #3 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt index d938ba85e762c..05cf4c2490b7b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt @@ -4,50 +4,50 @@ TakeOrderedAndProject (70) +- * SortMergeJoin Inner (68) :- * Project (46) : +- * SortMergeJoin Inner (45) - : :- * Sort (24) - : : +- * Filter (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) - : : :- * Project (13) - : : : +- * Filter (12) - : : : +- SortMergeJoin LeftOuter (11) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_returns (6) - : : +- BroadcastExchange (17) - : : +- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.date_dim (14) + : :- * Sort (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (13) + : : : +- * Filter (12) + : : : +- SortMergeJoin LeftOuter (11) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.date_dim (14) : +- * Sort (44) - : +- * HashAggregate (43) - : +- Exchange (42) - : +- * HashAggregate (41) - : +- * Project (40) - : +- * BroadcastHashJoin Inner BuildRight (39) - : :- * Project (37) - : : +- * Filter (36) - : : +- SortMergeJoin LeftOuter (35) - : : :- * Sort (29) - : : : +- Exchange (28) - : : : +- * Filter (27) - : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.store_sales (25) - : : +- * Sort (34) - : : +- Exchange (33) - : : +- * Filter (32) - : : +- * ColumnarToRow (31) - : : +- Scan parquet default.store_returns (30) - : +- ReusedExchange (38) + : +- * Filter (43) + : +- * HashAggregate (42) + : +- Exchange (41) + : +- * HashAggregate (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * Project (36) + : : +- * Filter (35) + : : +- SortMergeJoin LeftOuter (34) + : : :- * Sort (28) + : : : +- Exchange (27) + : : : +- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.catalog_sales (24) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.catalog_returns (29) + : +- ReusedExchange (37) +- * Sort (67) +- * Filter (66) +- * HashAggregate (65) @@ -71,68 +71,68 @@ TakeOrderedAndProject (70) +- ReusedExchange (60) -(1) Scan parquet default.catalog_sales -Output [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +(1) Scan parquet default.store_sales +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] (3) Filter [codegen id : 1] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Condition : ((isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_bill_customer_sk#2)) +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) (4) Exchange -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#8] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint), 5), true, [id=#8] (5) Sort [codegen id : 2] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 -(6) Scan parquet default.catalog_returns -Output [2]: [cr_item_sk#9, cr_order_number#10] +(6) Scan parquet default.store_returns +Output [2]: [sr_item_sk#9, sr_ticket_number#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [cr_item_sk#9, cr_order_number#10] +Input [2]: [sr_item_sk#9, sr_ticket_number#10] (8) Filter [codegen id : 3] -Input [2]: [cr_item_sk#9, cr_order_number#10] -Condition : (isnotnull(cr_order_number#10) AND isnotnull(cr_item_sk#9)) +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9)) (9) Exchange -Input [2]: [cr_item_sk#9, cr_order_number#10] -Arguments: hashpartitioning(cr_order_number#10, cr_item_sk#9, 5), true, [id=#11] +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Arguments: hashpartitioning(sr_ticket_number#10, sr_item_sk#9, 5), true, [id=#11] (10) Sort [codegen id : 4] -Input [2]: [cr_item_sk#9, cr_order_number#10] -Arguments: [cr_order_number#10 ASC NULLS FIRST, cr_item_sk#9 ASC NULLS FIRST], false, 0 +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Arguments: [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST], false, 0 (11) SortMergeJoin -Left keys [2]: [cs_order_number#4, cs_item_sk#3] -Right keys [2]: [cr_order_number#10, cr_item_sk#9] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint)] +Right keys [2]: [sr_ticket_number#10, sr_item_sk#9] Join condition: None (12) Filter [codegen id : 6] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] -Condition : isnull(cr_order_number#10) +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] +Condition : isnull(sr_ticket_number#10) (13) Project [codegen id : 6] -Output [6]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] (14) Scan parquet default.date_dim Output [2]: [d_date_sk#12, d_year#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk), EqualTo(d_year,2000), IsNotNull(d_year)] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct (15) ColumnarToRow [codegen id : 5] @@ -140,146 +140,146 @@ Input [2]: [d_date_sk#12, d_year#13] (16) Filter [codegen id : 5] Input [2]: [d_date_sk#12, d_year#13] -Condition : ((isnotnull(d_date_sk#12) AND (d_year#13 = 2000)) AND isnotnull(d_year#13)) +Condition : ((isnotnull(d_year#13) AND (d_year#13 = 2000)) AND isnotnull(d_date_sk#12)) (17) BroadcastExchange Input [2]: [d_date_sk#12, d_year#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] -Input [8]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_date_sk#12, d_year#13] +Output [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_date_sk#12, d_year#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] -Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] -Functions [3]: [partial_sum(cast(cs_quantity#5 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#6)), partial_sum(UnscaledValue(cs_sales_price#7))] +Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] +Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] +Functions [3]: [partial_sum(cast(ss_quantity#5 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#6)), partial_sum(UnscaledValue(ss_sales_price#7))] Aggregate Attributes [3]: [sum#15, sum#16, sum#17] -Results [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Results [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] (21) Exchange -Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] -Arguments: hashpartitioning(d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, 5), true, [id=#21] +Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Arguments: hashpartitioning(d_year#13, ss_item_sk#2, ss_customer_sk#3, 5), true, [id=#21] (22) HashAggregate [codegen id : 7] -Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] -Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] -Functions [3]: [sum(cast(cs_quantity#5 as bigint)), sum(UnscaledValue(cs_wholesale_cost#6)), sum(UnscaledValue(cs_sales_price#7))] -Aggregate Attributes [3]: [sum(cast(cs_quantity#5 as bigint))#22, sum(UnscaledValue(cs_wholesale_cost#6))#23, sum(UnscaledValue(cs_sales_price#7))#24] -Results [6]: [d_year#13 AS cs_sold_year#25, cs_item_sk#3, cs_bill_customer_sk#2 AS cs_customer_sk#26, sum(cast(cs_quantity#5 as bigint))#22 AS cs_qty#27, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#6))#23,17,2) AS cs_wc#28, MakeDecimal(sum(UnscaledValue(cs_sales_price#7))#24,17,2) AS cs_sp#29] - -(23) Filter [codegen id : 7] -Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] -Condition : (coalesce(cs_qty#27, 0) > 0) - -(24) Sort [codegen id : 7] -Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] -Arguments: [cs_sold_year#25 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST, cs_customer_sk#26 ASC NULLS FIRST], false, 0 - -(25) Scan parquet default.store_sales -Output [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] +Functions [3]: [sum(cast(ss_quantity#5 as bigint)), sum(UnscaledValue(ss_wholesale_cost#6)), sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#5 as bigint))#22, sum(UnscaledValue(ss_wholesale_cost#6))#23, sum(UnscaledValue(ss_sales_price#7))#24] +Results [6]: [d_year#13 AS ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, sum(cast(ss_quantity#5 as bigint))#22 AS ss_qty#26, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#6))#23,17,2) AS ss_wc#27, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#24,17,2) AS ss_sp#28] + +(23) Sort [codegen id : 7] +Input [6]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] +Arguments: [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct -(26) ColumnarToRow [codegen id : 8] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +(25) ColumnarToRow [codegen id : 8] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -(27) Filter [codegen id : 8] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Condition : ((isnotnull(ss_sold_date_sk#30) AND isnotnull(ss_item_sk#31)) AND isnotnull(ss_customer_sk#32)) +(26) Filter [codegen id : 8] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Condition : ((isnotnull(cs_sold_date_sk#29) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_bill_customer_sk#30)) -(28) Exchange -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Arguments: hashpartitioning(cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint), 5), true, [id=#37] +(27) Exchange +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Arguments: hashpartitioning(cs_order_number#32, cs_item_sk#31, 5), true, [id=#36] -(29) Sort [codegen id : 9] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Arguments: [cast(ss_ticket_number#33 as bigint) ASC NULLS FIRST, cast(ss_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 +(28) Sort [codegen id : 9] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Arguments: [cs_order_number#32 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.store_returns -Output [2]: [sr_item_sk#38, sr_ticket_number#39] +(29) Scan parquet default.catalog_returns +Output [2]: [cr_item_sk#37, cr_order_number#38] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct -(31) ColumnarToRow [codegen id : 10] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] +(30) ColumnarToRow [codegen id : 10] +Input [2]: [cr_item_sk#37, cr_order_number#38] -(32) Filter [codegen id : 10] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Condition : (isnotnull(sr_ticket_number#39) AND isnotnull(sr_item_sk#38)) +(31) Filter [codegen id : 10] +Input [2]: [cr_item_sk#37, cr_order_number#38] +Condition : (isnotnull(cr_order_number#38) AND isnotnull(cr_item_sk#37)) -(33) Exchange -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Arguments: hashpartitioning(sr_ticket_number#39, sr_item_sk#38, 5), true, [id=#40] +(32) Exchange +Input [2]: [cr_item_sk#37, cr_order_number#38] +Arguments: hashpartitioning(cr_order_number#38, cr_item_sk#37, 5), true, [id=#39] -(34) Sort [codegen id : 11] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Arguments: [sr_ticket_number#39 ASC NULLS FIRST, sr_item_sk#38 ASC NULLS FIRST], false, 0 +(33) Sort [codegen id : 11] +Input [2]: [cr_item_sk#37, cr_order_number#38] +Arguments: [cr_order_number#38 ASC NULLS FIRST, cr_item_sk#37 ASC NULLS FIRST], false, 0 -(35) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint)] -Right keys [2]: [sr_ticket_number#39, sr_item_sk#38] +(34) SortMergeJoin +Left keys [2]: [cs_order_number#32, cs_item_sk#31] +Right keys [2]: [cr_order_number#38, cr_item_sk#37] Join condition: None -(36) Filter [codegen id : 13] -Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] -Condition : isnull(sr_ticket_number#39) +(35) Filter [codegen id : 13] +Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] +Condition : isnull(cr_order_number#38) -(37) Project [codegen id : 13] -Output [6]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] +(36) Project [codegen id : 13] +Output [6]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] -(38) ReusedExchange [Reuses operator id: 17] +(37) ReusedExchange [Reuses operator id: 17] Output [2]: [d_date_sk#12, d_year#13] -(39) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ss_sold_date_sk#30] +(38) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [cs_sold_date_sk#29] Right keys [1]: [d_date_sk#12] Join condition: None -(40) Project [codegen id : 13] -Output [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] -Input [8]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_date_sk#12, d_year#13] +(39) Project [codegen id : 13] +Output [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] +Input [8]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_date_sk#12, d_year#13] + +(40) HashAggregate [codegen id : 13] +Input [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] +Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] +Functions [3]: [partial_sum(cast(cs_quantity#33 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#34)), partial_sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [3]: [sum#40, sum#41, sum#42] +Results [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -(41) HashAggregate [codegen id : 13] -Input [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] -Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] -Functions [3]: [partial_sum(cast(ss_quantity#34 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#35)), partial_sum(UnscaledValue(ss_sales_price#36))] -Aggregate Attributes [3]: [sum#41, sum#42, sum#43] -Results [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +(41) Exchange +Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +Arguments: hashpartitioning(d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, 5), true, [id=#46] -(42) Exchange -Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -Arguments: hashpartitioning(d_year#13, ss_item_sk#31, ss_customer_sk#32, 5), true, [id=#47] +(42) HashAggregate [codegen id : 14] +Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] +Functions [3]: [sum(cast(cs_quantity#33 as bigint)), sum(UnscaledValue(cs_wholesale_cost#34)), sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [3]: [sum(cast(cs_quantity#33 as bigint))#47, sum(UnscaledValue(cs_wholesale_cost#34))#48, sum(UnscaledValue(cs_sales_price#35))#49] +Results [6]: [d_year#13 AS cs_sold_year#50, cs_item_sk#31, cs_bill_customer_sk#30 AS cs_customer_sk#51, sum(cast(cs_quantity#33 as bigint))#47 AS cs_qty#52, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#34))#48,17,2) AS cs_wc#53, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#49,17,2) AS cs_sp#54] -(43) HashAggregate [codegen id : 14] -Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] -Functions [3]: [sum(cast(ss_quantity#34 as bigint)), sum(UnscaledValue(ss_wholesale_cost#35)), sum(UnscaledValue(ss_sales_price#36))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#34 as bigint))#48, sum(UnscaledValue(ss_wholesale_cost#35))#49, sum(UnscaledValue(ss_sales_price#36))#50] -Results [6]: [d_year#13 AS ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, sum(cast(ss_quantity#34 as bigint))#48 AS ss_qty#52, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#35))#49,17,2) AS ss_wc#53, MakeDecimal(sum(UnscaledValue(ss_sales_price#36))#50,17,2) AS ss_sp#54] +(43) Filter [codegen id : 14] +Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Condition : (coalesce(cs_qty#52, 0) > 0) (44) Sort [codegen id : 14] -Input [6]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Arguments: [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Arguments: [cs_sold_year#50 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST, cs_customer_sk#51 ASC NULLS FIRST], false, 0 (45) SortMergeJoin [codegen id : 15] -Left keys [3]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26] -Right keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] +Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] +Right keys [3]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51] Join condition: None (46) Project [codegen id : 15] -Output [9]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Input [12]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Output [9]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54] +Input [12]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] (47) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61] @@ -377,15 +377,15 @@ Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc# Arguments: [ws_sold_year#76 ASC NULLS FIRST, ws_item_sk#56 ASC NULLS FIRST, ws_customer_sk#77 ASC NULLS FIRST], false, 0 (68) SortMergeJoin [codegen id : 23] -Left keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] +Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] Right keys [3]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77] Join condition: None (69) Project [codegen id : 23] -Output [12]: [round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) AS ratio#81, ss_qty#52 AS store_qty#82, ss_wc#53 AS store_wholesale_cost#83, ss_sp#54 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#27, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#28, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#29, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_qty#52, ss_wc#53, ss_sp#54, ws_qty#78, cs_qty#27] -Input [15]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] +Output [12]: [round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) AS ratio#81, ss_qty#26 AS store_qty#82, ss_wc#27 AS store_wholesale_cost#83, ss_sp#28 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#52, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#53, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#54, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_qty#26, ss_wc#27, ss_sp#28, ws_qty#78, cs_qty#52] +Input [15]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] (70) TakeOrderedAndProject -Input [12]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_qty#52, ss_wc#53, ss_sp#54, ws_qty#78, cs_qty#27] -Arguments: 100, [ratio#81 ASC NULLS FIRST, ss_qty#52 DESC NULLS LAST, ss_wc#53 DESC NULLS LAST, ss_sp#54 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] +Input [12]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_qty#26, ss_wc#27, ss_sp#28, ws_qty#78, cs_qty#52] +Arguments: 100, [ratio#81 ASC NULLS FIRST, ss_qty#26 DESC NULLS LAST, ss_wc#27 DESC NULLS LAST, ss_sp#28 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt index 80581ddbdfaa8..b46178cb8f473 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt @@ -4,16 +4,55 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholes SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (15) - Project [cs_qty,cs_wc,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp] - SortMergeJoin [cs_sold_year,cs_item_sk,cs_customer_sk,ss_sold_year,ss_item_sk,ss_customer_sk] + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] InputAdapter WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] + Filter [sr_ticket_number] + InputAdapter + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #3 + WholeStageCodegen (3) + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) Sort [cs_sold_year,cs_item_sk,cs_customer_sk] Filter [cs_qty] HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cast(cs_quantity as bigint)),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #1 - WholeStageCodegen (6) + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 + WholeStageCodegen (13) HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -21,65 +60,26 @@ TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholes Filter [cr_order_number] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (2) + WholeStageCodegen (9) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #2 - WholeStageCodegen (1) + Exchange [cs_order_number,cs_item_sk] #6 + WholeStageCodegen (8) Filter [cs_sold_date_sk,cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price] - WholeStageCodegen (4) + WholeStageCodegen (11) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #3 - WholeStageCodegen (3) + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (10) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (5) - Filter [d_date_sk,d_year] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (14) - Sort [ss_sold_year,ss_item_sk,ss_customer_sk] - HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] - InputAdapter - Exchange [d_year,ss_item_sk,ss_customer_sk] #5 - WholeStageCodegen (13) - HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] - Filter [sr_ticket_number] - InputAdapter - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - WholeStageCodegen (9) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #6 - WholeStageCodegen (8) - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] - WholeStageCodegen (11) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #7 - WholeStageCodegen (10) - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [ws_sold_year,ws_item_sk,ws_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt index e1d004d37deb2..9ac081b356c94 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -87,20 +87,20 @@ TakeOrderedAndProject (108) : :- * Project (90) : : +- * BroadcastHashJoin Inner BuildRight (89) : : :- * Project (87) - : : : +- * BroadcastHashJoin Inner BuildLeft (86) - : : : :- ReusedExchange (73) - : : : +- * Project (85) - : : : +- SortMergeJoin LeftOuter (84) - : : : :- * Sort (78) - : : : : +- Exchange (77) - : : : : +- * Filter (76) - : : : : +- * ColumnarToRow (75) - : : : : +- Scan parquet default.web_sales (74) - : : : +- * Sort (83) - : : : +- Exchange (82) - : : : +- * Filter (81) - : : : +- * ColumnarToRow (80) - : : : +- Scan parquet default.web_returns (79) + : : : +- * BroadcastHashJoin Inner BuildRight (86) + : : : :- * Project (84) + : : : : +- SortMergeJoin LeftOuter (83) + : : : : :- * Sort (77) + : : : : : +- Exchange (76) + : : : : : +- * Filter (75) + : : : : : +- * ColumnarToRow (74) + : : : : : +- Scan parquet default.web_sales (73) + : : : : +- * Sort (82) + : : : : +- Exchange (81) + : : : : +- * Filter (80) + : : : : +- * ColumnarToRow (79) + : : : : +- Scan parquet default.web_returns (78) + : : : +- ReusedExchange (85) : : +- ReusedExchange (88) : +- ReusedExchange (91) +- BroadcastExchange (97) @@ -434,70 +434,70 @@ Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#50)), sum(coalesce(cast(cr_ Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#50))#72, sum(coalesce(cast(cr_return_amount#55 as decimal(12,2)), 0.00))#73, sum(CheckOverflow((promote_precision(cast(cs_net_profit#51 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#56 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#74] Results [5]: [MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#50))#72,17,2) AS sales#75, sum(coalesce(cast(cr_return_amount#55 as decimal(12,2)), 0.00))#73 AS returns#76, sum(CheckOverflow((promote_precision(cast(cs_net_profit#51 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#56 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#74 AS profit#77, catalog channel AS channel#78, concat(catalog_page, cp_catalog_page_id#59) AS id#79] -(73) ReusedExchange [Reuses operator id: 17] -Output [1]: [i_item_sk#14] - -(74) Scan parquet default.web_sales +(73) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] ReadSchema: struct -(75) ColumnarToRow [codegen id : 22] +(74) ColumnarToRow [codegen id : 21] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] -(76) Filter [codegen id : 22] +(75) Filter [codegen id : 21] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Condition : (((isnotnull(ws_sold_date_sk#80) AND isnotnull(ws_web_site_sk#82)) AND isnotnull(ws_item_sk#81)) AND isnotnull(ws_promo_sk#83)) -(77) Exchange +(76) Exchange Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Arguments: hashpartitioning(cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint), 5), true, [id=#87] -(78) Sort [codegen id : 23] +(77) Sort [codegen id : 22] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] Arguments: [cast(ws_item_sk#81 as bigint) ASC NULLS FIRST, cast(ws_order_number#84 as bigint) ASC NULLS FIRST], false, 0 -(79) Scan parquet default.web_returns +(78) Scan parquet default.web_returns Output [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] ReadSchema: struct -(80) ColumnarToRow [codegen id : 24] +(79) ColumnarToRow [codegen id : 23] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] -(81) Filter [codegen id : 24] +(80) Filter [codegen id : 23] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Condition : (isnotnull(wr_item_sk#88) AND isnotnull(wr_order_number#89)) -(82) Exchange +(81) Exchange Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Arguments: hashpartitioning(wr_item_sk#88, wr_order_number#89, 5), true, [id=#92] -(83) Sort [codegen id : 25] +(82) Sort [codegen id : 24] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] Arguments: [wr_item_sk#88 ASC NULLS FIRST, wr_order_number#89 ASC NULLS FIRST], false, 0 -(84) SortMergeJoin +(83) SortMergeJoin Left keys [2]: [cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint)] Right keys [2]: [wr_item_sk#88, wr_order_number#89] Join condition: None -(85) Project +(84) Project [codegen id : 29] Output [8]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] Input [11]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86, wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] +(85) ReusedExchange [Reuses operator id: 17] +Output [1]: [i_item_sk#14] + (86) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [i_item_sk#14] -Right keys [1]: [ws_item_sk#81] +Left keys [1]: [ws_item_sk#81] +Right keys [1]: [i_item_sk#14] Join condition: None (87) Project [codegen id : 29] Output [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [9]: [i_item_sk#14, ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] +Input [9]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, i_item_sk#14] (88) ReusedExchange [Reuses operator id: 24] Output [1]: [p_promo_sk#17] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt index 54f19c3fb0d09..ec00b49e71989 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt @@ -135,30 +135,30 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ws_sold_date_sk,ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] BroadcastHashJoin [ws_promo_sk,p_promo_sk] Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [i_item_sk,ws_item_sk] - InputAdapter - ReusedExchange [i_item_sk] #5 + BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] InputAdapter SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] - WholeStageCodegen (23) + WholeStageCodegen (22) Sort [ws_item_sk,ws_order_number] InputAdapter Exchange [ws_item_sk,ws_order_number] #14 - WholeStageCodegen (22) + WholeStageCodegen (21) Filter [ws_sold_date_sk,ws_web_site_sk,ws_item_sk,ws_promo_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit] - WholeStageCodegen (25) + WholeStageCodegen (24) Sort [wr_item_sk,wr_order_number] InputAdapter Exchange [wr_item_sk,wr_order_number] #15 - WholeStageCodegen (24) + WholeStageCodegen (23) Filter [wr_item_sk,wr_order_number] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] + InputAdapter + ReusedExchange [i_item_sk] #5 InputAdapter ReusedExchange [p_promo_sk] #6 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt index 94df2644152f2..6e757528a3e68 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt @@ -7,14 +7,14 @@ TakeOrderedAndProject (61) : :- * Sort (11) : : +- Exchange (10) : : +- * Project (9) - : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : :- BroadcastExchange (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.customer_address (1) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.customer (5) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.customer_address (4) : +- * Sort (36) : +- Exchange (35) : +- * Filter (34) @@ -53,63 +53,63 @@ TakeOrderedAndProject (61) :- * Sort (46) : +- Exchange (45) : +- * Project (44) - : +- * BroadcastHashJoin Inner BuildLeft (43) - : :- ReusedExchange (39) - : +- * Filter (42) - : +- * ColumnarToRow (41) - : +- Scan parquet default.catalog_returns (40) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Filter (41) + : : +- * ColumnarToRow (40) + : : +- Scan parquet default.catalog_returns (39) + : +- ReusedExchange (42) +- * Sort (48) +- ReusedExchange (47) -(1) Scan parquet default.customer_address -Output [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] +(1) Scan parquet default.customer +Output [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] -Condition : ((isnotnull(ca_state#8) AND (ca_state#8 = GA)) AND isnotnull(ca_address_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] -(4) BroadcastExchange -Input [12]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] +(3) Filter [codegen id : 2] +Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) -(5) Scan parquet default.customer -Output [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] +(4) Scan parquet default.customer_address +Output [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] -(6) ColumnarToRow -Input [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] +(6) Filter [codegen id : 1] +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Condition : ((isnotnull(ca_state#14) AND (ca_state#14 = GA)) AND isnotnull(ca_address_sk#7)) -(7) Filter -Input [6]: [c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] -Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_current_addr_sk#16)) +(7) BroadcastExchange +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [c_current_addr_sk#16] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#7] Join condition: None (9) Project [codegen id : 2] -Output [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] -Input [18]: [ca_address_sk#1, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_current_addr_sk#16, c_salutation#17, c_first_name#18, c_last_name#19] +Output [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Input [18]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] (10) Exchange -Input [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] -Arguments: hashpartitioning(c_customer_sk#14, 5), true, [id=#20] +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: hashpartitioning(c_customer_sk#1, 5), true, [id=#20] (11) Sort [codegen id : 3] -Input [16]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19] -Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0 +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 (12) Scan parquet default.catalog_returns Output [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] @@ -165,53 +165,53 @@ Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_ Arguments: [cr_returning_addr_sk#23 ASC NULLS FIRST], false, 0 (24) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#8] +Output [2]: [ca_address_sk#7, ca_state#14] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] ReadSchema: struct (25) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#1, ca_state#8] +Input [2]: [ca_address_sk#7, ca_state#14] (26) Filter [codegen id : 7] -Input [2]: [ca_address_sk#1, ca_state#8] -Condition : (isnotnull(ca_address_sk#1) AND isnotnull(ca_state#8)) +Input [2]: [ca_address_sk#7, ca_state#14] +Condition : (isnotnull(ca_address_sk#7) AND isnotnull(ca_state#14)) (27) Exchange -Input [2]: [ca_address_sk#1, ca_state#8] -Arguments: hashpartitioning(ca_address_sk#1, 5), true, [id=#29] +Input [2]: [ca_address_sk#7, ca_state#14] +Arguments: hashpartitioning(ca_address_sk#7, 5), true, [id=#29] (28) Sort [codegen id : 8] -Input [2]: [ca_address_sk#1, ca_state#8] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#7, ca_state#14] +Arguments: [ca_address_sk#7 ASC NULLS FIRST], false, 0 (29) SortMergeJoin [codegen id : 9] Left keys [1]: [cr_returning_addr_sk#23] -Right keys [1]: [ca_address_sk#1] +Right keys [1]: [ca_address_sk#7] Join condition: None (30) Project [codegen id : 9] -Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] -Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#1, ca_state#8] +Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] +Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#7, ca_state#14] (31) HashAggregate [codegen id : 9] -Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] -Keys [2]: [cr_returning_customer_sk#22, ca_state#8] +Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] +Keys [2]: [cr_returning_customer_sk#22, ca_state#14] Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum#30] -Results [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] +Results [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] (32) Exchange -Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] -Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#8, 5), true, [id=#32] +Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] +Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#14, 5), true, [id=#32] (33) HashAggregate [codegen id : 10] -Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#31] -Keys [2]: [cr_returning_customer_sk#22, ca_state#8] +Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#31] +Keys [2]: [cr_returning_customer_sk#22, ca_state#14] Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))#33] -Results [3]: [cr_returning_customer_sk#22 AS ctr_customer_sk#34, ca_state#8 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#33,17,2) AS ctr_total_return#36] +Results [3]: [cr_returning_customer_sk#22 AS ctr_customer_sk#34, ca_state#14 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#33,17,2) AS ctr_total_return#36] (34) Filter [codegen id : 10] Input [3]: [ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] @@ -226,39 +226,39 @@ Input [3]: [ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] Arguments: [ctr_customer_sk#34 ASC NULLS FIRST], false, 0 (37) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_customer_sk#14] +Left keys [1]: [c_customer_sk#1] Right keys [1]: [ctr_customer_sk#34] Join condition: None (38) Project [codegen id : 20] -Output [17]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_state#35, ctr_total_return#36] -Input [19]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_sk#14, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] - -(39) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#25] +Output [17]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#35, ctr_total_return#36] +Input [19]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_customer_sk#34, ctr_state#35, ctr_total_return#36] -(40) Scan parquet default.catalog_returns +(39) Scan parquet default.catalog_returns Output [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_addr_sk)] ReadSchema: struct -(41) ColumnarToRow +(40) ColumnarToRow [codegen id : 13] Input [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] -(42) Filter +(41) Filter [codegen id : 13] Input [4]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] Condition : (isnotnull(cr_returned_date_sk#21) AND isnotnull(cr_returning_addr_sk#23)) +(42) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#25] + (43) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [d_date_sk#25] -Right keys [1]: [cr_returned_date_sk#21] +Left keys [1]: [cr_returned_date_sk#21] +Right keys [1]: [d_date_sk#25] Join condition: None (44) Project [codegen id : 13] Output [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] -Input [5]: [d_date_sk#25, cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] +Input [5]: [cr_returned_date_sk#21, cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, d_date_sk#25] (45) Exchange Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24] @@ -269,38 +269,38 @@ Input [3]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_ Arguments: [cr_returning_addr_sk#23 ASC NULLS FIRST], false, 0 (47) ReusedExchange [Reuses operator id: 27] -Output [2]: [ca_address_sk#1, ca_state#8] +Output [2]: [ca_address_sk#7, ca_state#14] (48) Sort [codegen id : 16] -Input [2]: [ca_address_sk#1, ca_state#8] -Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#7, ca_state#14] +Arguments: [ca_address_sk#7 ASC NULLS FIRST], false, 0 (49) SortMergeJoin [codegen id : 17] Left keys [1]: [cr_returning_addr_sk#23] -Right keys [1]: [ca_address_sk#1] +Right keys [1]: [ca_address_sk#7] Join condition: None (50) Project [codegen id : 17] -Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] -Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#1, ca_state#8] +Output [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] +Input [5]: [cr_returning_customer_sk#22, cr_returning_addr_sk#23, cr_return_amt_inc_tax#24, ca_address_sk#7, ca_state#14] (51) HashAggregate [codegen id : 17] -Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#8] -Keys [2]: [cr_returning_customer_sk#22, ca_state#8] +Input [3]: [cr_returning_customer_sk#22, cr_return_amt_inc_tax#24, ca_state#14] +Keys [2]: [cr_returning_customer_sk#22, ca_state#14] Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum#39] -Results [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] +Results [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] (52) Exchange -Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] -Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#8, 5), true, [id=#41] +Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] +Arguments: hashpartitioning(cr_returning_customer_sk#22, ca_state#14, 5), true, [id=#41] (53) HashAggregate [codegen id : 18] -Input [3]: [cr_returning_customer_sk#22, ca_state#8, sum#40] -Keys [2]: [cr_returning_customer_sk#22, ca_state#8] +Input [3]: [cr_returning_customer_sk#22, ca_state#14, sum#40] +Keys [2]: [cr_returning_customer_sk#22, ca_state#14] Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))] Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#24))#42] -Results [2]: [ca_state#8 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#42,17,2) AS ctr_total_return#36] +Results [2]: [ca_state#14 AS ctr_state#35, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#24))#42,17,2) AS ctr_total_return#36] (54) HashAggregate [codegen id : 18] Input [2]: [ctr_state#35, ctr_total_return#36] @@ -334,10 +334,10 @@ Right keys [1]: [ctr_state#35#50] Join condition: (cast(ctr_total_return#36 as decimal(24,7)) > (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49) (60) Project [codegen id : 20] -Output [16]: [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] -Input [19]: [ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ctr_state#35, ctr_total_return#36, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49, ctr_state#35#50] +Output [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] +Input [19]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#35, ctr_total_return#36, (CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))#49, ctr_state#35#50] (61) TakeOrderedAndProject -Input [16]: [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] -Arguments: 100, [c_customer_id#15 ASC NULLS FIRST, c_salutation#17 ASC NULLS FIRST, c_first_name#18 ASC NULLS FIRST, c_last_name#19 ASC NULLS FIRST, ca_street_number#2 ASC NULLS FIRST, ca_street_name#3 ASC NULLS FIRST, ca_street_type#4 ASC NULLS FIRST, ca_suite_number#5 ASC NULLS FIRST, ca_city#6 ASC NULLS FIRST, ca_county#7 ASC NULLS FIRST, ca_state#8 ASC NULLS FIRST, ca_zip#9 ASC NULLS FIRST, ca_country#10 ASC NULLS FIRST, ca_gmt_offset#11 ASC NULLS FIRST, ca_location_type#12 ASC NULLS FIRST, ctr_total_return#36 ASC NULLS FIRST], [c_customer_id#15, c_salutation#17, c_first_name#18, c_last_name#19, ca_street_number#2, ca_street_name#3, ca_street_type#4, ca_suite_number#5, ca_city#6, ca_county#7, ca_state#8, ca_zip#9, ca_country#10, ca_gmt_offset#11, ca_location_type#12, ctr_total_return#36] +Input [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] +Arguments: 100, [c_customer_id#2 ASC NULLS FIRST, c_salutation#4 ASC NULLS FIRST, c_first_name#5 ASC NULLS FIRST, c_last_name#6 ASC NULLS FIRST, ca_street_number#8 ASC NULLS FIRST, ca_street_name#9 ASC NULLS FIRST, ca_street_type#10 ASC NULLS FIRST, ca_suite_number#11 ASC NULLS FIRST, ca_city#12 ASC NULLS FIRST, ca_county#13 ASC NULLS FIRST, ca_state#14 ASC NULLS FIRST, ca_zip#15 ASC NULLS FIRST, ca_country#16 ASC NULLS FIRST, ca_gmt_offset#17 ASC NULLS FIRST, ca_location_type#18 ASC NULLS FIRST, ctr_total_return#36 ASC NULLS FIRST], [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt index dba67335b3a48..c603ab5194286 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt @@ -2,7 +2,7 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st WholeStageCodegen (20) Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(CAST(avg(ctr_total_return) AS DECIMAL(21,6)) * CAST(1.2 AS DECIMAL(21,6)))] - Project [ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,c_customer_id,c_salutation,c_first_name,c_last_name,ctr_state,ctr_total_return] + Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_state,ctr_total_return] SortMergeJoin [c_customer_sk,ctr_customer_sk] InputAdapter WholeStageCodegen (3) @@ -10,8 +10,12 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st InputAdapter Exchange [c_customer_sk] #1 WholeStageCodegen (2) - Project [ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -19,10 +23,6 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st ColumnarToRow InputAdapter Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] - Filter [c_customer_sk,c_current_addr_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] InputAdapter WholeStageCodegen (11) Sort [ctr_customer_sk] @@ -90,13 +90,13 @@ TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_st Exchange [cr_returning_addr_sk] #11 WholeStageCodegen (13) Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] - BroadcastHashJoin [d_date_sk,cr_returned_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] Filter [cr_returned_date_sk,cr_returning_addr_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] + InputAdapter + ReusedExchange [d_date_sk] #6 InputAdapter WholeStageCodegen (16) Sort [ca_address_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt index f7d8f7946be86..4f1a4a4a8a127 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt @@ -10,16 +10,16 @@ TakeOrderedAndProject (31) : +- * Project (18) : +- * BroadcastHashJoin Inner BuildRight (17) : :- * Project (11) - : : +- * BroadcastHashJoin Inner BuildRight (10) - : : :- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (9) - : : +- * Project (8) - : : +- * Filter (7) - : : +- * ColumnarToRow (6) - : : +- Scan parquet default.item (5) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.inventory (6) : +- BroadcastExchange (16) : +- * Project (15) : +- * Filter (14) @@ -32,54 +32,54 @@ TakeOrderedAndProject (31) +- Scan parquet default.store_sales (21) -(1) Scan parquet default.inventory -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 3] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -(3) Filter [codegen id : 3] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] -Condition : ((((isnotnull(inv_quantity_on_hand#3) AND (inv_quantity_on_hand#3 >= 100)) AND (inv_quantity_on_hand#3 <= 500)) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_date_sk#1)) +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 62.00)) AND (cast(i_current_price#4 as decimal(12,2)) <= 92.00)) AND i_manufact_id#5 IN (129,270,821,423)) AND isnotnull(i_item_sk#1)) -(4) Project [codegen id : 3] -Output [2]: [inv_date_sk#1, inv_item_sk#2] -Input [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#3] +(4) Project [codegen id : 1] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] -(5) Scan parquet default.item -Output [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] -ReadSchema: struct +(5) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(6) ColumnarToRow [codegen id : 1] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +(6) Scan parquet default.inventory +Output [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(7) Filter [codegen id : 1] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] -Condition : ((((isnotnull(i_current_price#7) AND (i_current_price#7 >= 62.00)) AND (cast(i_current_price#7 as decimal(12,2)) <= 92.00)) AND i_manufact_id#8 IN (129,270,821,423)) AND isnotnull(i_item_sk#4)) +(7) ColumnarToRow +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] -(8) Project [codegen id : 1] -Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_manufact_id#8] +(8) Filter +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] +Condition : ((((isnotnull(inv_quantity_on_hand#9) AND (inv_quantity_on_hand#9 >= 100)) AND (inv_quantity_on_hand#9 <= 500)) AND isnotnull(inv_item_sk#8)) AND isnotnull(inv_date_sk#7)) -(9) BroadcastExchange -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +(9) Project +Output [2]: [inv_date_sk#7, inv_item_sk#8] +Input [3]: [inv_date_sk#7, inv_item_sk#8, inv_quantity_on_hand#9] (10) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_item_sk#2] -Right keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#8] Join condition: None (11) Project [codegen id : 3] -Output [5]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [6]: [inv_date_sk#1, inv_item_sk#2, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, inv_item_sk#8] (12) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_date#11] @@ -104,21 +104,21 @@ Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (17) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] +Left keys [1]: [inv_date_sk#7] Right keys [1]: [d_date_sk#10] Join condition: None (18) Project [codegen id : 3] -Output [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Input [6]: [inv_date_sk#1, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, d_date_sk#10] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#7, d_date_sk#10] (19) Exchange -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: hashpartitioning(i_item_sk#4, 5), true, [id=#13] +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#13] (20) Sort [codegen id : 4] -Input [4]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: [i_item_sk#4 ASC NULLS FIRST], false, 0 +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 (21) Scan parquet default.store_sales Output [1]: [ss_item_sk#14] @@ -143,33 +143,33 @@ Input [1]: [ss_item_sk#14] Arguments: [ss_item_sk#14 ASC NULLS FIRST], false, 0 (26) SortMergeJoin [codegen id : 7] -Left keys [1]: [i_item_sk#4] +Left keys [1]: [i_item_sk#1] Right keys [1]: [ss_item_sk#14] Join condition: None (27) Project [codegen id : 7] -Output [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Input [5]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, ss_item_sk#14] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, ss_item_sk#14] (28) HashAggregate [codegen id : 7] -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] (29) Exchange -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: hashpartitioning(i_item_id#5, i_item_desc#6, i_current_price#7, 5), true, [id=#16] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), true, [id=#16] (30) HashAggregate [codegen id : 8] -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Keys [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] Functions: [] Aggregate Attributes: [] -Results [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] (31) TakeOrderedAndProject -Input [3]: [i_item_id#5, i_item_desc#6, i_current_price#7] -Arguments: 100, [i_item_id#5 ASC NULLS FIRST], [i_item_id#5, i_item_desc#6, i_current_price#7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt index 97c0c52263bb4..520fdde428200 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt @@ -15,13 +15,8 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] WholeStageCodegen (3) Project [i_item_sk,i_item_id,i_item_desc,i_current_price] BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,i_item_sk,i_item_id,i_item_desc,i_current_price] - BroadcastHashJoin [inv_item_sk,i_item_sk] - Project [inv_date_sk,inv_item_sk] - Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -30,6 +25,11 @@ TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + Project [inv_date_sk,inv_item_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt index 82290bdffd2f1..c41efb82d904c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject (61) : : : +- * BroadcastHashJoin Inner BuildRight (20) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_returns (1) + : : : : +- Scan parquet default.store_returns (1) : : : +- BroadcastExchange (19) : : : +- * Project (18) : : : +- * BroadcastHashJoin LeftSemi BuildRight (17) @@ -41,11 +41,11 @@ TakeOrderedAndProject (61) : +- * Project (39) : +- * BroadcastHashJoin Inner BuildRight (38) : :- * Project (36) - : : +- * BroadcastHashJoin Inner BuildLeft (35) - : : :- ReusedExchange (31) - : : +- * Filter (34) - : : +- * ColumnarToRow (33) - : : +- Scan parquet default.store_returns (32) + : : +- * BroadcastHashJoin Inner BuildRight (35) + : : :- * Filter (33) + : : : +- * ColumnarToRow (32) + : : : +- Scan parquet default.catalog_returns (31) + : : +- ReusedExchange (34) : +- ReusedExchange (37) +- BroadcastExchange (58) +- * HashAggregate (57) @@ -54,27 +54,27 @@ TakeOrderedAndProject (61) +- * Project (54) +- * BroadcastHashJoin Inner BuildRight (53) :- * Project (51) - : +- * BroadcastHashJoin Inner BuildLeft (50) - : :- ReusedExchange (46) - : +- * Filter (49) - : +- * ColumnarToRow (48) - : +- Scan parquet default.web_returns (47) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Filter (48) + : : +- * ColumnarToRow (47) + : : +- Scan parquet default.web_returns (46) + : +- ReusedExchange (49) +- ReusedExchange (52) -(1) Scan parquet default.catalog_returns -Output [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] +(1) Scan parquet default.store_returns +Output [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_returned_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_returned_date_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 5] -Input [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] +Input [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] (3) Filter [codegen id : 5] -Input [3]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3] -Condition : (isnotnull(cr_item_sk#2) AND isnotnull(cr_returned_date_sk#1)) +Input [3]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3] +Condition : (isnotnull(sr_item_sk#2) AND isnotnull(sr_returned_date_sk#1)) (4) Scan parquet default.date_dim Output [2]: [d_date_sk#4, d_date#5] @@ -147,13 +147,13 @@ Input [1]: [d_date_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (20) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cr_returned_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [sr_returned_date_sk#1] +Right keys [1]: [cast(d_date_sk#4 as bigint)] Join condition: None (21) Project [codegen id : 5] -Output [2]: [cr_item_sk#2, cr_return_quantity#3] -Input [4]: [cr_returned_date_sk#1, cr_item_sk#2, cr_return_quantity#3, d_date_sk#4] +Output [2]: [sr_item_sk#2, sr_return_quantity#3] +Input [4]: [sr_returned_date_sk#1, sr_item_sk#2, sr_return_quantity#3, d_date_sk#4] (22) Scan parquet default.item Output [2]: [i_item_sk#12, i_item_id#13] @@ -174,18 +174,18 @@ Input [2]: [i_item_sk#12, i_item_id#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (26) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cr_item_sk#2] -Right keys [1]: [i_item_sk#12] +Left keys [1]: [sr_item_sk#2] +Right keys [1]: [cast(i_item_sk#12 as bigint)] Join condition: None (27) Project [codegen id : 5] -Output [2]: [cr_return_quantity#3, i_item_id#13] -Input [4]: [cr_item_sk#2, cr_return_quantity#3, i_item_sk#12, i_item_id#13] +Output [2]: [sr_return_quantity#3, i_item_id#13] +Input [4]: [sr_item_sk#2, sr_return_quantity#3, i_item_sk#12, i_item_id#13] (28) HashAggregate [codegen id : 5] -Input [2]: [cr_return_quantity#3, i_item_id#13] +Input [2]: [sr_return_quantity#3, i_item_id#13] Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(cast(cr_return_quantity#3 as bigint))] +Functions [1]: [partial_sum(cast(sr_return_quantity#3 as bigint))] Aggregate Attributes [1]: [sum#15] Results [2]: [i_item_id#13, sum#16] @@ -196,52 +196,52 @@ Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#17] (30) HashAggregate [codegen id : 18] Input [2]: [i_item_id#13, sum#16] Keys [1]: [i_item_id#13] -Functions [1]: [sum(cast(cr_return_quantity#3 as bigint))] -Aggregate Attributes [1]: [sum(cast(cr_return_quantity#3 as bigint))#18] -Results [2]: [i_item_id#13 AS item_id#19, sum(cast(cr_return_quantity#3 as bigint))#18 AS cr_item_qty#20] - -(31) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#4] +Functions [1]: [sum(cast(sr_return_quantity#3 as bigint))] +Aggregate Attributes [1]: [sum(cast(sr_return_quantity#3 as bigint))#18] +Results [2]: [i_item_id#13 AS item_id#19, sum(cast(sr_return_quantity#3 as bigint))#18 AS sr_item_qty#20] -(32) Scan parquet default.store_returns -Output [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] +(31) Scan parquet default.catalog_returns +Output [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_returned_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_returned_date_sk)] +ReadSchema: struct -(33) ColumnarToRow -Input [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] +(32) ColumnarToRow [codegen id : 10] +Input [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] -(34) Filter -Input [3]: [sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] -Condition : (isnotnull(sr_item_sk#22) AND isnotnull(sr_returned_date_sk#21)) +(33) Filter [codegen id : 10] +Input [3]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23] +Condition : (isnotnull(cr_item_sk#22) AND isnotnull(cr_returned_date_sk#21)) + +(34) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#4] (35) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cast(d_date_sk#4 as bigint)] -Right keys [1]: [sr_returned_date_sk#21] +Left keys [1]: [cr_returned_date_sk#21] +Right keys [1]: [d_date_sk#4] Join condition: None (36) Project [codegen id : 10] -Output [2]: [sr_item_sk#22, sr_return_quantity#23] -Input [4]: [d_date_sk#4, sr_returned_date_sk#21, sr_item_sk#22, sr_return_quantity#23] +Output [2]: [cr_item_sk#22, cr_return_quantity#23] +Input [4]: [cr_returned_date_sk#21, cr_item_sk#22, cr_return_quantity#23, d_date_sk#4] (37) ReusedExchange [Reuses operator id: 25] Output [2]: [i_item_sk#12, i_item_id#13] (38) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [sr_item_sk#22] -Right keys [1]: [cast(i_item_sk#12 as bigint)] +Left keys [1]: [cr_item_sk#22] +Right keys [1]: [i_item_sk#12] Join condition: None (39) Project [codegen id : 10] -Output [2]: [sr_return_quantity#23, i_item_id#13] -Input [4]: [sr_item_sk#22, sr_return_quantity#23, i_item_sk#12, i_item_id#13] +Output [2]: [cr_return_quantity#23, i_item_id#13] +Input [4]: [cr_item_sk#22, cr_return_quantity#23, i_item_sk#12, i_item_id#13] (40) HashAggregate [codegen id : 10] -Input [2]: [sr_return_quantity#23, i_item_id#13] +Input [2]: [cr_return_quantity#23, i_item_id#13] Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(cast(sr_return_quantity#23 as bigint))] +Functions [1]: [partial_sum(cast(cr_return_quantity#23 as bigint))] Aggregate Attributes [1]: [sum#24] Results [2]: [i_item_id#13, sum#25] @@ -252,12 +252,12 @@ Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#26] (42) HashAggregate [codegen id : 11] Input [2]: [i_item_id#13, sum#25] Keys [1]: [i_item_id#13] -Functions [1]: [sum(cast(sr_return_quantity#23 as bigint))] -Aggregate Attributes [1]: [sum(cast(sr_return_quantity#23 as bigint))#27] -Results [2]: [i_item_id#13 AS item_id#28, sum(cast(sr_return_quantity#23 as bigint))#27 AS sr_item_qty#29] +Functions [1]: [sum(cast(cr_return_quantity#23 as bigint))] +Aggregate Attributes [1]: [sum(cast(cr_return_quantity#23 as bigint))#27] +Results [2]: [i_item_id#13 AS item_id#28, sum(cast(cr_return_quantity#23 as bigint))#27 AS cr_item_qty#29] (43) BroadcastExchange -Input [2]: [item_id#28, sr_item_qty#29] +Input [2]: [item_id#28, cr_item_qty#29] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#30] (44) BroadcastHashJoin [codegen id : 18] @@ -266,34 +266,34 @@ Right keys [1]: [item_id#28] Join condition: None (45) Project [codegen id : 18] -Output [3]: [cr_item_qty#20, item_id#28, sr_item_qty#29] -Input [4]: [item_id#19, cr_item_qty#20, item_id#28, sr_item_qty#29] - -(46) ReusedExchange [Reuses operator id: 19] -Output [1]: [d_date_sk#4] +Output [3]: [item_id#19, sr_item_qty#20, cr_item_qty#29] +Input [4]: [item_id#19, sr_item_qty#20, item_id#28, cr_item_qty#29] -(47) Scan parquet default.web_returns +(46) Scan parquet default.web_returns Output [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_returned_date_sk)] ReadSchema: struct -(48) ColumnarToRow +(47) ColumnarToRow [codegen id : 16] Input [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] -(49) Filter +(48) Filter [codegen id : 16] Input [3]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] Condition : (isnotnull(wr_item_sk#32) AND isnotnull(wr_returned_date_sk#31)) +(49) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#4] + (50) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [cast(d_date_sk#4 as bigint)] -Right keys [1]: [wr_returned_date_sk#31] +Left keys [1]: [wr_returned_date_sk#31] +Right keys [1]: [cast(d_date_sk#4 as bigint)] Join condition: None (51) Project [codegen id : 16] Output [2]: [wr_item_sk#32, wr_return_quantity#33] -Input [4]: [d_date_sk#4, wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33] +Input [4]: [wr_returned_date_sk#31, wr_item_sk#32, wr_return_quantity#33, d_date_sk#4] (52) ReusedExchange [Reuses operator id: 25] Output [2]: [i_item_sk#12, i_item_id#13] @@ -330,15 +330,15 @@ Input [2]: [item_id#38, wr_item_qty#39] Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] (59) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [item_id#28] +Left keys [1]: [item_id#19] Right keys [1]: [item_id#38] Join condition: None (60) Project [codegen id : 18] -Output [8]: [item_id#28, sr_item_qty#29, (((cast(sr_item_qty#29 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS sr_dev#41, cr_item_qty#20, (((cast(cr_item_qty#20 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS cr_dev#42, wr_item_qty#39, (((cast(wr_item_qty#39 as double) / cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS wr_dev#43, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#29 + cr_item_qty#20) + wr_item_qty#39) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#44] -Input [5]: [cr_item_qty#20, item_id#28, sr_item_qty#29, item_id#38, wr_item_qty#39] +Output [8]: [item_id#19, sr_item_qty#20, (((cast(sr_item_qty#20 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS sr_dev#41, cr_item_qty#29, (((cast(cr_item_qty#29 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS cr_dev#42, wr_item_qty#39, (((cast(wr_item_qty#39 as double) / cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as double)) / 3.0) * 100.0) AS wr_dev#43, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#20 + cr_item_qty#29) + wr_item_qty#39) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#44] +Input [5]: [item_id#19, sr_item_qty#20, cr_item_qty#29, item_id#38, wr_item_qty#39] (61) TakeOrderedAndProject -Input [8]: [item_id#28, sr_item_qty#29, sr_dev#41, cr_item_qty#20, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] -Arguments: 100, [item_id#28 ASC NULLS FIRST, sr_item_qty#29 ASC NULLS FIRST], [item_id#28, sr_item_qty#29, sr_dev#41, cr_item_qty#20, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] +Input [8]: [item_id#19, sr_item_qty#20, sr_dev#41, cr_item_qty#29, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] +Arguments: 100, [item_id#19 ASC NULLS FIRST, sr_item_qty#20 ASC NULLS FIRST], [item_id#19, sr_item_qty#20, sr_dev#41, cr_item_qty#29, cr_dev#42, wr_item_qty#39, wr_dev#43, average#44] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt index 25789d42f3edc..7d93f4458f95e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt @@ -2,21 +2,21 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty WholeStageCodegen (18) Project [item_id,sr_item_qty,cr_item_qty,wr_item_qty] BroadcastHashJoin [item_id,item_id] - Project [cr_item_qty,item_id,sr_item_qty] + Project [item_id,sr_item_qty,cr_item_qty] BroadcastHashJoin [item_id,item_id] - HashAggregate [i_item_id,sum] [sum(cast(cr_return_quantity as bigint)),item_id,cr_item_qty,sum] + HashAggregate [i_item_id,sum] [sum(cast(sr_return_quantity as bigint)),item_id,sr_item_qty,sum] InputAdapter Exchange [i_item_id] #1 WholeStageCodegen (5) - HashAggregate [i_item_id,cr_return_quantity] [sum,sum] - Project [cr_return_quantity,i_item_id] - BroadcastHashJoin [cr_item_sk,i_item_sk] - Project [cr_item_sk,cr_return_quantity] - BroadcastHashJoin [cr_returned_date_sk,d_date_sk] - Filter [cr_item_sk,cr_returned_date_sk] + HashAggregate [i_item_id,sr_return_quantity] [sum,sum] + Project [sr_return_quantity,i_item_id] + BroadcastHashJoin [sr_item_sk,i_item_sk] + Project [sr_item_sk,sr_return_quantity] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_item_sk,sr_returned_date_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_returns [cr_returned_date_sk,cr_item_sk,cr_return_quantity] + Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_return_quantity] InputAdapter BroadcastExchange #2 WholeStageCodegen (3) @@ -52,21 +52,21 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty InputAdapter BroadcastExchange #6 WholeStageCodegen (11) - HashAggregate [i_item_id,sum] [sum(cast(sr_return_quantity as bigint)),item_id,sr_item_qty,sum] + HashAggregate [i_item_id,sum] [sum(cast(cr_return_quantity as bigint)),item_id,cr_item_qty,sum] InputAdapter Exchange [i_item_id] #7 WholeStageCodegen (10) - HashAggregate [i_item_id,sr_return_quantity] [sum,sum] - Project [sr_return_quantity,i_item_id] - BroadcastHashJoin [sr_item_sk,i_item_sk] - Project [sr_item_sk,sr_return_quantity] - BroadcastHashJoin [d_date_sk,sr_returned_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 - Filter [sr_item_sk,sr_returned_date_sk] + HashAggregate [i_item_id,cr_return_quantity] [sum,sum] + Project [cr_return_quantity,i_item_id] + BroadcastHashJoin [cr_item_sk,i_item_sk] + Project [cr_item_sk,cr_return_quantity] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_item_sk,cr_returned_date_sk] ColumnarToRow InputAdapter - Scan parquet default.store_returns [sr_returned_date_sk,sr_item_sk,sr_return_quantity] + Scan parquet default.catalog_returns [cr_returned_date_sk,cr_item_sk,cr_return_quantity] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 InputAdapter @@ -80,12 +80,12 @@ TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty Project [wr_return_quantity,i_item_id] BroadcastHashJoin [wr_item_sk,i_item_sk] Project [wr_item_sk,wr_return_quantity] - BroadcastHashJoin [d_date_sk,wr_returned_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #2 + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] Filter [wr_item_sk,wr_returned_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_returned_date_sk,wr_item_sk,wr_return_quantity] + InputAdapter + ReusedExchange [d_date_sk] #2 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt index 3af319491085c..83ec6391d7736 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt @@ -7,28 +7,28 @@ TakeOrderedAndProject (36) : +- * BroadcastHashJoin Inner BuildLeft (28) : :- BroadcastExchange (24) : : +- * Project (23) - : : +- * BroadcastHashJoin Inner BuildLeft (22) - : : :- BroadcastExchange (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.income_band (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.household_demographics (6) - : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildLeft (20) - : : :- BroadcastExchange (16) - : : : +- * Project (15) - : : : +- * Filter (14) - : : : +- * ColumnarToRow (13) - : : : +- Scan parquet default.customer_address (12) - : : +- * Filter (19) - : : +- * ColumnarToRow (18) - : : +- Scan parquet default.customer (17) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_address (4) + : : +- BroadcastExchange (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.household_demographics (11) + : : +- BroadcastExchange (18) + : : +- * Project (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.income_band (14) : +- * Filter (27) : +- * ColumnarToRow (26) : +- Scan parquet default.customer_demographics (25) @@ -37,111 +37,111 @@ TakeOrderedAndProject (36) +- Scan parquet default.store_returns (31) -(1) Scan parquet default.income_band -Output [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] +(1) Scan parquet default.customer +Output [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/income_band] -PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] +(2) ColumnarToRow [codegen id : 4] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] -(3) Filter [codegen id : 1] -Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] -Condition : ((((isnotnull(ib_lower_bound#2) AND isnotnull(ib_upper_bound#3)) AND (ib_lower_bound#2 >= 38128)) AND (ib_upper_bound#3 <= 88128)) AND isnotnull(ib_income_band_sk#1)) +(3) Filter [codegen id : 4] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +Condition : ((isnotnull(c_current_addr_sk#4) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) -(4) Project [codegen id : 1] -Output [1]: [ib_income_band_sk#1] -Input [3]: [ib_income_band_sk#1, ib_lower_bound#2, ib_upper_bound#3] +(4) Scan parquet default.customer_address +Output [2]: [ca_address_sk#7, ca_city#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [ib_income_band_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] -(6) Scan parquet default.household_demographics -Output [2]: [hd_demo_sk#5, hd_income_band_sk#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/household_demographics] -PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] +Condition : ((isnotnull(ca_city#8) AND (ca_city#8 = Edgewood)) AND isnotnull(ca_address_sk#7)) -(7) ColumnarToRow -Input [2]: [hd_demo_sk#5, hd_income_band_sk#6] +(7) Project [codegen id : 1] +Output [1]: [ca_address_sk#7] +Input [2]: [ca_address_sk#7, ca_city#8] -(8) Filter -Input [2]: [hd_demo_sk#5, hd_income_band_sk#6] -Condition : (isnotnull(hd_demo_sk#5) AND isnotnull(hd_income_band_sk#6)) +(8) BroadcastExchange +Input [1]: [ca_address_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ib_income_band_sk#1] -Right keys [1]: [hd_income_band_sk#6] +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [c_current_addr_sk#4] +Right keys [1]: [ca_address_sk#7] Join condition: None -(10) Project [codegen id : 2] -Output [1]: [hd_demo_sk#5] -Input [3]: [ib_income_band_sk#1, hd_demo_sk#5, hd_income_band_sk#6] - -(11) BroadcastExchange -Input [1]: [hd_demo_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] +(10) Project [codegen id : 4] +Output [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6] +Input [7]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6, ca_address_sk#7] -(12) Scan parquet default.customer_address -Output [2]: [ca_address_sk#8, ca_city#9] +(11) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#10, hd_income_band_sk#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct -(13) ColumnarToRow [codegen id : 3] -Input [2]: [ca_address_sk#8, ca_city#9] +(12) ColumnarToRow [codegen id : 3] +Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] -(14) Filter [codegen id : 3] -Input [2]: [ca_address_sk#8, ca_city#9] -Condition : ((isnotnull(ca_city#9) AND (ca_city#9 = Edgewood)) AND isnotnull(ca_address_sk#8)) +(13) Filter [codegen id : 3] +Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] +Condition : (isnotnull(hd_demo_sk#10) AND isnotnull(hd_income_band_sk#11)) -(15) Project [codegen id : 3] -Output [1]: [ca_address_sk#8] -Input [2]: [ca_address_sk#8, ca_city#9] +(14) Scan parquet default.income_band +Output [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] +ReadSchema: struct -(16) BroadcastExchange -Input [1]: [ca_address_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] +(15) ColumnarToRow [codegen id : 2] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] -(17) Scan parquet default.customer -Output [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] -ReadSchema: struct +(16) Filter [codegen id : 2] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +Condition : ((((isnotnull(ib_lower_bound#13) AND isnotnull(ib_upper_bound#14)) AND (ib_lower_bound#13 >= 38128)) AND (ib_upper_bound#14 <= 88128)) AND isnotnull(ib_income_band_sk#12)) -(18) ColumnarToRow -Input [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] +(17) Project [codegen id : 2] +Output [1]: [ib_income_band_sk#12] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] -(19) Filter -Input [6]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] -Condition : ((isnotnull(c_current_addr_sk#14) AND isnotnull(c_current_cdemo_sk#12)) AND isnotnull(c_current_hdemo_sk#13)) +(18) BroadcastExchange +Input [1]: [ib_income_band_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] -(20) BroadcastHashJoin -Left keys [1]: [ca_address_sk#8] -Right keys [1]: [c_current_addr_sk#14] +(19) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [hd_income_band_sk#11] +Right keys [1]: [ib_income_band_sk#12] Join condition: None -(21) Project -Output [5]: [c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_first_name#15, c_last_name#16] -Input [7]: [ca_address_sk#8, c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_current_addr_sk#14, c_first_name#15, c_last_name#16] +(20) Project [codegen id : 3] +Output [1]: [hd_demo_sk#10] +Input [3]: [hd_demo_sk#10, hd_income_band_sk#11, ib_income_band_sk#12] + +(21) BroadcastExchange +Input [1]: [hd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [hd_demo_sk#5] -Right keys [1]: [c_current_hdemo_sk#13] +Left keys [1]: [c_current_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#10] Join condition: None (23) Project [codegen id : 4] -Output [4]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16] -Input [6]: [hd_demo_sk#5, c_customer_id#11, c_current_cdemo_sk#12, c_current_hdemo_sk#13, c_first_name#15, c_last_name#16] +Output [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, hd_demo_sk#10] (24) BroadcastExchange -Input [4]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16] +Input [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#17] (25) Scan parquet default.customer_demographics @@ -159,16 +159,16 @@ Input [1]: [cd_demo_sk#18] Condition : isnotnull(cd_demo_sk#18) (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_cdemo_sk#12] +Left keys [1]: [c_current_cdemo_sk#2] Right keys [1]: [cd_demo_sk#18] Join condition: None (29) Project [codegen id : 5] -Output [4]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18] -Input [5]: [c_customer_id#11, c_current_cdemo_sk#12, c_first_name#15, c_last_name#16, cd_demo_sk#18] +Output [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] +Input [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6, cd_demo_sk#18] (30) BroadcastExchange -Input [4]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18] +Input [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19] (31) Scan parquet default.store_returns @@ -191,10 +191,10 @@ Right keys [1]: [sr_cdemo_sk#20] Join condition: None (35) Project [codegen id : 6] -Output [3]: [c_customer_id#11 AS customer_id#21, concat(c_last_name#16, , , c_first_name#15) AS customername#22, c_customer_id#11] -Input [5]: [c_customer_id#11, c_first_name#15, c_last_name#16, cd_demo_sk#18, sr_cdemo_sk#20] +Output [3]: [c_customer_id#1 AS customer_id#21, concat(c_last_name#6, , , c_first_name#5) AS customername#22, c_customer_id#1] +Input [5]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18, sr_cdemo_sk#20] (36) TakeOrderedAndProject -Input [3]: [customer_id#21, customername#22, c_customer_id#11] -Arguments: 100, [c_customer_id#11 ASC NULLS FIRST], [customer_id#21, customername#22] +Input [3]: [customer_id#21, customername#22, c_customer_id#1] +Arguments: 100, [c_customer_id#1 ASC NULLS FIRST], [customer_id#21, customername#22] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt index 17bc7e4c1c4e4..16087526bc130 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt @@ -11,38 +11,38 @@ TakeOrderedAndProject [c_customer_id,customer_id,customername] BroadcastExchange #2 WholeStageCodegen (4) Project [c_customer_id,c_current_cdemo_sk,c_first_name,c_last_name] - BroadcastHashJoin [hd_demo_sk,c_current_hdemo_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_city,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] InputAdapter - BroadcastExchange #3 - WholeStageCodegen (2) + BroadcastExchange #4 + WholeStageCodegen (3) Project [hd_demo_sk] - BroadcastHashJoin [ib_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) + BroadcastExchange #5 + WholeStageCodegen (2) Project [ib_income_band_sk] Filter [ib_lower_bound,ib_upper_bound,ib_income_band_sk] ColumnarToRow InputAdapter Scan parquet default.income_band [ib_income_band_sk,ib_lower_bound,ib_upper_bound] - Filter [hd_demo_sk,hd_income_band_sk] - ColumnarToRow - InputAdapter - Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] - Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] - BroadcastHashJoin [ca_address_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) - Project [ca_address_sk] - Filter [ca_city,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_city] - Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] Filter [cd_demo_sk] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt index 60e90d4d809cd..7c3f00d33f24e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt @@ -18,14 +18,14 @@ TakeOrderedAndProject (57) : : : : :- * Sort (11) : : : : : +- Exchange (10) : : : : : +- * Project (9) - : : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : : :- BroadcastExchange (4) - : : : : : : +- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.web_page (1) - : : : : : +- * Filter (7) - : : : : : +- * ColumnarToRow (6) - : : : : : +- Scan parquet default.web_sales (5) + : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.web_sales (1) + : : : : : +- BroadcastExchange (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.web_page (4) : : : : +- * Sort (16) : : : : +- Exchange (15) : : : : +- * Filter (14) @@ -58,54 +58,54 @@ TakeOrderedAndProject (57) +- Scan parquet default.customer_demographics (45) -(1) Scan parquet default.web_page -Output [1]: [wp_web_page_sk#1] +(1) Scan parquet default.web_sales +Output [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_page] -PushedFilters: [IsNotNull(wp_web_page_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [1]: [wp_web_page_sk#1] +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), IsNotNull(ws_sold_date_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [1]: [wp_web_page_sk#1] -Condition : isnotnull(wp_web_page_sk#1) +(2) ColumnarToRow [codegen id : 2] +Input [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] -(4) BroadcastExchange -Input [1]: [wp_web_page_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#2] +(3) Filter [codegen id : 2] +Input [7]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] +Condition : (((((isnotnull(ws_item_sk#2) AND isnotnull(ws_order_number#4)) AND isnotnull(ws_web_page_sk#3)) AND isnotnull(ws_sold_date_sk#1)) AND ((((ws_sales_price#6 >= 100.00) AND (ws_sales_price#6 <= 150.00)) OR ((ws_sales_price#6 >= 50.00) AND (ws_sales_price#6 <= 100.00))) OR ((ws_sales_price#6 >= 150.00) AND (ws_sales_price#6 <= 200.00)))) AND ((((ws_net_profit#7 >= 100.00) AND (ws_net_profit#7 <= 200.00)) OR ((ws_net_profit#7 >= 150.00) AND (ws_net_profit#7 <= 300.00))) OR ((ws_net_profit#7 >= 50.00) AND (ws_net_profit#7 <= 250.00)))) -(5) Scan parquet default.web_sales -Output [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +(4) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), IsNotNull(ws_sold_date_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [wp_web_page_sk#8] -(6) ColumnarToRow -Input [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +(6) Filter [codegen id : 1] +Input [1]: [wp_web_page_sk#8] +Condition : isnotnull(wp_web_page_sk#8) -(7) Filter -Input [7]: [ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] -Condition : (((((isnotnull(ws_item_sk#4) AND isnotnull(ws_order_number#6)) AND isnotnull(ws_web_page_sk#5)) AND isnotnull(ws_sold_date_sk#3)) AND ((((ws_sales_price#8 >= 100.00) AND (ws_sales_price#8 <= 150.00)) OR ((ws_sales_price#8 >= 50.00) AND (ws_sales_price#8 <= 100.00))) OR ((ws_sales_price#8 >= 150.00) AND (ws_sales_price#8 <= 200.00)))) AND ((((ws_net_profit#9 >= 100.00) AND (ws_net_profit#9 <= 200.00)) OR ((ws_net_profit#9 >= 150.00) AND (ws_net_profit#9 <= 300.00))) OR ((ws_net_profit#9 >= 50.00) AND (ws_net_profit#9 <= 250.00)))) +(7) BroadcastExchange +Input [1]: [wp_web_page_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [wp_web_page_sk#1] -Right keys [1]: [ws_web_page_sk#5] +Left keys [1]: [ws_web_page_sk#3] +Right keys [1]: [wp_web_page_sk#8] Join condition: None (9) Project [codegen id : 2] -Output [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] -Input [8]: [wp_web_page_sk#1, ws_sold_date_sk#3, ws_item_sk#4, ws_web_page_sk#5, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] +Output [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] +Input [8]: [ws_sold_date_sk#1, ws_item_sk#2, ws_web_page_sk#3, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wp_web_page_sk#8] (10) Exchange -Input [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] -Arguments: hashpartitioning(cast(ws_item_sk#4 as bigint), cast(ws_order_number#6 as bigint), 5), true, [id=#10] +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] +Arguments: hashpartitioning(cast(ws_item_sk#2 as bigint), cast(ws_order_number#4 as bigint), 5), true, [id=#10] (11) Sort [codegen id : 3] -Input [6]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9] -Arguments: [cast(ws_item_sk#4 as bigint) ASC NULLS FIRST, cast(ws_order_number#6 as bigint) ASC NULLS FIRST], false, 0 +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7] +Arguments: [cast(ws_item_sk#2 as bigint) ASC NULLS FIRST, cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 (12) Scan parquet default.web_returns Output [8]: [wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] @@ -130,13 +130,13 @@ Input [8]: [wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_r Arguments: [wr_item_sk#11 ASC NULLS FIRST, wr_order_number#16 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 9] -Left keys [2]: [cast(ws_item_sk#4 as bigint), cast(ws_order_number#6 as bigint)] +Left keys [2]: [cast(ws_item_sk#2 as bigint), cast(ws_order_number#4 as bigint)] Right keys [2]: [wr_item_sk#11, wr_order_number#16] Join condition: None (18) Project [codegen id : 9] -Output [10]: [ws_sold_date_sk#3, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] -Input [14]: [ws_sold_date_sk#3, ws_item_sk#4, ws_order_number#6, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] +Output [10]: [ws_sold_date_sk#1, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] +Input [14]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#4, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_item_sk#11, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_order_number#16, wr_fee#17, wr_refunded_cash#18] (19) Scan parquet default.date_dim Output [2]: [d_date_sk#20, d_year#21] @@ -161,13 +161,13 @@ Input [1]: [d_date_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (24) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ws_sold_date_sk#3] +Left keys [1]: [ws_sold_date_sk#1] Right keys [1]: [d_date_sk#20] Join condition: None (25) Project [codegen id : 9] -Output [9]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] -Input [11]: [ws_sold_date_sk#3, ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, d_date_sk#20] +Output [9]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18] +Input [11]: [ws_sold_date_sk#1, ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, d_date_sk#20] (26) Scan parquet default.reason Output [2]: [r_reason_sk#23, r_reason_desc#24] @@ -193,8 +193,8 @@ Right keys [1]: [cast(r_reason_sk#23 as bigint)] Join condition: None (31) Project [codegen id : 9] -Output [9]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, r_reason_sk#23, r_reason_desc#24] +Output [9]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_reason_sk#15, wr_fee#17, wr_refunded_cash#18, r_reason_sk#23, r_reason_desc#24] (32) Scan parquet default.customer_address Output [3]: [ca_address_sk#26, ca_state#27, ca_country#28] @@ -221,18 +221,18 @@ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)) (37) BroadcastHashJoin [codegen id : 9] Left keys [1]: [wr_refunded_addr_sk#13] Right keys [1]: [cast(ca_address_sk#26 as bigint)] -Join condition: ((((ca_state#27 IN (IN,OH,NJ) AND (ws_net_profit#9 >= 100.00)) AND (ws_net_profit#9 <= 200.00)) OR ((ca_state#27 IN (WI,CT,KY) AND (ws_net_profit#9 >= 150.00)) AND (ws_net_profit#9 <= 300.00))) OR ((ca_state#27 IN (LA,IA,AR) AND (ws_net_profit#9 >= 50.00)) AND (ws_net_profit#9 <= 250.00))) +Join condition: ((((ca_state#27 IN (IN,OH,NJ) AND (ws_net_profit#7 >= 100.00)) AND (ws_net_profit#7 <= 200.00)) OR ((ca_state#27 IN (WI,CT,KY) AND (ws_net_profit#7 >= 150.00)) AND (ws_net_profit#7 <= 300.00))) OR ((ca_state#27 IN (LA,IA,AR) AND (ws_net_profit#7 >= 50.00)) AND (ws_net_profit#7 <= 250.00))) (38) Project [codegen id : 9] -Output [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#7, ws_sales_price#8, ws_net_profit#9, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, ca_address_sk#26, ca_state#27] +Output [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#5, ws_sales_price#6, ws_net_profit#7, wr_refunded_cdemo_sk#12, wr_refunded_addr_sk#13, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, ca_address_sk#26, ca_state#27] (39) Exchange -Input [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Arguments: hashpartitioning(wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, 5), true, [id=#30] (40) Sort [codegen id : 10] -Input [7]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [7]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Arguments: [wr_refunded_cdemo_sk#12 ASC NULLS FIRST, wr_returning_cdemo_sk#14 ASC NULLS FIRST], false, 0 (41) Scan parquet default.customer_demographics @@ -287,16 +287,16 @@ Arguments: [cast(cd_demo_sk#31 as bigint) ASC NULLS FIRST, cast(cd_demo_sk#35 as (52) SortMergeJoin [codegen id : 14] Left keys [2]: [wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14] Right keys [2]: [cast(cd_demo_sk#31 as bigint), cast(cd_demo_sk#35 as bigint)] -Join condition: ((((((cd_marital_status#32 = M) AND (cd_education_status#33 = Advanced Degree)) AND (ws_sales_price#8 >= 100.00)) AND (ws_sales_price#8 <= 150.00)) OR ((((cd_marital_status#32 = S) AND (cd_education_status#33 = College)) AND (ws_sales_price#8 >= 50.00)) AND (ws_sales_price#8 <= 100.00))) OR ((((cd_marital_status#32 = W) AND (cd_education_status#33 = 2 yr Degree)) AND (ws_sales_price#8 >= 150.00)) AND (ws_sales_price#8 <= 200.00))) +Join condition: ((((((cd_marital_status#32 = M) AND (cd_education_status#33 = Advanced Degree)) AND (ws_sales_price#6 >= 100.00)) AND (ws_sales_price#6 <= 150.00)) OR ((((cd_marital_status#32 = S) AND (cd_education_status#33 = College)) AND (ws_sales_price#6 >= 50.00)) AND (ws_sales_price#6 <= 100.00))) OR ((((cd_marital_status#32 = W) AND (cd_education_status#33 = 2 yr Degree)) AND (ws_sales_price#6 >= 150.00)) AND (ws_sales_price#6 <= 200.00))) (53) Project [codegen id : 14] -Output [4]: [ws_quantity#7, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] -Input [11]: [ws_quantity#7, ws_sales_price#8, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, cd_demo_sk#31, cd_marital_status#32, cd_education_status#33, cd_demo_sk#35] +Output [4]: [ws_quantity#5, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [11]: [ws_quantity#5, ws_sales_price#6, wr_refunded_cdemo_sk#12, wr_returning_cdemo_sk#14, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24, cd_demo_sk#31, cd_marital_status#32, cd_education_status#33, cd_demo_sk#35] (54) HashAggregate [codegen id : 14] -Input [4]: [ws_quantity#7, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] +Input [4]: [ws_quantity#5, wr_fee#17, wr_refunded_cash#18, r_reason_desc#24] Keys [1]: [r_reason_desc#24] -Functions [3]: [partial_avg(cast(ws_quantity#7 as bigint)), partial_avg(UnscaledValue(wr_refunded_cash#18)), partial_avg(UnscaledValue(wr_fee#17))] +Functions [3]: [partial_avg(cast(ws_quantity#5 as bigint)), partial_avg(UnscaledValue(wr_refunded_cash#18)), partial_avg(UnscaledValue(wr_fee#17))] Aggregate Attributes [6]: [sum#39, count#40, sum#41, count#42, sum#43, count#44] Results [7]: [r_reason_desc#24, sum#45, count#46, sum#47, count#48, sum#49, count#50] @@ -307,9 +307,9 @@ Arguments: hashpartitioning(r_reason_desc#24, 5), true, [id=#51] (56) HashAggregate [codegen id : 15] Input [7]: [r_reason_desc#24, sum#45, count#46, sum#47, count#48, sum#49, count#50] Keys [1]: [r_reason_desc#24] -Functions [3]: [avg(cast(ws_quantity#7 as bigint)), avg(UnscaledValue(wr_refunded_cash#18)), avg(UnscaledValue(wr_fee#17))] -Aggregate Attributes [3]: [avg(cast(ws_quantity#7 as bigint))#52, avg(UnscaledValue(wr_refunded_cash#18))#53, avg(UnscaledValue(wr_fee#17))#54] -Results [5]: [substr(r_reason_desc#24, 1, 20) AS substr(r_reason_desc, 1, 20)#55, avg(cast(ws_quantity#7 as bigint))#52 AS avg(ws_quantity)#56, cast((avg(UnscaledValue(wr_refunded_cash#18))#53 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#57, cast((avg(UnscaledValue(wr_fee#17))#54 / 100.0) as decimal(11,6)) AS avg(wr_fee)#58, avg(cast(ws_quantity#7 as bigint))#52 AS aggOrder#59] +Functions [3]: [avg(cast(ws_quantity#5 as bigint)), avg(UnscaledValue(wr_refunded_cash#18)), avg(UnscaledValue(wr_fee#17))] +Aggregate Attributes [3]: [avg(cast(ws_quantity#5 as bigint))#52, avg(UnscaledValue(wr_refunded_cash#18))#53, avg(UnscaledValue(wr_fee#17))#54] +Results [5]: [substr(r_reason_desc#24, 1, 20) AS substr(r_reason_desc, 1, 20)#55, avg(cast(ws_quantity#5 as bigint))#52 AS avg(ws_quantity)#56, cast((avg(UnscaledValue(wr_refunded_cash#18))#53 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#57, cast((avg(UnscaledValue(wr_fee#17))#54 / 100.0) as decimal(11,6)) AS avg(wr_fee)#58, avg(cast(ws_quantity#5 as bigint))#52 AS aggOrder#59] (57) TakeOrderedAndProject Input [5]: [substr(r_reason_desc, 1, 20)#55, avg(ws_quantity)#56, avg(wr_refunded_cash)#57, avg(wr_fee)#58, aggOrder#59] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt index ffb4f10098d4f..3fa7d84f55966 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt @@ -28,7 +28,11 @@ TakeOrderedAndProject [substr(r_reason_desc, 1, 20),aggOrder,avg(wr_refunded_cas Exchange [ws_item_sk,ws_order_number] #3 WholeStageCodegen (2) Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] - BroadcastHashJoin [wp_web_page_sk,ws_web_page_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sold_date_sk,ws_sales_price,ws_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -36,10 +40,6 @@ TakeOrderedAndProject [substr(r_reason_desc, 1, 20),aggOrder,avg(wr_refunded_cas ColumnarToRow InputAdapter Scan parquet default.web_page [wp_web_page_sk] - Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sold_date_sk,ws_sales_price,ws_net_profit] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit] InputAdapter WholeStageCodegen (5) Sort [wr_item_sk,wr_order_number] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt index 20beeb9d31d89..20ae4d244dcd8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt @@ -118,7 +118,7 @@ Input [4]: [i_category#11, i_class#12, spark_grouping_id#13, sum#15] Keys [3]: [i_category#11, i_class#12, spark_grouping_id#13] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#17] -Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS total_sum#18, i_category#11, i_class#12, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS lochierarchy#19, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS _w1#20, CASE WHEN (cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint) = 0) THEN i_category#11 END AS _w2#21, MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS _w3#22] +Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS total_sum#18, i_category#11, i_class#12, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS lochierarchy#19, (cast((shiftright(spark_grouping_id#13, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint)) AS _w1#20, CASE WHEN (cast(cast((shiftright(spark_grouping_id#13, 0) & 1) as tinyint) as int) = 0) THEN i_category#11 END AS _w2#21, MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#17,17,2) AS _w3#22] (21) Exchange Input [7]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, _w1#20, _w2#21, _w3#22] @@ -138,5 +138,5 @@ Input [8]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, _w1#20, _w (25) TakeOrderedAndProject Input [5]: [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] -Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (lochierarchy#19 = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#24 ASC NULLS FIRST], [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] +Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (cast(lochierarchy#19 as int) = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#24 ASC NULLS FIRST], [total_sum#18, i_category#11, i_class#12, lochierarchy#19, rank_within_parent#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt index 4ffbfb45a4623..377bd36f520eb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt @@ -42,11 +42,11 @@ : :- * Sort (29) : : +- Exchange (28) : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildLeft (26) - : : :- ReusedExchange (22) - : : +- * Filter (25) - : : +- * ColumnarToRow (24) - : : +- Scan parquet default.catalog_sales (23) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Filter (24) + : : : +- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (25) : +- * Sort (31) : +- ReusedExchange (30) +- * Sort (56) @@ -59,11 +59,11 @@ :- * Sort (47) : +- Exchange (46) : +- * Project (45) - : +- * BroadcastHashJoin Inner BuildLeft (44) - : :- ReusedExchange (40) - : +- * Filter (43) - : +- * ColumnarToRow (42) - : +- Scan parquet default.web_sales (41) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Filter (42) + : : +- * ColumnarToRow (41) + : : +- Scan parquet default.web_sales (40) + : +- ReusedExchange (43) +- * Sort (49) +- ReusedExchange (48) @@ -160,39 +160,39 @@ Arguments: hashpartitioning(coalesce(c_last_name#10, ), isnull(c_last_name#10), Input [3]: [d_date#4, c_first_name#9, c_last_name#10] Arguments: [coalesce(c_last_name#10, ) ASC NULLS FIRST, isnull(c_last_name#10) ASC NULLS FIRST, coalesce(c_first_name#9, ) ASC NULLS FIRST, isnull(c_first_name#9) ASC NULLS FIRST, coalesce(d_date#4, 0) ASC NULLS FIRST, isnull(d_date#4) ASC NULLS FIRST], false, 0 -(22) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#13, d_date#14] - -(23) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +(22) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_bill_customer_sk)] ReadSchema: struct -(24) ColumnarToRow -Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] +(23) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] + +(24) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#13, cs_bill_customer_sk#14] +Condition : (isnotnull(cs_sold_date_sk#13) AND isnotnull(cs_bill_customer_sk#14)) -(25) Filter -Input [2]: [cs_sold_date_sk#15, cs_bill_customer_sk#16] -Condition : (isnotnull(cs_sold_date_sk#15) AND isnotnull(cs_bill_customer_sk#16)) +(25) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#15, d_date#16] (26) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_date_sk#13] -Right keys [1]: [cs_sold_date_sk#15] +Left keys [1]: [cs_sold_date_sk#13] +Right keys [1]: [d_date_sk#15] Join condition: None (27) Project [codegen id : 9] -Output [2]: [d_date#14, cs_bill_customer_sk#16] -Input [4]: [d_date_sk#13, d_date#14, cs_sold_date_sk#15, cs_bill_customer_sk#16] +Output [2]: [cs_bill_customer_sk#14, d_date#16] +Input [4]: [cs_sold_date_sk#13, cs_bill_customer_sk#14, d_date_sk#15, d_date#16] (28) Exchange -Input [2]: [d_date#14, cs_bill_customer_sk#16] -Arguments: hashpartitioning(cs_bill_customer_sk#16, 5), true, [id=#17] +Input [2]: [cs_bill_customer_sk#14, d_date#16] +Arguments: hashpartitioning(cs_bill_customer_sk#14, 5), true, [id=#17] (29) Sort [codegen id : 10] -Input [2]: [d_date#14, cs_bill_customer_sk#16] -Arguments: [cs_bill_customer_sk#16 ASC NULLS FIRST], false, 0 +Input [2]: [cs_bill_customer_sk#14, d_date#16] +Arguments: [cs_bill_customer_sk#14 ASC NULLS FIRST], false, 0 (30) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] @@ -202,78 +202,78 @@ Input [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20] Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0 (32) SortMergeJoin [codegen id : 13] -Left keys [1]: [cs_bill_customer_sk#16] +Left keys [1]: [cs_bill_customer_sk#14] Right keys [1]: [c_customer_sk#18] Join condition: None (33) Project [codegen id : 13] -Output [3]: [c_last_name#20, c_first_name#19, d_date#14] -Input [5]: [d_date#14, cs_bill_customer_sk#16, c_customer_sk#18, c_first_name#19, c_last_name#20] +Output [3]: [c_last_name#20, c_first_name#19, d_date#16] +Input [5]: [cs_bill_customer_sk#14, d_date#16, c_customer_sk#18, c_first_name#19, c_last_name#20] (34) HashAggregate [codegen id : 13] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#14] +Results [3]: [c_last_name#20, c_first_name#19, d_date#16] (35) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#14, 5), true, [id=#21] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#16, 5), true, [id=#21] (36) HashAggregate [codegen id : 14] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Keys [3]: [c_last_name#20, c_first_name#19, d_date#14] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Keys [3]: [c_last_name#20, c_first_name#19, d_date#16] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#20, c_first_name#19, d_date#14] +Results [3]: [c_last_name#20, c_first_name#19, d_date#16] (37) Exchange -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14), 5), true, [id=#22] +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16), 5), true, [id=#22] (38) Sort [codegen id : 15] -Input [3]: [c_last_name#20, c_first_name#19, d_date#14] -Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#14, 0) ASC NULLS FIRST, isnull(d_date#14) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#20, c_first_name#19, d_date#16] +Arguments: [coalesce(c_last_name#20, ) ASC NULLS FIRST, isnull(c_last_name#20) ASC NULLS FIRST, coalesce(c_first_name#19, ) ASC NULLS FIRST, isnull(c_first_name#19) ASC NULLS FIRST, coalesce(d_date#16, 0) ASC NULLS FIRST, isnull(d_date#16) ASC NULLS FIRST], false, 0 (39) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#14, 0), isnull(d_date#14)] +Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 0), isnull(d_date#16)] Join condition: None -(40) ReusedExchange [Reuses operator id: 8] -Output [2]: [d_date_sk#23, d_date#24] - -(41) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +(40) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_bill_customer_sk)] ReadSchema: struct -(42) ColumnarToRow -Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] +(41) ColumnarToRow [codegen id : 17] +Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] + +(42) Filter [codegen id : 17] +Input [2]: [ws_sold_date_sk#23, ws_bill_customer_sk#24] +Condition : (isnotnull(ws_sold_date_sk#23) AND isnotnull(ws_bill_customer_sk#24)) -(43) Filter -Input [2]: [ws_sold_date_sk#25, ws_bill_customer_sk#26] -Condition : (isnotnull(ws_sold_date_sk#25) AND isnotnull(ws_bill_customer_sk#26)) +(43) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#25, d_date#26] (44) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [d_date_sk#23] -Right keys [1]: [ws_sold_date_sk#25] +Left keys [1]: [ws_sold_date_sk#23] +Right keys [1]: [d_date_sk#25] Join condition: None (45) Project [codegen id : 17] -Output [2]: [d_date#24, ws_bill_customer_sk#26] -Input [4]: [d_date_sk#23, d_date#24, ws_sold_date_sk#25, ws_bill_customer_sk#26] +Output [2]: [ws_bill_customer_sk#24, d_date#26] +Input [4]: [ws_sold_date_sk#23, ws_bill_customer_sk#24, d_date_sk#25, d_date#26] (46) Exchange -Input [2]: [d_date#24, ws_bill_customer_sk#26] -Arguments: hashpartitioning(ws_bill_customer_sk#26, 5), true, [id=#27] +Input [2]: [ws_bill_customer_sk#24, d_date#26] +Arguments: hashpartitioning(ws_bill_customer_sk#24, 5), true, [id=#27] (47) Sort [codegen id : 18] -Input [2]: [d_date#24, ws_bill_customer_sk#26] -Arguments: [ws_bill_customer_sk#26 ASC NULLS FIRST], false, 0 +Input [2]: [ws_bill_customer_sk#24, d_date#26] +Arguments: [ws_bill_customer_sk#24 ASC NULLS FIRST], false, 0 (48) ReusedExchange [Reuses operator id: 16] Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] @@ -283,43 +283,43 @@ Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30] Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 21] -Left keys [1]: [ws_bill_customer_sk#26] +Left keys [1]: [ws_bill_customer_sk#24] Right keys [1]: [c_customer_sk#28] Join condition: None (51) Project [codegen id : 21] -Output [3]: [c_last_name#30, c_first_name#29, d_date#24] -Input [5]: [d_date#24, ws_bill_customer_sk#26, c_customer_sk#28, c_first_name#29, c_last_name#30] +Output [3]: [c_last_name#30, c_first_name#29, d_date#26] +Input [5]: [ws_bill_customer_sk#24, d_date#26, c_customer_sk#28, c_first_name#29, c_last_name#30] (52) HashAggregate [codegen id : 21] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#24] +Results [3]: [c_last_name#30, c_first_name#29, d_date#26] (53) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#24, 5), true, [id=#31] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#26, 5), true, [id=#31] (54) HashAggregate [codegen id : 22] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Keys [3]: [c_last_name#30, c_first_name#29, d_date#24] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Keys [3]: [c_last_name#30, c_first_name#29, d_date#26] Functions: [] Aggregate Attributes: [] -Results [3]: [c_last_name#30, c_first_name#29, d_date#24] +Results [3]: [c_last_name#30, c_first_name#29, d_date#26] (55) Exchange -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24), 5), true, [id=#32] +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26), 5), true, [id=#32] (56) Sort [codegen id : 23] -Input [3]: [c_last_name#30, c_first_name#29, d_date#24] -Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#24, 0) ASC NULLS FIRST, isnull(d_date#24) ASC NULLS FIRST], false, 0 +Input [3]: [c_last_name#30, c_first_name#29, d_date#26] +Arguments: [coalesce(c_last_name#30, ) ASC NULLS FIRST, isnull(c_last_name#30) ASC NULLS FIRST, coalesce(c_first_name#29, ) ASC NULLS FIRST, isnull(c_first_name#29) ASC NULLS FIRST, coalesce(d_date#26, 0) ASC NULLS FIRST, isnull(d_date#26) ASC NULLS FIRST], false, 0 (57) SortMergeJoin Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#4, 0), isnull(d_date#4)] -Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#24, 0), isnull(d_date#24)] +Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 0), isnull(d_date#26)] Join condition: None (58) HashAggregate [codegen id : 24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt index 310a89fcb642c..8dd59340cf069 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt @@ -71,14 +71,14 @@ WholeStageCodegen (26) InputAdapter Exchange [cs_bill_customer_sk] #9 WholeStageCodegen (9) - Project [d_date,cs_bill_customer_sk] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] @@ -102,14 +102,14 @@ WholeStageCodegen (26) InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (17) - Project [d_date,ws_bill_customer_sk] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_date] #5 + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk,ws_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 InputAdapter WholeStageCodegen (20) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt index bf70b8f5840a4..562f73c509ee7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt @@ -14,15 +14,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : : : : : :- * Project (17) : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : : : : : : :- * Project (10) -: : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) -: : : : : : : : : :- BroadcastExchange (5) -: : : : : : : : : : +- * Project (4) -: : : : : : : : : : +- * Filter (3) -: : : : : : : : : : +- * ColumnarToRow (2) -: : : : : : : : : : +- Scan parquet default.time_dim (1) -: : : : : : : : : +- * Filter (8) -: : : : : : : : : +- * ColumnarToRow (7) -: : : : : : : : : +- Scan parquet default.store_sales (6) +: : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) +: : : : : : : : : :- * Filter (3) +: : : : : : : : : : +- * ColumnarToRow (2) +: : : : : : : : : : +- Scan parquet default.store_sales (1) +: : : : : : : : : +- BroadcastExchange (8) +: : : : : : : : : +- * Project (7) +: : : : : : : : : +- * Filter (6) +: : : : : : : : : +- * ColumnarToRow (5) +: : : : : : : : : +- Scan parquet default.time_dim (4) : : : : : : : : +- BroadcastExchange (15) : : : : : : : : +- * Project (14) : : : : : : : : +- * Filter (13) @@ -42,15 +42,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : : : : :- * Project (40) : : : : : : : +- * BroadcastHashJoin Inner BuildRight (39) : : : : : : : :- * Project (37) -: : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (36) -: : : : : : : : :- BroadcastExchange (32) -: : : : : : : : : +- * Project (31) -: : : : : : : : : +- * Filter (30) -: : : : : : : : : +- * ColumnarToRow (29) -: : : : : : : : : +- Scan parquet default.time_dim (28) -: : : : : : : : +- * Filter (35) -: : : : : : : : +- * ColumnarToRow (34) -: : : : : : : : +- Scan parquet default.store_sales (33) +: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (36) +: : : : : : : : :- * Filter (30) +: : : : : : : : : +- * ColumnarToRow (29) +: : : : : : : : : +- Scan parquet default.store_sales (28) +: : : : : : : : +- BroadcastExchange (35) +: : : : : : : : +- * Project (34) +: : : : : : : : +- * Filter (33) +: : : : : : : : +- * ColumnarToRow (32) +: : : : : : : : +- Scan parquet default.time_dim (31) : : : : : : : +- ReusedExchange (38) : : : : : : +- ReusedExchange (41) : : : : : +- BroadcastExchange (68) @@ -102,15 +102,15 @@ BroadcastNestedLoopJoin Inner BuildRight (174) : : : :- * Project (103) : : : : +- * BroadcastHashJoin Inner BuildRight (102) : : : : :- * Project (100) -: : : : : +- * BroadcastHashJoin Inner BuildLeft (99) -: : : : : :- BroadcastExchange (95) -: : : : : : +- * Project (94) -: : : : : : +- * Filter (93) -: : : : : : +- * ColumnarToRow (92) -: : : : : : +- Scan parquet default.time_dim (91) -: : : : : +- * Filter (98) -: : : : : +- * ColumnarToRow (97) -: : : : : +- Scan parquet default.store_sales (96) +: : : : : +- * BroadcastHashJoin Inner BuildRight (99) +: : : : : :- * Filter (93) +: : : : : : +- * ColumnarToRow (92) +: : : : : : +- Scan parquet default.store_sales (91) +: : : : : +- BroadcastExchange (98) +: : : : : +- * Project (97) +: : : : : +- * Filter (96) +: : : : : +- * ColumnarToRow (95) +: : : : : +- Scan parquet default.time_dim (94) : : : : +- ReusedExchange (101) : : : +- ReusedExchange (104) : : +- BroadcastExchange (131) @@ -175,50 +175,50 @@ BroadcastNestedLoopJoin Inner BuildRight (174) +- ReusedExchange (167) -(1) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] + +(3) Filter [codegen id : 4] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.time_dim +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,8), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(3) Filter [codegen id : 1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 8)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) +(6) Filter [codegen id : 1] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 8)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) -(4) Project [codegen id : 1] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(7) Project [codegen id : 1] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(5) BroadcastExchange -Input [1]: [t_time_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] - -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(7) ColumnarToRow -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] - -(8) Filter -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +(8) BroadcastExchange +Input [1]: [t_time_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [t_time_sk#1] -Right keys [1]: [ss_sold_time_sk#5] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (10) Project [codegen id : 4] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (11) Scan parquet default.store Output [2]: [s_store_sk#8, s_store_name#9] @@ -243,13 +243,13 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 4] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (18) Scan parquet default.household_demographics Output [3]: [hd_demo_sk#11, hd_dep_count#12, hd_vehicle_count#13] @@ -274,13 +274,13 @@ Input [1]: [hd_demo_sk#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (24) Project [codegen id : 4] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (25) HashAggregate [codegen id : 4] Input: [] @@ -300,74 +300,74 @@ Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#18] Results [1]: [count(1)#18 AS h8_30_to_9#19] -(28) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(28) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] + +(30) Filter [codegen id : 9] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(31) Scan parquet default.time_dim +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(29) ColumnarToRow [codegen id : 6] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(32) ColumnarToRow [codegen id : 6] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(30) Filter [codegen id : 6] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 9)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) +(33) Filter [codegen id : 6] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 9)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) -(31) Project [codegen id : 6] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(34) Project [codegen id : 6] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(32) BroadcastExchange -Input [1]: [t_time_sk#1] +(35) BroadcastExchange +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] -(33) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(34) ColumnarToRow -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] - -(35) Filter -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) - (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [t_time_sk#1] -Right keys [1]: [ss_sold_time_sk#5] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (37) Project [codegen id : 9] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (38) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (39) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (40) Project [codegen id : 9] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (41) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (42) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (43) Project [codegen id : 9] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (44) HashAggregate [codegen id : 9] Input: [] @@ -395,73 +395,73 @@ Arguments: IdentityBroadcastMode, [id=#26] Join condition: None (49) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (50) ColumnarToRow [codegen id : 14] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] (51) Filter [codegen id : 14] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) (52) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (53) ColumnarToRow [codegen id : 11] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (54) Filter [codegen id : 11] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 9)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 9)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) (55) Project [codegen id : 11] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (56) BroadcastExchange -Input [1]: [t_time_sk#1] +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] (57) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_sold_time_sk#5] -Right keys [1]: [t_time_sk#1] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (58) Project [codegen id : 14] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (59) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (60) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (61) Project [codegen id : 14] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (62) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (63) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (64) Project [codegen id : 14] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (65) HashAggregate [codegen id : 14] Input: [] @@ -489,73 +489,73 @@ Arguments: IdentityBroadcastMode, [id=#33] Join condition: None (70) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (71) ColumnarToRow [codegen id : 19] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] (72) Filter [codegen id : 19] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) (73) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (74) ColumnarToRow [codegen id : 16] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (75) Filter [codegen id : 16] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 10)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 10)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) (76) Project [codegen id : 16] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (77) BroadcastExchange -Input [1]: [t_time_sk#1] +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] (78) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_sold_time_sk#5] -Right keys [1]: [t_time_sk#1] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (79) Project [codegen id : 19] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (80) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (81) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (82) Project [codegen id : 19] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (83) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (84) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (85) Project [codegen id : 19] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (86) HashAggregate [codegen id : 19] Input: [] @@ -582,74 +582,74 @@ Arguments: IdentityBroadcastMode, [id=#40] (90) BroadcastNestedLoopJoin Join condition: None -(91) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(91) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 24] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] + +(93) Filter [codegen id : 24] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(94) Scan parquet default.time_dim +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct -(92) ColumnarToRow [codegen id : 21] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(95) ColumnarToRow [codegen id : 21] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(93) Filter [codegen id : 21] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 10)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) +(96) Filter [codegen id : 21] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 10)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) -(94) Project [codegen id : 21] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(97) Project [codegen id : 21] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(95) BroadcastExchange -Input [1]: [t_time_sk#1] +(98) BroadcastExchange +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#41] -(96) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(97) ColumnarToRow -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] - -(98) Filter -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) - (99) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [t_time_sk#1] -Right keys [1]: [ss_sold_time_sk#5] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (100) Project [codegen id : 24] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (101) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (102) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (103) Project [codegen id : 24] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (104) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (105) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (106) Project [codegen id : 24] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (107) HashAggregate [codegen id : 24] Input: [] @@ -677,73 +677,73 @@ Arguments: IdentityBroadcastMode, [id=#47] Join condition: None (112) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 29] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] (114) Filter [codegen id : 29] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) (115) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (116) ColumnarToRow [codegen id : 26] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (117) Filter [codegen id : 26] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 11)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 11)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) (118) Project [codegen id : 26] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (119) BroadcastExchange -Input [1]: [t_time_sk#1] +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#48] (120) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_sold_time_sk#5] -Right keys [1]: [t_time_sk#1] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (121) Project [codegen id : 29] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (122) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (123) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (124) Project [codegen id : 29] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (125) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (126) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (127) Project [codegen id : 29] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (128) HashAggregate [codegen id : 29] Input: [] @@ -771,73 +771,73 @@ Arguments: IdentityBroadcastMode, [id=#54] Join condition: None (133) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (134) ColumnarToRow [codegen id : 34] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] (135) Filter [codegen id : 34] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) (136) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (137) ColumnarToRow [codegen id : 31] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (138) Filter [codegen id : 31] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 11)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 11)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) (139) Project [codegen id : 31] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (140) BroadcastExchange -Input [1]: [t_time_sk#1] +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#55] (141) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_sold_time_sk#5] -Right keys [1]: [t_time_sk#1] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (142) Project [codegen id : 34] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (143) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (144) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (145) Project [codegen id : 34] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (146) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (147) BroadcastHashJoin [codegen id : 34] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (148) Project [codegen id : 34] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (149) HashAggregate [codegen id : 34] Input: [] @@ -865,73 +865,73 @@ Arguments: IdentityBroadcastMode, [id=#61] Join condition: None (154) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] ReadSchema: struct (155) ColumnarToRow [codegen id : 39] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] (156) Filter [codegen id : 39] -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) (157) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,12), LessThan(t_minute,30), IsNotNull(t_time_sk)] ReadSchema: struct (158) ColumnarToRow [codegen id : 36] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (159) Filter [codegen id : 36] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 12)) AND (t_minute#3 < 30)) AND isnotnull(t_time_sk#1)) +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 12)) AND (t_minute#6 < 30)) AND isnotnull(t_time_sk#4)) (160) Project [codegen id : 36] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] (161) BroadcastExchange -Input [1]: [t_time_sk#1] +Input [1]: [t_time_sk#4] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#62] (162) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_sold_time_sk#5] -Right keys [1]: [t_time_sk#1] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (163) Project [codegen id : 39] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7, t_time_sk#1] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (164) ReusedExchange [Reuses operator id: 15] Output [1]: [s_store_sk#8] (165) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (166) Project [codegen id : 39] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (167) ReusedExchange [Reuses operator id: 22] Output [1]: [hd_demo_sk#11] (168) BroadcastHashJoin [codegen id : 39] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (169) Project [codegen id : 39] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (170) HashAggregate [codegen id : 39] Input: [] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt index f212ebf34b839..99ca86aadc661 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt @@ -16,7 +16,11 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [t_time_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -25,10 +29,6 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -57,7 +57,11 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [t_time_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #7 WholeStageCodegen (6) @@ -66,10 +70,6 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter ReusedExchange [s_store_sk] #3 InputAdapter @@ -144,7 +144,11 @@ BroadcastNestedLoopJoin Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [t_time_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #16 WholeStageCodegen (21) @@ -153,10 +157,6 @@ BroadcastNestedLoopJoin ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter ReusedExchange [s_store_sk] #3 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt index 124f3c58c8919..0d47735a1138d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt @@ -13,14 +13,14 @@ TakeOrderedAndProject (31) :- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) - : : :- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.item (4) + : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : :- BroadcastExchange (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) : +- BroadcastExchange (14) : +- * Project (13) : +- * Filter (12) @@ -32,46 +32,46 @@ TakeOrderedAndProject (31) +- Scan parquet default.store (17) -(1) Scan parquet default.store_sales -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] - -(3) Filter [codegen id : 4] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4] -Condition : ((isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#3)) - -(4) Scan parquet default.item -Output [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [Or(And(In(i_category, [Books,Electronics,Sports]),In(i_class, [computers,stereo,football])),And(In(i_category, [Men,Jewelry,Women]),In(i_class, [shirts,birdal,dresses]))), IsNotNull(i_item_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] + +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Condition : (((i_category#4 IN (Books,Electronics,Sports) AND i_class#3 IN (computers,stereo,football)) OR (i_category#4 IN (Men,Jewelry,Women) AND i_class#3 IN (shirts,birdal,dresses))) AND isnotnull(i_item_sk#1)) + +(4) BroadcastExchange +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(6) Filter [codegen id : 1] -Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] -Condition : (((i_category#8 IN (Books,Electronics,Sports) AND i_class#7 IN (computers,stereo,football)) OR (i_category#8 IN (Men,Jewelry,Women) AND i_class#7 IN (shirts,birdal,dresses))) AND isnotnull(i_item_sk#5)) +(6) ColumnarToRow +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] -(7) BroadcastExchange -Input [4]: [i_item_sk#5, i_brand#6, i_class#7, i_category#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] +(7) Filter +Input [4]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] +Condition : ((isnotnull(ss_item_sk#7) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#8)) (8) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#7] Join condition: None (9) Project [codegen id : 4] -Output [6]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4, i_item_sk#5, i_brand#6, i_class#7, i_category#8] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_store_sk#8, ss_sales_price#9] +Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#8, ss_sales_price#9] (10) Scan parquet default.date_dim Output [3]: [d_date_sk#10, d_year#11, d_moy#12] @@ -96,13 +96,13 @@ Input [2]: [d_date_sk#10, d_moy#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (15) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#6] Right keys [1]: [d_date_sk#10] Join condition: None (16) Project [codegen id : 4] -Output [6]: [ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_moy#12] -Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_date_sk#10, d_moy#12] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#8, ss_sales_price#9, d_moy#12] +Input [8]: [i_brand#2, i_class#3, i_category#4, ss_sold_date_sk#6, ss_store_sk#8, ss_sales_price#9, d_date_sk#10, d_moy#12] (17) Scan parquet default.store Output [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] @@ -123,53 +123,53 @@ Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (21) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#3] +Left keys [1]: [ss_store_sk#8] Right keys [1]: [s_store_sk#14] Join condition: None (22) Project [codegen id : 4] -Output [7]: [i_brand#6, i_class#7, i_category#8, ss_sales_price#4, d_moy#12, s_store_name#15, s_company_name#16] -Input [9]: [ss_store_sk#3, ss_sales_price#4, i_brand#6, i_class#7, i_category#8, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] +Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#9, d_moy#12, s_store_name#15, s_company_name#16] +Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#8, ss_sales_price#9, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] (23) HashAggregate [codegen id : 4] -Input [7]: [i_brand#6, i_class#7, i_category#8, ss_sales_price#4, d_moy#12, s_store_name#15, s_company_name#16] -Keys [6]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12] -Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#4))] +Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#9, d_moy#12, s_store_name#15, s_company_name#16] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#9))] Aggregate Attributes [1]: [sum#18] -Results [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] (24) Exchange -Input [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] -Arguments: hashpartitioning(i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, 5), true, [id=#20] +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, 5), true, [id=#20] (25) HashAggregate [codegen id : 5] -Input [7]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum#19] -Keys [6]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12] -Functions [1]: [sum(UnscaledValue(ss_sales_price#4))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#4))#21] -Results [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#4))#21,17,2) AS _w0#23] +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum#19] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12] +Functions [1]: [sum(UnscaledValue(ss_sales_price#9))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#9))#21] +Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#9))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#9))#21,17,2) AS _w0#23] (26) Exchange -Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: hashpartitioning(i_category#8, i_brand#6, s_store_name#15, s_company_name#16, 5), true, [id=#24] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#15, s_company_name#16, 5), true, [id=#24] (27) Sort [codegen id : 6] -Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: [i_category#8 ASC NULLS FIRST, i_brand#6 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST], false, 0 +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST], false, 0 (28) Window -Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] -Arguments: [avg(_w0#23) windowspecdefinition(i_category#8, i_brand#6, s_store_name#15, s_company_name#16, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#8, i_brand#6, s_store_name#15, s_company_name#16] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#4, i_brand#2, s_store_name#15, s_company_name#16, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#4, i_brand#2, s_store_name#15, s_company_name#16] (29) Filter [codegen id : 7] -Input [9]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] Condition : (CASE WHEN NOT (avg_monthly_sales#25 = 0.000000) THEN CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true))) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) ELSE null END > 0.1000000000000000) (30) Project [codegen id : 7] -Output [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] -Input [9]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] +Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] (31) TakeOrderedAndProject -Input [8]: [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] -Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST], [i_category#8, i_class#7, i_brand#6, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#15, s_company_name#16, d_moy#12, sum_sales#22, avg_monthly_sales#25] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt index 2a02ca009a3e0..0d41c4559139a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt @@ -16,14 +16,10 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_cla HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_store_sk,ss_sales_price,i_brand,i_class,i_category,d_moy] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,d_moy] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_sales_price,i_brand,i_class,i_category] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] + Project [i_brand,i_class,i_category,ss_sold_date_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -31,6 +27,10 @@ TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_cla ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] + Filter [ss_item_sk,ss_sold_date_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt index 69b02557c4750..4e85516b594f7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt @@ -13,14 +13,14 @@ : : :- * Project (16) : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : :- BroadcastExchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer_demographics (1) - : : : : +- * Filter (7) - : : : : +- * ColumnarToRow (6) - : : : : +- Scan parquet default.customer (5) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) : : : +- BroadcastExchange (14) : : : +- * Project (13) : : : +- * Filter (12) @@ -33,61 +33,61 @@ : : +- Scan parquet default.customer_address (17) : +- BroadcastExchange (34) : +- * Project (33) - : +- * BroadcastHashJoin Inner BuildLeft (32) - : :- BroadcastExchange (28) - : : +- * Project (27) - : : +- * Filter (26) - : : +- * ColumnarToRow (25) - : : +- Scan parquet default.date_dim (24) - : +- * Filter (31) - : +- * ColumnarToRow (30) - : +- Scan parquet default.catalog_returns (29) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Filter (26) + : : +- * ColumnarToRow (25) + : : +- Scan parquet default.catalog_returns (24) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.date_dim (27) +- BroadcastExchange (40) +- * Filter (39) +- * ColumnarToRow (38) +- Scan parquet default.call_center (37) -(1) Scan parquet default.customer_demographics -Output [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Unknown)),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,Advanced Degree))), IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] -Condition : ((((cd_marital_status#2 = M) AND (cd_education_status#3 = Unknown)) OR ((cd_marital_status#2 = W) AND (cd_education_status#3 = Advanced Degree))) AND isnotnull(cd_demo_sk#1)) +(2) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] -(4) BroadcastExchange -Input [3]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#4] +(3) Filter [codegen id : 7] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] +Condition : (((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#4)) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) -(5) Scan parquet default.customer -Output [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] +(4) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Unknown)),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,Advanced Degree))), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] -(6) ColumnarToRow -Input [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] +(6) Filter [codegen id : 1] +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Condition : ((((cd_marital_status#6 = M) AND (cd_education_status#7 = Unknown)) OR ((cd_marital_status#6 = W) AND (cd_education_status#7 = Advanced Degree))) AND isnotnull(cd_demo_sk#5)) -(7) Filter -Input [4]: [c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] -Condition : (((isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#8)) AND isnotnull(c_current_cdemo_sk#6)) AND isnotnull(c_current_hdemo_sk#7)) +(7) BroadcastExchange +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] (8) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [c_current_cdemo_sk#6] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#5] Join condition: None (9) Project [codegen id : 7] -Output [5]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_hdemo_sk#7, c_current_addr_sk#8] -Input [7]: [cd_demo_sk#1, cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_cdemo_sk#6, c_current_hdemo_sk#7, c_current_addr_sk#8] +Output [5]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] +Input [7]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] (10) Scan parquet default.household_demographics Output [2]: [hd_demo_sk#9, hd_buy_potential#10] @@ -112,13 +112,13 @@ Input [1]: [hd_demo_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_hdemo_sk#7] +Left keys [1]: [c_current_hdemo_sk#3] Right keys [1]: [hd_demo_sk#9] Join condition: None (16) Project [codegen id : 7] -Output [4]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_addr_sk#8] -Input [6]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_hdemo_sk#7, c_current_addr_sk#8, hd_demo_sk#9] +Output [4]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] +Input [6]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, hd_demo_sk#9] (17) Scan parquet default.customer_address Output [2]: [ca_address_sk#12, ca_gmt_offset#13] @@ -143,71 +143,71 @@ Input [1]: [ca_address_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (22) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_addr_sk#8] +Left keys [1]: [c_current_addr_sk#4] Right keys [1]: [ca_address_sk#12] Join condition: None (23) Project [codegen id : 7] -Output [3]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5] -Input [5]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, c_current_addr_sk#8, ca_address_sk#12] +Output [3]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7] +Input [5]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, ca_address_sk#12] -(24) Scan parquet default.date_dim -Output [3]: [d_date_sk#15, d_year#16, d_moy#17] +(24) Scan parquet default.catalog_returns +Output [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct -(25) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#15, d_year#16, d_moy#17] +(25) ColumnarToRow [codegen id : 5] +Input [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] -(26) Filter [codegen id : 4] -Input [3]: [d_date_sk#15, d_year#16, d_moy#17] -Condition : ((((isnotnull(d_year#16) AND isnotnull(d_moy#17)) AND (d_year#16 = 1998)) AND (d_moy#17 = 11)) AND isnotnull(d_date_sk#15)) +(26) Filter [codegen id : 5] +Input [4]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] +Condition : ((isnotnull(cr_call_center_sk#17) AND isnotnull(cr_returned_date_sk#15)) AND isnotnull(cr_returning_customer_sk#16)) -(27) Project [codegen id : 4] -Output [1]: [d_date_sk#15] -Input [3]: [d_date_sk#15, d_year#16, d_moy#17] +(27) Scan parquet default.date_dim +Output [3]: [d_date_sk#19, d_year#20, d_moy#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct -(28) BroadcastExchange -Input [1]: [d_date_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +(28) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#19, d_year#20, d_moy#21] -(29) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returned_date_sk), IsNotNull(cr_returning_customer_sk)] -ReadSchema: struct +(29) Filter [codegen id : 4] +Input [3]: [d_date_sk#19, d_year#20, d_moy#21] +Condition : ((((isnotnull(d_year#20) AND isnotnull(d_moy#21)) AND (d_year#20 = 1998)) AND (d_moy#21 = 11)) AND isnotnull(d_date_sk#19)) -(30) ColumnarToRow -Input [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +(30) Project [codegen id : 4] +Output [1]: [d_date_sk#19] +Input [3]: [d_date_sk#19, d_year#20, d_moy#21] -(31) Filter -Input [4]: [cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] -Condition : ((isnotnull(cr_call_center_sk#21) AND isnotnull(cr_returned_date_sk#19)) AND isnotnull(cr_returning_customer_sk#20)) +(31) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (32) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#15] -Right keys [1]: [cr_returned_date_sk#19] +Left keys [1]: [cr_returned_date_sk#15] +Right keys [1]: [d_date_sk#19] Join condition: None (33) Project [codegen id : 5] -Output [3]: [cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] -Input [5]: [d_date_sk#15, cr_returned_date_sk#19, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Output [3]: [cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] +Input [5]: [cr_returned_date_sk#15, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18, d_date_sk#19] (34) BroadcastExchange -Input [3]: [cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Input [3]: [cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (35) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_customer_sk#5] -Right keys [1]: [cr_returning_customer_sk#20] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [cr_returning_customer_sk#16] Join condition: None (36) Project [codegen id : 7] -Output [4]: [cd_marital_status#2, cd_education_status#3, cr_call_center_sk#21, cr_net_loss#22] -Input [6]: [cd_marital_status#2, cd_education_status#3, c_customer_sk#5, cr_returning_customer_sk#20, cr_call_center_sk#21, cr_net_loss#22] +Output [4]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#17, cr_net_loss#18] +Input [6]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7, cr_returning_customer_sk#16, cr_call_center_sk#17, cr_net_loss#18] (37) Scan parquet default.call_center Output [4]: [cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] @@ -228,31 +228,31 @@ Input [4]: [cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#2 Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] (41) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [cr_call_center_sk#21] +Left keys [1]: [cr_call_center_sk#17] Right keys [1]: [cc_call_center_sk#24] Join condition: None (42) Project [codegen id : 7] -Output [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#22, cd_marital_status#2, cd_education_status#3] -Input [8]: [cd_marital_status#2, cd_education_status#3, cr_call_center_sk#21, cr_net_loss#22, cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] +Output [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#18, cd_marital_status#6, cd_education_status#7] +Input [8]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#17, cr_net_loss#18, cc_call_center_sk#24, cc_call_center_id#25, cc_name#26, cc_manager#27] (43) HashAggregate [codegen id : 7] -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#22, cd_marital_status#2, cd_education_status#3] -Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3] -Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#22))] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cr_net_loss#18, cd_marital_status#6, cd_education_status#7] +Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7] +Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#18))] Aggregate Attributes [1]: [sum#29] -Results [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] +Results [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] (44) Exchange -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] -Arguments: hashpartitioning(cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, 5), true, [id=#31] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] +Arguments: hashpartitioning(cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, 5), true, [id=#31] (45) HashAggregate [codegen id : 8] -Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3, sum#30] -Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#2, cd_education_status#3] -Functions [1]: [sum(UnscaledValue(cr_net_loss#22))] -Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#22))#32] -Results [4]: [cc_call_center_id#25 AS Call_Center#33, cc_name#26 AS Call_Center_Name#34, cc_manager#27 AS Manager#35, MakeDecimal(sum(UnscaledValue(cr_net_loss#22))#32,17,2) AS Returns_Loss#36] +Input [6]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7, sum#30] +Keys [5]: [cc_call_center_id#25, cc_name#26, cc_manager#27, cd_marital_status#6, cd_education_status#7] +Functions [1]: [sum(UnscaledValue(cr_net_loss#18))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#18))#32] +Results [4]: [cc_call_center_id#25 AS Call_Center#33, cc_name#26 AS Call_Center_Name#34, cc_manager#27 AS Manager#35, MakeDecimal(sum(UnscaledValue(cr_net_loss#18))#32,17,2) AS Returns_Loss#36] (46) Exchange Input [4]: [Call_Center#33, Call_Center_Name#34, Manager#35, Returns_Loss#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt index f64791821893d..87beb3b565cc1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt @@ -12,12 +12,16 @@ WholeStageCodegen (9) BroadcastHashJoin [cr_call_center_sk,cc_call_center_sk] Project [cd_marital_status,cd_education_status,cr_call_center_sk,cr_net_loss] BroadcastHashJoin [c_customer_sk,cr_returning_customer_sk] - Project [cd_marital_status,cd_education_status,c_customer_sk] + Project [c_customer_sk,cd_marital_status,cd_education_status] BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Project [cd_marital_status,cd_education_status,c_customer_sk,c_current_addr_sk] + Project [c_customer_sk,c_current_addr_sk,cd_marital_status,cd_education_status] BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] - Project [cd_marital_status,cd_education_status,c_customer_sk,c_current_hdemo_sk,c_current_addr_sk] - BroadcastHashJoin [cd_demo_sk,c_current_cdemo_sk] + Project [c_customer_sk,c_current_hdemo_sk,c_current_addr_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) @@ -25,10 +29,6 @@ WholeStageCodegen (9) ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] - Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) @@ -49,7 +49,11 @@ WholeStageCodegen (9) BroadcastExchange #6 WholeStageCodegen (5) Project [cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] - BroadcastHashJoin [d_date_sk,cr_returned_date_sk] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_call_center_sk,cr_returned_date_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] InputAdapter BroadcastExchange #7 WholeStageCodegen (4) @@ -58,10 +62,6 @@ WholeStageCodegen (9) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Filter [cr_call_center_sk,cr_returned_date_sk,cr_returning_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_returns [cr_returned_date_sk,cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] InputAdapter BroadcastExchange #8 WholeStageCodegen (6) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt index 7c479d6e41b84..dc4665185b014 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt @@ -9,173 +9,173 @@ TakeOrderedAndProject (34) : +- * BroadcastHashJoin Inner BuildLeft (26) : :- BroadcastExchange (22) : : +- * Project (21) - : : +- * BroadcastHashJoin Inner BuildRight (20) - : : :- * Filter (14) - : : : +- * HashAggregate (13) - : : : +- Exchange (12) - : : : +- * HashAggregate (11) - : : : +- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : :- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.web_sales (1) - : : : +- BroadcastExchange (8) - : : : +- * Project (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.date_dim (4) - : : +- BroadcastExchange (19) - : : +- * Project (18) - : : +- * Filter (17) - : : +- * ColumnarToRow (16) - : : +- Scan parquet default.item (15) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (19) + : : +- * HashAggregate (18) + : : +- Exchange (17) + : : +- * HashAggregate (16) + : : +- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.web_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) : +- * Filter (25) : +- * ColumnarToRow (24) : +- Scan parquet default.web_sales (23) +- ReusedExchange (28) -(1) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +(1) Scan parquet default.item +Output [2]: [i_item_sk#1, i_manufact_id#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(3) Filter [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] +Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 350)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [i_item_sk#1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(5) BroadcastExchange +Input [1]: [i_item_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +(7) ColumnarToRow [codegen id : 3] +Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] -(3) Filter [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] -Condition : (isnotnull(ws_sold_date_sk#1) AND isnotnull(ws_item_sk#2)) +(8) Filter [codegen id : 3] +Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +Condition : (isnotnull(ws_sold_date_sk#4) AND isnotnull(ws_item_sk#5)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] +(9) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_date#8] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(10) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#7, d_date#8] -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10983)) AND (d_date#5 <= 11073)) AND isnotnull(d_date_sk#4)) +(11) Filter [codegen id : 2] +Input [2]: [d_date_sk#7, d_date#8] +Condition : (((isnotnull(d_date#8) AND (d_date#8 >= 10983)) AND (d_date#8 <= 11073)) AND isnotnull(d_date_sk#7)) -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_date#8] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(13) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#4] +Right keys [1]: [d_date_sk#7] Join condition: None -(10) Project [codegen id : 2] -Output [2]: [ws_item_sk#2, ws_ext_discount_amt#3] -Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3, d_date_sk#4] - -(11) HashAggregate [codegen id : 2] -Input [2]: [ws_item_sk#2, ws_ext_discount_amt#3] -Keys [1]: [ws_item_sk#2] -Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#3))] -Aggregate Attributes [2]: [sum#7, count#8] -Results [3]: [ws_item_sk#2, sum#9, count#10] - -(12) Exchange -Input [3]: [ws_item_sk#2, sum#9, count#10] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#11] - -(13) HashAggregate [codegen id : 4] -Input [3]: [ws_item_sk#2, sum#9, count#10] -Keys [1]: [ws_item_sk#2] -Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#3))] -Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#3))#12] -Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#3))#12 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2 AS ws_item_sk#2#14] - -(14) Filter [codegen id : 4] -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2#14] -Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13) - -(15) Scan parquet default.item -Output [2]: [i_item_sk#15, i_manufact_id#16] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] -ReadSchema: struct +(15) Project [codegen id : 3] +Output [2]: [ws_item_sk#5, ws_ext_discount_amt#6] +Input [4]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6, d_date_sk#7] -(16) ColumnarToRow [codegen id : 3] -Input [2]: [i_item_sk#15, i_manufact_id#16] +(16) HashAggregate [codegen id : 3] +Input [2]: [ws_item_sk#5, ws_ext_discount_amt#6] +Keys [1]: [ws_item_sk#5] +Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#6))] +Aggregate Attributes [2]: [sum#10, count#11] +Results [3]: [ws_item_sk#5, sum#12, count#13] -(17) Filter [codegen id : 3] -Input [2]: [i_item_sk#15, i_manufact_id#16] -Condition : ((isnotnull(i_manufact_id#16) AND (i_manufact_id#16 = 350)) AND isnotnull(i_item_sk#15)) +(17) Exchange +Input [3]: [ws_item_sk#5, sum#12, count#13] +Arguments: hashpartitioning(ws_item_sk#5, 5), true, [id=#14] -(18) Project [codegen id : 3] -Output [1]: [i_item_sk#15] -Input [2]: [i_item_sk#15, i_manufact_id#16] +(18) HashAggregate +Input [3]: [ws_item_sk#5, sum#12, count#13] +Keys [1]: [ws_item_sk#5] +Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#6))] +Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#6))#15] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#6))#15 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5 AS ws_item_sk#5#17] -(19) BroadcastExchange -Input [1]: [i_item_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +(19) Filter +Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5#17] +Condition : isnotnull((CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16) (20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ws_item_sk#2#14] -Right keys [1]: [i_item_sk#15] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ws_item_sk#5#17] Join condition: None (21) Project [codegen id : 4] -Output [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] -Input [3]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, ws_item_sk#2#14, i_item_sk#15] +Output [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16] +Input [3]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_item_sk#5#17] (22) BroadcastExchange -Input [2]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#18] +Input [2]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] (23) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +Output [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (24) ColumnarToRow -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] (25) Filter -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] -Condition : ((isnotnull(ws_item_sk#2) AND isnotnull(ws_ext_discount_amt#3)) AND isnotnull(ws_sold_date_sk#1)) +Input [3]: [ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] +Condition : ((isnotnull(ws_item_sk#5) AND isnotnull(ws_ext_discount_amt#6)) AND isnotnull(ws_sold_date_sk#4)) (26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [i_item_sk#15] -Right keys [1]: [ws_item_sk#2] -Join condition: (cast(ws_ext_discount_amt#3 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13) +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ws_item_sk#5] +Join condition: (cast(ws_ext_discount_amt#6 as decimal(14,7)) > (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16) (27) Project [codegen id : 6] -Output [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3] -Input [5]: [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#13, i_item_sk#15, ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3] +Output [2]: [ws_sold_date_sk#4, ws_ext_discount_amt#6] +Input [5]: [i_item_sk#1, (CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))#16, ws_sold_date_sk#4, ws_item_sk#5, ws_ext_discount_amt#6] -(28) ReusedExchange [Reuses operator id: 8] -Output [1]: [d_date_sk#4] +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] (29) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] +Left keys [1]: [ws_sold_date_sk#4] +Right keys [1]: [d_date_sk#7] Join condition: None (30) Project [codegen id : 6] -Output [1]: [ws_ext_discount_amt#3] -Input [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, d_date_sk#4] +Output [1]: [ws_ext_discount_amt#6] +Input [3]: [ws_sold_date_sk#4, ws_ext_discount_amt#6, d_date_sk#7] (31) HashAggregate [codegen id : 6] -Input [1]: [ws_ext_discount_amt#3] +Input [1]: [ws_ext_discount_amt#6] Keys: [] -Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#3))] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#6))] Aggregate Attributes [1]: [sum#19] Results [1]: [sum#20] @@ -186,9 +186,9 @@ Arguments: SinglePartition, true, [id=#21] (33) HashAggregate [codegen id : 7] Input [1]: [sum#20] Keys: [] -Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#22] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#3))#22,17,2) AS Excess Discount Amount #23] +Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#6))#22] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#6))#22,17,2) AS Excess Discount Amount #23] (34) TakeOrderedAndProject Input [1]: [Excess Discount Amount #23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt index 75aa17c4a22c1..7fd1cd3637a09 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt @@ -12,13 +12,21 @@ TakeOrderedAndProject [Excess Discount Amount ] InputAdapter BroadcastExchange #2 WholeStageCodegen (4) - Project [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6))),i_item_sk] - BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [i_item_sk,(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))] + BroadcastHashJoin [i_item_sk,ws_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] Filter [(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6)))] HashAggregate [ws_item_sk,sum,count] [avg(UnscaledValue(ws_ext_discount_amt)),(CAST(1.3 AS DECIMAL(11,6)) * CAST(avg(ws_ext_discount_amt) AS DECIMAL(11,6))),ws_item_sk,sum,count] InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (2) + Exchange [ws_item_sk] #4 + WholeStageCodegen (3) HashAggregate [ws_item_sk,ws_ext_discount_amt] [sum,count,sum,count] Project [ws_item_sk,ws_ext_discount_amt] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] @@ -27,24 +35,16 @@ TakeOrderedAndProject [Excess Discount Amount ] InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_discount_amt] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) + BroadcastExchange #5 + WholeStageCodegen (2) Project [d_date_sk] Filter [d_date,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (3) - Project [i_item_sk] - Filter [i_manufact_id,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_manufact_id] Filter [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_discount_amt] InputAdapter - ReusedExchange [d_date_sk] #4 + ReusedExchange [d_date_sk] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 9a97932d6d4e5..7720d9dee4170 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -11,241 +11,241 @@ TakeOrderedAndProject (47) :- * Project (33) : +- * BroadcastHashJoin Inner BuildRight (32) : :- * Project (26) - : : +- * BroadcastHashJoin Inner BuildLeft (25) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.customer_address (1) - : : +- SortMergeJoin LeftAnti (24) - : : :- * Sort (19) - : : : +- Exchange (18) - : : : +- * Project (17) - : : : +- SortMergeJoin LeftSemi (16) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.web_sales (6) - : : : +- * Sort (15) - : : : +- Exchange (14) - : : : +- * Project (13) - : : : +- * ColumnarToRow (12) - : : : +- Scan parquet default.web_sales (11) - : : +- * Sort (23) - : : +- Exchange (22) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Sort (14) + : : : : +- Exchange (13) + : : : : +- * Project (12) + : : : : +- SortMergeJoin LeftSemi (11) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (10) + : : : : +- Exchange (9) + : : : : +- * Project (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.web_sales (6) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.web_returns (15) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) : : +- * ColumnarToRow (21) - : : +- Scan parquet default.web_returns (20) + : : +- Scan parquet default.customer_address (20) : +- BroadcastExchange (31) : +- * Project (30) : +- * Filter (29) : +- * ColumnarToRow (28) - : +- Scan parquet default.date_dim (27) + : +- Scan parquet default.web_site (27) +- BroadcastExchange (38) +- * Project (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.web_site (34) + +- Scan parquet default.date_dim (34) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#2] +(1) Scan parquet default.web_sales +Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] (3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] -Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = IL)) AND isnotnull(ca_address_sk#1)) +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#1] -Input [2]: [ca_address_sk#1, ca_state#2] +(4) Exchange +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#8] -(5) BroadcastExchange -Input [1]: [ca_address_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) Sort [codegen id : 2] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: [ws_order_number#5 ASC NULLS FIRST], false, 0 (6) Scan parquet default.web_sales -Output [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Output [2]: [ws_warehouse_sk#4, ws_order_number#5] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] -ReadSchema: struct +ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +(7) ColumnarToRow [codegen id : 3] +Input [2]: [ws_warehouse_sk#4, ws_order_number#5] -(8) Filter [codegen id : 2] -Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Condition : ((isnotnull(ws_ship_date_sk#4) AND isnotnull(ws_ship_addr_sk#5)) AND isnotnull(ws_web_site_sk#6)) +(8) Project [codegen id : 3] +Output [2]: [ws_warehouse_sk#4 AS ws_warehouse_sk#4#9, ws_order_number#5 AS ws_order_number#5#10] +Input [2]: [ws_warehouse_sk#4, ws_order_number#5] (9) Exchange -Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Arguments: hashpartitioning(ws_order_number#8, 5), true, [id=#11] +Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] +Arguments: hashpartitioning(ws_order_number#5#10, 5), true, [id=#11] -(10) Sort [codegen id : 3] -Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Arguments: [ws_order_number#8 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] +Arguments: [ws_order_number#5#10 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.web_sales -Output [2]: [ws_warehouse_sk#7, ws_order_number#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -ReadSchema: struct +(11) SortMergeJoin +Left keys [1]: [ws_order_number#5] +Right keys [1]: [ws_order_number#5#10] +Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#4#9) -(12) ColumnarToRow [codegen id : 4] -Input [2]: [ws_warehouse_sk#7, ws_order_number#8] +(12) Project [codegen id : 5] +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -(13) Project [codegen id : 4] -Output [2]: [ws_warehouse_sk#7 AS ws_warehouse_sk#7#12, ws_order_number#8 AS ws_order_number#8#13] -Input [2]: [ws_warehouse_sk#7, ws_order_number#8] +(13) Exchange +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), true, [id=#12] -(14) Exchange -Input [2]: [ws_warehouse_sk#7#12, ws_order_number#8#13] -Arguments: hashpartitioning(ws_order_number#8#13, 5), true, [id=#14] +(14) Sort [codegen id : 6] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: [cast(ws_order_number#5 as bigint) ASC NULLS FIRST], false, 0 -(15) Sort [codegen id : 5] -Input [2]: [ws_warehouse_sk#7#12, ws_order_number#8#13] -Arguments: [ws_order_number#8#13 ASC NULLS FIRST], false, 0 +(15) Scan parquet default.web_returns +Output [1]: [wr_order_number#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +ReadSchema: struct -(16) SortMergeJoin -Left keys [1]: [ws_order_number#8] -Right keys [1]: [ws_order_number#8#13] -Join condition: NOT (ws_warehouse_sk#7 = ws_warehouse_sk#7#12) +(16) ColumnarToRow [codegen id : 7] +Input [1]: [wr_order_number#13] -(17) Project [codegen id : 6] -Output [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Input [7]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_warehouse_sk#7, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +(17) Exchange +Input [1]: [wr_order_number#13] +Arguments: hashpartitioning(wr_order_number#13, 5), true, [id=#14] -(18) Exchange -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Arguments: hashpartitioning(cast(ws_order_number#8 as bigint), 5), true, [id=#15] +(18) Sort [codegen id : 8] +Input [1]: [wr_order_number#13] +Arguments: [wr_order_number#13 ASC NULLS FIRST], false, 0 -(19) Sort [codegen id : 7] -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Arguments: [cast(ws_order_number#8 as bigint) ASC NULLS FIRST], false, 0 +(19) SortMergeJoin +Left keys [1]: [cast(ws_order_number#5 as bigint)] +Right keys [1]: [wr_order_number#13] +Join condition: None -(20) Scan parquet default.web_returns -Output [1]: [wr_order_number#16] +(20) Scan parquet default.customer_address +Output [2]: [ca_address_sk#15, ca_state#16] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_returns] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct -(21) ColumnarToRow [codegen id : 8] -Input [1]: [wr_order_number#16] +(21) ColumnarToRow [codegen id : 9] +Input [2]: [ca_address_sk#15, ca_state#16] -(22) Exchange -Input [1]: [wr_order_number#16] -Arguments: hashpartitioning(wr_order_number#16, 5), true, [id=#17] +(22) Filter [codegen id : 9] +Input [2]: [ca_address_sk#15, ca_state#16] +Condition : ((isnotnull(ca_state#16) AND (ca_state#16 = IL)) AND isnotnull(ca_address_sk#15)) -(23) Sort [codegen id : 9] -Input [1]: [wr_order_number#16] -Arguments: [wr_order_number#16 ASC NULLS FIRST], false, 0 +(23) Project [codegen id : 9] +Output [1]: [ca_address_sk#15] +Input [2]: [ca_address_sk#15, ca_state#16] -(24) SortMergeJoin -Left keys [1]: [cast(ws_order_number#8 as bigint)] -Right keys [1]: [wr_order_number#16] -Join condition: None +(24) BroadcastExchange +Input [1]: [ca_address_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (25) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [ws_ship_addr_sk#5] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#15] Join condition: None (26) Project [codegen id : 12] -Output [5]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Input [7]: [ca_address_sk#1, ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#15] -(27) Scan parquet default.date_dim -Output [2]: [d_date_sk#18, d_date#19] +(27) Scan parquet default.web_site +Output [2]: [web_site_sk#18, web_company_name#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (28) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#18, d_date#19] +Input [2]: [web_site_sk#18, web_company_name#19] (29) Filter [codegen id : 10] -Input [2]: [d_date_sk#18, d_date#19] -Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 10623)) AND (d_date#19 <= 10683)) AND isnotnull(d_date_sk#18)) +Input [2]: [web_site_sk#18, web_company_name#19] +Condition : ((isnotnull(web_company_name#19) AND (web_company_name#19 = pri)) AND isnotnull(web_site_sk#18)) (30) Project [codegen id : 10] -Output [1]: [d_date_sk#18] -Input [2]: [d_date_sk#18, d_date#19] +Output [1]: [web_site_sk#18] +Input [2]: [web_site_sk#18, web_company_name#19] (31) BroadcastExchange -Input [1]: [d_date_sk#18] +Input [1]: [web_site_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (32) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_date_sk#4] -Right keys [1]: [d_date_sk#18] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#18] Join condition: None (33) Project [codegen id : 12] -Output [4]: [ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Input [6]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10, d_date_sk#18] +Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#18] -(34) Scan parquet default.web_site -Output [2]: [web_site_sk#21, web_company_name#22] +(34) Scan parquet default.date_dim +Output [2]: [d_date_sk#21, d_date#22] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (35) ColumnarToRow [codegen id : 11] -Input [2]: [web_site_sk#21, web_company_name#22] +Input [2]: [d_date_sk#21, d_date#22] (36) Filter [codegen id : 11] -Input [2]: [web_site_sk#21, web_company_name#22] -Condition : ((isnotnull(web_company_name#22) AND (web_company_name#22 = pri)) AND isnotnull(web_site_sk#21)) +Input [2]: [d_date_sk#21, d_date#22] +Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10623)) AND (d_date#22 <= 10683)) AND isnotnull(d_date_sk#21)) (37) Project [codegen id : 11] -Output [1]: [web_site_sk#21] -Input [2]: [web_site_sk#21, web_company_name#22] +Output [1]: [d_date_sk#21] +Input [2]: [d_date_sk#21, d_date#22] (38) BroadcastExchange -Input [1]: [web_site_sk#21] +Input [1]: [d_date_sk#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (39) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_web_site_sk#6] -Right keys [1]: [web_site_sk#21] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#21] Join condition: None (40) Project [codegen id : 12] -Output [3]: [ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Input [5]: [ws_web_site_sk#6, ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10, web_site_sk#21] +Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#21] (41) HashAggregate [codegen id : 12] -Input [3]: [ws_order_number#8, ws_ext_ship_cost#9, ws_net_profit#10] -Keys [1]: [ws_order_number#8] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#9)), partial_sum(UnscaledValue(ws_net_profit#10))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25] -Results [3]: [ws_order_number#8, sum#26, sum#27] +Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Keys [1]: [ws_order_number#5] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25] +Results [3]: [ws_order_number#5, sum#26, sum#27] (42) Exchange -Input [3]: [ws_order_number#8, sum#26, sum#27] -Arguments: hashpartitioning(ws_order_number#8, 5), true, [id=#28] +Input [3]: [ws_order_number#5, sum#26, sum#27] +Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#28] (43) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#8, sum#26, sum#27] -Keys [1]: [ws_order_number#8] -Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#9)), merge_sum(UnscaledValue(ws_net_profit#10))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25] -Results [3]: [ws_order_number#8, sum#26, sum#27] +Input [3]: [ws_order_number#5, sum#26, sum#27] +Keys [1]: [ws_order_number#5] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25] +Results [3]: [ws_order_number#5, sum#26, sum#27] (44) HashAggregate [codegen id : 13] -Input [3]: [ws_order_number#8, sum#26, sum#27] +Input [3]: [ws_order_number#5, sum#26, sum#27] Keys: [] -Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#9)), merge_sum(UnscaledValue(ws_net_profit#10)), partial_count(distinct ws_order_number#8)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25, count(ws_order_number#8)#29] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29] Results [3]: [sum#26, sum#27, count#30] (45) Exchange @@ -255,9 +255,9 @@ Arguments: SinglePartition, true, [id=#31] (46) HashAggregate [codegen id : 14] Input [3]: [sum#26, sum#27, count#30] Keys: [] -Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#9)), sum(UnscaledValue(ws_net_profit#10)), count(distinct ws_order_number#8)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#9))#24, sum(UnscaledValue(ws_net_profit#10))#25, count(ws_order_number#8)#29] -Results [3]: [count(ws_order_number#8)#29 AS order count #32, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#9))#24,17,2) AS total shipping cost #33, MakeDecimal(sum(UnscaledValue(ws_net_profit#10))#25,17,2) AS total net profit #34] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29] +Results [3]: [count(ws_order_number#5)#29 AS order count #32, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#24,17,2) AS total shipping cost #33, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#25,17,2) AS total net profit #34] (47) TakeOrderedAndProject Input [3]: [order count #32, total shipping cost #33, total net profit #34] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt index 1b1fe6026ec4d..128a8179ac10b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt @@ -11,68 +11,68 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (12) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ca_address_sk,ws_ship_addr_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] InputAdapter SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (7) + WholeStageCodegen (6) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #4 - WholeStageCodegen (6) + Exchange [ws_order_number] #3 + WholeStageCodegen (5) Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] InputAdapter SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (2) + Exchange [ws_order_number] #4 + WholeStageCodegen (1) Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - WholeStageCodegen (5) + WholeStageCodegen (4) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #6 - WholeStageCodegen (4) + Exchange [ws_order_number] #5 + WholeStageCodegen (3) Project [ws_warehouse_sk,ws_order_number] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number] - WholeStageCodegen (9) + WholeStageCodegen (8) Sort [wr_order_number] InputAdapter - Exchange [wr_order_number] #7 - WholeStageCodegen (8) + Exchange [wr_order_number] #6 + WholeStageCodegen (7) ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_order_number] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter BroadcastExchange #8 WholeStageCodegen (10) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] InputAdapter BroadcastExchange #9 WholeStageCodegen (11) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt index 6add431cd5b04..eae118d46245d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -11,323 +11,323 @@ TakeOrderedAndProject (63) :- * Project (49) : +- * BroadcastHashJoin Inner BuildRight (48) : :- * Project (42) - : : +- * BroadcastHashJoin Inner BuildLeft (41) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.customer_address (1) - : : +- SortMergeJoin LeftSemi (40) - : : :- * Sort (24) - : : : +- Exchange (23) - : : : +- SortMergeJoin LeftSemi (22) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.web_sales (6) - : : : +- * Sort (21) - : : : +- Exchange (20) - : : : +- * Project (19) - : : : +- * SortMergeJoin Inner (18) - : : : :- * Sort (15) - : : : : +- Exchange (14) - : : : : +- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.web_sales (11) - : : : +- * Sort (17) - : : : +- ReusedExchange (16) + : : +- * BroadcastHashJoin Inner BuildRight (41) + : : :- SortMergeJoin LeftSemi (35) + : : : :- * Sort (19) + : : : : +- Exchange (18) + : : : : +- SortMergeJoin LeftSemi (17) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * SortMergeJoin Inner (13) + : : : : :- * Sort (10) + : : : : : +- Exchange (9) + : : : : : +- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.web_sales (6) + : : : : +- * Sort (12) + : : : : +- ReusedExchange (11) + : : : +- * Project (34) + : : : +- * SortMergeJoin Inner (33) + : : : :- * Sort (27) + : : : : +- Exchange (26) + : : : : +- * Project (25) + : : : : +- * SortMergeJoin Inner (24) + : : : : :- * Sort (21) + : : : : : +- ReusedExchange (20) + : : : : +- * Sort (23) + : : : : +- ReusedExchange (22) + : : : +- * Sort (32) + : : : +- Exchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.web_returns (28) + : : +- BroadcastExchange (40) : : +- * Project (39) - : : +- * SortMergeJoin Inner (38) - : : :- * Sort (32) - : : : +- Exchange (31) - : : : +- * Project (30) - : : : +- * SortMergeJoin Inner (29) - : : : :- * Sort (26) - : : : : +- ReusedExchange (25) - : : : +- * Sort (28) - : : : +- ReusedExchange (27) - : : +- * Sort (37) - : : +- Exchange (36) - : : +- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.web_returns (33) + : : +- * Filter (38) + : : +- * ColumnarToRow (37) + : : +- Scan parquet default.customer_address (36) : +- BroadcastExchange (47) : +- * Project (46) : +- * Filter (45) : +- * ColumnarToRow (44) - : +- Scan parquet default.date_dim (43) + : +- Scan parquet default.web_site (43) +- BroadcastExchange (54) +- * Project (53) +- * Filter (52) +- * ColumnarToRow (51) - +- Scan parquet default.web_site (50) + +- Scan parquet default.date_dim (50) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#1, ca_state#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] - -(3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#1, ca_state#2] -Condition : ((isnotnull(ca_state#2) AND (ca_state#2 = IL)) AND isnotnull(ca_address_sk#1)) - -(4) Project [codegen id : 1] -Output [1]: [ca_address_sk#1] -Input [2]: [ca_address_sk#1, ca_state#2] - -(5) BroadcastExchange -Input [1]: [ca_address_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] - -(6) Scan parquet default.web_sales -Output [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +(1) Scan parquet default.web_sales +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] ReadSchema: struct -(7) ColumnarToRow [codegen id : 2] -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -(8) Filter [codegen id : 2] -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Condition : ((isnotnull(ws_ship_date_sk#4) AND isnotnull(ws_ship_addr_sk#5)) AND isnotnull(ws_web_site_sk#6)) +(3) Filter [codegen id : 1] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) -(9) Exchange -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#10] +(4) Exchange +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#7] -(10) Sort [codegen id : 3] -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 +(5) Sort [codegen id : 2] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 -(11) Scan parquet default.web_sales -Output [2]: [ws_warehouse_sk#11, ws_order_number#7] +(6) Scan parquet default.web_sales +Output [2]: [ws_warehouse_sk#8, ws_order_number#4] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_order_number), IsNotNull(ws_warehouse_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 4] -Input [2]: [ws_warehouse_sk#11, ws_order_number#7] +(7) ColumnarToRow [codegen id : 3] +Input [2]: [ws_warehouse_sk#8, ws_order_number#4] -(13) Filter [codegen id : 4] -Input [2]: [ws_warehouse_sk#11, ws_order_number#7] -Condition : (isnotnull(ws_order_number#7) AND isnotnull(ws_warehouse_sk#11)) +(8) Filter [codegen id : 3] +Input [2]: [ws_warehouse_sk#8, ws_order_number#4] +Condition : (isnotnull(ws_order_number#4) AND isnotnull(ws_warehouse_sk#8)) -(14) Exchange -Input [2]: [ws_warehouse_sk#11, ws_order_number#7] -Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#12] +(9) Exchange +Input [2]: [ws_warehouse_sk#8, ws_order_number#4] +Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#9] -(15) Sort [codegen id : 5] -Input [2]: [ws_warehouse_sk#11, ws_order_number#7] -Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 +(10) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#8, ws_order_number#4] +Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 -(16) ReusedExchange [Reuses operator id: 14] -Output [2]: [ws_warehouse_sk#13, ws_order_number#14] +(11) ReusedExchange [Reuses operator id: 9] +Output [2]: [ws_warehouse_sk#10, ws_order_number#11] -(17) Sort [codegen id : 7] -Input [2]: [ws_warehouse_sk#13, ws_order_number#14] -Arguments: [ws_order_number#14 ASC NULLS FIRST], false, 0 +(12) Sort [codegen id : 6] +Input [2]: [ws_warehouse_sk#10, ws_order_number#11] +Arguments: [ws_order_number#11 ASC NULLS FIRST], false, 0 -(18) SortMergeJoin [codegen id : 8] -Left keys [1]: [ws_order_number#7] -Right keys [1]: [ws_order_number#14] -Join condition: NOT (ws_warehouse_sk#11 = ws_warehouse_sk#13) +(13) SortMergeJoin [codegen id : 7] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [ws_order_number#11] +Join condition: NOT (ws_warehouse_sk#8 = ws_warehouse_sk#10) -(19) Project [codegen id : 8] -Output [1]: [ws_order_number#7 AS ws_order_number#7#15] -Input [4]: [ws_warehouse_sk#11, ws_order_number#7, ws_warehouse_sk#13, ws_order_number#14] +(14) Project [codegen id : 7] +Output [1]: [ws_order_number#4 AS ws_order_number#4#12] +Input [4]: [ws_warehouse_sk#8, ws_order_number#4, ws_warehouse_sk#10, ws_order_number#11] -(20) Exchange -Input [1]: [ws_order_number#7#15] -Arguments: hashpartitioning(ws_order_number#7#15, 5), true, [id=#16] +(15) Exchange +Input [1]: [ws_order_number#4#12] +Arguments: hashpartitioning(ws_order_number#4#12, 5), true, [id=#13] -(21) Sort [codegen id : 9] -Input [1]: [ws_order_number#7#15] -Arguments: [ws_order_number#7#15 ASC NULLS FIRST], false, 0 +(16) Sort [codegen id : 8] +Input [1]: [ws_order_number#4#12] +Arguments: [ws_order_number#4#12 ASC NULLS FIRST], false, 0 -(22) SortMergeJoin -Left keys [1]: [ws_order_number#7] -Right keys [1]: [ws_order_number#7#15] +(17) SortMergeJoin +Left keys [1]: [ws_order_number#4] +Right keys [1]: [ws_order_number#4#12] Join condition: None -(23) Exchange -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), 5), true, [id=#17] +(18) Exchange +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), true, [id=#14] -(24) Sort [codegen id : 10] -Input [6]: [ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST], false, 0 +(19) Sort [codegen id : 9] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 -(25) ReusedExchange [Reuses operator id: 14] -Output [2]: [ws_warehouse_sk#11, ws_order_number#7] +(20) ReusedExchange [Reuses operator id: 9] +Output [2]: [ws_warehouse_sk#8, ws_order_number#4] -(26) Sort [codegen id : 12] -Input [2]: [ws_warehouse_sk#11, ws_order_number#7] -Arguments: [ws_order_number#7 ASC NULLS FIRST], false, 0 +(21) Sort [codegen id : 11] +Input [2]: [ws_warehouse_sk#8, ws_order_number#4] +Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 -(27) ReusedExchange [Reuses operator id: 14] -Output [2]: [ws_warehouse_sk#18, ws_order_number#19] +(22) ReusedExchange [Reuses operator id: 9] +Output [2]: [ws_warehouse_sk#15, ws_order_number#16] -(28) Sort [codegen id : 14] -Input [2]: [ws_warehouse_sk#18, ws_order_number#19] -Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 +(23) Sort [codegen id : 13] +Input [2]: [ws_warehouse_sk#15, ws_order_number#16] +Arguments: [ws_order_number#16 ASC NULLS FIRST], false, 0 -(29) SortMergeJoin [codegen id : 15] -Left keys [1]: [ws_order_number#7] -Right keys [1]: [ws_order_number#19] -Join condition: NOT (ws_warehouse_sk#11 = ws_warehouse_sk#18) +(24) SortMergeJoin [codegen id : 14] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [ws_order_number#16] +Join condition: NOT (ws_warehouse_sk#8 = ws_warehouse_sk#15) -(30) Project [codegen id : 15] -Output [1]: [ws_order_number#7] -Input [4]: [ws_warehouse_sk#11, ws_order_number#7, ws_warehouse_sk#18, ws_order_number#19] +(25) Project [codegen id : 14] +Output [1]: [ws_order_number#4] +Input [4]: [ws_warehouse_sk#8, ws_order_number#4, ws_warehouse_sk#15, ws_order_number#16] -(31) Exchange -Input [1]: [ws_order_number#7] -Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), 5), true, [id=#20] +(26) Exchange +Input [1]: [ws_order_number#4] +Arguments: hashpartitioning(cast(ws_order_number#4 as bigint), 5), true, [id=#17] -(32) Sort [codegen id : 16] -Input [1]: [ws_order_number#7] -Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST], false, 0 +(27) Sort [codegen id : 15] +Input [1]: [ws_order_number#4] +Arguments: [cast(ws_order_number#4 as bigint) ASC NULLS FIRST], false, 0 -(33) Scan parquet default.web_returns -Output [1]: [wr_order_number#21] +(28) Scan parquet default.web_returns +Output [1]: [wr_order_number#18] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 17] -Input [1]: [wr_order_number#21] +(29) ColumnarToRow [codegen id : 16] +Input [1]: [wr_order_number#18] -(35) Filter [codegen id : 17] -Input [1]: [wr_order_number#21] -Condition : isnotnull(wr_order_number#21) +(30) Filter [codegen id : 16] +Input [1]: [wr_order_number#18] +Condition : isnotnull(wr_order_number#18) -(36) Exchange -Input [1]: [wr_order_number#21] -Arguments: hashpartitioning(wr_order_number#21, 5), true, [id=#22] +(31) Exchange +Input [1]: [wr_order_number#18] +Arguments: hashpartitioning(wr_order_number#18, 5), true, [id=#19] -(37) Sort [codegen id : 18] -Input [1]: [wr_order_number#21] -Arguments: [wr_order_number#21 ASC NULLS FIRST], false, 0 +(32) Sort [codegen id : 17] +Input [1]: [wr_order_number#18] +Arguments: [wr_order_number#18 ASC NULLS FIRST], false, 0 -(38) SortMergeJoin [codegen id : 19] -Left keys [1]: [cast(ws_order_number#7 as bigint)] -Right keys [1]: [wr_order_number#21] +(33) SortMergeJoin [codegen id : 18] +Left keys [1]: [cast(ws_order_number#4 as bigint)] +Right keys [1]: [wr_order_number#18] Join condition: None -(39) Project [codegen id : 19] -Output [1]: [wr_order_number#21] -Input [2]: [ws_order_number#7, wr_order_number#21] +(34) Project [codegen id : 18] +Output [1]: [wr_order_number#18] +Input [2]: [ws_order_number#4, wr_order_number#18] -(40) SortMergeJoin -Left keys [1]: [cast(ws_order_number#7 as bigint)] -Right keys [1]: [wr_order_number#21] +(35) SortMergeJoin +Left keys [1]: [cast(ws_order_number#4 as bigint)] +Right keys [1]: [wr_order_number#18] Join condition: None +(36) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 19] +Input [2]: [ca_address_sk#20, ca_state#21] + +(38) Filter [codegen id : 19] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : ((isnotnull(ca_state#21) AND (ca_state#21 = IL)) AND isnotnull(ca_address_sk#20)) + +(39) Project [codegen id : 19] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_state#21] + +(40) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + (41) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ca_address_sk#1] -Right keys [1]: [ws_ship_addr_sk#5] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#20] Join condition: None (42) Project [codegen id : 22] -Output [5]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Input [7]: [ca_address_sk#1, ws_ship_date_sk#4, ws_ship_addr_sk#5, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#20] -(43) Scan parquet default.date_dim -Output [2]: [d_date_sk#23, d_date#24] +(43) Scan parquet default.web_site +Output [2]: [web_site_sk#23, web_company_name#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (44) ColumnarToRow [codegen id : 20] -Input [2]: [d_date_sk#23, d_date#24] +Input [2]: [web_site_sk#23, web_company_name#24] (45) Filter [codegen id : 20] -Input [2]: [d_date_sk#23, d_date#24] -Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 10623)) AND (d_date#24 <= 10683)) AND isnotnull(d_date_sk#23)) +Input [2]: [web_site_sk#23, web_company_name#24] +Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri)) AND isnotnull(web_site_sk#23)) (46) Project [codegen id : 20] -Output [1]: [d_date_sk#23] -Input [2]: [d_date_sk#23, d_date#24] +Output [1]: [web_site_sk#23] +Input [2]: [web_site_sk#23, web_company_name#24] (47) BroadcastExchange -Input [1]: [d_date_sk#23] +Input [1]: [web_site_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (48) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_ship_date_sk#4] -Right keys [1]: [d_date_sk#23] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#23] Join condition: None (49) Project [codegen id : 22] -Output [4]: [ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Input [6]: [ws_ship_date_sk#4, ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9, d_date_sk#23] +Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#23] -(50) Scan parquet default.web_site -Output [2]: [web_site_sk#26, web_company_name#27] +(50) Scan parquet default.date_dim +Output [2]: [d_date_sk#26, d_date#27] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (51) ColumnarToRow [codegen id : 21] -Input [2]: [web_site_sk#26, web_company_name#27] +Input [2]: [d_date_sk#26, d_date#27] (52) Filter [codegen id : 21] -Input [2]: [web_site_sk#26, web_company_name#27] -Condition : ((isnotnull(web_company_name#27) AND (web_company_name#27 = pri)) AND isnotnull(web_site_sk#26)) +Input [2]: [d_date_sk#26, d_date#27] +Condition : (((isnotnull(d_date#27) AND (d_date#27 >= 10623)) AND (d_date#27 <= 10683)) AND isnotnull(d_date_sk#26)) (53) Project [codegen id : 21] -Output [1]: [web_site_sk#26] -Input [2]: [web_site_sk#26, web_company_name#27] +Output [1]: [d_date_sk#26] +Input [2]: [d_date_sk#26, d_date#27] (54) BroadcastExchange -Input [1]: [web_site_sk#26] +Input [1]: [d_date_sk#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] (55) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_web_site_sk#6] -Right keys [1]: [web_site_sk#26] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#26] Join condition: None (56) Project [codegen id : 22] -Output [3]: [ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Input [5]: [ws_web_site_sk#6, ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9, web_site_sk#26] +Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#26] (57) HashAggregate [codegen id : 22] -Input [3]: [ws_order_number#7, ws_ext_ship_cost#8, ws_net_profit#9] -Keys [1]: [ws_order_number#7] -Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#8)), partial_sum(UnscaledValue(ws_net_profit#9))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30] -Results [3]: [ws_order_number#7, sum#31, sum#32] +Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Keys [1]: [ws_order_number#4] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30] +Results [3]: [ws_order_number#4, sum#31, sum#32] (58) Exchange -Input [3]: [ws_order_number#7, sum#31, sum#32] -Arguments: hashpartitioning(ws_order_number#7, 5), true, [id=#33] +Input [3]: [ws_order_number#4, sum#31, sum#32] +Arguments: hashpartitioning(ws_order_number#4, 5), true, [id=#33] (59) HashAggregate [codegen id : 23] -Input [3]: [ws_order_number#7, sum#31, sum#32] -Keys [1]: [ws_order_number#7] -Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#8)), merge_sum(UnscaledValue(ws_net_profit#9))] -Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30] -Results [3]: [ws_order_number#7, sum#31, sum#32] +Input [3]: [ws_order_number#4, sum#31, sum#32] +Keys [1]: [ws_order_number#4] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30] +Results [3]: [ws_order_number#4, sum#31, sum#32] (60) HashAggregate [codegen id : 23] -Input [3]: [ws_order_number#7, sum#31, sum#32] +Input [3]: [ws_order_number#4, sum#31, sum#32] Keys: [] -Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#8)), merge_sum(UnscaledValue(ws_net_profit#9)), partial_count(distinct ws_order_number#7)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30, count(ws_order_number#7)#34] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30, count(ws_order_number#4)#34] Results [3]: [sum#31, sum#32, count#35] (61) Exchange @@ -337,9 +337,9 @@ Arguments: SinglePartition, true, [id=#36] (62) HashAggregate [codegen id : 24] Input [3]: [sum#31, sum#32, count#35] Keys: [] -Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#8)), sum(UnscaledValue(ws_net_profit#9)), count(distinct ws_order_number#7)] -Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#8))#29, sum(UnscaledValue(ws_net_profit#9))#30, count(ws_order_number#7)#34] -Results [3]: [count(ws_order_number#7)#34 AS order count #37, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#8))#29,17,2) AS total shipping cost #38, MakeDecimal(sum(UnscaledValue(ws_net_profit#9))#30,17,2) AS total net profit #39] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#29, sum(UnscaledValue(ws_net_profit#6))#30, count(ws_order_number#4)#34] +Results [3]: [count(ws_order_number#4)#34 AS order count #37, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#29,17,2) AS total shipping cost #38, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#30,17,2) AS total net profit #39] (63) TakeOrderedAndProject Input [3]: [order count #37, total shipping cost #38, total net profit #39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt index 057fa5dc3441f..bdcbb87b372dc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt @@ -11,101 +11,101 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (22) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ca_address_sk,ws_ship_addr_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [ca_address_sk] - Filter [ca_state,ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] InputAdapter SortMergeJoin [ws_order_number,wr_order_number] - WholeStageCodegen (10) + WholeStageCodegen (9) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #4 + Exchange [ws_order_number] #3 SortMergeJoin [ws_order_number,ws_order_number] - WholeStageCodegen (3) + WholeStageCodegen (2) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #5 - WholeStageCodegen (2) + Exchange [ws_order_number] #4 + WholeStageCodegen (1) Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - WholeStageCodegen (9) + WholeStageCodegen (8) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #6 - WholeStageCodegen (8) + Exchange [ws_order_number] #5 + WholeStageCodegen (7) Project [ws_order_number] SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] InputAdapter - WholeStageCodegen (5) + WholeStageCodegen (4) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #7 - WholeStageCodegen (4) + Exchange [ws_order_number] #6 + WholeStageCodegen (3) Filter [ws_order_number,ws_warehouse_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number] InputAdapter - WholeStageCodegen (7) + WholeStageCodegen (6) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #7 - WholeStageCodegen (19) + ReusedExchange [ws_warehouse_sk,ws_order_number] #6 + WholeStageCodegen (18) Project [wr_order_number] SortMergeJoin [ws_order_number,wr_order_number] InputAdapter - WholeStageCodegen (16) + WholeStageCodegen (15) Sort [ws_order_number] InputAdapter - Exchange [ws_order_number] #8 - WholeStageCodegen (15) + Exchange [ws_order_number] #7 + WholeStageCodegen (14) Project [ws_order_number] SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] InputAdapter - WholeStageCodegen (12) + WholeStageCodegen (11) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #7 + ReusedExchange [ws_warehouse_sk,ws_order_number] #6 InputAdapter - WholeStageCodegen (14) + WholeStageCodegen (13) Sort [ws_order_number] InputAdapter - ReusedExchange [ws_warehouse_sk,ws_order_number] #7 + ReusedExchange [ws_warehouse_sk,ws_order_number] #6 InputAdapter - WholeStageCodegen (18) + WholeStageCodegen (17) Sort [wr_order_number] InputAdapter - Exchange [wr_order_number] #9 - WholeStageCodegen (17) + Exchange [wr_order_number] #8 + WholeStageCodegen (16) Filter [wr_order_number] ColumnarToRow InputAdapter Scan parquet default.web_returns [wr_order_number] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (19) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter BroadcastExchange #10 WholeStageCodegen (20) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] InputAdapter BroadcastExchange #11 WholeStageCodegen (21) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt index a809ab1dd6644..d00029f985471 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt @@ -8,15 +8,15 @@ TakeOrderedAndProject (28) :- * Project (17) : +- * BroadcastHashJoin Inner BuildRight (16) : :- * Project (10) - : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.time_dim (1) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.store_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.time_dim (4) : +- BroadcastExchange (15) : +- * Project (14) : +- * Filter (13) @@ -29,50 +29,50 @@ TakeOrderedAndProject (28) +- Scan parquet default.household_demographics (18) -(1) Scan parquet default.time_dim -Output [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/time_dim] -PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,20), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(2) ColumnarToRow [codegen id : 4] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] -(3) Filter [codegen id : 1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] -Condition : ((((isnotnull(t_hour#2) AND isnotnull(t_minute#3)) AND (t_hour#2 = 20)) AND (t_minute#3 >= 30)) AND isnotnull(t_time_sk#1)) +(3) Filter [codegen id : 4] +Input [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) -(4) Project [codegen id : 1] -Output [1]: [t_time_sk#1] -Input [3]: [t_time_sk#1, t_hour#2, t_minute#3] +(4) Scan parquet default.time_dim +Output [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,20), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [t_time_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] +Condition : ((((isnotnull(t_hour#5) AND isnotnull(t_minute#6)) AND (t_hour#5 = 20)) AND (t_minute#6 >= 30)) AND isnotnull(t_time_sk#4)) -(7) ColumnarToRow -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +(7) Project [codegen id : 1] +Output [1]: [t_time_sk#4] +Input [3]: [t_time_sk#4, t_hour#5, t_minute#6] -(8) Filter -Input [3]: [ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] -Condition : ((isnotnull(ss_hdemo_sk#6) AND isnotnull(ss_sold_time_sk#5)) AND isnotnull(ss_store_sk#7)) +(8) BroadcastExchange +Input [1]: [t_time_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [t_time_sk#1] -Right keys [1]: [ss_sold_time_sk#5] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#4] Join condition: None (10) Project [codegen id : 4] -Output [2]: [ss_hdemo_sk#6, ss_store_sk#7] -Input [4]: [t_time_sk#1, ss_sold_time_sk#5, ss_hdemo_sk#6, ss_store_sk#7] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#4] (11) Scan parquet default.store Output [2]: [s_store_sk#8, s_store_name#9] @@ -97,13 +97,13 @@ Input [1]: [s_store_sk#8] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#7] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#8] Join condition: None (17) Project [codegen id : 4] -Output [1]: [ss_hdemo_sk#6] -Input [3]: [ss_hdemo_sk#6, ss_store_sk#7, s_store_sk#8] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#8] (18) Scan parquet default.household_demographics Output [2]: [hd_demo_sk#11, hd_dep_count#12] @@ -128,13 +128,13 @@ Input [1]: [hd_demo_sk#11] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#6] +Left keys [1]: [ss_hdemo_sk#2] Right keys [1]: [hd_demo_sk#11] Join condition: None (24) Project [codegen id : 4] Output: [] -Input [2]: [ss_hdemo_sk#6, hd_demo_sk#11] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#11] (25) HashAggregate [codegen id : 4] Input: [] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt index e4fc01bb6027b..1355caffbbfe8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt @@ -10,7 +10,11 @@ TakeOrderedAndProject [count(1)] Project [ss_hdemo_sk] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_hdemo_sk,ss_store_sk] - BroadcastHashJoin [t_time_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -19,10 +23,6 @@ TakeOrderedAndProject [count(1)] ColumnarToRow InputAdapter Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] - Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt index 7d6ff8f589693..30dabdd2d5523 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -10,153 +10,153 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.item (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.store_sales (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] - -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Condition : (i_category#6 IN (Sports,Books,Home) AND isnotnull(i_item_sk#1)) +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(4) Exchange -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Arguments: hashpartitioning(i_item_sk#1, 5), true, [id=#7] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(5) Sort [codegen id : 2] -Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 +(3) Filter [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(6) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] -Condition : (isnotnull(ss_item_sk#9) AND isnotnull(ss_sold_date_sk#8)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] -Arguments: hashpartitioning(ss_item_sk#9, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [3]: [ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] -Arguments: [ss_item_sk#9 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [ss_item_sk#9] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_ext_sales_price#10] -Input [9]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_item_sk#9, ss_ext_sales_price#10] +(10) Project [codegen id : 2] +Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(11) Exchange +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#8] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Input [8]: [i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6, ss_sold_date_sk#8, ss_ext_sales_price#10, d_date_sk#12] +Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#10, i_item_id#2, i_item_desc#3, i_current_price#4, i_class#5, i_category#6] -Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#10))] +Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] -Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4, sum#16] -Keys [5]: [i_item_id#2, i_item_desc#3, i_category#6, i_class#5, i_current_price#4] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#10))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#10))#18] -Results [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#10))#18,17,2) AS _w1#21, i_item_id#2] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: hashpartitioning(i_class#5, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: [i_class#5 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#5] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#2] -Input [9]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, _w0#20, _w1#21, i_item_id#2, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) Exchange -Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] -Arguments: rangepartitioning(i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] -Arguments: [i_category#6 ASC NULLS FIRST, i_class#5 ASC NULLS FIRST, i_item_id#2 ASC NULLS FIRST, i_item_desc#3 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 (29) Project [codegen id : 10] -Output [6]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24] -Input [7]: [i_item_desc#3, i_category#6, i_class#5, i_current_price#4, itemrevenue#19, revenueratio#24, i_item_id#2] +Output [6]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt index e15073da7fb51..a180ed2b060b9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt @@ -18,34 +18,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [i_item_id,i_item_desc,i_current_price,i_class,i_category,ss_sold_date_sk,ss_ext_sales_price] - SortMergeJoin [i_item_sk,ss_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (1) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] - InputAdapter - WholeStageCodegen (4) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #5 - WholeStageCodegen (3) + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt index c547e7af5d790..34eba382992c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt @@ -10,15 +10,15 @@ TakeOrderedAndProject (32) : :- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) @@ -33,50 +33,50 @@ TakeOrderedAndProject (32) +- Scan parquet default.warehouse (23) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_month_seq#2] +(1) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] +(2) ColumnarToRow [codegen id : 5] +Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] -Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1200)) AND (d_month_seq#2 <= 1211)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 5] +Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] +Condition : (((isnotnull(cs_warehouse_sk#5) AND isnotnull(cs_ship_mode_sk#4)) AND isnotnull(cs_call_center_sk#3)) AND isnotnull(cs_ship_date_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_month_seq#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] -(6) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] -(8) Filter -Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] -Condition : (((isnotnull(cs_warehouse_sk#8) AND isnotnull(cs_ship_mode_sk#7)) AND isnotnull(cs_call_center_sk#6)) AND isnotnull(cs_ship_date_sk#5)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_ship_date_sk#5] +Left keys [1]: [cs_ship_date_sk#2] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] -Input [6]: [d_date_sk#1, cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8] +Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5] +Input [6]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5, d_date_sk#6] (11) Scan parquet default.ship_mode Output [2]: [sm_ship_mode_sk#9, sm_type#10] @@ -97,13 +97,13 @@ Input [2]: [sm_ship_mode_sk#9, sm_type#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_ship_mode_sk#7] +Left keys [1]: [cs_ship_mode_sk#4] Right keys [1]: [sm_ship_mode_sk#9] Join condition: None (16) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_warehouse_sk#8, sm_type#10] -Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_ship_mode_sk#7, cs_warehouse_sk#8, sm_ship_mode_sk#9, sm_type#10] +Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_warehouse_sk#5, sm_type#10] +Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_ship_mode_sk#4, cs_warehouse_sk#5, sm_ship_mode_sk#9, sm_type#10] (17) Scan parquet default.call_center Output [2]: [cc_call_center_sk#12, cc_name#13] @@ -124,13 +124,13 @@ Input [2]: [cc_call_center_sk#12, cc_name#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_call_center_sk#6] +Left keys [1]: [cs_call_center_sk#3] Right keys [1]: [cc_call_center_sk#12] Join condition: None (22) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_warehouse_sk#8, sm_type#10, cc_name#13] -Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_call_center_sk#6, cs_warehouse_sk#8, sm_type#10, cc_call_center_sk#12, cc_name#13] +Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_warehouse_sk#5, sm_type#10, cc_name#13] +Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_call_center_sk#3, cs_warehouse_sk#5, sm_type#10, cc_call_center_sk#12, cc_name#13] (23) Scan parquet default.warehouse Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] @@ -151,18 +151,18 @@ Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (27) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_warehouse_sk#8] +Left keys [1]: [cs_warehouse_sk#5] Right keys [1]: [w_warehouse_sk#15] Join condition: None (28) Project [codegen id : 5] -Output [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, w_warehouse_name#16, sm_type#10, cc_name#13] -Input [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_warehouse_sk#8, sm_type#10, cc_name#13, w_warehouse_sk#15, w_warehouse_name#16] +Output [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, w_warehouse_name#16, sm_type#10, cc_name#13] +Input [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_warehouse_sk#5, sm_type#10, cc_name#13, w_warehouse_sk#15, w_warehouse_name#16] (29) HashAggregate [codegen id : 5] -Input [5]: [cs_sold_date_sk#4, cs_ship_date_sk#5, w_warehouse_name#16, sm_type#10, cc_name#13] +Input [5]: [cs_sold_date_sk#1, cs_ship_date_sk#2, w_warehouse_name#16, sm_type#10, cc_name#13] Keys [3]: [substr(w_warehouse_name#16, 1, 20) AS substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13] -Functions [5]: [partial_sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))] +Functions [5]: [partial_sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint)), partial_sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))] Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] Results [8]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] @@ -173,9 +173,9 @@ Arguments: hashpartitioning(substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, c (31) HashAggregate [codegen id : 6] Input [8]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] Keys [3]: [substr(w_warehouse_name#16, 1, 20)#18, sm_type#10, cc_name#13] -Functions [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))] -Aggregate Attributes [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint))#30, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint))#31, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint))#32, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint))#33, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))#34] -Results [8]: [substr(w_warehouse_name#16, 1, 20)#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 30) THEN 1 ELSE 0 END as bigint))#30 AS 30 days #36, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 30) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 60)) THEN 1 ELSE 0 END as bigint))#31 AS 31 - 60 days #37, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 60) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 90)) THEN 1 ELSE 0 END as bigint))#32 AS 61 - 90 days #38, sum(cast(CASE WHEN (((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 90) AND ((cs_ship_date_sk#5 - cs_sold_date_sk#4) <= 120)) THEN 1 ELSE 0 END as bigint))#33 AS 91 - 120 days #39, sum(cast(CASE WHEN ((cs_ship_date_sk#5 - cs_sold_date_sk#4) > 120) THEN 1 ELSE 0 END as bigint))#34 AS >120 days #40] +Functions [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint)), sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))] +Aggregate Attributes [5]: [sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint))#30, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint))#31, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint))#32, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint))#33, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))#34] +Results [8]: [substr(w_warehouse_name#16, 1, 20)#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 30) THEN 1 ELSE 0 END as bigint))#30 AS 30 days #36, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 30) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 60)) THEN 1 ELSE 0 END as bigint))#31 AS 31 - 60 days #37, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 60) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 90)) THEN 1 ELSE 0 END as bigint))#32 AS 61 - 90 days #38, sum(cast(CASE WHEN (((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 90) AND ((cs_ship_date_sk#2 - cs_sold_date_sk#1) <= 120)) THEN 1 ELSE 0 END as bigint))#33 AS 91 - 120 days #39, sum(cast(CASE WHEN ((cs_ship_date_sk#2 - cs_sold_date_sk#1) > 120) THEN 1 ELSE 0 END as bigint))#34 AS >120 days #40] (32) TakeOrderedAndProject Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt index de3b1913ae25c..b25b16136992c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt @@ -12,7 +12,11 @@ TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days , Project [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_warehouse_sk,sm_type] BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] Project [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] - BroadcastHashJoin [d_date_sk,cs_ship_date_sk] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -21,10 +25,6 @@ TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days , ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_month_seq] - Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt index 7714067c5bded..ab502fd0933f0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt @@ -61,11 +61,11 @@ TakeOrderedAndProject (86) : :- * Sort (53) : : +- Exchange (52) : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildLeft (50) - : : :- ReusedExchange (46) - : : +- * Filter (49) - : : +- * ColumnarToRow (48) - : : +- Scan parquet default.web_sales (47) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) : +- * Sort (55) : +- ReusedExchange (54) +- * Sort (83) @@ -293,38 +293,38 @@ Left keys [1]: [customer_id#22] Right keys [1]: [customer_id#31] Join condition: None -(46) ReusedExchange [Reuses operator id: 7] -Output [2]: [d_date_sk#5, d_year#6] - -(47) Scan parquet default.web_sales +(46) Scan parquet default.web_sales Output [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(48) ColumnarToRow +(47) ColumnarToRow [codegen id : 19] Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] -(49) Filter +(48) Filter [codegen id : 19] Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] Condition : (isnotnull(ws_bill_customer_sk#38) AND isnotnull(ws_sold_date_sk#37)) +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#5, d_year#6] + (50) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [d_date_sk#5] -Right keys [1]: [ws_sold_date_sk#37] +Left keys [1]: [ws_sold_date_sk#37] +Right keys [1]: [d_date_sk#5] Join condition: None (51) Project [codegen id : 19] -Output [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] -Input [6]: [d_date_sk#5, d_year#6, ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +Output [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] +Input [6]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_date_sk#5, d_year#6] (52) Exchange -Input [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] Arguments: hashpartitioning(ws_bill_customer_sk#38, 5), true, [id=#41] (53) Sort [codegen id : 20] -Input [4]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -341,7 +341,7 @@ Join condition: None (57) Project [codegen id : 23] Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] -Input [12]: [d_year#6, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] +Input [12]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16] (58) HashAggregate [codegen id : 23] Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt index d69e46d092c13..93d3d21e1e02f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt @@ -110,14 +110,14 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [ws_bill_customer_sk] #12 WholeStageCodegen (19) - Project [d_year,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_bill_customer_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price] + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt index 1d9ac2afeaf29..dad6098ce4685 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt @@ -36,15 +36,15 @@ TakeOrderedAndProject (110) : : : : : +- * Project (24) : : : : : +- * BroadcastHashJoin Inner BuildRight (23) : : : : : :- * Project (18) - : : : : : : +- * BroadcastHashJoin Inner BuildLeft (17) - : : : : : : :- BroadcastExchange (13) - : : : : : : : +- * Project (12) - : : : : : : : +- * Filter (11) - : : : : : : : +- * ColumnarToRow (10) - : : : : : : : +- Scan parquet default.date_dim (9) - : : : : : : +- * Filter (16) - : : : : : : +- * ColumnarToRow (15) - : : : : : : +- Scan parquet default.store_sales (14) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : : :- * Filter (11) + : : : : : : : +- * ColumnarToRow (10) + : : : : : : : +- Scan parquet default.store_sales (9) + : : : : : : +- BroadcastExchange (16) + : : : : : : +- * Project (15) + : : : : : : +- * Filter (14) + : : : : : : +- * ColumnarToRow (13) + : : : : : : +- Scan parquet default.date_dim (12) : : : : : +- BroadcastExchange (22) : : : : : +- * Filter (21) : : : : : +- * ColumnarToRow (20) @@ -54,11 +54,11 @@ TakeOrderedAndProject (110) : : : : +- * Project (38) : : : : +- * BroadcastHashJoin Inner BuildRight (37) : : : : :- * Project (32) - : : : : : +- * BroadcastHashJoin Inner BuildLeft (31) - : : : : : :- ReusedExchange (27) - : : : : : +- * Filter (30) - : : : : : +- * ColumnarToRow (29) - : : : : : +- Scan parquet default.catalog_sales (28) + : : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : : :- * Filter (29) + : : : : : : +- * ColumnarToRow (28) + : : : : : : +- Scan parquet default.catalog_sales (27) + : : : : : +- ReusedExchange (30) : : : : +- BroadcastExchange (36) : : : : +- * Filter (35) : : : : +- * ColumnarToRow (34) @@ -68,11 +68,11 @@ TakeOrderedAndProject (110) : : : +- * Project (50) : : : +- * BroadcastHashJoin Inner BuildRight (49) : : : :- * Project (47) - : : : : +- * BroadcastHashJoin Inner BuildLeft (46) - : : : : :- ReusedExchange (42) - : : : : +- * Filter (45) - : : : : +- * ColumnarToRow (44) - : : : : +- Scan parquet default.web_sales (43) + : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : :- * Filter (44) + : : : : : +- * ColumnarToRow (43) + : : : : : +- Scan parquet default.web_sales (42) + : : : : +- ReusedExchange (45) : : : +- ReusedExchange (48) : : +- BroadcastExchange (69) : : +- * Project (68) @@ -97,17 +97,17 @@ TakeOrderedAndProject (110) +- * Project (102) +- * BroadcastHashJoin Inner BuildRight (101) :- * Project (99) - : +- * BroadcastHashJoin Inner BuildLeft (98) - : :- BroadcastExchange (92) - : : +- * Project (91) - : : +- * Filter (90) - : : +- * ColumnarToRow (89) - : : +- Scan parquet default.date_dim (88) - : +- SortMergeJoin LeftSemi (97) - : :- * Sort (94) - : : +- ReusedExchange (93) - : +- * Sort (96) - : +- ReusedExchange (95) + : +- * BroadcastHashJoin Inner BuildRight (98) + : :- SortMergeJoin LeftSemi (92) + : : :- * Sort (89) + : : : +- ReusedExchange (88) + : : +- * Sort (91) + : : +- ReusedExchange (90) + : +- BroadcastExchange (97) + : +- * Project (96) + : +- * Filter (95) + : +- * ColumnarToRow (94) + : +- Scan parquet default.date_dim (93) +- ReusedExchange (100) @@ -147,50 +147,50 @@ Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) -(9) Scan parquet default.date_dim +(9) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] + +(11) Filter [codegen id : 5] +Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] +Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) + +(12) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_year#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct -(10) ColumnarToRow [codegen id : 3] +(13) ColumnarToRow [codegen id : 3] Input [2]: [d_date_sk#10, d_year#11] -(11) Filter [codegen id : 3] +(14) Filter [codegen id : 3] Input [2]: [d_date_sk#10, d_year#11] Condition : (((isnotnull(d_year#11) AND (d_year#11 >= 1998)) AND (d_year#11 <= 2000)) AND isnotnull(d_date_sk#10)) -(12) Project [codegen id : 3] +(15) Project [codegen id : 3] Output [1]: [d_date_sk#10] Input [2]: [d_date_sk#10, d_year#11] -(13) BroadcastExchange +(16) BroadcastExchange Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(14) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(15) ColumnarToRow -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] - -(16) Filter -Input [2]: [ss_sold_date_sk#1, ss_item_sk#2] -Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) - (17) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (18) Project [codegen id : 5] Output [1]: [ss_item_sk#2] -Input [3]: [d_date_sk#10, ss_sold_date_sk#1, ss_item_sk#2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, d_date_sk#10] (19) Scan parquet default.item Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -227,31 +227,31 @@ Arguments: hashpartitioning(coalesce(brand_id#14, 0), isnull(brand_id#14), coale Input [3]: [brand_id#14, class_id#15, category_id#16] Arguments: [coalesce(brand_id#14, 0) ASC NULLS FIRST, isnull(brand_id#14) ASC NULLS FIRST, coalesce(class_id#15, 0) ASC NULLS FIRST, isnull(class_id#15) ASC NULLS FIRST, coalesce(category_id#16, 0) ASC NULLS FIRST, isnull(category_id#16) ASC NULLS FIRST], false, 0 -(27) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#10] - -(28) Scan parquet default.catalog_sales +(27) Scan parquet default.catalog_sales Output [2]: [cs_sold_date_sk#18, cs_item_sk#19] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(29) ColumnarToRow +(28) ColumnarToRow [codegen id : 9] Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] -(30) Filter +(29) Filter [codegen id : 9] Input [2]: [cs_sold_date_sk#18, cs_item_sk#19] Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_date_sk#18)) +(30) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] + (31) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [cs_sold_date_sk#18] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#10] Join condition: None (32) Project [codegen id : 9] Output [1]: [cs_item_sk#19] -Input [3]: [d_date_sk#10, cs_sold_date_sk#18, cs_item_sk#19] +Input [3]: [cs_sold_date_sk#18, cs_item_sk#19, d_date_sk#10] (33) Scan parquet default.item Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -293,31 +293,31 @@ Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(42) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#10] - -(43) Scan parquet default.web_sales +(42) Scan parquet default.web_sales Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(44) ColumnarToRow +(43) ColumnarToRow [codegen id : 13] Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(45) Filter +(44) Filter [codegen id : 13] Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) +(45) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] + (46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [ws_sold_date_sk#22] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None (47) Project [codegen id : 13] Output [1]: [ws_item_sk#23] -Input [3]: [d_date_sk#10, ws_sold_date_sk#22, ws_item_sk#23] +Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] (48) ReusedExchange [Reuses operator id: 36] Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] @@ -506,55 +506,55 @@ Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantit Output [6]: [store AS channel#49, i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45] Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sales#44, number_sales#45, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#46] -(88) Scan parquet default.date_dim +(88) ReusedExchange [Reuses operator id: 4] +Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] + +(89) Sort [codegen id : 40] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 + +(90) ReusedExchange [Reuses operator id: 62] +Output [1]: [ss_item_sk#27] + +(91) Sort [codegen id : 56] +Input [1]: [ss_item_sk#27] +Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 + +(92) SortMergeJoin +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [ss_item_sk#27] +Join condition: None + +(93) Scan parquet default.date_dim Output [2]: [d_date_sk#10, d_week_seq#29] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] ReadSchema: struct -(89) ColumnarToRow [codegen id : 39] +(94) ColumnarToRow [codegen id : 57] Input [2]: [d_date_sk#10, d_week_seq#29] -(90) Filter [codegen id : 39] +(95) Filter [codegen id : 57] Input [2]: [d_date_sk#10, d_week_seq#29] Condition : ((isnotnull(d_week_seq#29) AND (d_week_seq#29 = Subquery scalar-subquery#50, [id=#51])) AND isnotnull(d_date_sk#10)) -(91) Project [codegen id : 39] +(96) Project [codegen id : 57] Output [1]: [d_date_sk#10] Input [2]: [d_date_sk#10, d_week_seq#29] -(92) BroadcastExchange +(97) BroadcastExchange Input [1]: [d_date_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] -(93) ReusedExchange [Reuses operator id: 4] -Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] - -(94) Sort [codegen id : 41] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 - -(95) ReusedExchange [Reuses operator id: 62] -Output [1]: [ss_item_sk#27] - -(96) Sort [codegen id : 57] -Input [1]: [ss_item_sk#27] -Arguments: [ss_item_sk#27 ASC NULLS FIRST], false, 0 - -(97) SortMergeJoin -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [ss_item_sk#27] -Join condition: None - (98) BroadcastHashJoin [codegen id : 76] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [ss_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#10] Join condition: None (99) Project [codegen id : 76] Output [3]: [ss_item_sk#2, ss_quantity#3, ss_list_price#4] -Input [5]: [d_date_sk#10, ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#3, ss_list_price#4, d_date_sk#10] (100) ReusedExchange [Reuses operator id: 80] Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] @@ -782,7 +782,7 @@ Input [4]: [d_week_seq#29, d_year#11, d_moy#89, d_dom#90] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] -Subquery:4 Hosting operator id = 90 Hosting Expression = Subquery scalar-subquery#50, [id=#51] +Subquery:4 Hosting operator id = 95 Hosting Expression = Subquery scalar-subquery#50, [id=#51] * Project (144) +- * Filter (143) +- * ColumnarToRow (142) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt index fc24efc4567af..d6b8ba4395d2e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt @@ -97,7 +97,11 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter BroadcastExchange #7 WholeStageCodegen (3) @@ -106,10 +110,6 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_item_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk] InputAdapter BroadcastExchange #8 WholeStageCodegen (4) @@ -125,13 +125,13 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #7 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk] + InputAdapter + ReusedExchange [d_date_sk] #7 InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -147,13 +147,13 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #7 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] + InputAdapter + ReusedExchange [d_date_sk] #7 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10 InputAdapter @@ -201,10 +201,20 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + InputAdapter + SortMergeJoin [ss_item_sk,ss_item_sk] + WholeStageCodegen (40) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 + WholeStageCodegen (56) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #3 InputAdapter BroadcastExchange #19 - WholeStageCodegen (39) + WholeStageCodegen (57) Project [d_date_sk] Filter [d_week_seq,d_date_sk] Subquery #3 @@ -217,15 +227,5 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_week_seq] - InputAdapter - SortMergeJoin [ss_item_sk,ss_item_sk] - WholeStageCodegen (41) - Sort [ss_item_sk] - InputAdapter - ReusedExchange [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price] #2 - WholeStageCodegen (57) - Sort [ss_item_sk] - InputAdapter - ReusedExchange [ss_item_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt index f17901bf84a98..38292528b42fc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt @@ -87,11 +87,11 @@ TakeOrderedAndProject (222) : : : : : : : +- * Project (50) : : : : : : : +- * BroadcastHashJoin Inner BuildRight (49) : : : : : : : :- * Project (47) - : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (46) - : : : : : : : : :- ReusedExchange (42) - : : : : : : : : +- * Filter (45) - : : : : : : : : +- * ColumnarToRow (44) - : : : : : : : : +- Scan parquet default.web_sales (43) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : : : : : :- * Filter (44) + : : : : : : : : : +- * ColumnarToRow (43) + : : : : : : : : : +- Scan parquet default.web_sales (42) + : : : : : : : : +- ReusedExchange (45) : : : : : : : +- ReusedExchange (48) : : : : : : +- BroadcastExchange (69) : : : : : : +- * Project (68) @@ -405,31 +405,31 @@ Left keys [6]: [coalesce(brand_id#14, 0), isnull(brand_id#14), coalesce(class_id Right keys [6]: [coalesce(i_brand_id#7, 0), isnull(i_brand_id#7), coalesce(i_class_id#8, 0), isnull(i_class_id#8), coalesce(i_category_id#9, 0), isnull(i_category_id#9)] Join condition: None -(42) ReusedExchange [Reuses operator id: 16] -Output [1]: [d_date_sk#10] - -(43) Scan parquet default.web_sales +(42) Scan parquet default.web_sales Output [2]: [ws_sold_date_sk#22, ws_item_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(44) ColumnarToRow +(43) ColumnarToRow [codegen id : 13] Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] -(45) Filter +(44) Filter [codegen id : 13] Input [2]: [ws_sold_date_sk#22, ws_item_sk#23] Condition : (isnotnull(ws_item_sk#23) AND isnotnull(ws_sold_date_sk#22)) +(45) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#10] + (46) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [d_date_sk#10] -Right keys [1]: [ws_sold_date_sk#22] +Left keys [1]: [ws_sold_date_sk#22] +Right keys [1]: [d_date_sk#10] Join condition: None (47) Project [codegen id : 13] Output [1]: [ws_item_sk#23] -Input [3]: [d_date_sk#10, ws_sold_date_sk#22, ws_item_sk#23] +Input [3]: [ws_sold_date_sk#22, ws_item_sk#23, d_date_sk#10] (48) ReusedExchange [Reuses operator id: 36] Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt index 76a6f5c4a6048..30856e02f2b62 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt @@ -192,13 +192,13 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num Project [i_brand_id,i_class_id,i_category_id] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_item_sk] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #12 + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk] + InputAdapter + ReusedExchange [d_date_sk] #12 InputAdapter ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #15 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt index 09c08a0131d34..2d76deefcaa36 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt @@ -109,34 +109,34 @@ TakeOrderedAndProject (160) : +- * Project (134) : +- * BroadcastHashJoin Inner BuildRight (133) : :- * Project (131) - : : +- * BroadcastHashJoin Inner BuildLeft (130) - : : :- BroadcastExchange (120) - : : : +- * Project (119) - : : : +- * BroadcastHashJoin Inner BuildLeft (118) - : : : :- BroadcastExchange (114) - : : : : +- * Project (113) - : : : : +- * BroadcastHashJoin Inner BuildRight (112) - : : : : :- * Project (106) - : : : : : +- * Filter (105) - : : : : : +- * ColumnarToRow (104) - : : : : : +- Scan parquet default.customer (103) - : : : : +- BroadcastExchange (111) - : : : : +- * Project (110) - : : : : +- * Filter (109) - : : : : +- * ColumnarToRow (108) - : : : : +- Scan parquet default.customer_address (107) - : : : +- * Filter (117) - : : : +- * ColumnarToRow (116) - : : : +- Scan parquet default.customer_demographics (115) - : : +- * Project (129) - : : +- * BroadcastHashJoin Inner BuildRight (128) - : : :- * Project (126) - : : : +- * BroadcastHashJoin Inner BuildRight (125) - : : : :- * Filter (123) - : : : : +- * ColumnarToRow (122) - : : : : +- Scan parquet default.catalog_sales (121) - : : : +- ReusedExchange (124) - : : +- ReusedExchange (127) + : : +- * BroadcastHashJoin Inner BuildRight (130) + : : :- * Project (111) + : : : +- * BroadcastHashJoin Inner BuildRight (110) + : : : :- * Project (108) + : : : : +- * BroadcastHashJoin Inner BuildRight (107) + : : : : :- * Filter (105) + : : : : : +- * ColumnarToRow (104) + : : : : : +- Scan parquet default.catalog_sales (103) + : : : : +- ReusedExchange (106) + : : : +- ReusedExchange (109) + : : +- BroadcastExchange (129) + : : +- * Project (128) + : : +- * BroadcastHashJoin Inner BuildLeft (127) + : : :- BroadcastExchange (123) + : : : +- * Project (122) + : : : +- * BroadcastHashJoin Inner BuildRight (121) + : : : :- * Project (115) + : : : : +- * Filter (114) + : : : : +- * ColumnarToRow (113) + : : : : +- Scan parquet default.customer (112) + : : : +- BroadcastExchange (120) + : : : +- * Project (119) + : : : +- * Filter (118) + : : : +- * ColumnarToRow (117) + : : : +- Scan parquet default.customer_address (116) + : : +- * Filter (126) + : : +- * ColumnarToRow (125) + : : +- Scan parquet default.customer_demographics (124) : +- ReusedExchange (132) +- * HashAggregate (158) +- Exchange (157) @@ -617,132 +617,132 @@ Functions [7]: [avg(agg1#36), avg(agg2#37), avg(agg3#38), avg(agg4#39), avg(agg5 Aggregate Attributes [7]: [avg(agg1#36)#167, avg(agg2#37)#168, avg(agg3#38)#169, avg(agg4#39)#170, avg(agg5#40)#171, avg(agg6#41)#172, avg(agg7#42)#173] Results [11]: [i_item_id#19, ca_country#30, null AS ca_state#174, null AS county#175, avg(agg1#36)#167 AS agg1#176, avg(agg2#37)#168 AS agg2#177, avg(agg3#38)#169 AS agg3#178, avg(agg4#39)#170 AS agg4#179, avg(agg5#40)#171 AS agg5#180, avg(agg6#41)#172 AS agg6#181, avg(agg7#42)#173 AS agg7#182] -(103) Scan parquet default.customer +(103) Scan parquet default.catalog_sales +Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 49] +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] + +(105) Filter [codegen id : 49] +Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] +Condition : (((isnotnull(cs_bill_cdemo_sk#3) AND isnotnull(cs_bill_customer_sk#2)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#4)) + +(106) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#10, cd_dep_count#13] + +(107) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_bill_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(108) Project [codegen id : 49] +Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Input [11]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_demo_sk#10, cd_dep_count#13] + +(109) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + +(110) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(111) Project [codegen id : 49] +Output [8]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Input [10]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, d_date_sk#15] + +(112) Scan parquet default.customer Output [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct -(104) ColumnarToRow [codegen id : 44] +(113) ColumnarToRow [codegen id : 46] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] -(105) Filter [codegen id : 44] +(114) Filter [codegen id : 46] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] Condition : (((c_birth_month#25 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#22)) AND isnotnull(c_current_cdemo_sk#23)) AND isnotnull(c_current_addr_sk#24)) -(106) Project [codegen id : 44] +(115) Project [codegen id : 46] Output [4]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_year#26] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_month#25, c_birth_year#26] -(107) Scan parquet default.customer_address +(116) Scan parquet default.customer_address Output [2]: [ca_address_sk#27, ca_state#29] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] ReadSchema: struct -(108) ColumnarToRow [codegen id : 43] +(117) ColumnarToRow [codegen id : 45] Input [2]: [ca_address_sk#27, ca_state#29] -(109) Filter [codegen id : 43] +(118) Filter [codegen id : 45] Input [2]: [ca_address_sk#27, ca_state#29] Condition : (ca_state#29 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#27)) -(110) Project [codegen id : 43] +(119) Project [codegen id : 45] Output [1]: [ca_address_sk#27] Input [2]: [ca_address_sk#27, ca_state#29] -(111) BroadcastExchange +(120) BroadcastExchange Input [1]: [ca_address_sk#27] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#183] -(112) BroadcastHashJoin [codegen id : 44] +(121) BroadcastHashJoin [codegen id : 46] Left keys [1]: [c_current_addr_sk#24] Right keys [1]: [ca_address_sk#27] Join condition: None -(113) Project [codegen id : 44] +(122) Project [codegen id : 46] Output [3]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26] Input [5]: [c_customer_sk#22, c_current_cdemo_sk#23, c_current_addr_sk#24, c_birth_year#26, ca_address_sk#27] -(114) BroadcastExchange +(123) BroadcastExchange Input [3]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26] Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#184] -(115) Scan parquet default.customer_demographics +(124) Scan parquet default.customer_demographics Output [1]: [cd_demo_sk#185] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct -(116) ColumnarToRow +(125) ColumnarToRow Input [1]: [cd_demo_sk#185] -(117) Filter +(126) Filter Input [1]: [cd_demo_sk#185] Condition : isnotnull(cd_demo_sk#185) -(118) BroadcastHashJoin [codegen id : 45] +(127) BroadcastHashJoin [codegen id : 47] Left keys [1]: [c_current_cdemo_sk#23] Right keys [1]: [cd_demo_sk#185] Join condition: None -(119) Project [codegen id : 45] +(128) Project [codegen id : 47] Output [2]: [c_customer_sk#22, c_birth_year#26] Input [4]: [c_customer_sk#22, c_current_cdemo_sk#23, c_birth_year#26, cd_demo_sk#185] -(120) BroadcastExchange +(129) BroadcastExchange Input [2]: [c_customer_sk#22, c_birth_year#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#186] -(121) Scan parquet default.catalog_sales -Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk)] -ReadSchema: struct - -(122) ColumnarToRow -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] - -(123) Filter -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9] -Condition : (((isnotnull(cs_bill_cdemo_sk#3) AND isnotnull(cs_bill_customer_sk#2)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_item_sk#4)) - -(124) ReusedExchange [Reuses operator id: 8] -Output [2]: [cd_demo_sk#10, cd_dep_count#13] - -(125) BroadcastHashJoin -Left keys [1]: [cs_bill_cdemo_sk#3] -Right keys [1]: [cd_demo_sk#10] -Join condition: None - -(126) Project -Output [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] -Input [11]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_demo_sk#10, cd_dep_count#13] - -(127) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#15] - -(128) BroadcastHashJoin -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#15] -Join condition: None - -(129) Project -Output [8]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] -Input [10]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, d_date_sk#15] - (130) BroadcastHashJoin [codegen id : 49] -Left keys [1]: [c_customer_sk#22] -Right keys [1]: [cs_bill_customer_sk#2] +Left keys [1]: [cs_bill_customer_sk#2] +Right keys [1]: [c_customer_sk#22] Join condition: None (131) Project [codegen id : 49] -Output [8]: [c_birth_year#26, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] -Input [10]: [c_customer_sk#22, c_birth_year#26, cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] +Output [8]: [cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_birth_year#26] +Input [10]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_customer_sk#22, c_birth_year#26] (132) ReusedExchange [Reuses operator id: 21] Output [2]: [i_item_sk#18, i_item_id#19] @@ -754,7 +754,7 @@ Join condition: None (134) Project [codegen id : 49] Output [8]: [i_item_id#19, cast(cs_quantity#5 as decimal(12,2)) AS agg1#36, cast(cs_list_price#6 as decimal(12,2)) AS agg2#37, cast(cs_coupon_amt#8 as decimal(12,2)) AS agg3#38, cast(cs_sales_price#7 as decimal(12,2)) AS agg4#39, cast(cs_net_profit#9 as decimal(12,2)) AS agg5#40, cast(c_birth_year#26 as decimal(12,2)) AS agg6#41, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#42] -Input [10]: [c_birth_year#26, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, i_item_sk#18, i_item_id#19] +Input [10]: [cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, c_birth_year#26, i_item_sk#18, i_item_id#19] (135) HashAggregate [codegen id : 49] Input [8]: [i_item_id#19, agg1#36, agg2#37, agg3#38, agg4#39, agg5#40, agg6#41, agg7#42] @@ -839,7 +839,7 @@ Join condition: None Output [7]: [cs_bill_customer_sk#2, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13] Input [9]: [cs_bill_customer_sk#2, cs_item_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cs_net_profit#9, cd_dep_count#13, i_item_sk#18] -(153) ReusedExchange [Reuses operator id: 120] +(153) ReusedExchange [Reuses operator id: 129] Output [2]: [c_customer_sk#22, c_birth_year#26] (154) BroadcastHashJoin [codegen id : 57] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt index 6030a0d04a50f..5514e335f1b51 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt @@ -186,16 +186,28 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag HashAggregate [i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] Project [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] BroadcastHashJoin [cs_item_sk,i_item_sk] - Project [c_birth_year,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] - BroadcastHashJoin [c_customer_sk,cs_bill_customer_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_sold_date_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit] + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [d_date_sk] #4 InputAdapter BroadcastExchange #19 - WholeStageCodegen (45) + WholeStageCodegen (47) Project [c_customer_sk,c_birth_year] BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] InputAdapter BroadcastExchange #20 - WholeStageCodegen (44) + WholeStageCodegen (46) Project [c_customer_sk,c_current_cdemo_sk,c_birth_year] BroadcastHashJoin [c_current_addr_sk,ca_address_sk] Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] @@ -205,7 +217,7 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] InputAdapter BroadcastExchange #21 - WholeStageCodegen (43) + WholeStageCodegen (45) Project [ca_address_sk] Filter [ca_state,ca_address_sk] ColumnarToRow @@ -215,18 +227,6 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,ag ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk] - Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] - BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] - Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_sold_date_sk,cs_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit] - InputAdapter - ReusedExchange [cd_demo_sk,cd_dep_count] #3 - InputAdapter - ReusedExchange [d_date_sk] #4 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 WholeStageCodegen (58) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt index a22109fc2b4d7..15cde1a45a99b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -12,15 +12,15 @@ TakeOrderedAndProject (27) :- * Sort (12) : +- Exchange (11) : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildLeft (9) - : :- BroadcastExchange (5) - : : +- * Project (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.date_dim (1) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.catalog_sales (6) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) +- * Sort (17) +- Exchange (16) +- * Filter (15) @@ -28,58 +28,58 @@ TakeOrderedAndProject (27) +- Scan parquet default.item (13) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_date#2] +(1) Scan parquet default.catalog_sales +Output [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] +(2) ColumnarToRow [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_date#2] -Condition : (((isnotnull(d_date#2) AND (d_date#2 >= 10644)) AND (d_date#2 <= 10674)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_date#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(6) Scan parquet default.catalog_sales -Output [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(7) ColumnarToRow -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter -Input [3]: [cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] -Condition : (isnotnull(cs_item_sk#5) AND isnotnull(cs_sold_date_sk#4)) +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#4] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (10) Project [codegen id : 2] -Output [2]: [cs_item_sk#5, cs_ext_sales_price#6] -Input [4]: [d_date_sk#1, cs_sold_date_sk#4, cs_item_sk#5, cs_ext_sales_price#6] +Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] (11) Exchange -Input [2]: [cs_item_sk#5, cs_ext_sales_price#6] -Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#7] +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] -Input [2]: [cs_item_sk#5, cs_ext_sales_price#6] -Arguments: [cs_item_sk#5 ASC NULLS FIRST], false, 0 +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 (13) Scan parquet default.item Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -104,18 +104,18 @@ Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_clas Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 (18) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#5] +Left keys [1]: [cs_item_sk#2] Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [cs_item_sk#5, cs_ext_sales_price#6, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#6, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#6))] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -126,9 +126,9 @@ Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class# (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] -Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#6))#18] -Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#6))#18,17,2) AS _w1#21] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] +Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt index f1568a8212b43..e66efff75180a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt @@ -22,7 +22,11 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c Exchange [cs_item_sk] #3 WholeStageCodegen (2) Project [cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date] - Filter [cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] InputAdapter WholeStageCodegen (5) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt index e754e998b6c8b..0234a65ac06a5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt @@ -12,20 +12,20 @@ TakeOrderedAndProject (52) : : +- Exchange (17) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) - : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.inventory (6) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.warehouse (4) : : +- BroadcastExchange (14) - : : +- * Filter (13) - : : +- * ColumnarToRow (12) - : : +- Scan parquet default.warehouse (11) + : : +- * Project (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.date_dim (10) : +- * Sort (23) : +- Exchange (22) : +- * Filter (21) @@ -53,85 +53,85 @@ TakeOrderedAndProject (52) +- ReusedExchange (46) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_month_seq#2] +(1) Scan parquet default.inventory +Output [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] - -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_month_seq#2] -Condition : (((isnotnull(d_month_seq#2) AND (d_month_seq#2 >= 1212)) AND (d_month_seq#2 <= 1223)) AND isnotnull(d_date_sk#1)) +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_date_sk), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_month_seq#2] +(2) ColumnarToRow [codegen id : 3] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(3) Filter [codegen id : 3] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) -(6) Scan parquet default.inventory -Output [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +(4) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_date_sk), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct -(7) ColumnarToRow -Input [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +(5) ColumnarToRow [codegen id : 1] +Input [1]: [w_warehouse_sk#5] -(8) Filter -Input [4]: [inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] -Condition : ((isnotnull(inv_date_sk#4) AND isnotnull(inv_item_sk#5)) AND isnotnull(inv_warehouse_sk#6)) +(6) Filter [codegen id : 1] +Input [1]: [w_warehouse_sk#5] +Condition : isnotnull(w_warehouse_sk#5) -(9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [inv_date_sk#4] +(7) BroadcastExchange +Input [1]: [w_warehouse_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#5] Join condition: None -(10) Project [codegen id : 3] -Output [3]: [inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] -Input [5]: [d_date_sk#1, inv_date_sk#4, inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7] +(9) Project [codegen id : 3] +Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] +Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] -(11) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#8] +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_month_seq#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#7, d_month_seq#8] -(12) ColumnarToRow [codegen id : 2] -Input [1]: [w_warehouse_sk#8] +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#7, d_month_seq#8] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND isnotnull(d_date_sk#7)) -(13) Filter [codegen id : 2] -Input [1]: [w_warehouse_sk#8] -Condition : isnotnull(w_warehouse_sk#8) +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_month_seq#8] (14) BroadcastExchange -Input [1]: [w_warehouse_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#6] -Right keys [1]: [w_warehouse_sk#8] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (16) Project [codegen id : 3] -Output [2]: [inv_item_sk#5, inv_quantity_on_hand#7] -Input [4]: [inv_item_sk#5, inv_warehouse_sk#6, inv_quantity_on_hand#7, w_warehouse_sk#8] +Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] +Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] (17) Exchange -Input [2]: [inv_item_sk#5, inv_quantity_on_hand#7] -Arguments: hashpartitioning(inv_item_sk#5, 5), true, [id=#10] +Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] +Arguments: hashpartitioning(inv_item_sk#2, 5), true, [id=#10] (18) Sort [codegen id : 4] -Input [2]: [inv_item_sk#5, inv_quantity_on_hand#7] -Arguments: [inv_item_sk#5 ASC NULLS FIRST], false, 0 +Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] +Arguments: [inv_item_sk#2 ASC NULLS FIRST], false, 0 (19) Scan parquet default.item Output [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] @@ -156,18 +156,18 @@ Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name# Arguments: [i_item_sk#11 ASC NULLS FIRST], false, 0 (24) SortMergeJoin [codegen id : 7] -Left keys [1]: [inv_item_sk#5] +Left keys [1]: [inv_item_sk#2] Right keys [1]: [i_item_sk#11] Join condition: None (25) Project [codegen id : 7] -Output [5]: [inv_quantity_on_hand#7, i_brand#12, i_class#13, i_category#14, i_product_name#15] -Input [7]: [inv_item_sk#5, inv_quantity_on_hand#7, i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Output [5]: [inv_quantity_on_hand#4, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Input [7]: [inv_item_sk#2, inv_quantity_on_hand#4, i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] (26) HashAggregate [codegen id : 7] -Input [5]: [inv_quantity_on_hand#7, i_brand#12, i_class#13, i_category#14, i_product_name#15] +Input [5]: [inv_quantity_on_hand#4, i_brand#12, i_class#13, i_category#14, i_product_name#15] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [partial_avg(cast(inv_quantity_on_hand#7 as bigint))] +Functions [1]: [partial_avg(cast(inv_quantity_on_hand#4 as bigint))] Aggregate Attributes [2]: [sum#17, count#18] Results [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] @@ -178,9 +178,9 @@ Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, i_categor (28) HashAggregate [codegen id : 8] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#22] -Results [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, avg(cast(inv_quantity_on_hand#7 as bigint))#22 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#22] +Results [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, avg(cast(inv_quantity_on_hand#4 as bigint))#22 AS qoh#23] (29) HashAggregate [codegen id : 8] Input [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#23] @@ -202,9 +202,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#30, c (32) HashAggregate [codegen id : 16] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#30, count#31] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#32] -Results [4]: [i_product_name#15, i_brand#12, i_class#13, avg(cast(inv_quantity_on_hand#7 as bigint))#32 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#32] +Results [4]: [i_product_name#15, i_brand#12, i_class#13, avg(cast(inv_quantity_on_hand#4 as bigint))#32 AS qoh#23] (33) HashAggregate [codegen id : 16] Input [4]: [i_product_name#15, i_brand#12, i_class#13, qoh#23] @@ -230,9 +230,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#41, c (37) HashAggregate [codegen id : 25] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#41, count#42] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#43] -Results [3]: [i_product_name#15, i_brand#12, avg(cast(inv_quantity_on_hand#7 as bigint))#43 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#43] +Results [3]: [i_product_name#15, i_brand#12, avg(cast(inv_quantity_on_hand#4 as bigint))#43 AS qoh#23] (38) HashAggregate [codegen id : 25] Input [3]: [i_product_name#15, i_brand#12, qoh#23] @@ -258,9 +258,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#53, c (42) HashAggregate [codegen id : 34] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#53, count#54] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#55] -Results [2]: [i_product_name#15, avg(cast(inv_quantity_on_hand#7 as bigint))#55 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#55] +Results [2]: [i_product_name#15, avg(cast(inv_quantity_on_hand#4 as bigint))#55 AS qoh#23] (43) HashAggregate [codegen id : 34] Input [2]: [i_product_name#15, qoh#23] @@ -286,9 +286,9 @@ Output [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#66, c (47) HashAggregate [codegen id : 43] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#66, count#67] Keys [4]: [i_product_name#15, i_brand#12, i_class#13, i_category#14] -Functions [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))] -Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#68] -Results [1]: [avg(cast(inv_quantity_on_hand#7 as bigint))#68 AS qoh#23] +Functions [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))] +Aggregate Attributes [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#68] +Results [1]: [avg(cast(inv_quantity_on_hand#4 as bigint))#68 AS qoh#23] (48) HashAggregate [codegen id : 43] Input [1]: [qoh#23] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt index 3cb90d4e7dda2..c2fe3189b2d10 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt @@ -17,28 +17,28 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] - Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] - BroadcastHashJoin [d_date_sk,inv_date_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt index 6787138c04a3f..9c1273c85439f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt @@ -22,15 +22,15 @@ : : : +- * BroadcastHashJoin Inner BuildLeft (15) : : : :- BroadcastExchange (11) : : : : +- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildRight (9) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer_address (1) - : : : : +- BroadcastExchange (8) - : : : : +- * Project (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store (4) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer_address (6) : : : +- * Filter (14) : : : +- * ColumnarToRow (13) : : : +- Scan parquet default.customer (12) @@ -48,54 +48,54 @@ +- Scan parquet default.store_returns (31) -(1) Scan parquet default.customer_address -Output [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 2] -Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] - -(3) Filter [codegen id : 2] -Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] -Condition : ((isnotnull(ca_address_sk#1) AND isnotnull(ca_country#4)) AND isnotnull(ca_zip#3)) - -(4) Scan parquet default.store -Output [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(1) Scan parquet default.store +Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(5) ColumnarToRow [codegen id : 1] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(2) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] -(6) Filter [codegen id : 1] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -Condition : (((isnotnull(s_market_id#7) AND (s_market_id#7 = 8)) AND isnotnull(s_store_sk#5)) AND isnotnull(s_zip#9)) +(3) Filter [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5)) + +(4) Project [codegen id : 1] +Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] + +(5) BroadcastExchange +Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#6] + +(6) Scan parquet default.customer_address +Output [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(7) ColumnarToRow +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] -(8) BroadcastExchange -Input [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] -Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#10] +(8) Filter +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Condition : ((isnotnull(ca_address_sk#7) AND isnotnull(ca_country#10)) AND isnotnull(ca_zip#9)) (9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ca_zip#3] -Right keys [1]: [s_zip#9] +Left keys [1]: [s_zip#5] +Right keys [1]: [ca_zip#9] Join condition: None (10) Project [codegen id : 2] -Output [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] -Input [8]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] (11) BroadcastExchange -Input [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[2, string, true])),false), [id=#11] +Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#11] (12) Scan parquet default.customer Output [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] @@ -112,17 +112,17 @@ Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name Condition : ((isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) AND isnotnull(c_birth_country#16)) (15) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [ca_address_sk#1, upper(ca_country#4)] +Left keys [2]: [ca_address_sk#7, upper(ca_country#10)] Right keys [2]: [c_current_addr_sk#13, c_birth_country#16] Join condition: None (16) Project [codegen id : 3] -Output [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Input [11]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] (17) BroadcastExchange -Input [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#17] +Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#17] (18) Scan parquet default.store_sales Output [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] @@ -139,13 +139,13 @@ Input [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#2 Condition : (((isnotnull(ss_ticket_number#21) AND isnotnull(ss_item_sk#18)) AND isnotnull(ss_store_sk#20)) AND isnotnull(ss_customer_sk#19)) (21) BroadcastHashJoin [codegen id : 5] -Left keys [2]: [s_store_sk#5, c_customer_sk#12] +Left keys [2]: [s_store_sk#1, c_customer_sk#12] Right keys [2]: [ss_store_sk#20, ss_customer_sk#19] Join condition: None (22) Project [codegen id : 5] -Output [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] -Input [12]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] +Output [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] (23) Scan parquet default.item Output [6]: [i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] @@ -171,15 +171,15 @@ Right keys [1]: [i_item_sk#23] Join condition: None (28) Project [codegen id : 5] -Output [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] -Input [14]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Output [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] (29) Exchange -Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: hashpartitioning(cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint), 5), true, [id=#30] (30) Sort [codegen id : 6] -Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: [cast(ss_ticket_number#21 as bigint) ASC NULLS FIRST, cast(ss_item_sk#18 as bigint) ASC NULLS FIRST], false, 0 (31) Scan parquet default.store_returns @@ -210,60 +210,60 @@ Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] Join condition: None (37) Project [codegen id : 9] -Output [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] -Input [15]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] +Input [15]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] (38) HashAggregate [codegen id : 9] -Input [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum#34] -Results [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Results [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] (39) Exchange -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#36] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#36] (40) HashAggregate [codegen id : 10] -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#35] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#37] -Results [4]: [c_last_name#15, c_first_name#14, s_store_name#6, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#37,17,2) AS netpaid#38] +Results [4]: [c_last_name#15, c_first_name#14, s_store_name#2, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#37,17,2) AS netpaid#38] (41) HashAggregate [codegen id : 10] -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, netpaid#38] -Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#6] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, netpaid#38] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] Functions [1]: [partial_sum(netpaid#38)] Aggregate Attributes [2]: [sum#39, isEmpty#40] -Results [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] (42) Exchange -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, 5), true, [id=#43] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, 5), true, [id=#43] (43) HashAggregate [codegen id : 11] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum#41, isEmpty#42] -Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#6] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#41, isEmpty#42] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] Functions [1]: [sum(netpaid#38)] Aggregate Attributes [1]: [sum(netpaid#38)#44] -Results [5]: [c_last_name#15, c_first_name#14, s_store_name#6, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] (44) Filter [codegen id : 11] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45, sum(netpaid#38)#46] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45, sum(netpaid#38)#46] Condition : (isnotnull(sum(netpaid#38)#46) AND (cast(sum(netpaid#38)#46 as decimal(33,8)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(33,8)))) (45) Project [codegen id : 11] -Output [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] -Input [5]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45, sum(netpaid#38)#46] +Output [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45, sum(netpaid#38)#46] (46) Exchange -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] -Arguments: rangepartitioning(c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#6 ASC NULLS FIRST, 5), true, [id=#49] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] +Arguments: rangepartitioning(c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST, 5), true, [id=#49] (47) Sort [codegen id : 12] -Input [4]: [c_last_name#15, c_first_name#14, s_store_name#6, paid#45] -Arguments: [c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#6 ASC NULLS FIRST], true, 0 +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#45] +Arguments: [c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST], true, 0 ===== Subqueries ===== @@ -289,15 +289,15 @@ Subquery:1 Hosting operator id = 44 Hosting Expression = Subquery scalar-subquer : : : +- * BroadcastHashJoin Inner BuildLeft (62) : : : :- BroadcastExchange (58) : : : : +- * Project (57) - : : : : +- * BroadcastHashJoin Inner BuildRight (56) - : : : : :- * Filter (50) - : : : : : +- * ColumnarToRow (49) - : : : : : +- Scan parquet default.customer_address (48) - : : : : +- BroadcastExchange (55) - : : : : +- * Project (54) - : : : : +- * Filter (53) - : : : : +- * ColumnarToRow (52) - : : : : +- Scan parquet default.store (51) + : : : : +- * BroadcastHashJoin Inner BuildLeft (56) + : : : : :- BroadcastExchange (52) + : : : : : +- * Project (51) + : : : : : +- * Filter (50) + : : : : : +- * ColumnarToRow (49) + : : : : : +- Scan parquet default.store (48) + : : : : +- * Filter (55) + : : : : +- * ColumnarToRow (54) + : : : : +- Scan parquet default.customer_address (53) : : : +- * Filter (61) : : : +- * ColumnarToRow (60) : : : +- Scan parquet default.customer (59) @@ -316,54 +316,54 @@ Subquery:1 Hosting operator id = 44 Hosting Expression = Subquery scalar-subquer +- Scan parquet default.store_returns (81) -(48) Scan parquet default.customer_address -Output [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] -ReadSchema: struct - -(49) ColumnarToRow [codegen id : 2] -Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] - -(50) Filter [codegen id : 2] -Input [4]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4] -Condition : ((isnotnull(ca_address_sk#1) AND isnotnull(ca_country#4)) AND isnotnull(ca_zip#3)) - -(51) Scan parquet default.store -Output [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(48) Scan parquet default.store +Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] ReadSchema: struct -(52) ColumnarToRow [codegen id : 1] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(49) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] -(53) Filter [codegen id : 1] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] -Condition : (((isnotnull(s_market_id#7) AND (s_market_id#7 = 8)) AND isnotnull(s_store_sk#5)) AND isnotnull(s_zip#9)) +(50) Filter [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5)) -(54) Project [codegen id : 1] -Output [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] -Input [5]: [s_store_sk#5, s_store_name#6, s_market_id#7, s_state#8, s_zip#9] +(51) Project [codegen id : 1] +Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] -(55) BroadcastExchange -Input [4]: [s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +(52) BroadcastExchange +Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#50] +(53) Scan parquet default.customer_address +Output [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(54) ColumnarToRow +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] + +(55) Filter +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Condition : ((isnotnull(ca_address_sk#7) AND isnotnull(ca_country#10)) AND isnotnull(ca_zip#9)) + (56) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ca_zip#3] -Right keys [1]: [s_zip#9] +Left keys [1]: [s_zip#5] +Right keys [1]: [ca_zip#9] Join condition: None (57) Project [codegen id : 2] -Output [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] -Input [8]: [ca_address_sk#1, ca_state#2, ca_zip#3, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, s_zip#9] +Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] (58) BroadcastExchange -Input [6]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8] -Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[2, string, true])),false), [id=#51] +Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#51] (59) Scan parquet default.customer Output [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] @@ -380,17 +380,17 @@ Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name Condition : ((isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) AND isnotnull(c_birth_country#16)) (62) BroadcastHashJoin [codegen id : 3] -Left keys [2]: [ca_address_sk#1, upper(ca_country#4)] +Left keys [2]: [ca_address_sk#7, upper(ca_country#10)] Right keys [2]: [c_current_addr_sk#13, c_birth_country#16] Join condition: None (63) Project [codegen id : 3] -Output [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Input [11]: [ca_address_sk#1, ca_state#2, ca_country#4, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] (64) BroadcastExchange -Input [7]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] -Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#52] +Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#52] (65) Scan parquet default.store_sales Output [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] @@ -407,20 +407,20 @@ Input [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#2 Condition : (((isnotnull(ss_ticket_number#21) AND isnotnull(ss_item_sk#18)) AND isnotnull(ss_store_sk#20)) AND isnotnull(ss_customer_sk#19)) (68) BroadcastHashJoin [codegen id : 4] -Left keys [2]: [s_store_sk#5, c_customer_sk#12] +Left keys [2]: [s_store_sk#1, c_customer_sk#12] Right keys [2]: [ss_store_sk#20, ss_customer_sk#19] Join condition: None (69) Project [codegen id : 4] -Output [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] -Input [12]: [ca_state#2, s_store_sk#5, s_store_name#6, s_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] +Output [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] (70) Exchange -Input [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] Arguments: hashpartitioning(ss_item_sk#18, 5), true, [id=#53] (71) Sort [codegen id : 5] -Input [8]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] Arguments: [ss_item_sk#18 ASC NULLS FIRST], false, 0 (72) Scan parquet default.item @@ -451,15 +451,15 @@ Right keys [1]: [i_item_sk#23] Join condition: None (78) Project [codegen id : 8] -Output [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] -Input [14]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Output [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#23, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] (79) Exchange -Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: hashpartitioning(cast(ss_ticket_number#21 as bigint), cast(ss_item_sk#18 as bigint), 5), true, [id=#55] (80) Sort [codegen id : 9] -Input [13]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28] Arguments: [cast(ss_ticket_number#21 as bigint) ASC NULLS FIRST, cast(ss_item_sk#18 as bigint) ASC NULLS FIRST], false, 0 (81) Scan parquet default.store_returns @@ -490,23 +490,23 @@ Right keys [2]: [sr_ticket_number#32, sr_item_sk#31] Join condition: None (87) Project [codegen id : 12] -Output [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] -Input [15]: [ca_state#2, s_store_name#6, s_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] +Output [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] +Input [15]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, sr_item_sk#31, sr_ticket_number#32] (88) HashAggregate [codegen id : 12] -Input [11]: [ss_net_paid#22, s_store_name#6, s_state#8, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#2] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#24, i_size#25, i_color#26, i_units#27, i_manager_id#28, c_first_name#14, c_last_name#15, ca_state#8] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum#57] -Results [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Results [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] (89) Exchange -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] -Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#59] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, 5), true, [id=#59] (90) HashAggregate [codegen id : 13] -Input [11]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] -Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#6, ca_state#2, s_state#8, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25, sum#58] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#26, i_current_price#24, i_manager_id#28, i_units#27, i_size#25] Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#60] Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#60,17,2) AS netpaid#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt index b15a5081c49a4..7b1c03ef15b15 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt @@ -25,7 +25,7 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #12 WholeStageCodegen (8) - Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] SortMergeJoin [ss_item_sk,i_item_sk] InputAdapter WholeStageCodegen (5) @@ -33,22 +33,18 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_item_sk] #13 WholeStageCodegen (4) - Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] InputAdapter BroadcastExchange #14 WholeStageCodegen (3) - Project [ca_state,s_store_sk,s_store_name,s_state,c_customer_sk,c_first_name,c_last_name] + Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] InputAdapter BroadcastExchange #15 WholeStageCodegen (2) - Project [ca_address_sk,ca_state,ca_country,s_store_sk,s_store_name,s_state] - BroadcastHashJoin [ca_zip,s_zip] - Filter [ca_address_sk,ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] + Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] InputAdapter BroadcastExchange #16 WholeStageCodegen (1) @@ -57,6 +53,10 @@ WholeStageCodegen (12) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] Filter [c_customer_sk,c_current_addr_sk,c_birth_country] ColumnarToRow InputAdapter @@ -103,24 +103,20 @@ WholeStageCodegen (12) InputAdapter Exchange [ss_ticket_number,ss_item_sk] #4 WholeStageCodegen (5) - Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [ca_state,s_store_name,s_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] InputAdapter BroadcastExchange #5 WholeStageCodegen (3) - Project [ca_state,s_store_sk,s_store_name,s_state,c_customer_sk,c_first_name,c_last_name] + Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) - Project [ca_address_sk,ca_state,ca_country,s_store_sk,s_store_name,s_state] - BroadcastHashJoin [ca_zip,s_zip] - Filter [ca_address_sk,ca_country,ca_zip] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] + Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] InputAdapter BroadcastExchange #7 WholeStageCodegen (1) @@ -129,6 +125,10 @@ WholeStageCodegen (12) ColumnarToRow InputAdapter Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] Filter [c_customer_sk,c_current_addr_sk,c_birth_country] ColumnarToRow InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt index d6bdfad449631..86722de954ff3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt @@ -11,15 +11,15 @@ TakeOrderedAndProject (77) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : :- BroadcastExchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer_demographics (1) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.store_sales (6) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -40,20 +40,20 @@ TakeOrderedAndProject (77) : +- * BroadcastHashJoin Inner BuildRight (50) : :- * Project (48) : : +- * BroadcastHashJoin Inner BuildRight (47) - : : :- * Project (41) - : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (45) + : : : +- * BroadcastHashJoin Inner BuildRight (44) : : : :- * Project (38) - : : : : +- * BroadcastHashJoin Inner BuildLeft (37) - : : : : :- ReusedExchange (33) - : : : : +- * Filter (36) - : : : : +- * ColumnarToRow (35) - : : : : +- Scan parquet default.store_sales (34) - : : : +- ReusedExchange (39) - : : +- BroadcastExchange (46) - : : +- * Project (45) - : : +- * Filter (44) - : : +- * ColumnarToRow (43) - : : +- Scan parquet default.store (42) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) + : : : +- BroadcastExchange (43) + : : : +- * Project (42) + : : : +- * Filter (41) + : : : +- * ColumnarToRow (40) + : : : +- Scan parquet default.store (39) + : : +- ReusedExchange (46) : +- ReusedExchange (49) +- * HashAggregate (75) +- Exchange (74) @@ -65,11 +65,11 @@ TakeOrderedAndProject (77) : :- * Project (63) : : +- * BroadcastHashJoin Inner BuildRight (62) : : :- * Project (60) - : : : +- * BroadcastHashJoin Inner BuildLeft (59) - : : : :- ReusedExchange (55) - : : : +- * Filter (58) - : : : +- * ColumnarToRow (57) - : : : +- Scan parquet default.store_sales (56) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) : : +- ReusedExchange (61) : +- ReusedExchange (64) +- BroadcastExchange (70) @@ -78,50 +78,50 @@ TakeOrderedAndProject (77) +- Scan parquet default.item (67) -(1) Scan parquet default.customer_demographics -Output [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(1) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary), IsNotNull(cd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -(3) Filter [codegen id : 1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] -Condition : ((((((isnotnull(cd_gender#2) AND isnotnull(cd_marital_status#3)) AND isnotnull(cd_education_status#4)) AND (cd_gender#2 = F)) AND (cd_marital_status#3 = W)) AND (cd_education_status#4 = Primary)) AND isnotnull(cd_demo_sk#1)) +(3) Filter [codegen id : 5] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [cd_demo_sk#1] -Input [4]: [cd_demo_sk#1, cd_gender#2, cd_marital_status#3, cd_education_status#4] +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary), IsNotNull(cd_demo_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [cd_demo_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(6) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] +Condition : ((((((isnotnull(cd_gender#10) AND isnotnull(cd_marital_status#11)) AND isnotnull(cd_education_status#12)) AND (cd_gender#10 = F)) AND (cd_marital_status#11 = W)) AND (cd_education_status#12 = Primary)) AND isnotnull(cd_demo_sk#9)) -(7) ColumnarToRow -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#9] +Input [4]: [cd_demo_sk#9, cd_gender#10, cd_marital_status#11, cd_education_status#12] -(8) Filter -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) +(8) BroadcastExchange +Input [1]: [cd_demo_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] (9) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [ss_cdemo_sk#8] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#9] Join condition: None (10) Project [codegen id : 5] -Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] @@ -146,13 +146,13 @@ Input [1]: [d_date_sk#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#6] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] +Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] (18) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] @@ -173,13 +173,13 @@ Input [2]: [s_store_sk#17, s_state#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_store_sk#9] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None (23) Project [codegen id : 5] -Output [6]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_state#18] -Input [8]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17, s_state#18] +Output [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18] +Input [8]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17, s_state#18] (24) Scan parquet default.item Output [2]: [i_item_sk#20, i_item_id#21] @@ -200,13 +200,13 @@ Input [2]: [i_item_sk#20, i_item_id#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] (28) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (29) Project [codegen id : 5] -Output [6]: [i_item_id#21, s_state#18, ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] -Input [8]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_state#18, i_item_sk#20, i_item_id#21] +Output [6]: [i_item_id#21, s_state#18, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [8]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_state#18, i_item_sk#20, i_item_id#21] (30) HashAggregate [codegen id : 5] Input [6]: [i_item_id#21, s_state#18, agg1#23, agg2#24, agg3#25, agg4#26] @@ -226,86 +226,86 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#44, avg(UnscaledValue(agg2#24))#45, avg(UnscaledValue(agg3#25))#46, avg(UnscaledValue(agg4#26))#47] Results [7]: [i_item_id#21, s_state#18, 0 AS g_state#48, avg(cast(agg1#23 as bigint))#44 AS agg1#49, cast((avg(UnscaledValue(agg2#24))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(agg3#25))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(agg4#26))#47 / 100.0) as decimal(11,6)) AS agg4#52] -(33) ReusedExchange [Reuses operator id: 5] -Output [1]: [cd_demo_sk#1] - -(34) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(33) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(35) ColumnarToRow -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -(36) Filter -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) +(35) Filter [codegen id : 11] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#9] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [ss_cdemo_sk#8] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#9] Join condition: None (38) Project [codegen id : 11] -Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] - -(39) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] - -(40) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#14] -Join condition: None - -(41) Project [codegen id : 11] -Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] -(42) Scan parquet default.store +(39) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 9] +(40) ColumnarToRow [codegen id : 8] Input [2]: [s_store_sk#17, s_state#18] -(44) Filter [codegen id : 9] +(41) Filter [codegen id : 8] Input [2]: [s_store_sk#17, s_state#18] Condition : ((isnotnull(s_state#18) AND (s_state#18 = TN)) AND isnotnull(s_store_sk#17)) -(45) Project [codegen id : 9] +(42) Project [codegen id : 8] Output [1]: [s_store_sk#17] Input [2]: [s_store_sk#17, s_state#18] -(46) BroadcastExchange +(43) BroadcastExchange Input [1]: [s_store_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] -(47) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_store_sk#9] +(44) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None +(45) Project [codegen id : 11] +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] + +(46) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] + +(47) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] +Join condition: None + (48) Project [codegen id : 11] -Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [7]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17] +Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] (49) ReusedExchange [Reuses operator id: 27] Output [2]: [i_item_sk#20, i_item_id#21] (50) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (51) Project [codegen id : 11] -Output [5]: [i_item_id#21, ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] -Input [7]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#20, i_item_id#21] +Output [5]: [i_item_id#21, ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [7]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20, i_item_id#21] (52) HashAggregate [codegen id : 11] Input [5]: [i_item_id#21, agg1#23, agg2#24, agg3#25, agg4#26] @@ -325,55 +325,55 @@ Functions [4]: [avg(cast(agg1#23 as bigint)), avg(UnscaledValue(agg2#24)), avg(U Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#71, avg(UnscaledValue(agg2#24))#72, avg(UnscaledValue(agg3#25))#73, avg(UnscaledValue(agg4#26))#74] Results [7]: [i_item_id#21, null AS s_state#75, 1 AS g_state#76, avg(cast(agg1#23 as bigint))#71 AS agg1#77, cast((avg(UnscaledValue(agg2#24))#72 / 100.0) as decimal(11,6)) AS agg2#78, cast((avg(UnscaledValue(agg3#25))#73 / 100.0) as decimal(11,6)) AS agg3#79, cast((avg(UnscaledValue(agg4#26))#74 / 100.0) as decimal(11,6)) AS agg4#80] -(55) ReusedExchange [Reuses operator id: 5] -Output [1]: [cd_demo_sk#1] - -(56) Scan parquet default.store_sales -Output [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(55) Scan parquet default.store_sales +Output [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] ReadSchema: struct -(57) ColumnarToRow -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] + +(57) Filter [codegen id : 17] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Condition : (((isnotnull(ss_cdemo_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_item_sk#2)) -(58) Filter -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Condition : (((isnotnull(ss_cdemo_sk#8) AND isnotnull(ss_sold_date_sk#6)) AND isnotnull(ss_store_sk#9)) AND isnotnull(ss_item_sk#7)) +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#9] (59) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [cd_demo_sk#1] -Right keys [1]: [ss_cdemo_sk#8] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#9] Join condition: None (60) Project [codegen id : 17] -Output [7]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [9]: [cd_demo_sk#1, ss_sold_date_sk#6, ss_item_sk#7, ss_cdemo_sk#8, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] -(61) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] +(61) ReusedExchange [Reuses operator id: 43] +Output [1]: [s_store_sk#17] (62) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_sold_date_sk#6] -Right keys [1]: [d_date_sk#14] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#17] Join condition: None (63) Project [codegen id : 17] -Output [6]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [8]: [ss_sold_date_sk#6, ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, d_date_sk#14] +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] -(64) ReusedExchange [Reuses operator id: 46] -Output [1]: [s_store_sk#17] +(64) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] (65) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_store_sk#9] -Right keys [1]: [s_store_sk#17] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] Join condition: None (66) Project [codegen id : 17] -Output [5]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13] -Input [7]: [ss_item_sk#7, ss_store_sk#9, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, s_store_sk#17] +Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] (67) Scan parquet default.item Output [1]: [i_item_sk#20] @@ -394,13 +394,13 @@ Input [1]: [i_item_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] (71) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_item_sk#7] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#20] Join condition: None (72) Project [codegen id : 17] -Output [4]: [ss_quantity#10 AS agg1#23, ss_list_price#11 AS agg2#24, ss_coupon_amt#13 AS agg3#25, ss_sales_price#12 AS agg4#26] -Input [6]: [ss_item_sk#7, ss_quantity#10, ss_list_price#11, ss_sales_price#12, ss_coupon_amt#13, i_item_sk#20] +Output [4]: [ss_quantity#5 AS agg1#23, ss_list_price#6 AS agg2#24, ss_coupon_amt#8 AS agg3#25, ss_sales_price#7 AS agg4#26] +Input [6]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, i_item_sk#20] (73) HashAggregate [codegen id : 17] Input [4]: [agg1#23, agg2#24, agg3#25, agg4#26] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt index 6dcf353b87a27..61aaa22964cb7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt @@ -13,7 +13,11 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #2 WholeStageCodegen (1) @@ -22,10 +26,6 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] ColumnarToRow InputAdapter Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] - Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) @@ -57,27 +57,27 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] - InputAdapter - ReusedExchange [cd_demo_sk] #2 + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + InputAdapter + ReusedExchange [cd_demo_sk] #2 InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastExchange #7 + WholeStageCodegen (8) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (9) - Project [s_store_sk] - Filter [s_state,s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_state] + ReusedExchange [d_date_sk] #3 InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 WholeStageCodegen (18) @@ -89,21 +89,21 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [cd_demo_sk,ss_cdemo_sk] - InputAdapter - ReusedExchange [cd_demo_sk] #2 + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + InputAdapter + ReusedExchange [cd_demo_sk] #2 InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [s_store_sk] #7 InputAdapter - ReusedExchange [s_store_sk] #7 + ReusedExchange [d_date_sk] #3 InputAdapter BroadcastExchange #9 WholeStageCodegen (16) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt index c348509a890e9..c7b8685b64bea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt @@ -14,15 +14,15 @@ : :- * Project (17) : : +- * BroadcastHashJoin Inner BuildRight (16) : : :- * Project (10) - : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : :- BroadcastExchange (5) - : : : : +- * Project (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.date_dim (1) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.store_sales (6) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (15) : : +- * Project (14) : : +- * Filter (13) @@ -40,50 +40,50 @@ +- Scan parquet default.customer (31) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_dom#3] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] -Condition : (((((d_dom#3 >= 1) AND (d_dom#3 <= 3)) OR ((d_dom#3 >= 25) AND (d_dom#3 <= 28))) AND d_year#2 IN (1999,2000,2001)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_dom#3] +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_dom#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] +Condition : (((((d_dom#8 >= 1) AND (d_dom#8 <= 3)) OR ((d_dom#8 >= 25) AND (d_dom#8 <= 28))) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_dom#8] -(8) Filter -Input [5]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Condition : (((isnotnull(ss_sold_date_sk#5) AND isnotnull(ss_store_sk#8)) AND isnotnull(ss_hdemo_sk#7)) AND isnotnull(ss_customer_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] -Input [6]: [d_date_sk#1, ss_sold_date_sk#5, ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9] +Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5] +Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6] (11) Scan parquet default.store Output [2]: [s_store_sk#10, s_county#11] @@ -108,13 +108,13 @@ Input [1]: [s_store_sk#10] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#8] +Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#10] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9] -Input [5]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_store_sk#8, ss_ticket_number#9, s_store_sk#10] +Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5] +Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#10] (18) Scan parquet default.household_demographics Output [4]: [hd_demo_sk#13, hd_buy_potential#14, hd_dep_count#15, hd_vehicle_count#16] @@ -139,43 +139,43 @@ Input [1]: [hd_demo_sk#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] (23) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_hdemo_sk#7] +Left keys [1]: [ss_hdemo_sk#3] Right keys [1]: [hd_demo_sk#13] Join condition: None (24) Project [codegen id : 4] -Output [2]: [ss_customer_sk#6, ss_ticket_number#9] -Input [4]: [ss_customer_sk#6, ss_hdemo_sk#7, ss_ticket_number#9, hd_demo_sk#13] +Output [2]: [ss_customer_sk#2, ss_ticket_number#5] +Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#13] (25) HashAggregate [codegen id : 4] -Input [2]: [ss_customer_sk#6, ss_ticket_number#9] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [2]: [ss_customer_sk#2, ss_ticket_number#5] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#18] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] (26) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Arguments: hashpartitioning(ss_ticket_number#9, ss_customer_sk#6, 5), true, [id=#20] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 5), true, [id=#20] (27) HashAggregate [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, count#19] -Keys [2]: [ss_ticket_number#9, ss_customer_sk#6] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#19] +Keys [2]: [ss_ticket_number#5, ss_customer_sk#2] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#21] -Results [3]: [ss_ticket_number#9, ss_customer_sk#6, count(1)#21 AS cnt#22] +Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#21 AS cnt#22] (28) Filter [codegen id : 5] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] Condition : ((cnt#22 >= 15) AND (cnt#22 <= 20)) (29) Exchange -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: hashpartitioning(ss_customer_sk#6, 5), true, [id=#23] +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] (30) Sort [codegen id : 6] -Input [3]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22] -Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 +Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (31) Scan parquet default.customer Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] @@ -200,19 +200,19 @@ Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0 (36) SortMergeJoin [codegen id : 9] -Left keys [1]: [ss_customer_sk#6] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#24] Join condition: None (37) Project [codegen id : 9] -Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] -Input [8]: [ss_ticket_number#9, ss_customer_sk#6, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] (38) Exchange -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] -Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#9 ASC NULLS FIRST, 5), true, [id=#30] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#5 ASC NULLS FIRST, 5), true, [id=#30] (39) Sort [codegen id : 10] -Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#9, cnt#22] -Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#9 ASC NULLS FIRST], true, 0 +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#5, cnt#22] +Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#5 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt index 8882bc7cf00d7..451659e2c617c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt @@ -22,7 +22,11 @@ WholeStageCodegen (10) Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -31,10 +35,6 @@ WholeStageCodegen (10) ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_dom] - Filter [ss_sold_date_sk,ss_store_sk,ss_hdemo_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] InputAdapter BroadcastExchange #5 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt index b81bade24c504..d38804d4f0422 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt @@ -9,51 +9,51 @@ TakeOrderedAndProject (60) : +- Exchange (48) : +- * Project (47) : +- * SortMergeJoin Inner (46) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.customer_address (1) + : :- * Sort (40) + : : +- Exchange (39) + : : +- * Project (38) + : : +- * Filter (37) + : : +- SortMergeJoin ExistenceJoin(exists#1) (36) + : : :- SortMergeJoin ExistenceJoin(exists#2) (27) + : : : :- SortMergeJoin LeftSemi (18) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (17) + : : : : +- Exchange (16) + : : : : +- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.catalog_sales (28) + : : +- ReusedExchange (31) : +- * Sort (45) : +- Exchange (44) - : +- * Project (43) - : +- * Filter (42) - : +- SortMergeJoin ExistenceJoin(exists#1) (41) - : :- SortMergeJoin ExistenceJoin(exists#2) (32) - : : :- SortMergeJoin LeftSemi (23) - : : : :- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.customer (6) - : : : +- * Sort (22) - : : : +- Exchange (21) - : : : +- * Project (20) - : : : +- * BroadcastHashJoin Inner BuildRight (19) - : : : :- * Filter (13) - : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.store_sales (11) - : : : +- BroadcastExchange (18) - : : : +- * Project (17) - : : : +- * Filter (16) - : : : +- * ColumnarToRow (15) - : : : +- Scan parquet default.date_dim (14) - : : +- * Sort (31) - : : +- Exchange (30) - : : +- * Project (29) - : : +- * BroadcastHashJoin Inner BuildRight (28) - : : :- * Filter (26) - : : : +- * ColumnarToRow (25) - : : : +- Scan parquet default.web_sales (24) - : : +- ReusedExchange (27) - : +- * Sort (40) - : +- Exchange (39) - : +- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.catalog_sales (33) - : +- ReusedExchange (36) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.customer_address (41) +- * Sort (54) +- Exchange (53) +- * Filter (52) @@ -61,218 +61,218 @@ TakeOrderedAndProject (60) +- Scan parquet default.customer_demographics (50) -(1) Scan parquet default.customer_address -Output [2]: [ca_address_sk#3, ca_state#4] +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_state#4] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] (3) Filter [codegen id : 1] -Input [2]: [ca_address_sk#3, ca_state#4] -Condition : isnotnull(ca_address_sk#3) +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) (4) Exchange -Input [2]: [ca_address_sk#3, ca_state#4] -Arguments: hashpartitioning(ca_address_sk#3, 5), true, [id=#5] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), true, [id=#6] (5) Sort [codegen id : 2] -Input [2]: [ca_address_sk#3, ca_state#4] -Arguments: [ca_address_sk#3 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.customer -Output [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer] -PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] -ReadSchema: struct - -(7) ColumnarToRow [codegen id : 3] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] - -(8) Filter [codegen id : 3] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Condition : (isnotnull(c_current_addr_sk#8) AND isnotnull(c_current_cdemo_sk#7)) - -(9) Exchange -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: hashpartitioning(c_customer_sk#6, 5), true, [id=#9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 -(10) Sort [codegen id : 4] -Input [3]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0 - -(11) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(6) Scan parquet default.store_sales +Output [2]: [ss_sold_date_sk#7, ss_customer_sk#8] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(12) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] -(13) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#10, ss_customer_sk#11] -Condition : isnotnull(ss_sold_date_sk#10) +(8) Filter [codegen id : 4] +Input [2]: [ss_sold_date_sk#7, ss_customer_sk#8] +Condition : isnotnull(ss_sold_date_sk#7) -(14) Scan parquet default.date_dim -Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] ReadSchema: struct -(15) ColumnarToRow [codegen id : 5] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -(16) Filter [codegen id : 5] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] -Condition : ((((isnotnull(d_year#13) AND isnotnull(d_qoy#14)) AND (d_year#13 = 2002)) AND (d_qoy#14 < 4)) AND isnotnull(d_date_sk#12)) +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) -(17) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] -(18) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +(13) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] -(19) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#10] -Right keys [1]: [d_date_sk#12] +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] Join condition: None -(20) Project [codegen id : 6] -Output [1]: [ss_customer_sk#11] -Input [3]: [ss_sold_date_sk#10, ss_customer_sk#11, d_date_sk#12] +(15) Project [codegen id : 4] +Output [1]: [ss_customer_sk#8] +Input [3]: [ss_sold_date_sk#7, ss_customer_sk#8, d_date_sk#9] -(21) Exchange -Input [1]: [ss_customer_sk#11] -Arguments: hashpartitioning(ss_customer_sk#11, 5), true, [id=#16] +(16) Exchange +Input [1]: [ss_customer_sk#8] +Arguments: hashpartitioning(ss_customer_sk#8, 5), true, [id=#13] -(22) Sort [codegen id : 7] -Input [1]: [ss_customer_sk#11] -Arguments: [ss_customer_sk#11 ASC NULLS FIRST], false, 0 +(17) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#8] +Arguments: [ss_customer_sk#8 ASC NULLS FIRST], false, 0 -(23) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ss_customer_sk#11] +(18) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#8] Join condition: None -(24) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(19) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(25) ColumnarToRow [codegen id : 9] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] -(26) Filter [codegen id : 9] -Input [2]: [ws_sold_date_sk#17, ws_bill_customer_sk#18] -Condition : isnotnull(ws_sold_date_sk#17) +(21) Filter [codegen id : 7] +Input [2]: [ws_sold_date_sk#14, ws_bill_customer_sk#15] +Condition : isnotnull(ws_sold_date_sk#14) -(27) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(28) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ws_sold_date_sk#17] -Right keys [1]: [d_date_sk#12] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#9] Join condition: None -(29) Project [codegen id : 9] -Output [1]: [ws_bill_customer_sk#18] -Input [3]: [ws_sold_date_sk#17, ws_bill_customer_sk#18, d_date_sk#12] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_sold_date_sk#14, ws_bill_customer_sk#15, d_date_sk#9] -(30) Exchange -Input [1]: [ws_bill_customer_sk#18] -Arguments: hashpartitioning(ws_bill_customer_sk#18, 5), true, [id=#19] +(25) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), true, [id=#16] -(31) Sort [codegen id : 10] -Input [1]: [ws_bill_customer_sk#18] -Arguments: [ws_bill_customer_sk#18 ASC NULLS FIRST], false, 0 +(26) Sort [codegen id : 8] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 -(32) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [ws_bill_customer_sk#18] +(27) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] Join condition: None -(33) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(28) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(34) ColumnarToRow [codegen id : 12] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] +(29) ColumnarToRow [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] -(35) Filter [codegen id : 12] -Input [2]: [cs_sold_date_sk#20, cs_ship_customer_sk#21] -Condition : isnotnull(cs_sold_date_sk#20) +(30) Filter [codegen id : 10] +Input [2]: [cs_sold_date_sk#17, cs_ship_customer_sk#18] +Condition : isnotnull(cs_sold_date_sk#17) -(36) ReusedExchange [Reuses operator id: 18] -Output [1]: [d_date_sk#12] +(31) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#9] -(37) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cs_sold_date_sk#20] -Right keys [1]: [d_date_sk#12] +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#9] Join condition: None +(33) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_sold_date_sk#17, cs_ship_customer_sk#18, d_date_sk#9] + +(34) Exchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: hashpartitioning(cs_ship_customer_sk#18, 5), true, [id=#19] + +(35) Sort [codegen id : 11] +Input [1]: [cs_ship_customer_sk#18] +Arguments: [cs_ship_customer_sk#18 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] +Join condition: None + +(37) Filter [codegen id : 12] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + (38) Project [codegen id : 12] -Output [1]: [cs_ship_customer_sk#21] -Input [3]: [cs_sold_date_sk#20, cs_ship_customer_sk#21, d_date_sk#12] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] (39) Exchange -Input [1]: [cs_ship_customer_sk#21] -Arguments: hashpartitioning(cs_ship_customer_sk#21, 5), true, [id=#22] +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), true, [id=#20] (40) Sort [codegen id : 13] -Input [1]: [cs_ship_customer_sk#21] -Arguments: [cs_ship_customer_sk#21 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 -(41) SortMergeJoin -Left keys [1]: [c_customer_sk#6] -Right keys [1]: [cs_ship_customer_sk#21] -Join condition: None +(41) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_state#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(42) Filter [codegen id : 14] -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] -Condition : (exists#2 OR exists#1) +(42) ColumnarToRow [codegen id : 14] +Input [2]: [ca_address_sk#21, ca_state#22] -(43) Project [codegen id : 14] -Output [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Input [5]: [c_customer_sk#6, c_current_cdemo_sk#7, c_current_addr_sk#8, exists#2, exists#1] +(43) Filter [codegen id : 14] +Input [2]: [ca_address_sk#21, ca_state#22] +Condition : isnotnull(ca_address_sk#21) (44) Exchange -Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: hashpartitioning(c_current_addr_sk#8, 5), true, [id=#23] +Input [2]: [ca_address_sk#21, ca_state#22] +Arguments: hashpartitioning(ca_address_sk#21, 5), true, [id=#23] (45) Sort [codegen id : 15] -Input [2]: [c_current_cdemo_sk#7, c_current_addr_sk#8] -Arguments: [c_current_addr_sk#8 ASC NULLS FIRST], false, 0 +Input [2]: [ca_address_sk#21, ca_state#22] +Arguments: [ca_address_sk#21 ASC NULLS FIRST], false, 0 (46) SortMergeJoin [codegen id : 16] -Left keys [1]: [ca_address_sk#3] -Right keys [1]: [c_current_addr_sk#8] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#21] Join condition: None (47) Project [codegen id : 16] -Output [2]: [ca_state#4, c_current_cdemo_sk#7] -Input [4]: [ca_address_sk#3, ca_state#4, c_current_cdemo_sk#7, c_current_addr_sk#8] +Output [2]: [c_current_cdemo_sk#4, ca_state#22] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#21, ca_state#22] (48) Exchange -Input [2]: [ca_state#4, c_current_cdemo_sk#7] -Arguments: hashpartitioning(c_current_cdemo_sk#7, 5), true, [id=#24] +Input [2]: [c_current_cdemo_sk#4, ca_state#22] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), true, [id=#24] (49) Sort [codegen id : 17] -Input [2]: [ca_state#4, c_current_cdemo_sk#7] -Arguments: [c_current_cdemo_sk#7 ASC NULLS FIRST], false, 0 +Input [2]: [c_current_cdemo_sk#4, ca_state#22] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 (50) Scan parquet default.customer_demographics Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] @@ -297,33 +297,33 @@ Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, Arguments: [cd_demo_sk#25 ASC NULLS FIRST], false, 0 (55) SortMergeJoin [codegen id : 20] -Left keys [1]: [c_current_cdemo_sk#7] +Left keys [1]: [c_current_cdemo_sk#4] Right keys [1]: [cd_demo_sk#25] Join condition: None (56) Project [codegen id : 20] -Output [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Input [8]: [ca_state#4, c_current_cdemo_sk#7, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [c_current_cdemo_sk#4, ca_state#22, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (57) HashAggregate [codegen id : 20] -Input [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#28 as bigint)), partial_max(cd_dep_count#28), partial_sum(cast(cd_dep_count#28 as bigint)), partial_avg(cast(cd_dep_employed_count#29 as bigint)), partial_max(cd_dep_employed_count#29), partial_sum(cast(cd_dep_employed_count#29 as bigint)), partial_avg(cast(cd_dep_college_count#30 as bigint)), partial_max(cd_dep_college_count#30), partial_sum(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [13]: [count#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40, sum#41, count#42, max#43, sum#44] -Results [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Results [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] (58) Exchange -Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] -Arguments: hashpartitioning(ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] +Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Arguments: hashpartitioning(ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#58] (59) HashAggregate [codegen id : 21] -Input [19]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] -Keys [6]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [19]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Keys [6]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [10]: [count(1), avg(cast(cd_dep_count#28 as bigint)), max(cd_dep_count#28), sum(cast(cd_dep_count#28 as bigint)), avg(cast(cd_dep_employed_count#29 as bigint)), max(cd_dep_employed_count#29), sum(cast(cd_dep_employed_count#29 as bigint)), avg(cast(cd_dep_college_count#30 as bigint)), max(cd_dep_college_count#30), sum(cast(cd_dep_college_count#30 as bigint))] Aggregate Attributes [10]: [count(1)#59, avg(cast(cd_dep_count#28 as bigint))#60, max(cd_dep_count#28)#61, sum(cast(cd_dep_count#28 as bigint))#62, avg(cast(cd_dep_employed_count#29 as bigint))#63, max(cd_dep_employed_count#29)#64, sum(cast(cd_dep_employed_count#29 as bigint))#65, avg(cast(cd_dep_college_count#30 as bigint))#66, max(cd_dep_college_count#30)#67, sum(cast(cd_dep_college_count#30 as bigint))#68] -Results [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, count(1)#59 AS cnt1#69, avg(cast(cd_dep_count#28 as bigint))#60 AS avg(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, sum(cast(cd_dep_count#28 as bigint))#62 AS sum(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, avg(cast(cd_dep_employed_count#29 as bigint))#63 AS avg(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, sum(cast(cd_dep_employed_count#29 as bigint))#65 AS sum(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, avg(cast(cd_dep_college_count#30 as bigint))#66 AS avg(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, sum(cast(cd_dep_college_count#30 as bigint))#68 AS sum(cd_dep_college_count)#80] +Results [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, count(1)#59 AS cnt1#69, avg(cast(cd_dep_count#28 as bigint))#60 AS avg(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, sum(cast(cd_dep_count#28 as bigint))#62 AS sum(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, avg(cast(cd_dep_employed_count#29 as bigint))#63 AS avg(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, sum(cast(cd_dep_employed_count#29 as bigint))#65 AS sum(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, avg(cast(cd_dep_college_count#30 as bigint))#66 AS avg(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, sum(cast(cd_dep_college_count#30 as bigint))#68 AS sum(cd_dep_college_count)#80] (60) TakeOrderedAndProject -Input [18]: [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] -Arguments: 100, [ca_state#4 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#4, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] +Input [18]: [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] +Arguments: 100, [ca_state#22 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#22, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt index 90dfd27201999..b1e750592d99e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt @@ -13,44 +13,34 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Exchange [c_current_cdemo_sk] #2 WholeStageCodegen (16) - Project [ca_state,c_current_cdemo_sk] - SortMergeJoin [ca_address_sk,c_current_addr_sk] + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] InputAdapter - WholeStageCodegen (2) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #3 - WholeStageCodegen (1) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - WholeStageCodegen (15) + WholeStageCodegen (13) Sort [c_current_addr_sk] InputAdapter - Exchange [c_current_addr_sk] #4 - WholeStageCodegen (14) + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (12) Project [c_current_cdemo_sk,c_current_addr_sk] Filter [exists,exists] InputAdapter SortMergeJoin [c_customer_sk,cs_ship_customer_sk] SortMergeJoin [c_customer_sk,ws_bill_customer_sk] SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (4) + WholeStageCodegen (2) Sort [c_customer_sk] InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (3) + Exchange [c_customer_sk] #4 + WholeStageCodegen (1) Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - WholeStageCodegen (7) + WholeStageCodegen (5) Sort [ss_customer_sk] InputAdapter - Exchange [ss_customer_sk] #6 - WholeStageCodegen (6) + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) Project [ss_customer_sk] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_sold_date_sk] @@ -58,18 +48,18 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - BroadcastExchange #7 - WholeStageCodegen (5) + BroadcastExchange #6 + WholeStageCodegen (3) Project [d_date_sk] Filter [d_year,d_qoy,d_date_sk] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - WholeStageCodegen (10) + WholeStageCodegen (8) Sort [ws_bill_customer_sk] InputAdapter - Exchange [ws_bill_customer_sk] #8 - WholeStageCodegen (9) + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (7) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_sold_date_sk] @@ -77,12 +67,12 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #7 - WholeStageCodegen (13) + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (11) Sort [cs_ship_customer_sk] InputAdapter - Exchange [cs_ship_customer_sk] #9 - WholeStageCodegen (12) + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (10) Project [cs_ship_customer_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_sold_date_sk] @@ -90,7 +80,17 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (15) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (14) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter WholeStageCodegen (19) Sort [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt index e19940ea96720..107343f091fb2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt @@ -20,15 +20,15 @@ TakeOrderedAndProject (49) : : :- * Project (17) : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : :- * Project (10) - : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : :- BroadcastExchange (5) - : : : : : +- * Project (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.store_sales (6) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- BroadcastExchange (15) : : : +- * Project (14) : : : +- * Filter (13) @@ -50,50 +50,50 @@ TakeOrderedAndProject (49) +- ReusedExchange (36) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(1) Scan parquet default.store_sales +Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND isnotnull(d_date_sk#1)) +(3) Filter [codegen id : 4] +Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_store_sk#3)) -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [2]: [d_date_sk#1, d_year#2] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] -(6) Scan parquet default.store_sales -Output [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) -(7) ColumnarToRow -Input [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_year#7] -(8) Filter -Input [5]: [ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] -Condition : ((isnotnull(ss_sold_date_sk#4) AND isnotnull(ss_item_sk#5)) AND isnotnull(ss_store_sk#6)) +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#6] Join condition: None (10) Project [codegen id : 4] -Output [4]: [ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] -Input [6]: [d_date_sk#1, ss_sold_date_sk#4, ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8] +Output [4]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5] +Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5, d_date_sk#6] (11) Scan parquet default.store Output [2]: [s_store_sk#9, s_state#10] @@ -118,13 +118,13 @@ Input [1]: [s_store_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_store_sk#6] +Left keys [1]: [ss_store_sk#3] Right keys [1]: [s_store_sk#9] Join condition: None (17) Project [codegen id : 4] -Output [3]: [ss_item_sk#5, ss_ext_sales_price#7, ss_net_profit#8] -Input [5]: [ss_item_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_net_profit#8, s_store_sk#9] +Output [3]: [ss_item_sk#2, ss_ext_sales_price#4, ss_net_profit#5] +Input [5]: [ss_item_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_net_profit#5, s_store_sk#9] (18) Scan parquet default.item Output [3]: [i_item_sk#12, i_class#13, i_category#14] @@ -145,18 +145,18 @@ Input [3]: [i_item_sk#12, i_class#13, i_category#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ss_item_sk#5] +Left keys [1]: [ss_item_sk#2] Right keys [1]: [i_item_sk#12] Join condition: None (23) Project [codegen id : 4] -Output [4]: [ss_ext_sales_price#7, ss_net_profit#8, i_class#13, i_category#14] -Input [6]: [ss_item_sk#5, ss_ext_sales_price#7, ss_net_profit#8, i_item_sk#12, i_class#13, i_category#14] +Output [4]: [ss_ext_sales_price#4, ss_net_profit#5, i_class#13, i_category#14] +Input [6]: [ss_item_sk#2, ss_ext_sales_price#4, ss_net_profit#5, i_item_sk#12, i_class#13, i_category#14] (24) HashAggregate [codegen id : 4] -Input [4]: [ss_ext_sales_price#7, ss_net_profit#8, i_class#13, i_category#14] +Input [4]: [ss_ext_sales_price#4, ss_net_profit#5, i_class#13, i_category#14] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#8)), partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(ss_ext_sales_price#4))] Aggregate Attributes [2]: [sum#16, sum#17] Results [4]: [i_category#14, i_class#13, sum#18, sum#19] @@ -167,9 +167,9 @@ Arguments: hashpartitioning(i_category#14, i_class#13, 5), true, [id=#20] (26) HashAggregate [codegen id : 5] Input [4]: [i_category#14, i_class#13, sum#18, sum#19] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#21, sum(UnscaledValue(ss_ext_sales_price#7))#22] -Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#21,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#22,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#23, i_category#14, i_class#13, 0 AS t_category#24, 0 AS t_class#25, 0 AS lochierarchy#26] +Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#21, sum(UnscaledValue(ss_ext_sales_price#4))#22] +Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#21,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#22,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#23, i_category#14, i_class#13, 0 AS t_category#24, 0 AS t_class#25, 0 AS lochierarchy#26] (27) ReusedExchange [Reuses operator id: 25] Output [4]: [i_category#14, i_class#13, sum#27, sum#28] @@ -177,9 +177,9 @@ Output [4]: [i_category#14, i_class#13, sum#27, sum#28] (28) HashAggregate [codegen id : 10] Input [4]: [i_category#14, i_class#13, sum#27, sum#28] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#29, sum(UnscaledValue(ss_ext_sales_price#7))#30] -Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#29,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#30,17,2) AS ss_ext_sales_price#32, i_category#14] +Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#29, sum(UnscaledValue(ss_ext_sales_price#4))#30] +Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#29,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#30,17,2) AS ss_ext_sales_price#32, i_category#14] (29) HashAggregate [codegen id : 10] Input [3]: [ss_net_profit#31, ss_ext_sales_price#32, i_category#14] @@ -225,9 +225,9 @@ Output [4]: [i_category#14, i_class#13, sum#50, sum#51] (37) HashAggregate [codegen id : 18] Input [4]: [i_category#14, i_class#13, sum#50, sum#51] Keys [2]: [i_category#14, i_class#13] -Functions [2]: [sum(UnscaledValue(ss_net_profit#8)), sum(UnscaledValue(ss_ext_sales_price#7))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#8))#52, sum(UnscaledValue(ss_ext_sales_price#7))#53] -Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#52,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#53,17,2) AS ss_ext_sales_price#32] +Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#52, sum(UnscaledValue(ss_ext_sales_price#4))#53] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#52,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#53,17,2) AS ss_ext_sales_price#32] (38) HashAggregate [codegen id : 18] Input [2]: [ss_net_profit#31, ss_ext_sales_price#32] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt index de0eb008c9a54..aa85d4870683d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt @@ -34,7 +34,11 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i Project [ss_item_sk,ss_ext_sales_price,ss_net_profit] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -43,10 +47,6 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_sold_date_sk,ss_item_sk,ss_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt index f52623876edb1..22479caee2de1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt @@ -19,16 +19,16 @@ TakeOrderedAndProject (87) : :- * Sort (13) : : +- Exchange (12) : : +- * Project (11) - : : +- * BroadcastHashJoin Inner BuildLeft (10) - : : :- BroadcastExchange (5) - : : : +- * Project (4) - : : : +- * Filter (3) - : : : +- * ColumnarToRow (2) - : : : +- Scan parquet default.date_dim (1) - : : +- * Project (9) - : : +- * Filter (8) - : : +- * ColumnarToRow (7) - : : +- Scan parquet default.web_sales (6) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.date_dim (5) : +- * Sort (18) : +- Exchange (17) : +- * Filter (16) @@ -49,12 +49,12 @@ TakeOrderedAndProject (87) : :- * Sort (39) : : +- Exchange (38) : : +- * Project (37) - : : +- * BroadcastHashJoin Inner BuildLeft (36) - : : :- ReusedExchange (31) - : : +- * Project (35) - : : +- * Filter (34) - : : +- * ColumnarToRow (33) - : : +- Scan parquet default.catalog_sales (32) + : : +- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Project (34) + : : : +- * Filter (33) + : : : +- * ColumnarToRow (32) + : : : +- Scan parquet default.catalog_sales (31) + : : +- ReusedExchange (35) : +- * Sort (44) : +- Exchange (43) : +- * Filter (42) @@ -75,12 +75,12 @@ TakeOrderedAndProject (87) :- * Sort (65) : +- Exchange (64) : +- * Project (63) - : +- * BroadcastHashJoin Inner BuildLeft (62) - : :- ReusedExchange (57) - : +- * Project (61) - : +- * Filter (60) - : +- * ColumnarToRow (59) - : +- Scan parquet default.store_sales (58) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Project (60) + : : +- * Filter (59) + : : +- * ColumnarToRow (58) + : : +- Scan parquet default.store_sales (57) + : +- ReusedExchange (61) +- * Sort (70) +- Exchange (69) +- * Filter (68) @@ -88,62 +88,62 @@ TakeOrderedAndProject (87) +- Scan parquet default.store_returns (66) -(1) Scan parquet default.date_dim -Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +(1) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] -Condition : ((((isnotnull(d_year#2) AND isnotnull(d_moy#3)) AND (d_year#2 = 2001)) AND (d_moy#3 = 12)) AND isnotnull(d_date_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] -(4) Project [codegen id : 1] -Output [1]: [d_date_sk#1] -Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +(3) Filter [codegen id : 2] +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] +Condition : ((((((((isnotnull(ws_net_profit#6) AND isnotnull(ws_net_paid#5)) AND isnotnull(ws_quantity#4)) AND (ws_net_profit#6 > 1.00)) AND (ws_net_paid#5 > 0.00)) AND (ws_quantity#4 > 0)) AND isnotnull(ws_order_number#3)) AND isnotnull(ws_item_sk#2)) AND isnotnull(ws_sold_date_sk#1)) -(5) BroadcastExchange -Input [1]: [d_date_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] +(4) Project [codegen id : 2] +Output [5]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, ws_net_profit#6] -(6) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] +(5) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(7) ColumnarToRow -Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] +(7) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : ((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 = 12)) AND isnotnull(d_date_sk#7)) -(8) Filter -Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] -Condition : ((((((((isnotnull(ws_net_profit#10) AND isnotnull(ws_net_paid#9)) AND isnotnull(ws_quantity#8)) AND (ws_net_profit#10 > 1.00)) AND (ws_net_paid#9 > 0.00)) AND (ws_quantity#8 > 0)) AND isnotnull(ws_order_number#7)) AND isnotnull(ws_item_sk#6)) AND isnotnull(ws_sold_date_sk#5)) +(8) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] -(9) Project -Output [5]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] -Input [6]: [ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, ws_net_profit#10] +(9) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] (10) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ws_sold_date_sk#5] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#7] Join condition: None (11) Project [codegen id : 2] -Output [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] -Input [6]: [d_date_sk#1, ws_sold_date_sk#5, ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] +Output [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] +Input [6]: [ws_sold_date_sk#1, ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, d_date_sk#7] (12) Exchange -Input [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] -Arguments: hashpartitioning(cast(ws_order_number#7 as bigint), cast(ws_item_sk#6 as bigint), 5), true, [id=#11] +Input [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] +Arguments: hashpartitioning(cast(ws_order_number#3 as bigint), cast(ws_item_sk#2 as bigint), 5), true, [id=#11] (13) Sort [codegen id : 3] -Input [4]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9] -Arguments: [cast(ws_order_number#7 as bigint) ASC NULLS FIRST, cast(ws_item_sk#6 as bigint) ASC NULLS FIRST], false, 0 +Input [4]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5] +Arguments: [cast(ws_order_number#3 as bigint) ASC NULLS FIRST, cast(ws_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 (14) Scan parquet default.web_returns Output [4]: [wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] @@ -168,31 +168,31 @@ Input [4]: [wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_ Arguments: [wr_order_number#13 ASC NULLS FIRST, wr_item_sk#12 ASC NULLS FIRST], false, 0 (19) SortMergeJoin [codegen id : 6] -Left keys [2]: [cast(ws_order_number#7 as bigint), cast(ws_item_sk#6 as bigint)] +Left keys [2]: [cast(ws_order_number#3 as bigint), cast(ws_item_sk#2 as bigint)] Right keys [2]: [wr_order_number#13, wr_item_sk#12] Join condition: None (20) Project [codegen id : 6] -Output [5]: [ws_item_sk#6, ws_quantity#8, ws_net_paid#9, wr_return_quantity#14, wr_return_amt#15] -Input [8]: [ws_item_sk#6, ws_order_number#7, ws_quantity#8, ws_net_paid#9, wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] +Output [5]: [ws_item_sk#2, ws_quantity#4, ws_net_paid#5, wr_return_quantity#14, wr_return_amt#15] +Input [8]: [ws_item_sk#2, ws_order_number#3, ws_quantity#4, ws_net_paid#5, wr_item_sk#12, wr_order_number#13, wr_return_quantity#14, wr_return_amt#15] (21) HashAggregate [codegen id : 6] -Input [5]: [ws_item_sk#6, ws_quantity#8, ws_net_paid#9, wr_return_quantity#14, wr_return_amt#15] -Keys [1]: [ws_item_sk#6] -Functions [4]: [partial_sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), partial_sum(cast(coalesce(ws_quantity#8, 0) as bigint)), partial_sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))] +Input [5]: [ws_item_sk#2, ws_quantity#4, ws_net_paid#5, wr_return_quantity#14, wr_return_amt#15] +Keys [1]: [ws_item_sk#2] +Functions [4]: [partial_sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), partial_sum(cast(coalesce(ws_quantity#4, 0) as bigint)), partial_sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))] Aggregate Attributes [6]: [sum#17, sum#18, sum#19, isEmpty#20, sum#21, isEmpty#22] -Results [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Results [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] (22) Exchange -Input [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] -Arguments: hashpartitioning(ws_item_sk#6, 5), true, [id=#29] +Input [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#29] (23) HashAggregate [codegen id : 7] -Input [7]: [ws_item_sk#6, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] -Keys [1]: [ws_item_sk#6] -Functions [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), sum(cast(coalesce(ws_quantity#8, 0) as bigint)), sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))] -Aggregate Attributes [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30, sum(cast(coalesce(ws_quantity#8, 0) as bigint))#31, sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32, sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))#33] -Results [3]: [ws_item_sk#6 AS item#34, CheckOverflow((promote_precision(cast(sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30 as decimal(15,4))) / promote_precision(cast(sum(cast(coalesce(ws_quantity#8, 0) as bigint))#31 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#35, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#9 as decimal(12,2)), 0.00))#33 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#36] +Input [7]: [ws_item_sk#2, sum#23, sum#24, sum#25, isEmpty#26, sum#27, isEmpty#28] +Keys [1]: [ws_item_sk#2] +Functions [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint)), sum(cast(coalesce(ws_quantity#4, 0) as bigint)), sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30, sum(cast(coalesce(ws_quantity#4, 0) as bigint))#31, sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32, sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))#33] +Results [3]: [ws_item_sk#2 AS item#34, CheckOverflow((promote_precision(cast(sum(cast(coalesce(wr_return_quantity#14, 0) as bigint))#30 as decimal(15,4))) / promote_precision(cast(sum(cast(coalesce(ws_quantity#4, 0) as bigint))#31 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#35, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#15 as decimal(12,2)), 0.00))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#5 as decimal(12,2)), 0.00))#33 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#36] (24) Exchange Input [3]: [item#34, return_ratio#35, currency_ratio#36] @@ -222,35 +222,35 @@ Condition : ((return_rank#38 <= 10) OR (currency_rank#39 <= 10)) Output [5]: [web AS channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Input [5]: [item#34, return_ratio#35, currency_ratio#36, return_rank#38, currency_rank#39] -(31) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(32) Scan parquet default.catalog_sales +(31) Scan parquet default.catalog_sales Output [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(33) ColumnarToRow +(32) ColumnarToRow [codegen id : 12] Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] -(34) Filter +(33) Filter [codegen id : 12] Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] Condition : ((((((((isnotnull(cs_net_profit#46) AND isnotnull(cs_net_paid#45)) AND isnotnull(cs_quantity#44)) AND (cs_net_profit#46 > 1.00)) AND (cs_net_paid#45 > 0.00)) AND (cs_quantity#44 > 0)) AND isnotnull(cs_order_number#43)) AND isnotnull(cs_item_sk#42)) AND isnotnull(cs_sold_date_sk#41)) -(35) Project +(34) Project [codegen id : 12] Output [5]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46] +(35) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#7] + (36) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [cs_sold_date_sk#41] +Left keys [1]: [cs_sold_date_sk#41] +Right keys [1]: [d_date_sk#7] Join condition: None (37) Project [codegen id : 12] Output [4]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] -Input [6]: [d_date_sk#1, cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] +Input [6]: [cs_sold_date_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, d_date_sk#7] (38) Exchange Input [4]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45] @@ -337,35 +337,35 @@ Condition : ((return_rank#74 <= 10) OR (currency_rank#75 <= 10)) Output [5]: [catalog AS channel#76, item#70, return_ratio#71, return_rank#74, currency_rank#75] Input [5]: [item#70, return_ratio#71, currency_ratio#72, return_rank#74, currency_rank#75] -(57) ReusedExchange [Reuses operator id: 5] -Output [1]: [d_date_sk#1] - -(58) Scan parquet default.store_sales +(57) Scan parquet default.store_sales Output [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(59) ColumnarToRow +(58) ColumnarToRow [codegen id : 22] Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] -(60) Filter +(59) Filter [codegen id : 22] Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] Condition : ((((((((isnotnull(ss_net_profit#82) AND isnotnull(ss_net_paid#81)) AND isnotnull(ss_quantity#80)) AND (ss_net_profit#82 > 1.00)) AND (ss_net_paid#81 > 0.00)) AND (ss_quantity#80 > 0)) AND isnotnull(ss_ticket_number#79)) AND isnotnull(ss_item_sk#78)) AND isnotnull(ss_sold_date_sk#77)) -(61) Project +(60) Project [codegen id : 22] Output [5]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, ss_net_profit#82] +(61) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#7] + (62) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#77] +Left keys [1]: [ss_sold_date_sk#77] +Right keys [1]: [d_date_sk#7] Join condition: None (63) Project [codegen id : 22] Output [4]: [ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] -Input [6]: [d_date_sk#1, ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] +Input [6]: [ss_sold_date_sk#77, ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81, d_date_sk#7] (64) Exchange Input [4]: [ss_item_sk#78, ss_ticket_number#79, ss_quantity#80, ss_net_paid#81] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt index bc666523baadc..ab300ca150457 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt @@ -35,7 +35,12 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [ws_order_number,ws_item_sk] #4 WholeStageCodegen (2) Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] - BroadcastHashJoin [d_date_sk,ws_sold_date_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk,ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -44,11 +49,6 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_moy] - Project [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] - Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk,ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit] InputAdapter WholeStageCodegen (5) Sort [wr_order_number,wr_item_sk] @@ -87,14 +87,14 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [cs_order_number,cs_item_sk] #9 WholeStageCodegen (12) Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] - BroadcastHashJoin [d_date_sk,cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #5 + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit] + InputAdapter + ReusedExchange [d_date_sk] #5 InputAdapter WholeStageCodegen (15) Sort [cr_order_number,cr_item_sk] @@ -133,14 +133,14 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] Exchange [ss_ticket_number,ss_item_sk] #13 WholeStageCodegen (22) Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #5 + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit] + InputAdapter + ReusedExchange [d_date_sk] #5 InputAdapter WholeStageCodegen (25) Sort [sr_ticket_number,sr_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt index c2627bd7e4cc9..a7f328537b7ac 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt @@ -24,15 +24,15 @@ TakeOrderedAndProject (79) : : : : : :- * Project (17) : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) : : : : : : :- * Project (10) - : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : : : : :- BroadcastExchange (5) - : : : : : : : : +- * Project (4) - : : : : : : : : +- * Filter (3) - : : : : : : : : +- * ColumnarToRow (2) - : : : : : : : : +- Scan parquet default.household_demographics (1) - : : : : : : : +- * Filter (8) - : : : : : : : +- * ColumnarToRow (7) - : : : : : : : +- Scan parquet default.catalog_sales (6) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : : : :- * Filter (3) + : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : +- BroadcastExchange (8) + : : : : : : : +- * Project (7) + : : : : : : : +- * Filter (6) + : : : : : : : +- * ColumnarToRow (5) + : : : : : : : +- Scan parquet default.household_demographics (4) : : : : : : +- BroadcastExchange (15) : : : : : : +- * Project (14) : : : : : : +- * Filter (13) @@ -49,26 +49,26 @@ TakeOrderedAndProject (79) : : : : +- Scan parquet default.item (26) : : : +- BroadcastExchange (43) : : : +- * Project (42) - : : : +- * BroadcastHashJoin Inner BuildRight (41) - : : : :- * Filter (35) - : : : : +- * ColumnarToRow (34) - : : : : +- Scan parquet default.date_dim (33) - : : : +- BroadcastExchange (40) - : : : +- * Project (39) - : : : +- * Filter (38) - : : : +- * ColumnarToRow (37) - : : : +- Scan parquet default.date_dim (36) + : : : +- * BroadcastHashJoin Inner BuildLeft (41) + : : : :- BroadcastExchange (37) + : : : : +- * Project (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.date_dim (38) : : +- * Sort (58) : : +- Exchange (57) : : +- * Project (56) - : : +- * BroadcastHashJoin Inner BuildLeft (55) - : : :- BroadcastExchange (51) - : : : +- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.warehouse (48) - : : +- * Filter (54) - : : +- * ColumnarToRow (53) - : : +- Scan parquet default.inventory (52) + : : +- * BroadcastHashJoin Inner BuildRight (55) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.inventory (48) + : : +- BroadcastExchange (54) + : : +- * Filter (53) + : : +- * ColumnarToRow (52) + : : +- Scan parquet default.warehouse (51) : +- BroadcastExchange (64) : +- * Filter (63) : +- * ColumnarToRow (62) @@ -80,50 +80,50 @@ TakeOrderedAndProject (79) +- Scan parquet default.catalog_returns (69) -(1) Scan parquet default.household_demographics -Output [2]: [hd_demo_sk#1, hd_buy_potential#2] +(1) Scan parquet default.catalog_sales +Output [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/household_demographics] -PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,1001-5000), IsNotNull(hd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [2]: [hd_demo_sk#1, hd_buy_potential#2] +(2) ColumnarToRow [codegen id : 4] +Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] -(3) Filter [codegen id : 1] -Input [2]: [hd_demo_sk#1, hd_buy_potential#2] -Condition : ((isnotnull(hd_buy_potential#2) AND (hd_buy_potential#2 = 1001-5000)) AND isnotnull(hd_demo_sk#1)) +(3) Filter [codegen id : 4] +Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] +Condition : (((((isnotnull(cs_quantity#8) AND isnotnull(cs_item_sk#5)) AND isnotnull(cs_bill_cdemo_sk#3)) AND isnotnull(cs_bill_hdemo_sk#4)) AND isnotnull(cs_sold_date_sk#1)) AND isnotnull(cs_ship_date_sk#2)) -(4) Project [codegen id : 1] -Output [1]: [hd_demo_sk#1] -Input [2]: [hd_demo_sk#1, hd_buy_potential#2] +(4) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#9, hd_buy_potential#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,1001-5000), IsNotNull(hd_demo_sk)] +ReadSchema: struct -(5) BroadcastExchange -Input [1]: [hd_demo_sk#1] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] -(6) Scan parquet default.catalog_sales -Output [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_sold_date_sk), IsNotNull(cs_ship_date_sk)] -ReadSchema: struct +(6) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] +Condition : ((isnotnull(hd_buy_potential#10) AND (hd_buy_potential#10 = 1001-5000)) AND isnotnull(hd_demo_sk#9)) -(7) ColumnarToRow -Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +(7) Project [codegen id : 1] +Output [1]: [hd_demo_sk#9] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] -(8) Filter -Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] -Condition : (((((isnotnull(cs_quantity#11) AND isnotnull(cs_item_sk#8)) AND isnotnull(cs_bill_cdemo_sk#6)) AND isnotnull(cs_bill_hdemo_sk#7)) AND isnotnull(cs_sold_date_sk#4)) AND isnotnull(cs_ship_date_sk#5)) +(8) BroadcastExchange +Input [1]: [hd_demo_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] (9) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [hd_demo_sk#1] -Right keys [1]: [cs_bill_hdemo_sk#7] +Left keys [1]: [cs_bill_hdemo_sk#4] +Right keys [1]: [hd_demo_sk#9] Join condition: None (10) Project [codegen id : 4] -Output [7]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] -Input [9]: [hd_demo_sk#1, cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_bill_hdemo_sk#7, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] +Output [7]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] +Input [9]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_bill_hdemo_sk#4, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, hd_demo_sk#9] (11) Scan parquet default.customer_demographics Output [2]: [cd_demo_sk#12, cd_marital_status#13] @@ -148,13 +148,13 @@ Input [1]: [cd_demo_sk#12] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (16) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_bill_cdemo_sk#6] +Left keys [1]: [cs_bill_cdemo_sk#3] Right keys [1]: [cd_demo_sk#12] Join condition: None (17) Project [codegen id : 4] -Output [6]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11] -Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_bill_cdemo_sk#6, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, cd_demo_sk#12] +Output [6]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8] +Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_bill_cdemo_sk#3, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, cd_demo_sk#12] (18) Scan parquet default.date_dim Output [2]: [d_date_sk#15, d_date#16] @@ -175,21 +175,21 @@ Input [2]: [d_date_sk#15, d_date#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] (22) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [cs_ship_date_sk#5] +Left keys [1]: [cs_ship_date_sk#2] Right keys [1]: [d_date_sk#15] Join condition: None (23) Project [codegen id : 4] -Output [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] -Input [8]: [cs_sold_date_sk#4, cs_ship_date_sk#5, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date_sk#15, d_date#16] +Output [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] +Input [8]: [cs_sold_date_sk#1, cs_ship_date_sk#2, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date_sk#15, d_date#16] (24) Exchange -Input [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] -Arguments: hashpartitioning(cs_item_sk#8, 5), true, [id=#18] +Input [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] +Arguments: hashpartitioning(cs_item_sk#5, 5), true, [id=#18] (25) Sort [codegen id : 5] -Input [6]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16] -Arguments: [cs_item_sk#8 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16] +Arguments: [cs_item_sk#5 ASC NULLS FIRST], false, 0 (26) Scan parquet default.item Output [2]: [i_item_sk#19, i_item_desc#20] @@ -214,137 +214,137 @@ Input [2]: [i_item_sk#19, i_item_desc#20] Arguments: [i_item_sk#19 ASC NULLS FIRST], false, 0 (31) SortMergeJoin [codegen id : 10] -Left keys [1]: [cs_item_sk#8] +Left keys [1]: [cs_item_sk#5] Right keys [1]: [i_item_sk#19] Join condition: None (32) Project [codegen id : 10] -Output [7]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_desc#20] -Input [8]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_sk#19, i_item_desc#20] +Output [7]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20] +Input [8]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_sk#19, i_item_desc#20] (33) Scan parquet default.date_dim -Output [2]: [d_date_sk#22, d_week_seq#23] +Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct -(34) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#22, d_week_seq#23] +(34) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -(35) Filter [codegen id : 9] -Input [2]: [d_date_sk#22, d_week_seq#23] -Condition : (isnotnull(d_week_seq#23) AND isnotnull(d_date_sk#22)) +(35) Filter [codegen id : 8] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] +Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 2001)) AND isnotnull(d_date_sk#22)) AND isnotnull(d_week_seq#24)) AND isnotnull(d_date#23)) -(36) Scan parquet default.date_dim -Output [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] -ReadSchema: struct +(36) Project [codegen id : 8] +Output [3]: [d_date_sk#22, d_date#23, d_week_seq#24] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_year#25] -(37) ColumnarToRow [codegen id : 8] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +(37) BroadcastExchange +Input [3]: [d_date_sk#22, d_date#23, d_week_seq#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#26] -(38) Filter [codegen id : 8] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] -Condition : ((((isnotnull(d_year#27) AND (d_year#27 = 2001)) AND isnotnull(d_date_sk#24)) AND isnotnull(d_week_seq#26)) AND isnotnull(d_date#25)) +(38) Scan parquet default.date_dim +Output [2]: [d_date_sk#27, d_week_seq#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(39) Project [codegen id : 8] -Output [3]: [d_date_sk#24, d_date#25, d_week_seq#26] -Input [4]: [d_date_sk#24, d_date#25, d_week_seq#26, d_year#27] +(39) ColumnarToRow +Input [2]: [d_date_sk#27, d_week_seq#28] -(40) BroadcastExchange -Input [3]: [d_date_sk#24, d_date#25, d_week_seq#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#28] +(40) Filter +Input [2]: [d_date_sk#27, d_week_seq#28] +Condition : (isnotnull(d_week_seq#28) AND isnotnull(d_date_sk#27)) (41) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [d_week_seq#23] -Right keys [1]: [d_week_seq#26] +Left keys [1]: [d_week_seq#24] +Right keys [1]: [d_week_seq#28] Join condition: None (42) Project [codegen id : 9] -Output [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] -Input [5]: [d_date_sk#22, d_week_seq#23, d_date_sk#24, d_date#25, d_week_seq#26] +Output [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Input [5]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27, d_week_seq#28] (43) BroadcastExchange -Input [4]: [d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#29] +Input [4]: [d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (44) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#4] -Right keys [1]: [d_date_sk#24] -Join condition: (d_date#16 > d_date#25 + 5 days) +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#22] +Join condition: (d_date#16 > d_date#23 + 5 days) (45) Project [codegen id : 10] -Output [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Input [11]: [cs_sold_date_sk#4, cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, d_date#16, i_item_desc#20, d_date_sk#22, d_date_sk#24, d_date#25, d_week_seq#26] +Output [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Input [11]: [cs_sold_date_sk#1, cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, d_date#16, i_item_desc#20, d_date_sk#22, d_date#23, d_week_seq#24, d_date_sk#27] (46) Exchange -Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Arguments: hashpartitioning(cs_item_sk#8, d_date_sk#22, 5), true, [id=#30] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Arguments: hashpartitioning(cs_item_sk#5, d_date_sk#27, 5), true, [id=#30] (47) Sort [codegen id : 11] -Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26] -Arguments: [cs_item_sk#8 ASC NULLS FIRST, d_date_sk#22 ASC NULLS FIRST], false, 0 +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27] +Arguments: [cs_item_sk#5 ASC NULLS FIRST, d_date_sk#27 ASC NULLS FIRST], false, 0 -(48) Scan parquet default.warehouse -Output [2]: [w_warehouse_sk#31, w_warehouse_name#32] +(48) Scan parquet default.inventory +Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct - -(49) ColumnarToRow [codegen id : 12] -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] +Location [not included in comparison]/{warehouse_dir}/inventory] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] +ReadSchema: struct -(50) Filter [codegen id : 12] -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] -Condition : isnotnull(w_warehouse_sk#31) +(49) ColumnarToRow [codegen id : 13] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] -(51) BroadcastExchange -Input [2]: [w_warehouse_sk#31, w_warehouse_name#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] +(50) Filter [codegen id : 13] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34] +Condition : (((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) AND isnotnull(inv_date_sk#31)) -(52) Scan parquet default.inventory -Output [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +(51) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#35, w_warehouse_name#36] Batched: true -Location [not included in comparison]/{warehouse_dir}/inventory] -PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk), IsNotNull(inv_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] -(53) ColumnarToRow -Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +(53) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +Condition : isnotnull(w_warehouse_sk#35) -(54) Filter -Input [4]: [inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] -Condition : (((isnotnull(inv_quantity_on_hand#37) AND isnotnull(inv_item_sk#35)) AND isnotnull(inv_warehouse_sk#36)) AND isnotnull(inv_date_sk#34)) +(54) BroadcastExchange +Input [2]: [w_warehouse_sk#35, w_warehouse_name#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] (55) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [w_warehouse_sk#31] -Right keys [1]: [inv_warehouse_sk#36] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#35] Join condition: None (56) Project [codegen id : 13] -Output [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Input [6]: [w_warehouse_sk#31, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_warehouse_sk#36, inv_quantity_on_hand#37] +Output [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Input [6]: [inv_date_sk#31, inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, w_warehouse_sk#35, w_warehouse_name#36] (57) Exchange -Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Arguments: hashpartitioning(inv_item_sk#35, inv_date_sk#34, 5), true, [id=#38] +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#31, 5), true, [id=#38] (58) Sort [codegen id : 14] -Input [4]: [w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] -Arguments: [inv_item_sk#35 ASC NULLS FIRST, inv_date_sk#34 ASC NULLS FIRST], false, 0 +Input [4]: [inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] +Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#31 ASC NULLS FIRST], false, 0 (59) SortMergeJoin [codegen id : 16] -Left keys [2]: [cs_item_sk#8, d_date_sk#22] -Right keys [2]: [inv_item_sk#35, inv_date_sk#34] -Join condition: (inv_quantity_on_hand#37 < cs_quantity#11) +Left keys [2]: [cs_item_sk#5, d_date_sk#27] +Right keys [2]: [inv_item_sk#32, inv_date_sk#31] +Join condition: (inv_quantity_on_hand#34 < cs_quantity#8) (60) Project [codegen id : 16] -Output [6]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [11]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, cs_quantity#11, i_item_desc#20, d_date_sk#22, d_week_seq#26, w_warehouse_name#32, inv_date_sk#34, inv_item_sk#35, inv_quantity_on_hand#37] +Output [6]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [11]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, cs_quantity#8, i_item_desc#20, d_week_seq#24, d_date_sk#27, inv_date_sk#31, inv_item_sk#32, inv_quantity_on_hand#34, w_warehouse_name#36] (61) Scan parquet default.promotion Output [1]: [p_promo_sk#39] @@ -365,21 +365,21 @@ Input [1]: [p_promo_sk#39] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] (65) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [cs_promo_sk#9] +Left keys [1]: [cs_promo_sk#6] Right keys [1]: [p_promo_sk#39] Join condition: None (66) Project [codegen id : 16] -Output [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [7]: [cs_item_sk#8, cs_promo_sk#9, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, p_promo_sk#39] +Output [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [7]: [cs_item_sk#5, cs_promo_sk#6, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, p_promo_sk#39] (67) Exchange -Input [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Arguments: hashpartitioning(cs_item_sk#8, cs_order_number#10, 5), true, [id=#41] +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Arguments: hashpartitioning(cs_item_sk#5, cs_order_number#7, 5), true, [id=#41] (68) Sort [codegen id : 17] -Input [5]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Arguments: [cs_item_sk#8 ASC NULLS FIRST, cs_order_number#10 ASC NULLS FIRST], false, 0 +Input [5]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Arguments: [cs_item_sk#5 ASC NULLS FIRST, cs_order_number#7 ASC NULLS FIRST], false, 0 (69) Scan parquet default.catalog_returns Output [2]: [cr_item_sk#42, cr_order_number#43] @@ -404,33 +404,33 @@ Input [2]: [cr_item_sk#42, cr_order_number#43] Arguments: [cr_item_sk#42 ASC NULLS FIRST, cr_order_number#43 ASC NULLS FIRST], false, 0 (74) SortMergeJoin -Left keys [2]: [cs_item_sk#8, cs_order_number#10] +Left keys [2]: [cs_item_sk#5, cs_order_number#7] Right keys [2]: [cr_item_sk#42, cr_order_number#43] Join condition: None (75) Project [codegen id : 20] -Output [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Input [7]: [cs_item_sk#8, cs_order_number#10, w_warehouse_name#32, i_item_desc#20, d_week_seq#26, cr_item_sk#42, cr_order_number#43] +Output [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Input [7]: [cs_item_sk#5, cs_order_number#7, w_warehouse_name#36, i_item_desc#20, d_week_seq#24, cr_item_sk#42, cr_order_number#43] (76) HashAggregate [codegen id : 20] -Input [3]: [w_warehouse_name#32, i_item_desc#20, d_week_seq#26] -Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] +Input [3]: [w_warehouse_name#36, i_item_desc#20, d_week_seq#24] +Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] Functions [1]: [partial_count(1)] Aggregate Attributes [1]: [count#45] -Results [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] +Results [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] (77) Exchange -Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] -Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#32, d_week_seq#26, 5), true, [id=#47] +Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Arguments: hashpartitioning(i_item_desc#20, w_warehouse_name#36, d_week_seq#24, 5), true, [id=#47] (78) HashAggregate [codegen id : 21] -Input [4]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count#46] -Keys [3]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26] +Input [4]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count#46] +Keys [3]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24] Functions [1]: [count(1)] Aggregate Attributes [1]: [count(1)#48] -Results [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] +Results [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] (79) TakeOrderedAndProject -Input [6]: [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] -Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#32 ASC NULLS FIRST, d_week_seq#26 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#32, d_week_seq#26, no_promo#49, promo#50, total_cnt#51] +Input [6]: [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#20 ASC NULLS FIRST, w_warehouse_name#36 ASC NULLS FIRST, d_week_seq#24 ASC NULLS FIRST], [i_item_desc#20, w_warehouse_name#36, d_week_seq#24, no_promo#49, promo#50, total_cnt#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt index 39dba3af02359..918508787c4b0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt @@ -23,7 +23,7 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter Exchange [cs_item_sk,d_date_sk] #3 WholeStageCodegen (10) - Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_date_sk,d_week_seq] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,d_date,i_item_desc] SortMergeJoin [cs_item_sk,i_item_sk] @@ -38,7 +38,11 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom Project [cs_sold_date_sk,cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] Project [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] - BroadcastHashJoin [hd_demo_sk,cs_bill_hdemo_sk] + BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_sold_date_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] InputAdapter BroadcastExchange #5 WholeStageCodegen (1) @@ -47,10 +51,6 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] - Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_sold_date_sk,cs_ship_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity] InputAdapter BroadcastExchange #6 WholeStageCodegen (2) @@ -79,12 +79,8 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom InputAdapter BroadcastExchange #9 WholeStageCodegen (9) - Project [d_date_sk,d_date_sk,d_date,d_week_seq] + Project [d_date_sk,d_date,d_week_seq,d_date_sk] BroadcastHashJoin [d_week_seq,d_week_seq] - Filter [d_week_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -93,14 +89,22 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] InputAdapter WholeStageCodegen (14) Sort [inv_item_sk,inv_date_sk] InputAdapter Exchange [inv_item_sk,inv_date_sk] #11 WholeStageCodegen (13) - Project [w_warehouse_name,inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [w_warehouse_sk,inv_warehouse_sk] + Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #12 WholeStageCodegen (12) @@ -108,10 +112,6 @@ TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_prom ColumnarToRow InputAdapter Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] - Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk,inv_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.inventory [inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] InputAdapter BroadcastExchange #13 WholeStageCodegen (15) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt index 6e51dfda3143e..2d4b595efeff6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt @@ -16,14 +16,14 @@ TakeOrderedAndProject (86) : : : :- * Sort (11) : : : : +- Exchange (10) : : : : +- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildLeft (8) - : : : : :- BroadcastExchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.date_dim (1) - : : : : +- * Filter (7) - : : : : +- * ColumnarToRow (6) - : : : : +- Scan parquet default.store_sales (5) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) : : : +- * Sort (16) : : : +- Exchange (15) : : : +- * Filter (14) @@ -39,14 +39,14 @@ TakeOrderedAndProject (86) : : :- * Sort (35) : : : +- Exchange (34) : : : +- * Project (33) - : : : +- * BroadcastHashJoin Inner BuildLeft (32) - : : : :- BroadcastExchange (28) - : : : : +- * Filter (27) - : : : : +- * ColumnarToRow (26) - : : : : +- Scan parquet default.date_dim (25) - : : : +- * Filter (31) - : : : +- * ColumnarToRow (30) - : : : +- Scan parquet default.store_sales (29) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.store_sales (25) + : : : +- BroadcastExchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) : : +- * Sort (37) : : +- ReusedExchange (36) : +- * Sort (64) @@ -87,54 +87,54 @@ TakeOrderedAndProject (86) +- ReusedExchange (75) -(1) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(1) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] -ReadSchema: struct - -(2) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct -(3) Filter [codegen id : 1] -Input [2]: [d_date_sk#1, d_year#2] -Condition : (((isnotnull(d_year#2) AND (d_year#2 = 2001)) AND d_year#2 IN (2001,2002)) AND isnotnull(d_date_sk#1)) +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -(4) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#3] +(3) Filter [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(5) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_year#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_year#5] -(6) ColumnarToRow -Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_year#5] +Condition : (((isnotnull(d_year#5) AND (d_year#5 = 2001)) AND d_year#5 IN (2001,2002)) AND isnotnull(d_date_sk#4)) -(7) Filter -Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) +(7) BroadcastExchange +Input [2]: [d_date_sk#4, d_year#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] (8) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (9) Project [codegen id : 2] -Output [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Output [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3, d_date_sk#4, d_year#5] (10) Exchange -Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#7] +Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#7] (11) Sort [codegen id : 3] -Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (12) Scan parquet default.customer Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] @@ -159,31 +159,31 @@ Input [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] Arguments: [c_customer_sk#8 ASC NULLS FIRST], false, 0 (17) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None (18) Project [codegen id : 6] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] -Input [7]: [d_year#2, ss_customer_sk#5, ss_net_paid#6, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] +Input [7]: [ss_customer_sk#2, ss_net_paid#3, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (19) HashAggregate [codegen id : 6] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#3))] Aggregate Attributes [1]: [sum#13] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] (20) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#15] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#15] (21) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#14] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] -Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#16] -Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#16,17,2) AS year_total#18] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#14] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Functions [1]: [sum(UnscaledValue(ss_net_paid#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#16] +Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#16,17,2) AS year_total#18] (22) Filter [codegen id : 7] Input [2]: [customer_id#17, year_total#18] @@ -197,54 +197,54 @@ Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] Input [2]: [customer_id#17, year_total#18] Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.date_dim -Output [2]: [d_date_sk#1, d_year#2] +(25) Scan parquet default.store_sales +Output [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] + +(27) Filter [codegen id : 10] +Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1)) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_year#5] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(26) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#4, d_year#5] -(27) Filter [codegen id : 9] -Input [2]: [d_date_sk#1, d_year#2] -Condition : (((isnotnull(d_year#2) AND (d_year#2 = 2002)) AND d_year#2 IN (2001,2002)) AND isnotnull(d_date_sk#1)) +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#4, d_year#5] +Condition : (((isnotnull(d_year#5) AND (d_year#5 = 2002)) AND d_year#5 IN (2001,2002)) AND isnotnull(d_date_sk#4)) -(28) BroadcastExchange -Input [2]: [d_date_sk#1, d_year#2] +(31) BroadcastExchange +Input [2]: [d_date_sk#4, d_year#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(29) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] -ReadSchema: struct - -(30) ColumnarToRow -Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] - -(31) Filter -Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] -Condition : (isnotnull(ss_customer_sk#5) AND isnotnull(ss_sold_date_sk#4)) - (32) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [d_date_sk#1] -Right keys [1]: [ss_sold_date_sk#4] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (33) Project [codegen id : 10] -Output [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Input [5]: [d_date_sk#1, d_year#2, ss_sold_date_sk#4, ss_customer_sk#5, ss_net_paid#6] +Output [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3, d_date_sk#4, d_year#5] (34) Exchange -Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Arguments: hashpartitioning(ss_customer_sk#5, 5), true, [id=#21] +Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] (35) Sort [codegen id : 11] -Input [3]: [d_year#2, ss_customer_sk#5, ss_net_paid#6] -Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 +Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 (36) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] @@ -254,31 +254,31 @@ Input [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] Arguments: [c_customer_sk#8 ASC NULLS FIRST], false, 0 (38) SortMergeJoin [codegen id : 14] -Left keys [1]: [ss_customer_sk#5] +Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None (39) Project [codegen id : 14] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] -Input [7]: [d_year#2, ss_customer_sk#5, ss_net_paid#6, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] +Input [7]: [ss_customer_sk#2, ss_net_paid#3, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (40) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#6, d_year#2] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] -Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ss_net_paid#3, d_year#5] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#3))] Aggregate Attributes [1]: [sum#22] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] (41) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#24] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#24] (42) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#23] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] -Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#25] -Results [4]: [c_customer_id#9 AS customer_id#26, c_first_name#10 AS customer_first_name#27, c_last_name#11 AS customer_last_name#28, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#25,17,2) AS year_total#29] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] +Functions [1]: [sum(UnscaledValue(ss_net_paid#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#25] +Results [4]: [c_customer_id#9 AS customer_id#26, c_first_name#10 AS customer_first_name#27, c_last_name#11 AS customer_last_name#28, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#25,17,2) AS year_total#29] (43) Exchange Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] @@ -307,24 +307,24 @@ Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(49) ReusedExchange [Reuses operator id: 4] -Output [2]: [d_date_sk#1, d_year#2] +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#4, d_year#5] (50) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (51) Project [codegen id : 19] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#1, d_year#2] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] (52) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#34] (53) Sort [codegen id : 20] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (54) ReusedExchange [Reuses operator id: 15] @@ -340,23 +340,23 @@ Right keys [1]: [c_customer_sk#8] Join condition: None (57) Project [codegen id : 23] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (58) HashAggregate [codegen id : 23] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum#35] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] (59) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#37] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#37] (60) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#36] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] Functions [1]: [sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#33))#38] Results [2]: [c_customer_id#9 AS customer_id#39, MakeDecimal(sum(UnscaledValue(ws_net_paid#33))#38,17,2) AS year_total#40] @@ -400,24 +400,24 @@ Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] Condition : (isnotnull(ws_bill_customer_sk#32) AND isnotnull(ws_sold_date_sk#31)) -(70) ReusedExchange [Reuses operator id: 28] -Output [2]: [d_date_sk#1, d_year#2] +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#4, d_year#5] (71) BroadcastHashJoin [codegen id : 28] Left keys [1]: [ws_sold_date_sk#31] -Right keys [1]: [d_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None (72) Project [codegen id : 28] -Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] -Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#1, d_year#2] +Output [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] +Input [5]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33, d_date_sk#4, d_year#5] (73) Exchange -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: hashpartitioning(ws_bill_customer_sk#32, 5), true, [id=#44] (74) Sort [codegen id : 29] -Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2] +Input [3]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5] Arguments: [ws_bill_customer_sk#32 ASC NULLS FIRST], false, 0 (75) ReusedExchange [Reuses operator id: 15] @@ -433,23 +433,23 @@ Right keys [1]: [c_customer_sk#8] Join condition: None (78) Project [codegen id : 32] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] -Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#2, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] +Input [7]: [ws_bill_customer_sk#32, ws_net_paid#33, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] (79) HashAggregate [codegen id : 32] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#2] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#33, d_year#5] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum#45] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] (80) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, 5), true, [id=#47] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#47] (81) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2, sum#46] -Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#2] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] +Keys [4]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5] Functions [1]: [sum(UnscaledValue(ws_net_paid#33))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#33))#48] Results [2]: [c_customer_id#9 AS customer_id#49, MakeDecimal(sum(UnscaledValue(ws_net_paid#33))#48,17,2) AS year_total#50] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt index 1501079579fa2..4e4bc8b75134a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt @@ -29,8 +29,12 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [ss_customer_sk] #3 WholeStageCodegen (2) - Project [d_year,ss_customer_sk,ss_net_paid] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter BroadcastExchange #4 WholeStageCodegen (1) @@ -38,10 +42,6 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter WholeStageCodegen (5) Sort [c_customer_sk] @@ -71,8 +71,12 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [ss_customer_sk] #8 WholeStageCodegen (10) - Project [d_year,ss_customer_sk,ss_net_paid] - BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter BroadcastExchange #9 WholeStageCodegen (9) @@ -80,10 +84,6 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year] - Filter [ss_customer_sk,ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk,ss_net_paid] InputAdapter WholeStageCodegen (13) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt index 1bc8c24c2c591..3f452dc9272dc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt @@ -22,15 +22,15 @@ TakeOrderedAndProject (138) : : : : +- * Project (16) : : : : +- * BroadcastHashJoin Inner BuildRight (15) : : : : :- * Project (10) - : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) - : : : : : :- BroadcastExchange (5) - : : : : : : +- * Project (4) - : : : : : : +- * Filter (3) - : : : : : : +- * ColumnarToRow (2) - : : : : : : +- Scan parquet default.item (1) - : : : : : +- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.catalog_sales (6) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.item (4) : : : : +- BroadcastExchange (14) : : : : +- * Filter (13) : : : : +- * ColumnarToRow (12) @@ -96,11 +96,11 @@ TakeOrderedAndProject (138) : : : +- * Project (86) : : : +- * BroadcastHashJoin Inner BuildRight (85) : : : :- * Project (80) - : : : : +- * BroadcastHashJoin Inner BuildLeft (79) - : : : : :- ReusedExchange (75) - : : : : +- * Filter (78) - : : : : +- * ColumnarToRow (77) - : : : : +- Scan parquet default.catalog_sales (76) + : : : : +- * BroadcastHashJoin Inner BuildRight (79) + : : : : :- * Filter (77) + : : : : : +- * ColumnarToRow (76) + : : : : : +- Scan parquet default.catalog_sales (75) + : : : : +- ReusedExchange (78) : : : +- BroadcastExchange (84) : : : +- * Filter (83) : : : +- * ColumnarToRow (82) @@ -139,50 +139,50 @@ TakeOrderedAndProject (138) +- ReusedExchange (123) -(1) Scan parquet default.item -Output [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] +(1) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] + +(3) Filter [codegen id : 3] +Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] -Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] -(3) Filter [codegen id : 1] -Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] -Condition : ((((((isnotnull(i_category#5) AND (i_category#5 = Books)) AND isnotnull(i_item_sk#1)) AND isnotnull(i_brand_id#2)) AND isnotnull(i_class_id#3)) AND isnotnull(i_category_id#4)) AND isnotnull(i_manufact_id#6)) +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] +Condition : ((((((isnotnull(i_category#10) AND (i_category#10 = Books)) AND isnotnull(i_item_sk#6)) AND isnotnull(i_brand_id#7)) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) AND isnotnull(i_manufact_id#11)) -(4) Project [codegen id : 1] -Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] -Input [6]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_category#5, i_manufact_id#6] +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [6]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_category#10, i_manufact_id#11] -(5) BroadcastExchange -Input [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] - -(6) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] -ReadSchema: struct - -(7) ColumnarToRow -Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] - -(8) Filter -Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) +(8) BroadcastExchange +Input [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] (9) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_item_sk#1] -Right keys [1]: [cs_item_sk#9] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#6] Join condition: None (10) Project [codegen id : 3] -Output [9]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -Input [10]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Output [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (11) Scan parquet default.date_dim Output [2]: [d_date_sk#13, d_year#14] @@ -203,21 +203,21 @@ Input [2]: [d_date_sk#13, d_year#14] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [cs_sold_date_sk#8] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#13] Join condition: None (16) Project [codegen id : 3] -Output [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] -Input [11]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, d_date_sk#13, d_year#14] +Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [11]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (17) Exchange -Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] -Arguments: hashpartitioning(cs_order_number#10, cs_item_sk#9, 5), true, [id=#16] +Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), true, [id=#16] (18) Sort [codegen id : 4] -Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] -Arguments: [cs_order_number#10 ASC NULLS FIRST, cs_item_sk#9 ASC NULLS FIRST], false, 0 +Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 (19) Scan parquet default.catalog_returns Output [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] @@ -242,13 +242,13 @@ Input [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_ Arguments: [cr_order_number#18 ASC NULLS FIRST, cr_item_sk#17 ASC NULLS FIRST], false, 0 (24) SortMergeJoin -Left keys [2]: [cs_order_number#10, cs_item_sk#9] +Left keys [2]: [cs_order_number#3, cs_item_sk#2] Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (25) Project [codegen id : 7] -Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (cs_quantity#11 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#12 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] -Input [13]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (cs_quantity#4 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] +Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] (26) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] @@ -264,17 +264,17 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) -(29) ReusedExchange [Reuses operator id: 5] -Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +(29) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (30) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (31) Project [codegen id : 10] -Output [9]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] -Input [10]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Output [9]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (32) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] @@ -285,15 +285,15 @@ Right keys [1]: [d_date_sk#13] Join condition: None (34) Project [codegen id : 10] -Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] -Input [11]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_date_sk#13, d_year#14] +Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [11]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (35) Exchange -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#29] (36) Sort [codegen id : 11] -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] Arguments: [cast(ss_ticket_number#26 as bigint) ASC NULLS FIRST, cast(ss_item_sk#25 as bigint) ASC NULLS FIRST], false, 0 (37) Scan parquet default.store_returns @@ -324,28 +324,28 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (43) Project [codegen id : 14] -Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#35, CheckOverflow((promote_precision(cast(ss_ext_sales_price#28 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#33, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#36] -Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#35, CheckOverflow((promote_precision(cast(ss_ext_sales_price#28 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#33, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#36] +Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] (44) Union (45) HashAggregate [codegen id : 15] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] (46) Exchange -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23, 5), true, [id=#37] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23, 5), true, [id=#37] (47) HashAggregate [codegen id : 16] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] (48) Scan parquet default.web_sales Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] @@ -361,17 +361,17 @@ Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#4 Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Condition : (isnotnull(ws_item_sk#39) AND isnotnull(ws_sold_date_sk#38)) -(51) ReusedExchange [Reuses operator id: 5] -Output [5]: [i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +(51) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (52) BroadcastHashJoin [codegen id : 19] Left keys [1]: [ws_item_sk#39] -Right keys [1]: [i_item_sk#1] +Right keys [1]: [i_item_sk#6] Join condition: None (53) Project [codegen id : 19] -Output [9]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] -Input [10]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_item_sk#1, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Output [9]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (54) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] @@ -382,15 +382,15 @@ Right keys [1]: [d_date_sk#13] Join condition: None (56) Project [codegen id : 19] -Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] -Input [11]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_date_sk#13, d_year#14] +Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Input [11]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (57) Exchange -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#43] (58) Sort [codegen id : 20] -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 (59) Scan parquet default.web_returns @@ -421,80 +421,80 @@ Right keys [2]: [wr_order_number#45, wr_item_sk#44] Join condition: None (65) Project [codegen id : 23] -Output [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#49, CheckOverflow((promote_precision(cast(ws_ext_sales_price#42 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#47, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#50] -Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, d_year#14, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#49, CheckOverflow((promote_precision(cast(ws_ext_sales_price#42 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#47, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#50] +Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (66) Union (67) HashAggregate [codegen id : 24] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] (68) Exchange -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23, 5), true, [id=#51] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23, 5), true, [id=#51] (69) HashAggregate [codegen id : 25] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] (70) HashAggregate [codegen id : 25] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#22, sales_amt#23] -Keys [5]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#22, sales_amt#23] +Keys [5]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] Aggregate Attributes [2]: [sum#52, sum#53] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] (71) Exchange -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] -Arguments: hashpartitioning(d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, 5), true, [id=#56] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#56] (72) HashAggregate [codegen id : 26] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum#54, sum#55] -Keys [5]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] +Keys [5]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#57, sum(UnscaledValue(sales_amt#23))#58] -Results [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sum(cast(sales_cnt#22 as bigint))#57 AS sales_cnt#59, MakeDecimal(sum(UnscaledValue(sales_amt#23))#58,18,2) AS sales_amt#60] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum(cast(sales_cnt#22 as bigint))#57 AS sales_cnt#59, MakeDecimal(sum(UnscaledValue(sales_amt#23))#58,18,2) AS sales_amt#60] (73) Exchange -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60] -Arguments: hashpartitioning(i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, 5), true, [id=#61] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60] +Arguments: hashpartitioning(i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#61] (74) Sort [codegen id : 27] -Input [7]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60] -Arguments: [i_brand_id#2 ASC NULLS FIRST, i_class_id#3 ASC NULLS FIRST, i_category_id#4 ASC NULLS FIRST, i_manufact_id#6 ASC NULLS FIRST], false, 0 +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60] +Arguments: [i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_manufact_id#11 ASC NULLS FIRST], false, 0 -(75) ReusedExchange [Reuses operator id: 5] -Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] - -(76) Scan parquet default.catalog_sales -Output [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +(75) Scan parquet default.catalog_sales +Output [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(77) ColumnarToRow -Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +(76) ColumnarToRow [codegen id : 30] +Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] + +(77) Filter [codegen id : 30] +Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(78) Filter -Input [5]: [cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_sold_date_sk#8)) +(78) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (79) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [i_item_sk#62] -Right keys [1]: [cs_item_sk#9] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#62] Join condition: None (80) Project [codegen id : 30] -Output [9]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] -Input [10]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12] +Output [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Input [10]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (81) Scan parquet default.date_dim Output [2]: [d_date_sk#67, d_year#68] @@ -515,21 +515,21 @@ Input [2]: [d_date_sk#67, d_year#68] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] (85) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [cs_sold_date_sk#8] +Left keys [1]: [cs_sold_date_sk#1] Right keys [1]: [d_date_sk#67] Join condition: None (86) Project [codegen id : 30] -Output [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Input [11]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, cs_sold_date_sk#8, cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, d_date_sk#67, d_year#68] +Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Input [11]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] (87) Exchange -Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cs_order_number#10, cs_item_sk#9, 5), true, [id=#70] +Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), true, [id=#70] (88) Sort [codegen id : 31] -Input [9]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: [cs_order_number#10 ASC NULLS FIRST, cs_item_sk#9 ASC NULLS FIRST], false, 0 +Input [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 (89) ReusedExchange [Reuses operator id: 22] Output [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] @@ -539,13 +539,13 @@ Input [4]: [cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_ Arguments: [cr_order_number#18 ASC NULLS FIRST, cr_item_sk#17 ASC NULLS FIRST], false, 0 (91) SortMergeJoin -Left keys [2]: [cs_order_number#10, cs_item_sk#9] +Left keys [2]: [cs_order_number#3, cs_item_sk#2] Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (92) Project [codegen id : 34] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (cs_quantity#11 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#12 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] -Input [13]: [cs_item_sk#9, cs_order_number#10, cs_quantity#11, cs_ext_sales_price#12, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] +Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (cs_quantity#4 - coalesce(cr_return_quantity#19, 0)) AS sales_cnt#22, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#20, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#23] +Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, cr_item_sk#17, cr_order_number#18, cr_return_quantity#19, cr_return_amount#20] (93) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] @@ -561,7 +561,7 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28] Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) -(96) ReusedExchange [Reuses operator id: 5] +(96) ReusedExchange [Reuses operator id: 8] Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (97) BroadcastHashJoin [codegen id : 37] @@ -643,7 +643,7 @@ Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#4 Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Condition : (isnotnull(ws_item_sk#39) AND isnotnull(ws_sold_date_sk#38)) -(115) ReusedExchange [Reuses operator id: 5] +(115) ReusedExchange [Reuses operator id: 8] Output [5]: [i_item_sk#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (116) BroadcastHashJoin [codegen id : 46] @@ -738,15 +738,15 @@ Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufac Arguments: [i_brand_id#63 ASC NULLS FIRST, i_class_id#64 ASC NULLS FIRST, i_category_id#65 ASC NULLS FIRST, i_manufact_id#66 ASC NULLS FIRST], false, 0 (136) SortMergeJoin [codegen id : 55] -Left keys [4]: [i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6] +Left keys [4]: [i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] Right keys [4]: [i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#59 as decimal(17,2))) / promote_precision(cast(sales_cnt#86 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (137) Project [codegen id : 55] -Output [10]: [d_year#68 AS prev_year#89, d_year#14 AS year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#86 AS prev_yr_cnt#91, sales_cnt#59 AS curr_yr_cnt#92, (sales_cnt#59 - sales_cnt#86) AS sales_cnt_diff#93, CheckOverflow((promote_precision(cast(sales_amt#60 as decimal(19,2))) - promote_precision(cast(sales_amt#87 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#94] -Input [14]: [d_year#14, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, sales_cnt#59, sales_amt#60, d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#86, sales_amt#87] +Output [10]: [d_year#68 AS prev_year#89, d_year#14 AS year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#86 AS prev_yr_cnt#91, sales_cnt#59 AS curr_yr_cnt#92, (sales_cnt#59 - sales_cnt#86) AS sales_cnt_diff#93, CheckOverflow((promote_precision(cast(sales_amt#60 as decimal(19,2))) - promote_precision(cast(sales_amt#87 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#94] +Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#59, sales_amt#60, d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#86, sales_amt#87] (138) TakeOrderedAndProject -Input [10]: [prev_year#89, year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] -Arguments: 100, [sales_cnt_diff#93 ASC NULLS FIRST, sales_amt_diff#94 ASC NULLS FIRST], [prev_year#89, year#90, i_brand_id#2, i_class_id#3, i_category_id#4, i_manufact_id#6, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] +Input [10]: [prev_year#89, year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] +Arguments: 100, [sales_cnt_diff#93 ASC NULLS FIRST, sales_amt_diff#94 ASC NULLS FIRST], [prev_year#89, year#90, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#91, curr_yr_cnt#92, sales_cnt_diff#93, sales_amt_diff#94] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt index 32eadb186fe2b..69f8b6a5b6789 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt @@ -39,8 +39,12 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (3) Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] - BroadcastHashJoin [i_item_sk,cs_item_sk] + Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk,cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] InputAdapter BroadcastExchange #6 WholeStageCodegen (1) @@ -49,10 +53,6 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i ColumnarToRow InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] - Filter [cs_item_sk,cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] InputAdapter BroadcastExchange #7 WholeStageCodegen (2) @@ -166,14 +166,14 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (30) Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] - BroadcastHashJoin [i_item_sk,cs_item_sk] - InputAdapter - ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + Project [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price] + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 InputAdapter BroadcastExchange #18 WholeStageCodegen (29) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt index 940031a0344b2..fc9634469d6df 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt @@ -4,50 +4,50 @@ TakeOrderedAndProject (70) +- * SortMergeJoin Inner (68) :- * Project (46) : +- * SortMergeJoin Inner (45) - : :- * Sort (24) - : : +- * Filter (23) - : : +- * HashAggregate (22) - : : +- Exchange (21) - : : +- * HashAggregate (20) - : : +- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) - : : :- * Project (13) - : : : +- * Filter (12) - : : : +- SortMergeJoin LeftOuter (11) - : : : :- * Sort (5) - : : : : +- Exchange (4) - : : : : +- * Filter (3) - : : : : +- * ColumnarToRow (2) - : : : : +- Scan parquet default.catalog_sales (1) - : : : +- * Sort (10) - : : : +- Exchange (9) - : : : +- * Filter (8) - : : : +- * ColumnarToRow (7) - : : : +- Scan parquet default.catalog_returns (6) - : : +- BroadcastExchange (17) - : : +- * Filter (16) - : : +- * ColumnarToRow (15) - : : +- Scan parquet default.date_dim (14) + : :- * Sort (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (13) + : : : +- * Filter (12) + : : : +- SortMergeJoin LeftOuter (11) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (10) + : : : +- Exchange (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.date_dim (14) : +- * Sort (44) - : +- * HashAggregate (43) - : +- Exchange (42) - : +- * HashAggregate (41) - : +- * Project (40) - : +- * BroadcastHashJoin Inner BuildRight (39) - : :- * Project (37) - : : +- * Filter (36) - : : +- SortMergeJoin LeftOuter (35) - : : :- * Sort (29) - : : : +- Exchange (28) - : : : +- * Filter (27) - : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.store_sales (25) - : : +- * Sort (34) - : : +- Exchange (33) - : : +- * Filter (32) - : : +- * ColumnarToRow (31) - : : +- Scan parquet default.store_returns (30) - : +- ReusedExchange (38) + : +- * Filter (43) + : +- * HashAggregate (42) + : +- Exchange (41) + : +- * HashAggregate (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * Project (36) + : : +- * Filter (35) + : : +- SortMergeJoin LeftOuter (34) + : : :- * Sort (28) + : : : +- Exchange (27) + : : : +- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.catalog_sales (24) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.catalog_returns (29) + : +- ReusedExchange (37) +- * Sort (67) +- * Filter (66) +- * HashAggregate (65) @@ -71,68 +71,68 @@ TakeOrderedAndProject (70) +- ReusedExchange (60) -(1) Scan parquet default.catalog_sales -Output [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +(1) Scan parquet default.store_sales +Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct (2) ColumnarToRow [codegen id : 1] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] (3) Filter [codegen id : 1] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Condition : ((isnotnull(cs_sold_date_sk#1) AND isnotnull(cs_item_sk#3)) AND isnotnull(cs_bill_customer_sk#2)) +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3)) (4) Exchange -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Arguments: hashpartitioning(cs_order_number#4, cs_item_sk#3, 5), true, [id=#8] +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint), 5), true, [id=#8] (5) Sort [codegen id : 2] -Input [7]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Arguments: [cs_order_number#4 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST], false, 0 +Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST], false, 0 -(6) Scan parquet default.catalog_returns -Output [2]: [cr_item_sk#9, cr_order_number#10] +(6) Scan parquet default.store_returns +Output [2]: [sr_item_sk#9, sr_ticket_number#10] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_returns] -PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct (7) ColumnarToRow [codegen id : 3] -Input [2]: [cr_item_sk#9, cr_order_number#10] +Input [2]: [sr_item_sk#9, sr_ticket_number#10] (8) Filter [codegen id : 3] -Input [2]: [cr_item_sk#9, cr_order_number#10] -Condition : (isnotnull(cr_order_number#10) AND isnotnull(cr_item_sk#9)) +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9)) (9) Exchange -Input [2]: [cr_item_sk#9, cr_order_number#10] -Arguments: hashpartitioning(cr_order_number#10, cr_item_sk#9, 5), true, [id=#11] +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Arguments: hashpartitioning(sr_ticket_number#10, sr_item_sk#9, 5), true, [id=#11] (10) Sort [codegen id : 4] -Input [2]: [cr_item_sk#9, cr_order_number#10] -Arguments: [cr_order_number#10 ASC NULLS FIRST, cr_item_sk#9 ASC NULLS FIRST], false, 0 +Input [2]: [sr_item_sk#9, sr_ticket_number#10] +Arguments: [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST], false, 0 (11) SortMergeJoin -Left keys [2]: [cs_order_number#4, cs_item_sk#3] -Right keys [2]: [cr_order_number#10, cr_item_sk#9] +Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint)] +Right keys [2]: [sr_ticket_number#10, sr_item_sk#9] Join condition: None (12) Filter [codegen id : 6] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] -Condition : isnull(cr_order_number#10) +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] +Condition : isnull(sr_ticket_number#10) (13) Project [codegen id : 6] -Output [6]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7] -Input [9]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_order_number#4, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, cr_item_sk#9, cr_order_number#10] +Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10] (14) Scan parquet default.date_dim Output [2]: [d_date_sk#12, d_year#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date_sk), EqualTo(d_year,2000), IsNotNull(d_year)] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] ReadSchema: struct (15) ColumnarToRow [codegen id : 5] @@ -140,146 +140,146 @@ Input [2]: [d_date_sk#12, d_year#13] (16) Filter [codegen id : 5] Input [2]: [d_date_sk#12, d_year#13] -Condition : ((isnotnull(d_date_sk#12) AND (d_year#13 = 2000)) AND isnotnull(d_year#13)) +Condition : ((isnotnull(d_year#13) AND (d_year#13 = 2000)) AND isnotnull(d_date_sk#12)) (17) BroadcastExchange Input [2]: [d_date_sk#12, d_year#13] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#1] +Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] -Input [8]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_date_sk#12, d_year#13] +Output [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_date_sk#12, d_year#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#5, cs_wholesale_cost#6, cs_sales_price#7, d_year#13] -Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] -Functions [3]: [partial_sum(cast(cs_quantity#5 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#6)), partial_sum(UnscaledValue(cs_sales_price#7))] +Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13] +Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] +Functions [3]: [partial_sum(cast(ss_quantity#5 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#6)), partial_sum(UnscaledValue(ss_sales_price#7))] Aggregate Attributes [3]: [sum#15, sum#16, sum#17] -Results [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] +Results [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] (21) Exchange -Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] -Arguments: hashpartitioning(d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, 5), true, [id=#21] +Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Arguments: hashpartitioning(d_year#13, ss_item_sk#2, ss_customer_sk#3, 5), true, [id=#21] (22) HashAggregate [codegen id : 7] -Input [6]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2, sum#18, sum#19, sum#20] -Keys [3]: [d_year#13, cs_item_sk#3, cs_bill_customer_sk#2] -Functions [3]: [sum(cast(cs_quantity#5 as bigint)), sum(UnscaledValue(cs_wholesale_cost#6)), sum(UnscaledValue(cs_sales_price#7))] -Aggregate Attributes [3]: [sum(cast(cs_quantity#5 as bigint))#22, sum(UnscaledValue(cs_wholesale_cost#6))#23, sum(UnscaledValue(cs_sales_price#7))#24] -Results [6]: [d_year#13 AS cs_sold_year#25, cs_item_sk#3, cs_bill_customer_sk#2 AS cs_customer_sk#26, sum(cast(cs_quantity#5 as bigint))#22 AS cs_qty#27, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#6))#23,17,2) AS cs_wc#28, MakeDecimal(sum(UnscaledValue(cs_sales_price#7))#24,17,2) AS cs_sp#29] - -(23) Filter [codegen id : 7] -Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] -Condition : (coalesce(cs_qty#27, 0) > 0) - -(24) Sort [codegen id : 7] -Input [6]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29] -Arguments: [cs_sold_year#25 ASC NULLS FIRST, cs_item_sk#3 ASC NULLS FIRST, cs_customer_sk#26 ASC NULLS FIRST], false, 0 - -(25) Scan parquet default.store_sales -Output [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20] +Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3] +Functions [3]: [sum(cast(ss_quantity#5 as bigint)), sum(UnscaledValue(ss_wholesale_cost#6)), sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [3]: [sum(cast(ss_quantity#5 as bigint))#22, sum(UnscaledValue(ss_wholesale_cost#6))#23, sum(UnscaledValue(ss_sales_price#7))#24] +Results [6]: [d_year#13 AS ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, sum(cast(ss_quantity#5 as bigint))#22 AS ss_qty#26, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#6))#23,17,2) AS ss_wc#27, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#24,17,2) AS ss_sp#28] + +(23) Sort [codegen id : 7] +Input [6]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] +Arguments: [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_sales] -PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct -(26) ColumnarToRow [codegen id : 8] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] +(25) ColumnarToRow [codegen id : 8] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] -(27) Filter [codegen id : 8] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Condition : ((isnotnull(ss_sold_date_sk#30) AND isnotnull(ss_item_sk#31)) AND isnotnull(ss_customer_sk#32)) +(26) Filter [codegen id : 8] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Condition : ((isnotnull(cs_sold_date_sk#29) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_bill_customer_sk#30)) -(28) Exchange -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Arguments: hashpartitioning(cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint), 5), true, [id=#37] +(27) Exchange +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Arguments: hashpartitioning(cs_order_number#32, cs_item_sk#31, 5), true, [id=#36] -(29) Sort [codegen id : 9] -Input [7]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Arguments: [cast(ss_ticket_number#33 as bigint) ASC NULLS FIRST, cast(ss_item_sk#31 as bigint) ASC NULLS FIRST], false, 0 +(28) Sort [codegen id : 9] +Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Arguments: [cs_order_number#32 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST], false, 0 -(30) Scan parquet default.store_returns -Output [2]: [sr_item_sk#38, sr_ticket_number#39] +(29) Scan parquet default.catalog_returns +Output [2]: [cr_item_sk#37, cr_order_number#38] Batched: true -Location [not included in comparison]/{warehouse_dir}/store_returns] -PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct -(31) ColumnarToRow [codegen id : 10] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] +(30) ColumnarToRow [codegen id : 10] +Input [2]: [cr_item_sk#37, cr_order_number#38] -(32) Filter [codegen id : 10] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Condition : (isnotnull(sr_ticket_number#39) AND isnotnull(sr_item_sk#38)) +(31) Filter [codegen id : 10] +Input [2]: [cr_item_sk#37, cr_order_number#38] +Condition : (isnotnull(cr_order_number#38) AND isnotnull(cr_item_sk#37)) -(33) Exchange -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Arguments: hashpartitioning(sr_ticket_number#39, sr_item_sk#38, 5), true, [id=#40] +(32) Exchange +Input [2]: [cr_item_sk#37, cr_order_number#38] +Arguments: hashpartitioning(cr_order_number#38, cr_item_sk#37, 5), true, [id=#39] -(34) Sort [codegen id : 11] -Input [2]: [sr_item_sk#38, sr_ticket_number#39] -Arguments: [sr_ticket_number#39 ASC NULLS FIRST, sr_item_sk#38 ASC NULLS FIRST], false, 0 +(33) Sort [codegen id : 11] +Input [2]: [cr_item_sk#37, cr_order_number#38] +Arguments: [cr_order_number#38 ASC NULLS FIRST, cr_item_sk#37 ASC NULLS FIRST], false, 0 -(35) SortMergeJoin -Left keys [2]: [cast(ss_ticket_number#33 as bigint), cast(ss_item_sk#31 as bigint)] -Right keys [2]: [sr_ticket_number#39, sr_item_sk#38] +(34) SortMergeJoin +Left keys [2]: [cs_order_number#32, cs_item_sk#31] +Right keys [2]: [cr_order_number#38, cr_item_sk#37] Join condition: None -(36) Filter [codegen id : 13] -Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] -Condition : isnull(sr_ticket_number#39) +(35) Filter [codegen id : 13] +Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] +Condition : isnull(cr_order_number#38) -(37) Project [codegen id : 13] -Output [6]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36] -Input [9]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_ticket_number#33, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, sr_item_sk#38, sr_ticket_number#39] +(36) Project [codegen id : 13] +Output [6]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35] +Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38] -(38) ReusedExchange [Reuses operator id: 17] +(37) ReusedExchange [Reuses operator id: 17] Output [2]: [d_date_sk#12, d_year#13] -(39) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [ss_sold_date_sk#30] +(38) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [cs_sold_date_sk#29] Right keys [1]: [d_date_sk#12] Join condition: None -(40) Project [codegen id : 13] -Output [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] -Input [8]: [ss_sold_date_sk#30, ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_date_sk#12, d_year#13] +(39) Project [codegen id : 13] +Output [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] +Input [8]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_date_sk#12, d_year#13] + +(40) HashAggregate [codegen id : 13] +Input [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13] +Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] +Functions [3]: [partial_sum(cast(cs_quantity#33 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#34)), partial_sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [3]: [sum#40, sum#41, sum#42] +Results [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] -(41) HashAggregate [codegen id : 13] -Input [6]: [ss_item_sk#31, ss_customer_sk#32, ss_quantity#34, ss_wholesale_cost#35, ss_sales_price#36, d_year#13] -Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] -Functions [3]: [partial_sum(cast(ss_quantity#34 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#35)), partial_sum(UnscaledValue(ss_sales_price#36))] -Aggregate Attributes [3]: [sum#41, sum#42, sum#43] -Results [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] +(41) Exchange +Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +Arguments: hashpartitioning(d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, 5), true, [id=#46] -(42) Exchange -Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -Arguments: hashpartitioning(d_year#13, ss_item_sk#31, ss_customer_sk#32, 5), true, [id=#47] +(42) HashAggregate [codegen id : 14] +Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45] +Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30] +Functions [3]: [sum(cast(cs_quantity#33 as bigint)), sum(UnscaledValue(cs_wholesale_cost#34)), sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [3]: [sum(cast(cs_quantity#33 as bigint))#47, sum(UnscaledValue(cs_wholesale_cost#34))#48, sum(UnscaledValue(cs_sales_price#35))#49] +Results [6]: [d_year#13 AS cs_sold_year#50, cs_item_sk#31, cs_bill_customer_sk#30 AS cs_customer_sk#51, sum(cast(cs_quantity#33 as bigint))#47 AS cs_qty#52, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#34))#48,17,2) AS cs_wc#53, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#49,17,2) AS cs_sp#54] -(43) HashAggregate [codegen id : 14] -Input [6]: [d_year#13, ss_item_sk#31, ss_customer_sk#32, sum#44, sum#45, sum#46] -Keys [3]: [d_year#13, ss_item_sk#31, ss_customer_sk#32] -Functions [3]: [sum(cast(ss_quantity#34 as bigint)), sum(UnscaledValue(ss_wholesale_cost#35)), sum(UnscaledValue(ss_sales_price#36))] -Aggregate Attributes [3]: [sum(cast(ss_quantity#34 as bigint))#48, sum(UnscaledValue(ss_wholesale_cost#35))#49, sum(UnscaledValue(ss_sales_price#36))#50] -Results [6]: [d_year#13 AS ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, sum(cast(ss_quantity#34 as bigint))#48 AS ss_qty#52, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#35))#49,17,2) AS ss_wc#53, MakeDecimal(sum(UnscaledValue(ss_sales_price#36))#50,17,2) AS ss_sp#54] +(43) Filter [codegen id : 14] +Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Condition : (coalesce(cs_qty#52, 0) > 0) (44) Sort [codegen id : 14] -Input [6]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Arguments: [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST], false, 0 +Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] +Arguments: [cs_sold_year#50 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST, cs_customer_sk#51 ASC NULLS FIRST], false, 0 (45) SortMergeJoin [codegen id : 15] -Left keys [3]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26] -Right keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] +Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] +Right keys [3]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51] Join condition: None (46) Project [codegen id : 15] -Output [9]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Input [12]: [cs_sold_year#25, cs_item_sk#3, cs_customer_sk#26, cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] +Output [9]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54] +Input [12]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54] (47) Scan parquet default.web_sales Output [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61] @@ -377,15 +377,15 @@ Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc# Arguments: [ws_sold_year#76 ASC NULLS FIRST, ws_item_sk#56 ASC NULLS FIRST, ws_customer_sk#77 ASC NULLS FIRST], false, 0 (68) SortMergeJoin [codegen id : 23] -Left keys [3]: [ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32] +Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3] Right keys [3]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77] Join condition: None (69) Project [codegen id : 23] -Output [13]: [round((cast(ss_qty#52 as double) / cast(coalesce((ws_qty#78 + cs_qty#27), 1) as double)), 2) AS ratio#81, ss_qty#52 AS store_qty#82, ss_wc#53 AS store_wholesale_cost#83, ss_sp#54 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#27, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#28, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#29, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Input [15]: [cs_qty#27, cs_wc#28, cs_sp#29, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] +Output [13]: [round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) AS ratio#81, ss_qty#26 AS store_qty#82, ss_wc#27 AS store_wholesale_cost#83, ss_sp#28 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#52, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#53, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#54, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] +Input [15]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80] (70) TakeOrderedAndProject -Input [13]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_sold_year#51, ss_item_sk#31, ss_customer_sk#32, ss_qty#52, ss_wc#53, ss_sp#54] -Arguments: 100, [ss_sold_year#51 ASC NULLS FIRST, ss_item_sk#31 ASC NULLS FIRST, ss_customer_sk#32 ASC NULLS FIRST, ss_qty#52 DESC NULLS LAST, ss_wc#53 DESC NULLS LAST, ss_sp#54 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, ratio#81 ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] +Input [13]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28] +Arguments: 100, [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST, ss_qty#26 DESC NULLS LAST, ss_wc#27 DESC NULLS LAST, ss_sp#28 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, ratio#81 ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt index 184f9d9b2d8d9..097d27131cb21 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt @@ -4,16 +4,55 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] InputAdapter WholeStageCodegen (15) - Project [cs_qty,cs_wc,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp] - SortMergeJoin [cs_sold_year,cs_item_sk,cs_customer_sk,ss_sold_year,ss_item_sk,ss_customer_sk] + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,cs_qty,cs_wc,cs_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] InputAdapter WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] + Filter [sr_ticket_number] + InputAdapter + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #3 + WholeStageCodegen (3) + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) Sort [cs_sold_year,cs_item_sk,cs_customer_sk] Filter [cs_qty] HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cast(cs_quantity as bigint)),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] InputAdapter - Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #1 - WholeStageCodegen (6) + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #5 + WholeStageCodegen (13) HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] @@ -21,65 +60,26 @@ TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp Filter [cr_order_number] InputAdapter SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] - WholeStageCodegen (2) + WholeStageCodegen (9) Sort [cs_order_number,cs_item_sk] InputAdapter - Exchange [cs_order_number,cs_item_sk] #2 - WholeStageCodegen (1) + Exchange [cs_order_number,cs_item_sk] #6 + WholeStageCodegen (8) Filter [cs_sold_date_sk,cs_item_sk,cs_bill_customer_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price] - WholeStageCodegen (4) + WholeStageCodegen (11) Sort [cr_order_number,cr_item_sk] InputAdapter - Exchange [cr_order_number,cr_item_sk] #3 - WholeStageCodegen (3) + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (10) Filter [cr_order_number,cr_item_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_returns [cr_item_sk,cr_order_number] InputAdapter - BroadcastExchange #4 - WholeStageCodegen (5) - Filter [d_date_sk,d_year] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (14) - Sort [ss_sold_year,ss_item_sk,ss_customer_sk] - HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(cast(ss_quantity as bigint)),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] - InputAdapter - Exchange [d_year,ss_item_sk,ss_customer_sk] #5 - WholeStageCodegen (13) - HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] - Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] - Filter [sr_ticket_number] - InputAdapter - SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] - WholeStageCodegen (9) - Sort [ss_ticket_number,ss_item_sk] - InputAdapter - Exchange [ss_ticket_number,ss_item_sk] #6 - WholeStageCodegen (8) - Filter [ss_sold_date_sk,ss_item_sk,ss_customer_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price] - WholeStageCodegen (11) - Sort [sr_ticket_number,sr_item_sk] - InputAdapter - Exchange [sr_ticket_number,sr_item_sk] #7 - WholeStageCodegen (10) - Filter [sr_ticket_number,sr_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number] - InputAdapter - ReusedExchange [d_date_sk,d_year] #4 + ReusedExchange [d_date_sk,d_year] #4 InputAdapter WholeStageCodegen (22) Sort [ws_sold_year,ws_item_sk,ws_customer_sk] From c9028ad4bf0fabfac5deeb87b13b610c1ff13904 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Sun, 27 Sep 2020 23:47:19 +0300 Subject: [PATCH 05/11] make CostBasedJoinReorder idempotent --- .../optimizer/CostBasedJoinReorder.scala | 10 +- .../StarJoinCostBasedReorderSuite.scala | 8 +- .../approved-plans-v1_4/q12.sf100/explain.txt | 174 +++++++------- .../q12.sf100/simplified.txt | 52 ++-- .../approved-plans-v1_4/q16.sf100/explain.txt | 62 ++--- .../q16.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q20.sf100/explain.txt | 174 +++++++------- .../q20.sf100/simplified.txt | 52 ++-- .../approved-plans-v1_4/q22.sf100/explain.txt | 92 +++---- .../q22.sf100/simplified.txt | 24 +- .../approved-plans-v1_4/q26.sf100/explain.txt | 64 ++--- .../q26.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q6.sf100/explain.txt | 224 +++++++++--------- .../q6.sf100/simplified.txt | 74 +++--- .../approved-plans-v1_4/q61.sf100/explain.txt | 72 +++--- .../q61.sf100/simplified.txt | 20 +- .../approved-plans-v1_4/q7.sf100/explain.txt | 64 ++--- .../q7.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 98 ++++---- .../q80.sf100/simplified.txt | 38 +-- .../approved-plans-v1_4/q94.sf100/explain.txt | 62 ++--- .../q94.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q95.sf100/explain.txt | 62 ++--- .../q95.sf100/simplified.txt | 18 +- .../approved-plans-v1_4/q98.sf100/explain.txt | 182 +++++++------- .../q98.sf100/simplified.txt | 52 ++-- .../approved-plans-v2_7/q12.sf100/explain.txt | 174 +++++++------- .../q12.sf100/simplified.txt | 52 ++-- .../approved-plans-v2_7/q20.sf100/explain.txt | 174 +++++++------- .../q20.sf100/simplified.txt | 52 ++-- .../q22a.sf100/explain.txt | 92 +++---- .../q22a.sf100/simplified.txt | 24 +- .../q27a.sf100/explain.txt | 76 +++--- .../q27a.sf100/simplified.txt | 32 +-- .../approved-plans-v2_7/q6.sf100/explain.txt | 224 +++++++++--------- .../q6.sf100/simplified.txt | 74 +++--- .../q80a.sf100/explain.txt | 98 ++++---- .../q80a.sf100/simplified.txt | 38 +-- .../approved-plans-v2_7/q98.sf100/explain.txt | 178 +++++++------- .../q98.sf100/simplified.txt | 52 ++-- 40 files changed, 1546 insertions(+), 1544 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala index 8b019f35263f3..51ecf781906ab 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala @@ -206,13 +206,15 @@ object JoinReorderDP extends PredicateHelper with Logging { filters: Option[JoinGraphInfo]): JoinPlanMap = { val nextLevel = new JoinPlanMap - var k = 0 val lev = existingLevels.length - 1 + var k = lev // Build plans for the next level from plans at level k (one side of the join) and level // lev - k (the other side of the join). - // For the lower level k, we only need to search from 0 to lev - k, because when building + // For the higher level k, we only need to search from lev to lev - k, because when building // a join from A and B, both A J B and B J A are handled. - while (k <= lev - k) { + // Start searching from highest level to make sure that optimally ordered input doesn't get + // reordered into another plan with the same cost. + while (k >= lev - k) { val oneSideCandidates = existingLevels(k).values.toSeq for (i <- oneSideCandidates.indices) { val oneSidePlan = oneSideCandidates(i) @@ -236,7 +238,7 @@ object JoinReorderDP extends PredicateHelper with Logging { } } } - k += 1 + k -= 1 } nextLevel } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala index 0bb12cd873ef8..3d07956fa1b50 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/StarJoinCostBasedReorderSuite.scala @@ -345,8 +345,8 @@ class StarJoinCostBasedReorderSuite extends JoinReorderPlanTestBase with StatsEs val expected = f1.join(d3, Inner, Some(nameToAttr("f1_fk3") === nameToAttr("d3_pk"))) - .join(d2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("d2_pk"))) .join(d1, Inner, Some(nameToAttr("f1_fk1") === nameToAttr("d1_pk"))) + .join(d2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("d2_pk"))) .join(t4.join(t3, Inner, Some(nameToAttr("t3_c2") === nameToAttr("t4_c2"))), Inner, Some(nameToAttr("d1_c2") === nameToAttr("t3_c1"))) .join(t2.join(t1, Inner, Some(nameToAttr("t1_c2") === nameToAttr("t2_c2"))), Inner, @@ -380,8 +380,8 @@ class StarJoinCostBasedReorderSuite extends JoinReorderPlanTestBase with StatsEs val expected = f1.join(d3, Inner, Some(nameToAttr("f1_fk3") === nameToAttr("d3_pk"))) - .join(d2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("d2_pk"))) .join(d1, Inner, Some(nameToAttr("f1_fk1") === nameToAttr("d1_pk"))) + .join(d2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("d2_pk"))) .select(outputsOf(d1, d2, f1, d3): _*) assertEqualJoinPlans(Optimize, query, expected) @@ -405,8 +405,8 @@ class StarJoinCostBasedReorderSuite extends JoinReorderPlanTestBase with StatsEs (nameToAttr("f1_fk3") === nameToAttr("t3_c1"))) val expected = - f1.join(t3, Inner, Some(nameToAttr("f1_fk3") === nameToAttr("t3_c1"))) - .join(t2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("t2_c1"))) + f1.join(t2, Inner, Some(nameToAttr("f1_fk2") === nameToAttr("t2_c1"))) + .join(t3, Inner, Some(nameToAttr("f1_fk3") === nameToAttr("t3_c1"))) .join(t1, Inner, Some(nameToAttr("f1_fk1") === nameToAttr("t1_c1"))) .select(outputsOf(t1, f1, t2, t3): _*) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt index b4dd8173664b6..d6da0e09de6be 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt index e9b94a6b4651c..2207b0fee23ce 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (2) - Project [ws_item_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (1) Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt index 509fb0133095b..d7e8e52208058 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -37,12 +37,12 @@ TakeOrderedAndProject (44) : +- * Project (28) : +- * Filter (27) : +- * ColumnarToRow (26) - : +- Scan parquet default.call_center (25) + : +- Scan parquet default.date_dim (25) +- BroadcastExchange (36) +- * Project (35) +- * Filter (34) +- * ColumnarToRow (33) - +- Scan parquet default.date_dim (32) + +- Scan parquet default.call_center (32) (1) Scan parquet default.catalog_sales @@ -150,67 +150,67 @@ Join condition: None Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#14] -(25) Scan parquet default.call_center -Output [2]: [cc_call_center_sk#17, cc_county#18] +(25) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/call_center] -PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (26) ColumnarToRow [codegen id : 9] -Input [2]: [cc_call_center_sk#17, cc_county#18] +Input [2]: [d_date_sk#17, d_date#18] (27) Filter [codegen id : 9] -Input [2]: [cc_call_center_sk#17, cc_county#18] -Condition : ((isnotnull(cc_county#18) AND (cc_county#18 = Williamson County)) AND isnotnull(cc_call_center_sk#17)) +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 11719)) AND (d_date#18 <= 11779)) AND isnotnull(d_date_sk#17)) (28) Project [codegen id : 9] -Output [1]: [cc_call_center_sk#17] -Input [2]: [cc_call_center_sk#17, cc_county#18] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] (29) BroadcastExchange -Input [1]: [cc_call_center_sk#17] +Input [1]: [d_date_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (30) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_call_center_sk#3] -Right keys [1]: [cc_call_center_sk#17] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#17] Join condition: None (31) Project [codegen id : 11] -Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#17] +Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#17] -(32) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_date#21] +(32) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#20, cc_county#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] +ReadSchema: struct (33) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#20, d_date#21] +Input [2]: [cc_call_center_sk#20, cc_county#21] (34) Filter [codegen id : 10] -Input [2]: [d_date_sk#20, d_date#21] -Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 11719)) AND (d_date#21 <= 11779)) AND isnotnull(d_date_sk#20)) +Input [2]: [cc_call_center_sk#20, cc_county#21] +Condition : ((isnotnull(cc_county#21) AND (cc_county#21 = Williamson County)) AND isnotnull(cc_call_center_sk#20)) (35) Project [codegen id : 10] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_date#21] +Output [1]: [cc_call_center_sk#20] +Input [2]: [cc_call_center_sk#20, cc_county#21] (36) BroadcastExchange -Input [1]: [d_date_sk#20] +Input [1]: [cc_call_center_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_ship_date_sk#1] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#20] Join condition: None (38) Project [codegen id : 11] Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#20] +Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#20] (39) HashAggregate [codegen id : 11] Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt index ea9a0b27ff700..d2b88a409c0ab 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt @@ -8,9 +8,9 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] Project [cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_ship_date_sk,d_date_sk] - Project [cs_ship_date_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] - BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] Project [cs_ship_date_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk] InputAdapter @@ -56,16 +56,16 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] InputAdapter BroadcastExchange #6 WholeStageCodegen (9) - Project [cc_call_center_sk] - Filter [cc_county,cc_call_center_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.call_center [cc_call_center_sk,cc_county] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #7 WholeStageCodegen (10) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [cc_call_center_sk] + Filter [cc_county,cc_call_center_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.call_center [cc_call_center_sk,cc_county] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt index 2ef3660bc7ba4..3a4c1989fec9e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.catalog_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt index 1e8ab18f5e21a..965b68218eb0a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [cs_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (2) - Project [cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt index a405f658951d3..9319644f52d16 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt @@ -10,20 +10,20 @@ TakeOrderedAndProject (30) : +- Exchange (17) : +- * Project (16) : +- * BroadcastHashJoin Inner BuildRight (15) - : :- * Project (9) - : : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) : : :- * Filter (3) : : : +- * ColumnarToRow (2) : : : +- Scan parquet default.inventory (1) - : : +- BroadcastExchange (7) - : : +- * Filter (6) - : : +- * ColumnarToRow (5) - : : +- Scan parquet default.warehouse (4) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (14) - : +- * Project (13) - : +- * Filter (12) - : +- * ColumnarToRow (11) - : +- Scan parquet default.date_dim (10) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.warehouse (11) +- * Sort (23) +- Exchange (22) +- * Filter (21) @@ -45,63 +45,63 @@ Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_ha Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) -(4) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#5] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [1]: [w_warehouse_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] (6) Filter [codegen id : 1] -Input [1]: [w_warehouse_sk#5] -Condition : isnotnull(w_warehouse_sk#5) +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) -(7) BroadcastExchange -Input [1]: [w_warehouse_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] -(8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#3] -Right keys [1]: [w_warehouse_sk#5] +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None -(9) Project [codegen id : 3] -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] -Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] +(10) Project [codegen id : 3] +Output [3]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5] -(10) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_month_seq#8] +(11) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] -ReadSchema: struct - -(11) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct -(12) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] -Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1200)) AND (d_month_seq#8 <= 1211)) AND isnotnull(d_date_sk#7)) +(12) ColumnarToRow [codegen id : 2] +Input [1]: [w_warehouse_sk#8] -(13) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_month_seq#8] +(13) Filter [codegen id : 2] +Input [1]: [w_warehouse_sk#8] +Condition : isnotnull(w_warehouse_sk#8) (14) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +Input [1]: [w_warehouse_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [inv_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#8] Join condition: None (16) Project [codegen id : 3] Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] +Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#8] (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt index 2c4258c9d48e6..484a6d5dd2288 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt @@ -15,9 +15,9 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter @@ -25,18 +25,18 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt index 2a366c86fb264..366af10af1f32 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt @@ -23,12 +23,12 @@ TakeOrderedAndProject (34) : : +- * Project (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) - : : +- Scan parquet default.promotion (11) + : : +- Scan parquet default.date_dim (11) : +- BroadcastExchange (22) : +- * Project (21) : +- * Filter (20) : +- * ColumnarToRow (19) - : +- Scan parquet default.date_dim (18) + : +- Scan parquet default.promotion (18) +- BroadcastExchange (28) +- * Filter (27) +- * ColumnarToRow (26) @@ -80,67 +80,67 @@ Join condition: None Output [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] Input [9]: [cs_sold_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, cd_demo_sk#9] -(11) Scan parquet default.promotion -Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] Batched: true -Location [not included in comparison]/{warehouse_dir}/promotion] -PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct (12) ColumnarToRow [codegen id : 2] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +Input [2]: [d_date_sk#14, d_year#15] (13) Filter [codegen id : 2] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] -Condition : (((p_channel_email#15 = N) OR (p_channel_event#16 = N)) AND isnotnull(p_promo_sk#14)) +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) (14) Project [codegen id : 2] -Output [1]: [p_promo_sk#14] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] (15) BroadcastExchange -Input [1]: [p_promo_sk#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_promo_sk#4] -Right keys [1]: [p_promo_sk#14] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Input [8]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, p_promo_sk#14] +Output [6]: [cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] +Input [8]: [cs_sold_date_sk#1, cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, d_date_sk#14] -(18) Scan parquet default.date_dim -Output [2]: [d_date_sk#18, d_year#19] +(18) Scan parquet default.promotion +Output [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct (19) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#18, d_year#19] +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] (20) Filter [codegen id : 3] -Input [2]: [d_date_sk#18, d_year#19] -Condition : ((isnotnull(d_year#19) AND (d_year#19 = 2000)) AND isnotnull(d_date_sk#18)) +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] +Condition : (((p_channel_email#18 = N) OR (p_channel_event#19 = N)) AND isnotnull(p_promo_sk#17)) (21) Project [codegen id : 3] -Output [1]: [d_date_sk#18] -Input [2]: [d_date_sk#18, d_year#19] +Output [1]: [p_promo_sk#17] +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] (22) BroadcastExchange -Input [1]: [d_date_sk#18] +Input [1]: [p_promo_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#18] +Left keys [1]: [cs_promo_sk#4] +Right keys [1]: [p_promo_sk#17] Join condition: None (24) Project [codegen id : 5] Output [5]: [cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8] -Input [7]: [cs_sold_date_sk#1, cs_item_sk#3, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, d_date_sk#18] +Input [7]: [cs_item_sk#3, cs_promo_sk#4, cs_quantity#5, cs_list_price#6, cs_sales_price#7, cs_coupon_amt#8, p_promo_sk#17] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt index d4ae376d5b425..0ab5710e0c7e8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt @@ -8,9 +8,9 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,i_item_id] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] - BroadcastHashJoin [cs_promo_sk,p_promo_sk] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Project [cs_sold_date_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] Filter [cs_bill_cdemo_sk,cs_sold_date_sk,cs_item_sk,cs_promo_sk] @@ -28,19 +28,19 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) - Project [p_promo_sk] - Filter [p_channel_email,p_channel_event,p_promo_sk] + Project [d_date_sk] + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (3) - Project [d_date_sk] - Filter [d_year,d_date_sk] + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] InputAdapter BroadcastExchange #5 WholeStageCodegen (4) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt index 675cff99ad729..511e1b46cd7a7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt @@ -11,30 +11,30 @@ TakeOrderedAndProject (50) : +- Exchange (27) : +- * Project (26) : +- * BroadcastHashJoin Inner BuildRight (25) - : :- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) : : :- * Filter (3) : : : +- * ColumnarToRow (2) : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (17) - : : +- * Project (16) - : : +- * Filter (15) - : : +- * BroadcastHashJoin LeftOuter BuildRight (14) - : : :- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.item (4) - : : +- BroadcastExchange (13) - : : +- * HashAggregate (12) - : : +- Exchange (11) - : : +- * HashAggregate (10) - : : +- * Filter (9) - : : +- * ColumnarToRow (8) - : : +- Scan parquet default.item (7) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (24) : +- * Project (23) : +- * Filter (22) - : +- * ColumnarToRow (21) - : +- Scan parquet default.date_dim (20) + : +- * BroadcastHashJoin LeftOuter BuildRight (21) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (20) + : +- * HashAggregate (19) + : +- Exchange (18) + : +- * HashAggregate (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.item (14) +- * Sort (42) +- Exchange (41) +- * Project (40) @@ -65,112 +65,112 @@ Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3] Condition : ((isnotnull(ss_customer_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) -(4) Scan parquet default.item -Output [3]: [i_item_sk#4, i_current_price#5, i_category#6] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_month_seq#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#4, i_current_price#5, i_category#6] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] -(6) Filter [codegen id : 3] -Input [3]: [i_item_sk#4, i_current_price#5, i_category#6] -Condition : (isnotnull(i_current_price#5) AND isnotnull(i_item_sk#4)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] +Condition : ((isnotnull(d_month_seq#5) AND (d_month_seq#5 = Subquery scalar-subquery#6, [id=#7])) AND isnotnull(d_date_sk#4)) -(7) Scan parquet default.item -Output [2]: [i_current_price#5, i_category#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_category)] -ReadSchema: struct +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_month_seq#5] -(8) ColumnarToRow [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] - -(9) Filter [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] -Condition : isnotnull(i_category#6) - -(10) HashAggregate [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] -Keys [1]: [i_category#6] -Functions [1]: [partial_avg(UnscaledValue(i_current_price#5))] -Aggregate Attributes [2]: [sum#7, count#8] -Results [3]: [i_category#6, sum#9, count#10] - -(11) Exchange -Input [3]: [i_category#6, sum#9, count#10] -Arguments: hashpartitioning(i_category#6, 5), true, [id=#11] - -(12) HashAggregate [codegen id : 2] -Input [3]: [i_category#6, sum#9, count#10] -Keys [1]: [i_category#6] -Functions [1]: [avg(UnscaledValue(i_current_price#5))] -Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#5))#12] -Results [2]: [cast((avg(UnscaledValue(i_current_price#5))#12 / 100.0) as decimal(11,6)) AS avg(i_current_price)#13, i_category#6 AS i_category#6#14] - -(13) BroadcastExchange -Input [2]: [avg(i_current_price)#13, i_category#6#14] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#15] - -(14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_category#6] -Right keys [1]: [i_category#6#14] -Join condition: None +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] -(15) Filter [codegen id : 3] -Input [5]: [i_item_sk#4, i_current_price#5, i_category#6, avg(i_current_price)#13, i_category#6#14] -Condition : (cast(i_current_price#5 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#13)), DecimalType(14,7), true)) +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] +Join condition: None -(16) Project [codegen id : 3] -Output [1]: [i_item_sk#4] -Input [5]: [i_item_sk#4, i_current_price#5, i_category#6, avg(i_current_price)#13, i_category#6#14] +(10) Project [codegen id : 5] +Output [2]: [ss_item_sk#2, ss_customer_sk#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, d_date_sk#4] -(17) BroadcastExchange -Input [1]: [i_item_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +(11) Scan parquet default.item +Output [3]: [i_item_sk#9, i_current_price#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct -(18) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] -Join condition: None +(12) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#9, i_current_price#10, i_category#11] -(19) Project [codegen id : 5] -Output [2]: [ss_sold_date_sk#1, ss_customer_sk#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, i_item_sk#4] +(13) Filter [codegen id : 4] +Input [3]: [i_item_sk#9, i_current_price#10, i_category#11] +Condition : (isnotnull(i_current_price#10) AND isnotnull(i_item_sk#9)) -(20) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_month_seq#18] +(14) Scan parquet default.item +Output [2]: [i_current_price#10, i_category#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct -(21) ColumnarToRow [codegen id : 4] -Input [2]: [d_date_sk#17, d_month_seq#18] +(15) ColumnarToRow [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] + +(16) Filter [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] +Condition : isnotnull(i_category#11) + +(17) HashAggregate [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] +Keys [1]: [i_category#11] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#10))] +Aggregate Attributes [2]: [sum#12, count#13] +Results [3]: [i_category#11, sum#14, count#15] + +(18) Exchange +Input [3]: [i_category#11, sum#14, count#15] +Arguments: hashpartitioning(i_category#11, 5), true, [id=#16] + +(19) HashAggregate [codegen id : 3] +Input [3]: [i_category#11, sum#14, count#15] +Keys [1]: [i_category#11] +Functions [1]: [avg(UnscaledValue(i_current_price#10))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#10))#17] +Results [2]: [cast((avg(UnscaledValue(i_current_price#10))#17 / 100.0) as decimal(11,6)) AS avg(i_current_price)#18, i_category#11 AS i_category#11#19] + +(20) BroadcastExchange +Input [2]: [avg(i_current_price)#18, i_category#11#19] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#20] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_category#11] +Right keys [1]: [i_category#11#19] +Join condition: None (22) Filter [codegen id : 4] -Input [2]: [d_date_sk#17, d_month_seq#18] -Condition : ((isnotnull(d_month_seq#18) AND (d_month_seq#18 = Subquery scalar-subquery#19, [id=#20])) AND isnotnull(d_date_sk#17)) +Input [5]: [i_item_sk#9, i_current_price#10, i_category#11, avg(i_current_price)#18, i_category#11#19] +Condition : (cast(i_current_price#10 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#18)), DecimalType(14,7), true)) (23) Project [codegen id : 4] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_month_seq#18] +Output [1]: [i_item_sk#9] +Input [5]: [i_item_sk#9, i_current_price#10, i_category#11, avg(i_current_price)#18, i_category#11#19] (24) BroadcastExchange -Input [1]: [d_date_sk#17] +Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (25) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#9] Join condition: None (26) Project [codegen id : 5] Output [1]: [ss_customer_sk#3] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#3, d_date_sk#17] +Input [3]: [ss_item_sk#2, ss_customer_sk#3, i_item_sk#9] (27) Exchange Input [1]: [ss_customer_sk#3] @@ -282,7 +282,7 @@ Arguments: 100, [cnt#35 ASC NULLS FIRST], [state#34, cnt#35] ===== Subqueries ===== -Subquery:1 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquery#19, [id=#20] +Subquery:1 Hosting operator id = 6 Hosting Expression = Subquery scalar-subquery#6, [id=#7] * HashAggregate (57) +- Exchange (56) +- * HashAggregate (55) @@ -293,39 +293,39 @@ Subquery:1 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquer (51) Scan parquet default.date_dim -Output [3]: [d_month_seq#18, d_year#37, d_moy#38] +Output [3]: [d_month_seq#5, d_year#37, d_moy#38] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] ReadSchema: struct (52) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] (53) Filter [codegen id : 1] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] Condition : (((isnotnull(d_year#37) AND isnotnull(d_moy#38)) AND (d_year#37 = 2000)) AND (d_moy#38 = 1)) (54) Project [codegen id : 1] -Output [1]: [d_month_seq#18] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Output [1]: [d_month_seq#5] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] (55) HashAggregate [codegen id : 1] -Input [1]: [d_month_seq#18] -Keys [1]: [d_month_seq#18] +Input [1]: [d_month_seq#5] +Keys [1]: [d_month_seq#5] Functions: [] Aggregate Attributes: [] -Results [1]: [d_month_seq#18] +Results [1]: [d_month_seq#5] (56) Exchange -Input [1]: [d_month_seq#18] -Arguments: hashpartitioning(d_month_seq#18, 5), true, [id=#39] +Input [1]: [d_month_seq#5] +Arguments: hashpartitioning(d_month_seq#5, 5), true, [id=#39] (57) HashAggregate [codegen id : 2] -Input [1]: [d_month_seq#18] -Keys [1]: [d_month_seq#18] +Input [1]: [d_month_seq#5] +Keys [1]: [d_month_seq#5] Functions: [] Aggregate Attributes: [] -Results [1]: [d_month_seq#18] +Results [1]: [d_month_seq#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt index 73d42163240f0..dcebba331afb3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt @@ -16,55 +16,55 @@ TakeOrderedAndProject [cnt,state] Exchange [ss_customer_sk] #2 WholeStageCodegen (5) Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_customer_sk] - BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_customer_sk,ss_sold_date_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk] InputAdapter BroadcastExchange #3 - WholeStageCodegen (3) - Project [i_item_sk] - Filter [i_current_price,avg(i_current_price)] - BroadcastHashJoin [i_category,i_category] - Filter [i_current_price,i_item_sk] - ColumnarToRow + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #1 + WholeStageCodegen (2) + HashAggregate [d_month_seq] InputAdapter - Scan parquet default.item [i_item_sk,i_current_price,i_category] + Exchange [d_month_seq] #4 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow InputAdapter - BroadcastExchange #4 - WholeStageCodegen (2) - HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),i_category,sum,count] - InputAdapter - Exchange [i_category] #5 - WholeStageCodegen (1) - HashAggregate [i_category,i_current_price] [sum,count,sum,count] - Filter [i_category] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_current_price,i_category] + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #6 + BroadcastExchange #5 WholeStageCodegen (4) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - Subquery #1 - WholeStageCodegen (2) - HashAggregate [d_month_seq] + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow InputAdapter - Exchange [d_month_seq] #7 - WholeStageCodegen (1) - HashAggregate [d_month_seq] - Project [d_month_seq] - Filter [d_year,d_moy] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_month_seq,d_year,d_moy] - ColumnarToRow + Scan parquet default.item [i_item_sk,i_current_price,i_category] InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + BroadcastExchange #6 + WholeStageCodegen (3) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),i_category,sum,count] + InputAdapter + Exchange [i_category] #7 + WholeStageCodegen (2) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt index 58a60763b2b57..fb6eff4a2eb7b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt @@ -27,12 +27,12 @@ TakeOrderedAndProject (69) : : : : +- * Project (14) : : : : +- * Filter (13) : : : : +- * ColumnarToRow (12) - : : : : +- Scan parquet default.item (11) + : : : : +- Scan parquet default.promotion (11) : : : +- BroadcastExchange (22) : : : +- * Project (21) : : : +- * Filter (20) : : : +- * ColumnarToRow (19) - : : : +- Scan parquet default.promotion (18) + : : : +- Scan parquet default.item (18) : : +- BroadcastExchange (29) : : +- * Project (28) : : +- * Filter (27) @@ -115,67 +115,67 @@ Join condition: None Output [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6] Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, d_date_sk#7] -(11) Scan parquet default.item -Output [2]: [i_item_sk#11, i_category#12] +(11) Scan parquet default.promotion +Output [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)] +ReadSchema: struct (12) ColumnarToRow [codegen id : 2] -Input [2]: [i_item_sk#11, i_category#12] +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] (13) Filter [codegen id : 2] -Input [2]: [i_item_sk#11, i_category#12] -Condition : ((isnotnull(i_category#12) AND (i_category#12 = Jewelry)) AND isnotnull(i_item_sk#11)) +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] +Condition : ((((p_channel_dmail#12 = Y) OR (p_channel_email#13 = Y)) OR (p_channel_tv#14 = Y)) AND isnotnull(p_promo_sk#11)) (14) Project [codegen id : 2] -Output [1]: [i_item_sk#11] -Input [2]: [i_item_sk#11, i_category#12] +Output [1]: [p_promo_sk#11] +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] (15) BroadcastExchange -Input [1]: [i_item_sk#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +Input [1]: [p_promo_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] (16) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#11] +Left keys [1]: [ss_promo_sk#5] +Right keys [1]: [p_promo_sk#11] Join condition: None (17) Project [codegen id : 7] -Output [4]: [ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6] -Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, i_item_sk#11] +Output [4]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] +Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, p_promo_sk#11] -(18) Scan parquet default.promotion -Output [4]: [p_promo_sk#14, p_channel_dmail#15, p_channel_email#16, p_channel_tv#17] +(18) Scan parquet default.item +Output [2]: [i_item_sk#16, i_category#17] Batched: true -Location [not included in comparison]/{warehouse_dir}/promotion] -PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry), IsNotNull(i_item_sk)] +ReadSchema: struct (19) ColumnarToRow [codegen id : 3] -Input [4]: [p_promo_sk#14, p_channel_dmail#15, p_channel_email#16, p_channel_tv#17] +Input [2]: [i_item_sk#16, i_category#17] (20) Filter [codegen id : 3] -Input [4]: [p_promo_sk#14, p_channel_dmail#15, p_channel_email#16, p_channel_tv#17] -Condition : ((((p_channel_dmail#15 = Y) OR (p_channel_email#16 = Y)) OR (p_channel_tv#17 = Y)) AND isnotnull(p_promo_sk#14)) +Input [2]: [i_item_sk#16, i_category#17] +Condition : ((isnotnull(i_category#17) AND (i_category#17 = Jewelry)) AND isnotnull(i_item_sk#16)) (21) Project [codegen id : 3] -Output [1]: [p_promo_sk#14] -Input [4]: [p_promo_sk#14, p_channel_dmail#15, p_channel_email#16, p_channel_tv#17] +Output [1]: [i_item_sk#16] +Input [2]: [i_item_sk#16, i_category#17] (22) BroadcastExchange -Input [1]: [p_promo_sk#14] +Input [1]: [i_item_sk#16] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] (23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_promo_sk#5] -Right keys [1]: [p_promo_sk#14] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#16] Join condition: None (24) Project [codegen id : 7] Output [3]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [5]: [ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, p_promo_sk#14] +Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, i_item_sk#16] (25) Scan parquet default.store Output [2]: [s_store_sk#19, s_gmt_offset#20] @@ -310,17 +310,17 @@ Join condition: None Output [4]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, d_date_sk#7] -(54) ReusedExchange [Reuses operator id: 15] -Output [1]: [i_item_sk#11] +(54) ReusedExchange [Reuses operator id: 22] +Output [1]: [i_item_sk#16] (55) BroadcastHashJoin [codegen id : 14] Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#11] +Right keys [1]: [i_item_sk#16] Join condition: None (56) Project [codegen id : 14] Output [3]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, i_item_sk#11] +Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, i_item_sk#16] (57) ReusedExchange [Reuses operator id: 29] Output [1]: [s_store_sk#19] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt index 87f2b3ae03746..238661e707a6c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt @@ -14,9 +14,9 @@ TakeOrderedAndProject [promotions,total,(CAST((CAST(CAST(promotions AS DECIMAL(1 Project [ss_customer_sk,ss_ext_sales_price] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] - Project [ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_store_sk,ss_promo_sk,ss_sold_date_sk,ss_customer_sk,ss_item_sk] @@ -34,19 +34,19 @@ TakeOrderedAndProject [promotions,total,(CAST((CAST(CAST(promotions AS DECIMAL(1 InputAdapter BroadcastExchange #3 WholeStageCodegen (2) - Project [i_item_sk] - Filter [i_category,i_item_sk] + Project [p_promo_sk] + Filter [p_channel_dmail,p_channel_email,p_channel_tv,p_promo_sk] ColumnarToRow InputAdapter - Scan parquet default.item [i_item_sk,i_category] + Scan parquet default.promotion [p_promo_sk,p_channel_dmail,p_channel_email,p_channel_tv] InputAdapter BroadcastExchange #4 WholeStageCodegen (3) - Project [p_promo_sk] - Filter [p_channel_dmail,p_channel_email,p_channel_tv,p_promo_sk] + Project [i_item_sk] + Filter [i_category,i_item_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_dmail,p_channel_email,p_channel_tv] + Scan parquet default.item [i_item_sk,i_category] InputAdapter BroadcastExchange #5 WholeStageCodegen (4) @@ -94,7 +94,7 @@ TakeOrderedAndProject [promotions,total,(CAST((CAST(CAST(promotions AS DECIMAL(1 InputAdapter ReusedExchange [d_date_sk] #2 InputAdapter - ReusedExchange [i_item_sk] #3 + ReusedExchange [i_item_sk] #4 InputAdapter ReusedExchange [s_store_sk] #5 InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt index 38576c0adde4b..7831cda65bd46 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt @@ -23,12 +23,12 @@ TakeOrderedAndProject (34) : : +- * Project (14) : : +- * Filter (13) : : +- * ColumnarToRow (12) - : : +- Scan parquet default.promotion (11) + : : +- Scan parquet default.date_dim (11) : +- BroadcastExchange (22) : +- * Project (21) : +- * Filter (20) : +- * ColumnarToRow (19) - : +- Scan parquet default.date_dim (18) + : +- Scan parquet default.promotion (18) +- BroadcastExchange (28) +- * Filter (27) +- * ColumnarToRow (26) @@ -80,67 +80,67 @@ Join condition: None Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] -(11) Scan parquet default.promotion -Output [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] Batched: true -Location [not included in comparison]/{warehouse_dir}/promotion] -PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct (12) ColumnarToRow [codegen id : 2] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +Input [2]: [d_date_sk#14, d_year#15] (13) Filter [codegen id : 2] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] -Condition : (((p_channel_email#15 = N) OR (p_channel_event#16 = N)) AND isnotnull(p_promo_sk#14)) +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) (14) Project [codegen id : 2] -Output [1]: [p_promo_sk#14] -Input [3]: [p_promo_sk#14, p_channel_email#15, p_channel_event#16] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] (15) BroadcastExchange -Input [1]: [p_promo_sk#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_promo_sk#4] -Right keys [1]: [p_promo_sk#14] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] Join condition: None (17) Project [codegen id : 5] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, p_promo_sk#14] +Output [6]: [ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] -(18) Scan parquet default.date_dim -Output [2]: [d_date_sk#18, d_year#19] +(18) Scan parquet default.promotion +Output [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct (19) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#18, d_year#19] +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] (20) Filter [codegen id : 3] -Input [2]: [d_date_sk#18, d_year#19] -Condition : ((isnotnull(d_year#19) AND (d_year#19 = 2000)) AND isnotnull(d_date_sk#18)) +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] +Condition : (((p_channel_email#18 = N) OR (p_channel_event#19 = N)) AND isnotnull(p_promo_sk#17)) (21) Project [codegen id : 3] -Output [1]: [d_date_sk#18] -Input [2]: [d_date_sk#18, d_year#19] +Output [1]: [p_promo_sk#17] +Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19] (22) BroadcastExchange -Input [1]: [d_date_sk#18] +Input [1]: [p_promo_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (23) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#18] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#17] Join condition: None (24) Project [codegen id : 5] Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#18] +Input [7]: [ss_item_sk#2, ss_promo_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, p_promo_sk#17] (25) Scan parquet default.item Output [2]: [i_item_sk#21, i_item_id#22] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt index d78afa9979777..34f98d5debdd5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt @@ -8,9 +8,9 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Filter [ss_cdemo_sk,ss_sold_date_sk,ss_item_sk,ss_promo_sk] @@ -28,19 +28,19 @@ TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] InputAdapter BroadcastExchange #3 WholeStageCodegen (2) - Project [p_promo_sk] - Filter [p_channel_email,p_channel_event,p_promo_sk] + Project [d_date_sk] + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (3) - Project [d_date_sk] - Filter [d_year,d_date_sk] + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] InputAdapter BroadcastExchange #5 WholeStageCodegen (4) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt index 9ac081b356c94..057d786afbcdd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -37,12 +37,12 @@ TakeOrderedAndProject (108) : : : +- * Project (23) : : : +- * Filter (22) : : : +- * ColumnarToRow (21) - : : : +- Scan parquet default.promotion (20) + : : : +- Scan parquet default.date_dim (20) : : +- BroadcastExchange (31) : : +- * Project (30) : : +- * Filter (29) : : +- * ColumnarToRow (28) - : : +- Scan parquet default.date_dim (27) + : : +- Scan parquet default.promotion (27) : +- BroadcastExchange (37) : +- * Filter (36) : +- * ColumnarToRow (35) @@ -193,67 +193,67 @@ Join condition: None Output [7]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, i_item_sk#14] -(20) Scan parquet default.promotion -Output [2]: [p_promo_sk#17, p_channel_tv#18] +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/promotion] -PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-22), IsNotNull(d_date_sk)] +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] -Input [2]: [p_promo_sk#17, p_channel_tv#18] +Input [2]: [d_date_sk#17, d_date#18] (22) Filter [codegen id : 6] -Input [2]: [p_promo_sk#17, p_channel_tv#18] -Condition : ((isnotnull(p_channel_tv#18) AND (p_channel_tv#18 = N)) AND isnotnull(p_promo_sk#17)) +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 11192)) AND (d_date#18 <= 11222)) AND isnotnull(d_date_sk#17)) (23) Project [codegen id : 6] -Output [1]: [p_promo_sk#17] -Input [2]: [p_promo_sk#17, p_channel_tv#18] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] (24) BroadcastExchange -Input [1]: [p_promo_sk#17] +Input [1]: [d_date_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (25) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_promo_sk#4] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#17] Join condition: None (26) Project [codegen id : 9] -Output [6]: [ss_sold_date_sk#1, ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] -Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, p_promo_sk#17] +Output [6]: [ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] +Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, d_date_sk#17] -(27) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_date#21] +(27) Scan parquet default.promotion +Output [2]: [p_promo_sk#20, p_channel_tv#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-22), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct (28) ColumnarToRow [codegen id : 7] -Input [2]: [d_date_sk#20, d_date#21] +Input [2]: [p_promo_sk#20, p_channel_tv#21] (29) Filter [codegen id : 7] -Input [2]: [d_date_sk#20, d_date#21] -Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 11192)) AND (d_date#21 <= 11222)) AND isnotnull(d_date_sk#20)) +Input [2]: [p_promo_sk#20, p_channel_tv#21] +Condition : ((isnotnull(p_channel_tv#21) AND (p_channel_tv#21 = N)) AND isnotnull(p_promo_sk#20)) (30) Project [codegen id : 7] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_date#21] +Output [1]: [p_promo_sk#20] +Input [2]: [p_promo_sk#20, p_channel_tv#21] (31) BroadcastExchange -Input [1]: [d_date_sk#20] +Input [1]: [p_promo_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (32) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#20] Join condition: None (33) Project [codegen id : 9] Output [5]: [ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] -Input [7]: [ss_sold_date_sk#1, ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, d_date_sk#20] +Input [7]: [ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, p_promo_sk#20] (34) Scan parquet default.store Output [2]: [s_store_sk#23, s_store_id#24] @@ -366,28 +366,28 @@ Output [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_s Input [9]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_item_sk#47, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, i_item_sk#14] (58) ReusedExchange [Reuses operator id: 24] -Output [1]: [p_promo_sk#17] +Output [1]: [d_date_sk#17] (59) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_promo_sk#48] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [cs_sold_date_sk#45] +Right keys [1]: [d_date_sk#17] Join condition: None (60) Project [codegen id : 19] -Output [6]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] -Input [8]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, p_promo_sk#17] +Output [6]: [cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] +Input [8]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, d_date_sk#17] (61) ReusedExchange [Reuses operator id: 31] -Output [1]: [d_date_sk#20] +Output [1]: [p_promo_sk#20] (62) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_sold_date_sk#45] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [cs_promo_sk#48] +Right keys [1]: [p_promo_sk#20] Join condition: None (63) Project [codegen id : 19] Output [5]: [cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] -Input [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, d_date_sk#20] +Input [7]: [cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, p_promo_sk#20] (64) Scan parquet default.catalog_page Output [2]: [cp_catalog_page_sk#58, cp_catalog_page_id#59] @@ -500,28 +500,28 @@ Output [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales Input [9]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, i_item_sk#14] (88) ReusedExchange [Reuses operator id: 24] -Output [1]: [p_promo_sk#17] +Output [1]: [d_date_sk#17] (89) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ws_promo_sk#83] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [ws_sold_date_sk#80] +Right keys [1]: [d_date_sk#17] Join condition: None (90) Project [codegen id : 29] -Output [6]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [8]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, p_promo_sk#17] +Output [6]: [ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] +Input [8]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, d_date_sk#17] (91) ReusedExchange [Reuses operator id: 31] -Output [1]: [d_date_sk#20] +Output [1]: [p_promo_sk#20] (92) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ws_sold_date_sk#80] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ws_promo_sk#83] +Right keys [1]: [p_promo_sk#20] Join condition: None (93) Project [codegen id : 29] Output [5]: [ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, d_date_sk#20] +Input [7]: [ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, p_promo_sk#20] (94) Scan parquet default.web_site Output [2]: [web_site_sk#93, web_site_id#94] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt index ec00b49e71989..7b73e4307dcf0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt @@ -17,9 +17,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] @@ -54,19 +54,19 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter BroadcastExchange #6 WholeStageCodegen (6) - Project [p_promo_sk] - Filter [p_channel_tv,p_promo_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_tv] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #7 WholeStageCodegen (7) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.promotion [p_promo_sk,p_channel_tv] InputAdapter BroadcastExchange #8 WholeStageCodegen (8) @@ -83,9 +83,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_promo_sk,p_promo_sk] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] @@ -112,9 +112,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter - ReusedExchange [p_promo_sk] #6 + ReusedExchange [d_date_sk] #6 InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [p_promo_sk] #7 InputAdapter BroadcastExchange #12 WholeStageCodegen (18) @@ -131,9 +131,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] BroadcastHashJoin [ws_web_site_sk,web_site_sk] Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_promo_sk,p_promo_sk] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] @@ -160,9 +160,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #5 InputAdapter - ReusedExchange [p_promo_sk] #6 + ReusedExchange [d_date_sk] #6 InputAdapter - ReusedExchange [d_date_sk] #7 + ReusedExchange [p_promo_sk] #7 InputAdapter BroadcastExchange #16 WholeStageCodegen (28) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 7720d9dee4170..76dca5100cddc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -40,12 +40,12 @@ TakeOrderedAndProject (47) : +- * Project (30) : +- * Filter (29) : +- * ColumnarToRow (28) - : +- Scan parquet default.web_site (27) + : +- Scan parquet default.date_dim (27) +- BroadcastExchange (38) +- * Project (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.date_dim (34) + +- Scan parquet default.web_site (34) (1) Scan parquet default.web_sales @@ -161,67 +161,67 @@ Join condition: None Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#15] -(27) Scan parquet default.web_site -Output [2]: [web_site_sk#18, web_company_name#19] +(27) Scan parquet default.date_dim +Output [2]: [d_date_sk#18, d_date#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (28) ColumnarToRow [codegen id : 10] -Input [2]: [web_site_sk#18, web_company_name#19] +Input [2]: [d_date_sk#18, d_date#19] (29) Filter [codegen id : 10] -Input [2]: [web_site_sk#18, web_company_name#19] -Condition : ((isnotnull(web_company_name#19) AND (web_company_name#19 = pri)) AND isnotnull(web_site_sk#18)) +Input [2]: [d_date_sk#18, d_date#19] +Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 10623)) AND (d_date#19 <= 10683)) AND isnotnull(d_date_sk#18)) (30) Project [codegen id : 10] -Output [1]: [web_site_sk#18] -Input [2]: [web_site_sk#18, web_company_name#19] +Output [1]: [d_date_sk#18] +Input [2]: [d_date_sk#18, d_date#19] (31) BroadcastExchange -Input [1]: [web_site_sk#18] +Input [1]: [d_date_sk#18] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (32) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#18] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#18] Join condition: None (33) Project [codegen id : 12] -Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#18] +Output [4]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#18] -(34) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +(34) Scan parquet default.web_site +Output [2]: [web_site_sk#21, web_company_name#22] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (35) ColumnarToRow [codegen id : 11] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [web_site_sk#21, web_company_name#22] (36) Filter [codegen id : 11] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10623)) AND (d_date#22 <= 10683)) AND isnotnull(d_date_sk#21)) +Input [2]: [web_site_sk#21, web_company_name#22] +Condition : ((isnotnull(web_company_name#22) AND (web_company_name#22 = pri)) AND isnotnull(web_site_sk#21)) (37) Project [codegen id : 11] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [web_site_sk#21] +Input [2]: [web_site_sk#21, web_company_name#22] (38) BroadcastExchange -Input [1]: [d_date_sk#21] +Input [1]: [web_site_sk#21] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (39) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#21] Join condition: None (40) Project [codegen id : 12] Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#21] +Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#21] (41) HashAggregate [codegen id : 12] Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt index 128a8179ac10b..976eb7e9e9fdb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt @@ -11,9 +11,9 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (12) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] InputAdapter @@ -63,16 +63,16 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] InputAdapter BroadcastExchange #8 WholeStageCodegen (10) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #9 WholeStageCodegen (11) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt index eae118d46245d..b30d1ed919754 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -56,12 +56,12 @@ TakeOrderedAndProject (63) : +- * Project (46) : +- * Filter (45) : +- * ColumnarToRow (44) - : +- Scan parquet default.web_site (43) + : +- Scan parquet default.date_dim (43) +- BroadcastExchange (54) +- * Project (53) +- * Filter (52) +- * ColumnarToRow (51) - +- Scan parquet default.date_dim (50) + +- Scan parquet default.web_site (50) (1) Scan parquet default.web_sales @@ -243,67 +243,67 @@ Join condition: None Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#20] -(43) Scan parquet default.web_site -Output [2]: [web_site_sk#23, web_company_name#24] +(43) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_date#24] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_site] -PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct (44) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#23, web_company_name#24] +Input [2]: [d_date_sk#23, d_date#24] (45) Filter [codegen id : 20] -Input [2]: [web_site_sk#23, web_company_name#24] -Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri)) AND isnotnull(web_site_sk#23)) +Input [2]: [d_date_sk#23, d_date#24] +Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 10623)) AND (d_date#24 <= 10683)) AND isnotnull(d_date_sk#23)) (46) Project [codegen id : 20] -Output [1]: [web_site_sk#23] -Input [2]: [web_site_sk#23, web_company_name#24] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_date#24] (47) BroadcastExchange -Input [1]: [web_site_sk#23] +Input [1]: [d_date_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (48) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#23] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#23] Join condition: None (49) Project [codegen id : 22] -Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#23] +Output [4]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#23] -(50) Scan parquet default.date_dim -Output [2]: [d_date_sk#26, d_date#27] +(50) Scan parquet default.web_site +Output [2]: [web_site_sk#26, web_company_name#27] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] +ReadSchema: struct (51) ColumnarToRow [codegen id : 21] -Input [2]: [d_date_sk#26, d_date#27] +Input [2]: [web_site_sk#26, web_company_name#27] (52) Filter [codegen id : 21] -Input [2]: [d_date_sk#26, d_date#27] -Condition : (((isnotnull(d_date#27) AND (d_date#27 >= 10623)) AND (d_date#27 <= 10683)) AND isnotnull(d_date_sk#26)) +Input [2]: [web_site_sk#26, web_company_name#27] +Condition : ((isnotnull(web_company_name#27) AND (web_company_name#27 = pri)) AND isnotnull(web_site_sk#26)) (53) Project [codegen id : 21] -Output [1]: [d_date_sk#26] -Input [2]: [d_date_sk#26, d_date#27] +Output [1]: [web_site_sk#26] +Input [2]: [web_site_sk#26, web_company_name#27] (54) BroadcastExchange -Input [1]: [d_date_sk#26] +Input [1]: [web_site_sk#26] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] (55) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#26] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#26] Join condition: None (56) Project [codegen id : 22] Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#26] +Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#26] (57) HashAggregate [codegen id : 22] Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt index bdcbb87b372dc..590a7275a1cfb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt @@ -11,9 +11,9 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] WholeStageCodegen (22) HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_ship_date_sk,d_date_sk] - Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] InputAdapter @@ -96,16 +96,16 @@ TakeOrderedAndProject [order count ,total shipping cost ,total net profit ] InputAdapter BroadcastExchange #10 WholeStageCodegen (20) - Project [web_site_sk] - Filter [web_company_name,web_site_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.web_site [web_site_sk,web_company_name] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #11 WholeStageCodegen (21) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [web_site_sk] + Filter [web_company_name,web_site_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt index 30dabdd2d5523..77df1b031ed67 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -10,24 +10,24 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.store_sales @@ -37,126 +37,126 @@ Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] (23) Exchange -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] -Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] (27) Exchange -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 (29) Project [codegen id : 10] -Output [6]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt index a180ed2b060b9..c6ce597f3c1bf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt @@ -18,34 +18,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ss_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (2) - Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (1) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #6 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #6 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt index c1bf12b7c2c5a..416f0210e9fe1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt index d8db515f84f68..cfb9973ef6983 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (2) - Project [ws_item_sk,ws_ext_sales_price] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (1) Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt index 15cde1a45a99b..01f65c4403942 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.catalog_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt index e66efff75180a..3f5e15881c33c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [cs_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (2) - Project [cs_item_sk,cs_ext_sales_price] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt index 0234a65ac06a5..1aae8564295f1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt @@ -12,20 +12,20 @@ TakeOrderedAndProject (52) : : +- Exchange (17) : : +- * Project (16) : : +- * BroadcastHashJoin Inner BuildRight (15) - : : :- * Project (9) - : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) : : : : +- Scan parquet default.inventory (1) - : : : +- BroadcastExchange (7) - : : : +- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.warehouse (4) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) : : +- BroadcastExchange (14) - : : +- * Project (13) - : : +- * Filter (12) - : : +- * ColumnarToRow (11) - : : +- Scan parquet default.date_dim (10) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.warehouse (11) : +- * Sort (23) : +- Exchange (22) : +- * Filter (21) @@ -67,63 +67,63 @@ Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_ha Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] Condition : ((isnotnull(inv_date_sk#1) AND isnotnull(inv_item_sk#2)) AND isnotnull(inv_warehouse_sk#3)) -(4) Scan parquet default.warehouse -Output [1]: [w_warehouse_sk#5] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] Batched: true -Location [not included in comparison]/{warehouse_dir}/warehouse] -PushedFilters: [IsNotNull(w_warehouse_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct (5) ColumnarToRow [codegen id : 1] -Input [1]: [w_warehouse_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] (6) Filter [codegen id : 1] -Input [1]: [w_warehouse_sk#5] -Condition : isnotnull(w_warehouse_sk#5) +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1212)) AND (d_month_seq#6 <= 1223)) AND isnotnull(d_date_sk#5)) -(7) BroadcastExchange -Input [1]: [w_warehouse_sk#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] -(8) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_warehouse_sk#3] -Right keys [1]: [w_warehouse_sk#5] +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#1] +Right keys [1]: [d_date_sk#5] Join condition: None -(9) Project [codegen id : 3] -Output [3]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4] -Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#5] +(10) Project [codegen id : 3] +Output [3]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4] +Input [5]: [inv_date_sk#1, inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, d_date_sk#5] -(10) Scan parquet default.date_dim -Output [2]: [d_date_sk#7, d_month_seq#8] +(11) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#8] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] -ReadSchema: struct - -(11) ColumnarToRow [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct -(12) Filter [codegen id : 2] -Input [2]: [d_date_sk#7, d_month_seq#8] -Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND isnotnull(d_date_sk#7)) +(12) ColumnarToRow [codegen id : 2] +Input [1]: [w_warehouse_sk#8] -(13) Project [codegen id : 2] -Output [1]: [d_date_sk#7] -Input [2]: [d_date_sk#7, d_month_seq#8] +(13) Filter [codegen id : 2] +Input [1]: [w_warehouse_sk#8] +Condition : isnotnull(w_warehouse_sk#8) (14) BroadcastExchange -Input [1]: [d_date_sk#7] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] +Input [1]: [w_warehouse_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] (15) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [inv_date_sk#1] -Right keys [1]: [d_date_sk#7] +Left keys [1]: [inv_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#8] Join condition: None (16) Project [codegen id : 3] Output [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Input [4]: [inv_date_sk#1, inv_item_sk#2, inv_quantity_on_hand#4, d_date_sk#7] +Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehouse_sk#8] (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt index c2fe3189b2d10..d1adc589cb384 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt @@ -17,9 +17,9 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] Exchange [inv_item_sk] #2 WholeStageCodegen (3) Project [inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_date_sk,d_date_sk] - Project [inv_date_sk,inv_item_sk,inv_quantity_on_hand] - BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] Filter [inv_date_sk,inv_item_sk,inv_warehouse_sk] ColumnarToRow InputAdapter @@ -27,18 +27,18 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] InputAdapter BroadcastExchange #3 WholeStageCodegen (1) - Filter [w_warehouse_sk] - ColumnarToRow - InputAdapter - Scan parquet default.warehouse [w_warehouse_sk] + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter BroadcastExchange #4 WholeStageCodegen (2) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] InputAdapter WholeStageCodegen (6) Sort [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt index 86722de954ff3..75e07ce8cd680 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt @@ -40,20 +40,20 @@ TakeOrderedAndProject (77) : +- * BroadcastHashJoin Inner BuildRight (50) : :- * Project (48) : : +- * BroadcastHashJoin Inner BuildRight (47) - : : :- * Project (45) - : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : :- * Project (41) + : : : +- * BroadcastHashJoin Inner BuildRight (40) : : : :- * Project (38) : : : : +- * BroadcastHashJoin Inner BuildRight (37) : : : : :- * Filter (35) : : : : : +- * ColumnarToRow (34) : : : : : +- Scan parquet default.store_sales (33) : : : : +- ReusedExchange (36) - : : : +- BroadcastExchange (43) - : : : +- * Project (42) - : : : +- * Filter (41) - : : : +- * ColumnarToRow (40) - : : : +- Scan parquet default.store (39) - : : +- ReusedExchange (46) + : : : +- ReusedExchange (39) + : : +- BroadcastExchange (46) + : : +- * Project (45) + : : +- * Filter (44) + : : +- * ColumnarToRow (43) + : : +- Scan parquet default.store (42) : +- ReusedExchange (49) +- * HashAggregate (75) +- Exchange (74) @@ -252,48 +252,48 @@ Join condition: None Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] -(39) Scan parquet default.store +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(41) Project [codegen id : 11] +Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] + +(42) Scan parquet default.store Output [2]: [s_store_sk#17, s_state#18] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] ReadSchema: struct -(40) ColumnarToRow [codegen id : 8] +(43) ColumnarToRow [codegen id : 9] Input [2]: [s_store_sk#17, s_state#18] -(41) Filter [codegen id : 8] +(44) Filter [codegen id : 9] Input [2]: [s_store_sk#17, s_state#18] Condition : ((isnotnull(s_state#18) AND (s_state#18 = TN)) AND isnotnull(s_store_sk#17)) -(42) Project [codegen id : 8] +(45) Project [codegen id : 9] Output [1]: [s_store_sk#17] Input [2]: [s_store_sk#17, s_state#18] -(43) BroadcastExchange +(46) BroadcastExchange Input [1]: [s_store_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] -(44) BroadcastHashJoin [codegen id : 11] +(47) BroadcastHashJoin [codegen id : 11] Left keys [1]: [ss_store_sk#4] Right keys [1]: [s_store_sk#17] Join condition: None -(45) Project [codegen id : 11] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] - -(46) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] - -(47) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#14] -Join condition: None - (48) Project [codegen id : 11] Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] +Input [7]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] (49) ReusedExchange [Reuses operator id: 27] Output [2]: [i_item_sk#20, i_item_id#21] @@ -351,29 +351,29 @@ Join condition: None Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_cdemo_sk#3, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, cd_demo_sk#9] -(61) ReusedExchange [Reuses operator id: 43] -Output [1]: [s_store_sk#17] +(61) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] (62) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_store_sk#4] -Right keys [1]: [s_store_sk#17] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#14] Join condition: None (63) Project [codegen id : 17] -Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] +Output [6]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] +Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] -(64) ReusedExchange [Reuses operator id: 15] -Output [1]: [d_date_sk#14] +(64) ReusedExchange [Reuses operator id: 46] +Output [1]: [s_store_sk#17] (65) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#14] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#17] Join condition: None (66) Project [codegen id : 17] Output [5]: [ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8] -Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, d_date_sk#14] +Input [7]: [ss_item_sk#2, ss_store_sk#4, ss_quantity#5, ss_list_price#6, ss_sales_price#7, ss_coupon_amt#8, s_store_sk#17] (67) Scan parquet default.item Output [1]: [i_item_sk#20] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt index 61aaa22964cb7..995ed4b432be6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt @@ -57,9 +57,9 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] @@ -69,15 +69,15 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] InputAdapter ReusedExchange [cd_demo_sk] #2 InputAdapter - BroadcastExchange #7 - WholeStageCodegen (8) - Project [s_store_sk] - Filter [s_state,s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_state] + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + BroadcastExchange #7 + WholeStageCodegen (9) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] InputAdapter ReusedExchange [i_item_sk,i_item_id] #5 WholeStageCodegen (18) @@ -89,9 +89,9 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] - BroadcastHashJoin [ss_store_sk,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] Filter [ss_cdemo_sk,ss_sold_date_sk,ss_store_sk,ss_item_sk] @@ -101,9 +101,9 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] InputAdapter ReusedExchange [cd_demo_sk] #2 InputAdapter - ReusedExchange [s_store_sk] #7 + ReusedExchange [d_date_sk] #3 InputAdapter - ReusedExchange [d_date_sk] #3 + ReusedExchange [s_store_sk] #7 InputAdapter BroadcastExchange #9 WholeStageCodegen (16) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt index 1b9e8f37e9418..ab246a3449557 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt @@ -11,30 +11,30 @@ TakeOrderedAndProject (50) : +- Exchange (27) : +- * Project (26) : +- * BroadcastHashJoin Inner BuildRight (25) - : :- * Project (19) - : : +- * BroadcastHashJoin Inner BuildRight (18) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) : : :- * Filter (3) : : : +- * ColumnarToRow (2) : : : +- Scan parquet default.store_sales (1) - : : +- BroadcastExchange (17) - : : +- * Project (16) - : : +- * Filter (15) - : : +- * BroadcastHashJoin LeftOuter BuildRight (14) - : : :- * Filter (6) - : : : +- * ColumnarToRow (5) - : : : +- Scan parquet default.item (4) - : : +- BroadcastExchange (13) - : : +- * HashAggregate (12) - : : +- Exchange (11) - : : +- * HashAggregate (10) - : : +- * Filter (9) - : : +- * ColumnarToRow (8) - : : +- Scan parquet default.item (7) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) : +- BroadcastExchange (24) : +- * Project (23) : +- * Filter (22) - : +- * ColumnarToRow (21) - : +- Scan parquet default.date_dim (20) + : +- * BroadcastHashJoin LeftOuter BuildRight (21) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (20) + : +- * HashAggregate (19) + : +- Exchange (18) + : +- * HashAggregate (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.item (14) +- * Sort (42) +- Exchange (41) +- * Project (40) @@ -65,112 +65,112 @@ Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3] Condition : ((isnotnull(ss_customer_sk#3) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_item_sk#2)) -(4) Scan parquet default.item -Output [3]: [i_item_sk#4, i_current_price#5, i_category#6] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_month_seq#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct -(5) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#4, i_current_price#5, i_category#6] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] -(6) Filter [codegen id : 3] -Input [3]: [i_item_sk#4, i_current_price#5, i_category#6] -Condition : (isnotnull(i_current_price#5) AND isnotnull(i_item_sk#4)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_month_seq#5] +Condition : ((isnotnull(d_month_seq#5) AND (d_month_seq#5 = Subquery scalar-subquery#6, [id=#7])) AND isnotnull(d_date_sk#4)) -(7) Scan parquet default.item -Output [2]: [i_current_price#5, i_category#6] -Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [IsNotNull(i_category)] -ReadSchema: struct +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_month_seq#5] -(8) ColumnarToRow [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] - -(9) Filter [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] -Condition : isnotnull(i_category#6) - -(10) HashAggregate [codegen id : 1] -Input [2]: [i_current_price#5, i_category#6] -Keys [1]: [i_category#6] -Functions [1]: [partial_avg(UnscaledValue(i_current_price#5))] -Aggregate Attributes [2]: [sum#7, count#8] -Results [3]: [i_category#6, sum#9, count#10] - -(11) Exchange -Input [3]: [i_category#6, sum#9, count#10] -Arguments: hashpartitioning(i_category#6, 5), true, [id=#11] - -(12) HashAggregate [codegen id : 2] -Input [3]: [i_category#6, sum#9, count#10] -Keys [1]: [i_category#6] -Functions [1]: [avg(UnscaledValue(i_current_price#5))] -Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#5))#12] -Results [2]: [cast((avg(UnscaledValue(i_current_price#5))#12 / 100.0) as decimal(11,6)) AS avg(i_current_price)#13, i_category#6 AS i_category#6#14] - -(13) BroadcastExchange -Input [2]: [avg(i_current_price)#13, i_category#6#14] -Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#15] - -(14) BroadcastHashJoin [codegen id : 3] -Left keys [1]: [i_category#6] -Right keys [1]: [i_category#6#14] -Join condition: None +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] -(15) Filter [codegen id : 3] -Input [5]: [i_item_sk#4, i_current_price#5, i_category#6, avg(i_current_price)#13, i_category#6#14] -Condition : (cast(i_current_price#5 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#13)), DecimalType(14,7), true)) +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] +Join condition: None -(16) Project [codegen id : 3] -Output [1]: [i_item_sk#4] -Input [5]: [i_item_sk#4, i_current_price#5, i_category#6, avg(i_current_price)#13, i_category#6#14] +(10) Project [codegen id : 5] +Output [2]: [ss_item_sk#2, ss_customer_sk#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, d_date_sk#4] -(17) BroadcastExchange -Input [1]: [i_item_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +(11) Scan parquet default.item +Output [3]: [i_item_sk#9, i_current_price#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct -(18) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#4] -Join condition: None +(12) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#9, i_current_price#10, i_category#11] -(19) Project [codegen id : 5] -Output [2]: [ss_sold_date_sk#1, ss_customer_sk#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, i_item_sk#4] +(13) Filter [codegen id : 4] +Input [3]: [i_item_sk#9, i_current_price#10, i_category#11] +Condition : (isnotnull(i_current_price#10) AND isnotnull(i_item_sk#9)) -(20) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_month_seq#18] +(14) Scan parquet default.item +Output [2]: [i_current_price#10, i_category#11] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct -(21) ColumnarToRow [codegen id : 4] -Input [2]: [d_date_sk#17, d_month_seq#18] +(15) ColumnarToRow [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] + +(16) Filter [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] +Condition : isnotnull(i_category#11) + +(17) HashAggregate [codegen id : 2] +Input [2]: [i_current_price#10, i_category#11] +Keys [1]: [i_category#11] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#10))] +Aggregate Attributes [2]: [sum#12, count#13] +Results [3]: [i_category#11, sum#14, count#15] + +(18) Exchange +Input [3]: [i_category#11, sum#14, count#15] +Arguments: hashpartitioning(i_category#11, 5), true, [id=#16] + +(19) HashAggregate [codegen id : 3] +Input [3]: [i_category#11, sum#14, count#15] +Keys [1]: [i_category#11] +Functions [1]: [avg(UnscaledValue(i_current_price#10))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#10))#17] +Results [2]: [cast((avg(UnscaledValue(i_current_price#10))#17 / 100.0) as decimal(11,6)) AS avg(i_current_price)#18, i_category#11 AS i_category#11#19] + +(20) BroadcastExchange +Input [2]: [avg(i_current_price)#18, i_category#11#19] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#20] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_category#11] +Right keys [1]: [i_category#11#19] +Join condition: None (22) Filter [codegen id : 4] -Input [2]: [d_date_sk#17, d_month_seq#18] -Condition : ((isnotnull(d_month_seq#18) AND (d_month_seq#18 = Subquery scalar-subquery#19, [id=#20])) AND isnotnull(d_date_sk#17)) +Input [5]: [i_item_sk#9, i_current_price#10, i_category#11, avg(i_current_price)#18, i_category#11#19] +Condition : (cast(i_current_price#10 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#18)), DecimalType(14,7), true)) (23) Project [codegen id : 4] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_month_seq#18] +Output [1]: [i_item_sk#9] +Input [5]: [i_item_sk#9, i_current_price#10, i_category#11, avg(i_current_price)#18, i_category#11#19] (24) BroadcastExchange -Input [1]: [d_date_sk#17] +Input [1]: [i_item_sk#9] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (25) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#9] Join condition: None (26) Project [codegen id : 5] Output [1]: [ss_customer_sk#3] -Input [3]: [ss_sold_date_sk#1, ss_customer_sk#3, d_date_sk#17] +Input [3]: [ss_item_sk#2, ss_customer_sk#3, i_item_sk#9] (27) Exchange Input [1]: [ss_customer_sk#3] @@ -282,7 +282,7 @@ Arguments: 100, [cnt#35 ASC NULLS FIRST, ca_state#24 ASC NULLS FIRST], [state#34 ===== Subqueries ===== -Subquery:1 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquery#19, [id=#20] +Subquery:1 Hosting operator id = 6 Hosting Expression = Subquery scalar-subquery#6, [id=#7] * HashAggregate (57) +- Exchange (56) +- * HashAggregate (55) @@ -293,39 +293,39 @@ Subquery:1 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquer (51) Scan parquet default.date_dim -Output [3]: [d_month_seq#18, d_year#37, d_moy#38] +Output [3]: [d_month_seq#5, d_year#37, d_moy#38] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] ReadSchema: struct (52) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] (53) Filter [codegen id : 1] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] Condition : (((isnotnull(d_year#37) AND isnotnull(d_moy#38)) AND (d_year#37 = 2000)) AND (d_moy#38 = 1)) (54) Project [codegen id : 1] -Output [1]: [d_month_seq#18] -Input [3]: [d_month_seq#18, d_year#37, d_moy#38] +Output [1]: [d_month_seq#5] +Input [3]: [d_month_seq#5, d_year#37, d_moy#38] (55) HashAggregate [codegen id : 1] -Input [1]: [d_month_seq#18] -Keys [1]: [d_month_seq#18] +Input [1]: [d_month_seq#5] +Keys [1]: [d_month_seq#5] Functions: [] Aggregate Attributes: [] -Results [1]: [d_month_seq#18] +Results [1]: [d_month_seq#5] (56) Exchange -Input [1]: [d_month_seq#18] -Arguments: hashpartitioning(d_month_seq#18, 5), true, [id=#39] +Input [1]: [d_month_seq#5] +Arguments: hashpartitioning(d_month_seq#5, 5), true, [id=#39] (57) HashAggregate [codegen id : 2] -Input [1]: [d_month_seq#18] -Keys [1]: [d_month_seq#18] +Input [1]: [d_month_seq#5] +Keys [1]: [d_month_seq#5] Functions: [] Aggregate Attributes: [] -Results [1]: [d_month_seq#18] +Results [1]: [d_month_seq#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt index 3cbd44fc5a7d9..2700741b82c04 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt @@ -16,55 +16,55 @@ TakeOrderedAndProject [cnt,ca_state,state] Exchange [ss_customer_sk] #2 WholeStageCodegen (5) Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_customer_sk] - BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_customer_sk,ss_sold_date_sk,ss_item_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_customer_sk] InputAdapter BroadcastExchange #3 - WholeStageCodegen (3) - Project [i_item_sk] - Filter [i_current_price,avg(i_current_price)] - BroadcastHashJoin [i_category,i_category] - Filter [i_current_price,i_item_sk] - ColumnarToRow + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #1 + WholeStageCodegen (2) + HashAggregate [d_month_seq] InputAdapter - Scan parquet default.item [i_item_sk,i_current_price,i_category] + Exchange [d_month_seq] #4 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow InputAdapter - BroadcastExchange #4 - WholeStageCodegen (2) - HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),i_category,sum,count] - InputAdapter - Exchange [i_category] #5 - WholeStageCodegen (1) - HashAggregate [i_category,i_current_price] [sum,count,sum,count] - Filter [i_category] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_current_price,i_category] + Scan parquet default.date_dim [d_date_sk,d_month_seq] InputAdapter - BroadcastExchange #6 + BroadcastExchange #5 WholeStageCodegen (4) - Project [d_date_sk] - Filter [d_month_seq,d_date_sk] - Subquery #1 - WholeStageCodegen (2) - HashAggregate [d_month_seq] + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow InputAdapter - Exchange [d_month_seq] #7 - WholeStageCodegen (1) - HashAggregate [d_month_seq] - Project [d_month_seq] - Filter [d_year,d_moy] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_month_seq,d_year,d_moy] - ColumnarToRow + Scan parquet default.item [i_item_sk,i_current_price,i_category] InputAdapter - Scan parquet default.date_dim [d_date_sk,d_month_seq] + BroadcastExchange #6 + WholeStageCodegen (3) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),i_category,sum,count] + InputAdapter + Exchange [i_category] #7 + WholeStageCodegen (2) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] InputAdapter WholeStageCodegen (12) Sort [c_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt index 025e5a6f94741..e6210f4a26281 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt @@ -44,12 +44,12 @@ TakeOrderedAndProject (125) : : : : : +- * Project (23) : : : : : +- * Filter (22) : : : : : +- * ColumnarToRow (21) - : : : : : +- Scan parquet default.promotion (20) + : : : : : +- Scan parquet default.date_dim (20) : : : : +- BroadcastExchange (31) : : : : +- * Project (30) : : : : +- * Filter (29) : : : : +- * ColumnarToRow (28) - : : : : +- Scan parquet default.date_dim (27) + : : : : +- Scan parquet default.promotion (27) : : : +- BroadcastExchange (37) : : : +- * Filter (36) : : : +- * ColumnarToRow (35) @@ -210,67 +210,67 @@ Join condition: None Output [7]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, i_item_sk#14] -(20) Scan parquet default.promotion -Output [2]: [p_promo_sk#17, p_channel_tv#18] +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] Batched: true -Location [not included in comparison]/{warehouse_dir}/promotion] -PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] +ReadSchema: struct (21) ColumnarToRow [codegen id : 6] -Input [2]: [p_promo_sk#17, p_channel_tv#18] +Input [2]: [d_date_sk#17, d_date#18] (22) Filter [codegen id : 6] -Input [2]: [p_promo_sk#17, p_channel_tv#18] -Condition : ((isnotnull(p_channel_tv#18) AND (p_channel_tv#18 = N)) AND isnotnull(p_promo_sk#17)) +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 10442)) AND (d_date#18 <= 10472)) AND isnotnull(d_date_sk#17)) (23) Project [codegen id : 6] -Output [1]: [p_promo_sk#17] -Input [2]: [p_promo_sk#17, p_channel_tv#18] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] (24) BroadcastExchange -Input [1]: [p_promo_sk#17] +Input [1]: [d_date_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (25) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_promo_sk#4] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#17] Join condition: None (26) Project [codegen id : 9] -Output [6]: [ss_sold_date_sk#1, ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] -Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, p_promo_sk#17] +Output [6]: [ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] +Input [8]: [ss_sold_date_sk#1, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, d_date_sk#17] -(27) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_date#21] +(27) Scan parquet default.promotion +Output [2]: [p_promo_sk#20, p_channel_tv#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct (28) ColumnarToRow [codegen id : 7] -Input [2]: [d_date_sk#20, d_date#21] +Input [2]: [p_promo_sk#20, p_channel_tv#21] (29) Filter [codegen id : 7] -Input [2]: [d_date_sk#20, d_date#21] -Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 10442)) AND (d_date#21 <= 10472)) AND isnotnull(d_date_sk#20)) +Input [2]: [p_promo_sk#20, p_channel_tv#21] +Condition : ((isnotnull(p_channel_tv#21) AND (p_channel_tv#21 = N)) AND isnotnull(p_promo_sk#20)) (30) Project [codegen id : 7] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_date#21] +Output [1]: [p_promo_sk#20] +Input [2]: [p_promo_sk#20, p_channel_tv#21] (31) BroadcastExchange -Input [1]: [d_date_sk#20] +Input [1]: [p_promo_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (32) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#20] Join condition: None (33) Project [codegen id : 9] Output [5]: [ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12] -Input [7]: [ss_sold_date_sk#1, ss_store_sk#3, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, d_date_sk#20] +Input [7]: [ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#6, ss_net_profit#7, sr_return_amt#11, sr_net_loss#12, p_promo_sk#20] (34) Scan parquet default.store Output [2]: [s_store_sk#23, s_store_id#24] @@ -383,28 +383,28 @@ Output [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_s Input [9]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_item_sk#47, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, i_item_sk#14] (58) ReusedExchange [Reuses operator id: 24] -Output [1]: [p_promo_sk#17] +Output [1]: [d_date_sk#17] (59) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_promo_sk#48] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [cs_sold_date_sk#45] +Right keys [1]: [d_date_sk#17] Join condition: None (60) Project [codegen id : 19] -Output [6]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] -Input [8]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, p_promo_sk#17] +Output [6]: [cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] +Input [8]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, d_date_sk#17] (61) ReusedExchange [Reuses operator id: 31] -Output [1]: [d_date_sk#20] +Output [1]: [p_promo_sk#20] (62) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_sold_date_sk#45] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [cs_promo_sk#48] +Right keys [1]: [p_promo_sk#20] Join condition: None (63) Project [codegen id : 19] Output [5]: [cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56] -Input [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, d_date_sk#20] +Input [7]: [cs_catalog_page_sk#46, cs_promo_sk#48, cs_ext_sales_price#50, cs_net_profit#51, cr_return_amount#55, cr_net_loss#56, p_promo_sk#20] (64) Scan parquet default.catalog_page Output [2]: [cp_catalog_page_sk#58, cp_catalog_page_id#59] @@ -517,28 +517,28 @@ Output [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales Input [9]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, i_item_sk#14] (88) ReusedExchange [Reuses operator id: 24] -Output [1]: [p_promo_sk#17] +Output [1]: [d_date_sk#17] (89) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ws_promo_sk#83] -Right keys [1]: [p_promo_sk#17] +Left keys [1]: [ws_sold_date_sk#80] +Right keys [1]: [d_date_sk#17] Join condition: None (90) Project [codegen id : 29] -Output [6]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [8]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, p_promo_sk#17] +Output [6]: [ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] +Input [8]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, d_date_sk#17] (91) ReusedExchange [Reuses operator id: 31] -Output [1]: [d_date_sk#20] +Output [1]: [p_promo_sk#20] (92) BroadcastHashJoin [codegen id : 29] -Left keys [1]: [ws_sold_date_sk#80] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ws_promo_sk#83] +Right keys [1]: [p_promo_sk#20] Join condition: None (93) Project [codegen id : 29] Output [5]: [ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91] -Input [7]: [ws_sold_date_sk#80, ws_web_site_sk#82, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, d_date_sk#20] +Input [7]: [ws_web_site_sk#82, ws_promo_sk#83, ws_ext_sales_price#85, ws_net_profit#86, wr_return_amt#90, wr_net_loss#91, p_promo_sk#20] (94) Scan parquet default.web_site Output [2]: [web_site_sk#93, web_site_id#94] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt index ad59968740aaa..13781c8bd5993 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt @@ -32,9 +32,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] @@ -69,19 +69,19 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter BroadcastExchange #8 WholeStageCodegen (6) - Project [p_promo_sk] - Filter [p_channel_tv,p_promo_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_tv] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #9 WholeStageCodegen (7) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.promotion [p_promo_sk,p_channel_tv] InputAdapter BroadcastExchange #10 WholeStageCodegen (8) @@ -98,9 +98,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_promo_sk,p_promo_sk] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] @@ -127,9 +127,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #7 InputAdapter - ReusedExchange [p_promo_sk] #8 + ReusedExchange [d_date_sk] #8 InputAdapter - ReusedExchange [d_date_sk] #9 + ReusedExchange [p_promo_sk] #9 InputAdapter BroadcastExchange #14 WholeStageCodegen (18) @@ -146,9 +146,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] BroadcastHashJoin [ws_web_site_sk,web_site_sk] Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_promo_sk,p_promo_sk] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] @@ -175,9 +175,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #7 InputAdapter - ReusedExchange [p_promo_sk] #8 + ReusedExchange [d_date_sk] #8 InputAdapter - ReusedExchange [d_date_sk] #9 + ReusedExchange [p_promo_sk] #9 InputAdapter BroadcastExchange #18 WholeStageCodegen (28) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt index 6fa7b04a3b463..3104af37f1e82 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt @@ -9,24 +9,24 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * SortMergeJoin Inner (18) - :- * Sort (12) - : +- Exchange (11) - : +- * Project (10) - : +- * BroadcastHashJoin Inner BuildRight (9) - : :- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- BroadcastExchange (8) - : +- * Project (7) - : +- * Filter (6) - : +- * ColumnarToRow (5) - : +- Scan parquet default.date_dim (4) - +- * Sort (17) - +- Exchange (16) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.item (13) + +- Scan parquet default.date_dim (13) (1) Scan parquet default.store_sales @@ -36,122 +36,122 @@ Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 2] +(2) ColumnarToRow [codegen id : 1] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 2] +(3) Filter [codegen id : 1] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(4) Scan parquet default.date_dim -Output [2]: [d_date_sk#4, d_date#5] -Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +(4) Exchange +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#4] -(5) ColumnarToRow [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] +(5) Sort [codegen id : 2] +Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(6) Filter [codegen id : 1] -Input [2]: [d_date_sk#4, d_date#5] -Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) +(6) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(7) Project [codegen id : 1] -Output [1]: [d_date_sk#4] -Input [2]: [d_date_sk#4, d_date#5] +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(8) BroadcastExchange -Input [1]: [d_date_sk#4] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) -(9) BroadcastHashJoin [codegen id : 2] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#4] -Join condition: None +(9) Exchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] -(10) Project [codegen id : 2] -Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 -(11) Exchange -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#5] +Join condition: None -(12) Sort [codegen id : 3] -Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 +(12) Project [codegen id : 6] +Output [7]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -(13) Scan parquet default.item -Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] -(15) Filter [codegen id : 4] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) -(16) Exchange -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] -(17) Sort [codegen id : 5] -Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 +(17) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] -(18) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#8] +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#12] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Output [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] (21) Exchange -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#12 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] (26) Project [codegen id : 9] -Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) Exchange -Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt index ded65becfe826..7066245b3973e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt @@ -17,34 +17,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ss_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (2) - Project [ss_item_sk,ss_ext_sales_price] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (1) Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (1) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] InputAdapter - WholeStageCodegen (5) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #6 - WholeStageCodegen (4) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastExchange #6 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] From 4619acc3ce72a6df9ac849d045ecdbed56a562be Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Mon, 28 Sep 2020 00:00:30 +0300 Subject: [PATCH 06/11] style --- .../spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala index 51ecf781906ab..6419f0e2f6944 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala @@ -213,7 +213,7 @@ object JoinReorderDP extends PredicateHelper with Logging { // For the higher level k, we only need to search from lev to lev - k, because when building // a join from A and B, both A J B and B J A are handled. // Start searching from highest level to make sure that optimally ordered input doesn't get - // reordered into another plan with the same cost. + // reordered into another plan with the same cost. while (k >= lev - k) { val oneSideCandidates = existingLevels(k).values.toSeq for (i <- oneSideCandidates.indices) { From ee944e9b4df32eb96de1343787c990bc9c0c7cef Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Tue, 29 Sep 2020 07:23:44 +0300 Subject: [PATCH 07/11] Add UT --- .../joinReorder/JoinReorderSuite.scala | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala index ab70c8c61bb97..7827d405316dd 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/joinReorder/JoinReorderSuite.scala @@ -363,4 +363,51 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB assertEqualJoinPlans(Optimize, originalPlan3, bestPlan3) } + + test("SPARK-32995: Optimized plan should not get reordered to one with the same cost") { + // Define new columns and tables, so all join orders would have the same total cost + val columnInfo = AttributeMap(Seq( + attr("t1.col1") -> rangeColumnStat(5, 0), + attr("t1.col2") -> rangeColumnStat(5, 0), + attr("t2.col1") -> rangeColumnStat(5, 0), + attr("t2.col2") -> rangeColumnStat(5, 0), + attr("t3.col1") -> rangeColumnStat(5, 0), + attr("t3.col2") -> rangeColumnStat(5, 0) + )) + + val nameToAttr = columnInfo.map(kv => kv._1.name -> kv._1) + val nameToColInfo = columnInfo.map(kv => kv._1.name -> kv) + + val t1 = StatsTestPlan( + outputList = Seq("t1.col1", "t1.col2").map(nameToAttr), + rowCount = 1000, + size = Some(1000), + attributeStats = AttributeMap(Seq("t1.col1", "t1.col2").map(nameToColInfo))) + val t2 = StatsTestPlan( + outputList = Seq("t2.col1", "t2.col2").map(nameToAttr), + rowCount = 1000, + size = Some(1000), + attributeStats = AttributeMap(Seq("t2.col1", "t2.col2").map(nameToColInfo))) + val t3 = StatsTestPlan( + outputList = Seq("t3.col1", "t3.col2").map(nameToAttr), + rowCount = 1000, + size = Some(1000), + attributeStats = AttributeMap(Seq("t3.col1", "t3.col2").map(nameToColInfo))) + + // Right-deep + val originalPlan = t1.join( + t2.join(t3, Inner, Some(nameToAttr("t2.col2") === nameToAttr("t3.col2"))), + Inner, Some(nameToAttr("t1.col1") === nameToAttr("t2.col1"))) + + // Left-deep with the plans in the same order + val expectedPlan = + t1.join(t2, Inner, Some(nameToAttr("t1.col1") === nameToAttr("t2.col1"))) + .join(t3, Inner, Some(nameToAttr("t2.col2") === nameToAttr("t3.col2"))) + + // Right-deep gets turned into a left-deep + assertEqualJoinPlans(Optimize, originalPlan, expectedPlan) + + // Left-deep is not changed (the rule is idempotent) + assertEqualJoinPlans(Optimize, expectedPlan, expectedPlan) + } } From 6248e4aefa8790d0c31aae450d0353ee9bd2d87e Mon Sep 17 00:00:00 2001 From: Tanel Kiis Date: Tue, 5 Jan 2021 08:29:00 +0200 Subject: [PATCH 08/11] Merge branch 'master' into SPARK-33122 # Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/AliasHelper.scala # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/explain.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/simplified.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt # sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt --- .../q80a.sf100/explain.txt | 132 +----------- .../q80a.sf100/simplified.txt | 201 ++---------------- 2 files changed, 21 insertions(+), 312 deletions(-) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt index f2f8655d48c66..4a3bd6303bc2d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt @@ -1,131 +1,4 @@ == Physical Plan == -<<<<<<< HEAD -TakeOrderedAndProject (125) -+- * HashAggregate (124) - +- Exchange (123) - +- * HashAggregate (122) - +- Union (121) - :- * HashAggregate (115) - : +- Exchange (114) - : +- * HashAggregate (113) - : +- Union (112) - : :- * HashAggregate (106) - : : +- Exchange (105) - : : +- * HashAggregate (104) - : : +- Union (103) - : : :- * HashAggregate (42) - : : : +- Exchange (41) - : : : +- * HashAggregate (40) - : : : +- * Project (39) - : : : +- * BroadcastHashJoin Inner BuildRight (38) - : : : :- * Project (33) - : : : : +- * BroadcastHashJoin Inner BuildRight (32) - : : : : :- * Project (26) - : : : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : : : :- * Project (19) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (18) - : : : : : : :- * Project (12) - : : : : : : : +- SortMergeJoin LeftOuter (11) - : : : : : : : :- * Sort (5) - : : : : : : : : +- Exchange (4) - : : : : : : : : +- * Filter (3) - : : : : : : : : +- * ColumnarToRow (2) - : : : : : : : : +- Scan parquet default.store_sales (1) - : : : : : : : +- * Sort (10) - : : : : : : : +- Exchange (9) - : : : : : : : +- * Filter (8) - : : : : : : : +- * ColumnarToRow (7) - : : : : : : : +- Scan parquet default.store_returns (6) - : : : : : : +- BroadcastExchange (17) - : : : : : : +- * Project (16) - : : : : : : +- * Filter (15) - : : : : : : +- * ColumnarToRow (14) - : : : : : : +- Scan parquet default.item (13) - : : : : : +- BroadcastExchange (24) - : : : : : +- * Project (23) - : : : : : +- * Filter (22) - : : : : : +- * ColumnarToRow (21) - : : : : : +- Scan parquet default.date_dim (20) - : : : : +- BroadcastExchange (31) - : : : : +- * Project (30) - : : : : +- * Filter (29) - : : : : +- * ColumnarToRow (28) - : : : : +- Scan parquet default.promotion (27) - : : : +- BroadcastExchange (37) - : : : +- * Filter (36) - : : : +- * ColumnarToRow (35) - : : : +- Scan parquet default.store (34) - : : :- * HashAggregate (72) - : : : +- Exchange (71) - : : : +- * HashAggregate (70) - : : : +- * Project (69) - : : : +- * BroadcastHashJoin Inner BuildRight (68) - : : : :- * Project (63) - : : : : +- * BroadcastHashJoin Inner BuildRight (62) - : : : : :- * Project (60) - : : : : : +- * BroadcastHashJoin Inner BuildRight (59) - : : : : : :- * Project (57) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (56) - : : : : : : :- * Project (54) - : : : : : : : +- SortMergeJoin LeftOuter (53) - : : : : : : : :- * Sort (47) - : : : : : : : : +- Exchange (46) - : : : : : : : : +- * Filter (45) - : : : : : : : : +- * ColumnarToRow (44) - : : : : : : : : +- Scan parquet default.catalog_sales (43) - : : : : : : : +- * Sort (52) - : : : : : : : +- Exchange (51) - : : : : : : : +- * Filter (50) - : : : : : : : +- * ColumnarToRow (49) - : : : : : : : +- Scan parquet default.catalog_returns (48) - : : : : : : +- ReusedExchange (55) - : : : : : +- ReusedExchange (58) - : : : : +- ReusedExchange (61) - : : : +- BroadcastExchange (67) - : : : +- * Filter (66) - : : : +- * ColumnarToRow (65) - : : : +- Scan parquet default.catalog_page (64) - : : +- * HashAggregate (102) - : : +- Exchange (101) - : : +- * HashAggregate (100) - : : +- * Project (99) - : : +- * BroadcastHashJoin Inner BuildRight (98) - : : :- * Project (93) - : : : +- * BroadcastHashJoin Inner BuildRight (92) - : : : :- * Project (90) - : : : : +- * BroadcastHashJoin Inner BuildRight (89) - : : : : :- * Project (87) - : : : : : +- * BroadcastHashJoin Inner BuildRight (86) - : : : : : :- * Project (84) - : : : : : : +- SortMergeJoin LeftOuter (83) - : : : : : : :- * Sort (77) - : : : : : : : +- Exchange (76) - : : : : : : : +- * Filter (75) - : : : : : : : +- * ColumnarToRow (74) - : : : : : : : +- Scan parquet default.web_sales (73) - : : : : : : +- * Sort (82) - : : : : : : +- Exchange (81) - : : : : : : +- * Filter (80) - : : : : : : +- * ColumnarToRow (79) - : : : : : : +- Scan parquet default.web_returns (78) - : : : : : +- ReusedExchange (85) - : : : : +- ReusedExchange (88) - : : : +- ReusedExchange (91) - : : +- BroadcastExchange (97) - : : +- * Filter (96) - : : +- * ColumnarToRow (95) - : : +- Scan parquet default.web_site (94) - : +- * HashAggregate (111) - : +- Exchange (110) - : +- * HashAggregate (109) - : +- * HashAggregate (108) - : +- ReusedExchange (107) - +- * HashAggregate (120) - +- Exchange (119) - +- * HashAggregate (118) - +- * HashAggregate (117) - +- ReusedExchange (116) -======= TakeOrderedAndProject (121) +- * HashAggregate (120) +- Exchange (119) @@ -167,12 +40,12 @@ TakeOrderedAndProject (121) : : : : +- * Project (23) : : : : +- * Filter (22) : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.promotion (20) + : : : : +- Scan parquet default.date_dim (20) : : : +- BroadcastExchange (31) : : : +- * Project (30) : : : +- * Filter (29) : : : +- * ColumnarToRow (28) - : : : +- Scan parquet default.date_dim (27) + : : : +- Scan parquet default.promotion (27) : : +- BroadcastExchange (37) : : +- * Filter (36) : : +- * ColumnarToRow (35) @@ -247,7 +120,6 @@ TakeOrderedAndProject (121) +- * HashAggregate (114) +- * HashAggregate (113) +- ReusedExchange (112) ->>>>>>> master (1) Scan parquet default.store_sales diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt index ea91bb4f64342..a145f2600810c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt @@ -18,177 +18,15 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (10) HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] InputAdapter -<<<<<<< HEAD - Exchange [channel,id] #3 - WholeStageCodegen (31) - HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] - InputAdapter - Union - WholeStageCodegen (10) - HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] - InputAdapter - Exchange [s_store_id] #4 - WholeStageCodegen (9) - HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] - Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] - BroadcastHashJoin [ss_store_sk,s_store_sk] - Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] - Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_item_sk,i_item_sk] - Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - InputAdapter - SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] - WholeStageCodegen (2) - Sort [ss_item_sk,ss_ticket_number] - InputAdapter - Exchange [ss_item_sk,ss_ticket_number] #5 - WholeStageCodegen (1) - Filter [ss_sold_date_sk,ss_store_sk,ss_item_sk,ss_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_ext_sales_price,ss_net_profit] - WholeStageCodegen (4) - Sort [sr_item_sk,sr_ticket_number] - InputAdapter - Exchange [sr_item_sk,sr_ticket_number] #6 - WholeStageCodegen (3) - Filter [sr_item_sk,sr_ticket_number] - ColumnarToRow - InputAdapter - Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (5) - Project [i_item_sk] - Filter [i_current_price,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_current_price] - InputAdapter - BroadcastExchange #8 - WholeStageCodegen (6) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] - InputAdapter - BroadcastExchange #9 - WholeStageCodegen (7) - Project [p_promo_sk] - Filter [p_channel_tv,p_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_tv] - InputAdapter - BroadcastExchange #10 - WholeStageCodegen (8) - Filter [s_store_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store [s_store_sk,s_store_id] - WholeStageCodegen (20) - HashAggregate [cp_catalog_page_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(cs_ext_sales_price)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(cs_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] - InputAdapter - Exchange [cp_catalog_page_id] #11 - WholeStageCodegen (19) - HashAggregate [cp_catalog_page_id,cs_ext_sales_price,cr_return_amount,cs_net_profit,cr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] - Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] - BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] - Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_promo_sk,p_promo_sk] - Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_item_sk,i_item_sk] - Project [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - InputAdapter - SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] - WholeStageCodegen (12) - Sort [cs_item_sk,cs_order_number] - InputAdapter - Exchange [cs_item_sk,cs_order_number] #12 - WholeStageCodegen (11) - Filter [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_ext_sales_price,cs_net_profit] - WholeStageCodegen (14) - Sort [cr_item_sk,cr_order_number] - InputAdapter - Exchange [cr_item_sk,cr_order_number] #13 - WholeStageCodegen (13) - Filter [cr_item_sk,cr_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss] - InputAdapter - ReusedExchange [i_item_sk] #7 - InputAdapter - ReusedExchange [d_date_sk] #8 - InputAdapter - ReusedExchange [p_promo_sk] #9 - InputAdapter - BroadcastExchange #14 - WholeStageCodegen (18) - Filter [cp_catalog_page_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] - WholeStageCodegen (30) - HashAggregate [web_site_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ws_ext_sales_price)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ws_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] - InputAdapter - Exchange [web_site_id] #15 - WholeStageCodegen (29) - HashAggregate [web_site_id,ws_ext_sales_price,wr_return_amt,ws_net_profit,wr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] - Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] - BroadcastHashJoin [ws_web_site_sk,web_site_sk] - Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_promo_sk,p_promo_sk] - Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_item_sk,i_item_sk] - Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - InputAdapter - SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] - WholeStageCodegen (22) - Sort [ws_item_sk,ws_order_number] - InputAdapter - Exchange [ws_item_sk,ws_order_number] #16 - WholeStageCodegen (21) - Filter [ws_sold_date_sk,ws_web_site_sk,ws_item_sk,ws_promo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit] - WholeStageCodegen (24) - Sort [wr_item_sk,wr_order_number] - InputAdapter - Exchange [wr_item_sk,wr_order_number] #17 - WholeStageCodegen (23) - Filter [wr_item_sk,wr_order_number] - ColumnarToRow - InputAdapter - Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] - InputAdapter - ReusedExchange [i_item_sk] #7 - InputAdapter - ReusedExchange [d_date_sk] #8 - InputAdapter - ReusedExchange [p_promo_sk] #9 -======= Exchange [s_store_id] #3 WholeStageCodegen (9) HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] BroadcastHashJoin [ss_store_sk,s_store_sk] Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] - BroadcastHashJoin [ss_promo_sk,p_promo_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Project [ss_sold_date_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] BroadcastHashJoin [ss_item_sk,i_item_sk] Project [ss_sold_date_sk,ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] @@ -223,20 +61,19 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter BroadcastExchange #7 WholeStageCodegen (6) - Project [p_promo_sk] - Filter [p_channel_tv,p_promo_sk] + Project [d_date_sk] + Filter [d_date,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.promotion [p_promo_sk,p_channel_tv] + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter BroadcastExchange #8 WholeStageCodegen (7) - Project [d_date_sk] - Filter [d_date,d_date_sk] + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] ColumnarToRow ->>>>>>> master InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + Scan parquet default.promotion [p_promo_sk,p_channel_tv] InputAdapter BroadcastExchange #9 WholeStageCodegen (8) @@ -253,9 +90,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] - BroadcastHashJoin [cs_promo_sk,p_promo_sk] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] BroadcastHashJoin [cs_item_sk,i_item_sk] Project [cs_sold_date_sk,cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] @@ -282,9 +119,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #6 InputAdapter - ReusedExchange [p_promo_sk] #7 + ReusedExchange [d_date_sk] #7 InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [p_promo_sk] #8 InputAdapter BroadcastExchange #13 WholeStageCodegen (18) @@ -301,9 +138,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] BroadcastHashJoin [ws_web_site_sk,web_site_sk] Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] - BroadcastHashJoin [ws_promo_sk,p_promo_sk] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Project [ws_sold_date_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] BroadcastHashJoin [ws_item_sk,i_item_sk] Project [ws_sold_date_sk,ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] @@ -330,9 +167,9 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] InputAdapter ReusedExchange [i_item_sk] #6 InputAdapter - ReusedExchange [p_promo_sk] #7 + ReusedExchange [d_date_sk] #7 InputAdapter - ReusedExchange [d_date_sk] #8 + ReusedExchange [p_promo_sk] #8 InputAdapter BroadcastExchange #17 WholeStageCodegen (28) From 09c5da8f27c6ccc0093f305b867157e02d1551db Mon Sep 17 00:00:00 2001 From: Tanel Kiis Date: Tue, 5 Jan 2021 15:25:45 +0200 Subject: [PATCH 09/11] Rerun PlanStabilitySuite --- .../approved-plans-v1_4/q12.sf100/explain.txt | 174 ++++++++--------- .../q12.sf100/simplified.txt | 52 ++--- .../approved-plans-v1_4/q20.sf100/explain.txt | 174 ++++++++--------- .../q20.sf100/simplified.txt | 52 ++--- .../approved-plans-v1_4/q98.sf100/explain.txt | 182 +++++++++--------- .../q98.sf100/simplified.txt | 52 ++--- .../approved-plans-v2_7/q12.sf100/explain.txt | 174 ++++++++--------- .../q12.sf100/simplified.txt | 52 ++--- .../approved-plans-v2_7/q20.sf100/explain.txt | 174 ++++++++--------- .../q20.sf100/simplified.txt | 52 ++--- .../approved-plans-v2_7/q98.sf100/explain.txt | 178 ++++++++--------- .../q98.sf100/simplified.txt | 52 ++--- 12 files changed, 684 insertions(+), 684 deletions(-) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt index d6da0e09de6be..36704d3e67ca7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Exchange -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] -Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] -Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt index 2207b0fee23ce..e9b94a6b4651c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (1) + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (2) + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt index 3a4c1989fec9e..ed6f3a52f0f86 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.catalog_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(4) Exchange -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] -Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] -Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt index 965b68218eb0a..1e8ab18f5e21a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [cs_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (1) + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (2) + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt index 77df1b031ed67..213175dc26f97 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -10,24 +10,24 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.store_sales @@ -37,126 +37,126 @@ Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(4) Exchange -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#6] +Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21, i_item_id#9] (23) Exchange -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] -Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] +Output [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#9] +Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9, _we0#23] (27) Exchange -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] -Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] -Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] +Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 (29) Project [codegen id : 10] -Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] -Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Output [6]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt index c6ce597f3c1bf..a180ed2b060b9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt @@ -18,34 +18,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ss_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (1) + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt index 416f0210e9fe1..9730c76185719 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.web_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.web_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] Condition : (isnotnull(ws_item_sk#2) AND isnotnull(ws_sold_date_sk#1)) -(4) Exchange -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3] -Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [ws_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: hashpartitioning(ws_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] +Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ws_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [ws_sold_date_sk#1, ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ws_item_sk#2, ws_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ws_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [ws_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#3))#18] -Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] -Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt index cfb9973ef6983..d8db515f84f68 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Project [ws_sold_date_sk,ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ws_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ws_item_sk] - InputAdapter - Exchange [ws_item_sk] #3 - WholeStageCodegen (1) + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (2) + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] Filter [ws_item_sk,ws_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.web_sales [ws_sold_date_sk,ws_item_sk,ws_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt index 01f65c4403942..1df1f3ad5af25 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -8,24 +8,24 @@ TakeOrderedAndProject (27) +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.catalog_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.catalog_sales @@ -35,118 +35,118 @@ Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) -(4) Exchange -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3] -Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [cs_sold_date_sk#1, cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [cs_item_sk#2, cs_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [cs_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [cs_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#3))#18] -Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) TakeOrderedAndProject -Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] -Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt index 3f5e15881c33c..e66efff75180a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt @@ -14,34 +14,34 @@ TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_c WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Project [cs_sold_date_sk,cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [cs_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [cs_item_sk] - InputAdapter - Exchange [cs_item_sk] #3 - WholeStageCodegen (1) + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (2) + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] Filter [cs_item_sk,cs_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.catalog_sales [cs_sold_date_sk,cs_item_sk,cs_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #4 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt index 3104af37f1e82..c27fbd88d69b7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt @@ -9,24 +9,24 @@ +- Exchange (21) +- * HashAggregate (20) +- * Project (19) - +- * BroadcastHashJoin Inner BuildRight (18) - :- * Project (12) - : +- * SortMergeJoin Inner (11) - : :- * Sort (5) - : : +- Exchange (4) - : : +- * Filter (3) - : : +- * ColumnarToRow (2) - : : +- Scan parquet default.store_sales (1) - : +- * Sort (10) - : +- Exchange (9) - : +- * Filter (8) - : +- * ColumnarToRow (7) - : +- Scan parquet default.item (6) - +- BroadcastExchange (17) - +- * Project (16) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) +- * Filter (15) +- * ColumnarToRow (14) - +- Scan parquet default.date_dim (13) + +- Scan parquet default.item (13) (1) Scan parquet default.store_sales @@ -36,122 +36,122 @@ Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(2) ColumnarToRow [codegen id : 1] +(2) ColumnarToRow [codegen id : 2] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -(3) Filter [codegen id : 1] +(3) Filter [codegen id : 2] Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] Condition : (isnotnull(ss_item_sk#2) AND isnotnull(ss_sold_date_sk#1)) -(4) Exchange -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#4] - -(5) Sort [codegen id : 2] -Input [3]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3] -Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 - -(6) Scan parquet default.item -Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] Batched: true -Location [not included in comparison]/{warehouse_dir}/item] -PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct -(7) ColumnarToRow [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] -(8) Filter [codegen id : 3] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Condition : (i_category#10 IN (Sports,Books,Home) AND isnotnull(i_item_sk#5)) +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#4, d_date#5] +Condition : (((isnotnull(d_date#5) AND (d_date#5 >= 10644)) AND (d_date#5 <= 10674)) AND isnotnull(d_date_sk#4)) -(9) Exchange -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: hashpartitioning(i_item_sk#5, 5), true, [id=#11] +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] -(10) Sort [codegen id : 4] -Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Arguments: [i_item_sk#5 ASC NULLS FIRST], false, 0 +(8) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] -(11) SortMergeJoin [codegen id : 6] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#5] +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#1] +Right keys [1]: [d_date_sk#4] Join condition: None -(12) Project [codegen id : 6] -Output [7]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +(10) Project [codegen id : 2] +Output [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] + +(11) Exchange +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: hashpartitioning(ss_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(12) Sort [codegen id : 3] +Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] +Arguments: [ss_item_sk#2 ASC NULLS FIRST], false, 0 -(13) Scan parquet default.date_dim -Output [2]: [d_date_sk#12, d_date#13] +(13) Scan parquet default.item +Output [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/date_dim] -PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports,Books,Home]), IsNotNull(i_item_sk)] +ReadSchema: struct -(14) ColumnarToRow [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -(15) Filter [codegen id : 5] -Input [2]: [d_date_sk#12, d_date#13] -Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 10644)) AND (d_date#13 <= 10674)) AND isnotnull(d_date_sk#12)) +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) -(16) Project [codegen id : 5] -Output [1]: [d_date_sk#12] -Input [2]: [d_date_sk#12, d_date#13] +(16) Exchange +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] -(17) BroadcastExchange -Input [1]: [d_date_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Arguments: [i_item_sk#8 ASC NULLS FIRST], false, 0 -(18) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#1] -Right keys [1]: [d_date_sk#12] +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#2] +Right keys [1]: [i_item_sk#8] Join condition: None (19) Project [codegen id : 6] -Output [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Input [8]: [ss_sold_date_sk#1, ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] +Output [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Input [8]: [ss_item_sk#2, ss_ext_sales_price#3, i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] (20) HashAggregate [codegen id : 6] -Input [6]: [ss_ext_sales_price#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [ss_ext_sales_price#3, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum#15] -Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] (21) Exchange -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), true, [id=#17] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] (22) HashAggregate [codegen id : 7] -Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] -Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] +Keys [5]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11] Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#18] -Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21] +Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#18,17,2) AS _w1#21] (23) Exchange -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#9, 5), true, [id=#22] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] (24) Sort [codegen id : 8] -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [i_class#9 ASC NULLS FIRST], false, 0 +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#12 ASC NULLS FIRST], false, 0 (25) Window -Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] -Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] +Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#12] (26) Project [codegen id : 9] -Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] -Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] +Output [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, _we0#23] (27) Exchange -Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] -Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] +Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] (28) Sort [codegen id : 10] -Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] -Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 +Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] +Arguments: [i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt index 7066245b3973e..ded65becfe826 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt @@ -17,34 +17,34 @@ WholeStageCodegen (10) WholeStageCodegen (6) HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [ss_sold_date_sk,ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] - SortMergeJoin [ss_item_sk,i_item_sk] - InputAdapter - WholeStageCodegen (2) - Sort [ss_item_sk] - InputAdapter - Exchange [ss_item_sk] #4 - WholeStageCodegen (1) + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] Filter [ss_item_sk,ss_sold_date_sk] ColumnarToRow InputAdapter Scan parquet default.store_sales [ss_sold_date_sk,ss_item_sk,ss_ext_sales_price] - InputAdapter - WholeStageCodegen (4) - Sort [i_item_sk] - InputAdapter - Exchange [i_item_sk] #5 - WholeStageCodegen (3) - Filter [i_category,i_item_sk] - ColumnarToRow - InputAdapter - Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] InputAdapter - BroadcastExchange #6 - WholeStageCodegen (5) - Project [d_date_sk] - Filter [d_date,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] From f815feb15237049724d7033e7242577adbbab7b8 Mon Sep 17 00:00:00 2001 From: Tanel Kiis Date: Tue, 5 Jan 2021 15:31:23 +0200 Subject: [PATCH 10/11] Rerun PlanStabilitySuite --- .../approved-plans-v1_4/q12.sf100/explain.txt | 8 ++++---- .../approved-plans-v1_4/q16.sf100/explain.txt | 8 ++++---- .../approved-plans-v1_4/q20.sf100/explain.txt | 8 ++++---- .../approved-plans-v1_4/q22.sf100/explain.txt | 6 +++--- .../approved-plans-v1_4/q26.sf100/explain.txt | 2 +- .../approved-plans-v1_4/q6.sf100/explain.txt | 14 ++++++------- .../approved-plans-v1_4/q7.sf100/explain.txt | 2 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 20 +++++++++---------- .../approved-plans-v1_4/q94.sf100/explain.txt | 12 +++++------ .../approved-plans-v1_4/q98.sf100/explain.txt | 10 +++++----- .../approved-plans-v2_7/q12.sf100/explain.txt | 8 ++++---- .../approved-plans-v2_7/q20.sf100/explain.txt | 8 ++++---- .../q22a.sf100/explain.txt | 14 ++++++------- .../q27a.sf100/explain.txt | 6 +++--- .../approved-plans-v2_7/q6.sf100/explain.txt | 14 ++++++------- .../approved-plans-v2_7/q98.sf100/explain.txt | 10 +++++----- 16 files changed, 75 insertions(+), 75 deletions(-) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt index 36704d3e67ca7..b4dd8173664b6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -75,7 +75,7 @@ Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] @@ -97,7 +97,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -121,7 +121,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -132,7 +132,7 @@ Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, Mak (23) Exchange Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt index 0158b69f8adfc..2239e0feefc50 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -61,7 +61,7 @@ Condition : ((isnotnull(cs_ship_date_sk#1) AND isnotnull(cs_ship_addr_sk#2)) AND (4) Exchange Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Arguments: hashpartitioning(cs_order_number#5, 5), true, [id=#8] +Arguments: hashpartitioning(cs_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#8] (5) Sort [codegen id : 2] Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] @@ -82,7 +82,7 @@ Input [2]: [cs_warehouse_sk#4, cs_order_number#5] (9) Exchange Input [2]: [cs_warehouse_sk#4#9, cs_order_number#5#10] -Arguments: hashpartitioning(cs_order_number#5#10, 5), true, [id=#11] +Arguments: hashpartitioning(cs_order_number#5#10, 5), ENSURE_REQUIREMENTS, [id=#11] (10) Sort [codegen id : 4] Input [2]: [cs_warehouse_sk#4#9, cs_order_number#5#10] @@ -108,7 +108,7 @@ Input [1]: [cr_order_number#12] (15) Exchange Input [1]: [cr_order_number#12] -Arguments: hashpartitioning(cr_order_number#12, 5), true, [id=#13] +Arguments: hashpartitioning(cr_order_number#12, 5), ENSURE_REQUIREMENTS, [id=#13] (16) Sort [codegen id : 7] Input [1]: [cr_order_number#12] @@ -235,7 +235,7 @@ Results [3]: [sum#25, sum#26, count#28] (42) Exchange Input [3]: [sum#25, sum#26, count#28] -Arguments: SinglePartition, true, [id=#29] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#29] (43) HashAggregate [codegen id : 12] Input [3]: [sum#25, sum#26, count#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt index ed6f3a52f0f86..2ef3660bc7ba4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -75,7 +75,7 @@ Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] @@ -97,7 +97,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -121,7 +121,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -132,7 +132,7 @@ Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, Mak (23) Exchange Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt index 9319644f52d16..11bf92c7b2505 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt @@ -105,7 +105,7 @@ Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehou (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Arguments: hashpartitioning(inv_item_sk#2, 5), true, [id=#10] +Arguments: hashpartitioning(inv_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#10] (18) Sort [codegen id : 4] Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] @@ -127,7 +127,7 @@ Condition : isnotnull(i_item_sk#11) (22) Exchange Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] -Arguments: hashpartitioning(i_item_sk#11, 5), true, [id=#16] +Arguments: hashpartitioning(i_item_sk#11, 5), ENSURE_REQUIREMENTS, [id=#16] (23) Sort [codegen id : 6] Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] @@ -155,7 +155,7 @@ Results [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_gr (28) Exchange Input [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, sum#24, count#25] -Arguments: hashpartitioning(i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, 5), true, [id=#26] +Arguments: hashpartitioning(i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, 5), ENSURE_REQUIREMENTS, [id=#26] (29) HashAggregate [codegen id : 8] Input [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, sum#24, count#25] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt index 366af10af1f32..f3651c16e81b1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt @@ -178,7 +178,7 @@ Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37 (32) Exchange Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] -Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] +Arguments: hashpartitioning(i_item_id#22, 5), ENSURE_REQUIREMENTS, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt index 511e1b46cd7a7..5688c706e6725 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt @@ -133,7 +133,7 @@ Results [3]: [i_category#11, sum#14, count#15] (18) Exchange Input [3]: [i_category#11, sum#14, count#15] -Arguments: hashpartitioning(i_category#11, 5), true, [id=#16] +Arguments: hashpartitioning(i_category#11, 5), ENSURE_REQUIREMENTS, [id=#16] (19) HashAggregate [codegen id : 3] Input [3]: [i_category#11, sum#14, count#15] @@ -174,7 +174,7 @@ Input [3]: [ss_item_sk#2, ss_customer_sk#3, i_item_sk#9] (27) Exchange Input [1]: [ss_customer_sk#3] -Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#22] +Arguments: hashpartitioning(ss_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#22] (28) Sort [codegen id : 6] Input [1]: [ss_customer_sk#3] @@ -196,7 +196,7 @@ Condition : isnotnull(ca_address_sk#23) (32) Exchange Input [2]: [ca_address_sk#23, ca_state#24] -Arguments: hashpartitioning(ca_address_sk#23, 5), true, [id=#25] +Arguments: hashpartitioning(ca_address_sk#23, 5), ENSURE_REQUIREMENTS, [id=#25] (33) Sort [codegen id : 8] Input [2]: [ca_address_sk#23, ca_state#24] @@ -218,7 +218,7 @@ Condition : (isnotnull(c_current_addr_sk#27) AND isnotnull(c_customer_sk#26)) (37) Exchange Input [2]: [c_customer_sk#26, c_current_addr_sk#27] -Arguments: hashpartitioning(c_current_addr_sk#27, 5), true, [id=#28] +Arguments: hashpartitioning(c_current_addr_sk#27, 5), ENSURE_REQUIREMENTS, [id=#28] (38) Sort [codegen id : 10] Input [2]: [c_customer_sk#26, c_current_addr_sk#27] @@ -235,7 +235,7 @@ Input [4]: [ca_address_sk#23, ca_state#24, c_customer_sk#26, c_current_addr_sk#2 (41) Exchange Input [2]: [ca_state#24, c_customer_sk#26] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#29] +Arguments: hashpartitioning(c_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#29] (42) Sort [codegen id : 12] Input [2]: [ca_state#24, c_customer_sk#26] @@ -259,7 +259,7 @@ Results [2]: [ca_state#24, count#31] (46) Exchange Input [2]: [ca_state#24, count#31] -Arguments: hashpartitioning(ca_state#24, 5), true, [id=#32] +Arguments: hashpartitioning(ca_state#24, 5), ENSURE_REQUIREMENTS, [id=#32] (47) HashAggregate [codegen id : 14] Input [2]: [ca_state#24, count#31] @@ -319,7 +319,7 @@ Results [1]: [d_month_seq#5] (56) Exchange Input [1]: [d_month_seq#5] -Arguments: hashpartitioning(d_month_seq#5, 5), true, [id=#39] +Arguments: hashpartitioning(d_month_seq#5, 5), ENSURE_REQUIREMENTS, [id=#39] (57) HashAggregate [codegen id : 2] Input [1]: [d_month_seq#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt index 7831cda65bd46..ba933b7c76a7c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt @@ -178,7 +178,7 @@ Results [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37 (32) Exchange Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] -Arguments: hashpartitioning(i_item_id#22, 5), true, [id=#40] +Arguments: hashpartitioning(i_item_id#22, 5), ENSURE_REQUIREMENTS, [id=#40] (33) HashAggregate [codegen id : 6] Input [9]: [i_item_id#22, sum#32, count#33, sum#34, count#35, sum#36, count#37, sum#38, count#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt index 057d786afbcdd..ef7a97bf17d19 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -125,7 +125,7 @@ Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#3)) AND is (4) Exchange Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_net_profit#7] -Arguments: hashpartitioning(cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint), 5), true, [id=#8] +Arguments: hashpartitioning(cast(ss_item_sk#2 as bigint), cast(ss_ticket_number#5 as bigint), 5), ENSURE_REQUIREMENTS, [id=#8] (5) Sort [codegen id : 2] Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_net_profit#7] @@ -147,7 +147,7 @@ Condition : (isnotnull(sr_item_sk#9) AND isnotnull(sr_ticket_number#10)) (9) Exchange Input [4]: [sr_item_sk#9, sr_ticket_number#10, sr_return_amt#11, sr_net_loss#12] -Arguments: hashpartitioning(sr_item_sk#9, sr_ticket_number#10, 5), true, [id=#13] +Arguments: hashpartitioning(sr_item_sk#9, sr_ticket_number#10, 5), ENSURE_REQUIREMENTS, [id=#13] (10) Sort [codegen id : 4] Input [4]: [sr_item_sk#9, sr_ticket_number#10, sr_return_amt#11, sr_net_loss#12] @@ -291,7 +291,7 @@ Results [6]: [s_store_id#24, sum#31, sum#32, isEmpty#33, sum#34, isEmpty#35] (41) Exchange Input [6]: [s_store_id#24, sum#31, sum#32, isEmpty#33, sum#34, isEmpty#35] -Arguments: hashpartitioning(s_store_id#24, 5), true, [id=#36] +Arguments: hashpartitioning(s_store_id#24, 5), ENSURE_REQUIREMENTS, [id=#36] (42) HashAggregate [codegen id : 10] Input [6]: [s_store_id#24, sum#31, sum#32, isEmpty#33, sum#34, isEmpty#35] @@ -316,7 +316,7 @@ Condition : (((isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46 (46) Exchange Input [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_item_sk#47, cs_promo_sk#48, cs_order_number#49, cs_ext_sales_price#50, cs_net_profit#51] -Arguments: hashpartitioning(cs_item_sk#47, cs_order_number#49, 5), true, [id=#52] +Arguments: hashpartitioning(cs_item_sk#47, cs_order_number#49, 5), ENSURE_REQUIREMENTS, [id=#52] (47) Sort [codegen id : 12] Input [7]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_item_sk#47, cs_promo_sk#48, cs_order_number#49, cs_ext_sales_price#50, cs_net_profit#51] @@ -338,7 +338,7 @@ Condition : (isnotnull(cr_item_sk#53) AND isnotnull(cr_order_number#54)) (51) Exchange Input [4]: [cr_item_sk#53, cr_order_number#54, cr_return_amount#55, cr_net_loss#56] -Arguments: hashpartitioning(cr_item_sk#53, cr_order_number#54, 5), true, [id=#57] +Arguments: hashpartitioning(cr_item_sk#53, cr_order_number#54, 5), ENSURE_REQUIREMENTS, [id=#57] (52) Sort [codegen id : 14] Input [4]: [cr_item_sk#53, cr_order_number#54, cr_return_amount#55, cr_net_loss#56] @@ -425,7 +425,7 @@ Results [6]: [cp_catalog_page_id#59, sum#66, sum#67, isEmpty#68, sum#69, isEmpty (71) Exchange Input [6]: [cp_catalog_page_id#59, sum#66, sum#67, isEmpty#68, sum#69, isEmpty#70] -Arguments: hashpartitioning(cp_catalog_page_id#59, 5), true, [id=#71] +Arguments: hashpartitioning(cp_catalog_page_id#59, 5), ENSURE_REQUIREMENTS, [id=#71] (72) HashAggregate [codegen id : 20] Input [6]: [cp_catalog_page_id#59, sum#66, sum#67, isEmpty#68, sum#69, isEmpty#70] @@ -450,7 +450,7 @@ Condition : (((isnotnull(ws_sold_date_sk#80) AND isnotnull(ws_web_site_sk#82)) A (76) Exchange Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] -Arguments: hashpartitioning(cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint), 5), true, [id=#87] +Arguments: hashpartitioning(cast(ws_item_sk#81 as bigint), cast(ws_order_number#84 as bigint), 5), ENSURE_REQUIREMENTS, [id=#87] (77) Sort [codegen id : 22] Input [7]: [ws_sold_date_sk#80, ws_item_sk#81, ws_web_site_sk#82, ws_promo_sk#83, ws_order_number#84, ws_ext_sales_price#85, ws_net_profit#86] @@ -472,7 +472,7 @@ Condition : (isnotnull(wr_item_sk#88) AND isnotnull(wr_order_number#89)) (81) Exchange Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] -Arguments: hashpartitioning(wr_item_sk#88, wr_order_number#89, 5), true, [id=#92] +Arguments: hashpartitioning(wr_item_sk#88, wr_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#92] (82) Sort [codegen id : 24] Input [4]: [wr_item_sk#88, wr_order_number#89, wr_return_amt#90, wr_net_loss#91] @@ -559,7 +559,7 @@ Results [6]: [web_site_id#94, sum#101, sum#102, isEmpty#103, sum#104, isEmpty#10 (101) Exchange Input [6]: [web_site_id#94, sum#101, sum#102, isEmpty#103, sum#104, isEmpty#105] -Arguments: hashpartitioning(web_site_id#94, 5), true, [id=#106] +Arguments: hashpartitioning(web_site_id#94, 5), ENSURE_REQUIREMENTS, [id=#106] (102) HashAggregate [codegen id : 30] Input [6]: [web_site_id#94, sum#101, sum#102, isEmpty#103, sum#104, isEmpty#105] @@ -583,7 +583,7 @@ Results [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, (106) Exchange Input [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, sum#126, isEmpty#127, sum#128, isEmpty#129] -Arguments: hashpartitioning(channel#115, id#116, spark_grouping_id#117, 5), true, [id=#130] +Arguments: hashpartitioning(channel#115, id#116, spark_grouping_id#117, 5), ENSURE_REQUIREMENTS, [id=#130] (107) HashAggregate [codegen id : 32] Input [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, sum#126, isEmpty#127, sum#128, isEmpty#129] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 4eb3d1a494841..1edf1cdf5212b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -64,7 +64,7 @@ Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND (4) Exchange Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#8] +Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#8] (5) Sort [codegen id : 2] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] @@ -85,7 +85,7 @@ Input [2]: [ws_warehouse_sk#4, ws_order_number#5] (9) Exchange Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] -Arguments: hashpartitioning(ws_order_number#5#10, 5), true, [id=#11] +Arguments: hashpartitioning(ws_order_number#5#10, 5), ENSURE_REQUIREMENTS, [id=#11] (10) Sort [codegen id : 4] Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10] @@ -102,7 +102,7 @@ Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse (13) Exchange Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), true, [id=#12] +Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), ENSURE_REQUIREMENTS, [id=#12] (14) Sort [codegen id : 6] Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] @@ -119,7 +119,7 @@ Input [1]: [wr_order_number#13] (17) Exchange Input [1]: [wr_order_number#13] -Arguments: hashpartitioning(wr_order_number#13, 5), true, [id=#14] +Arguments: hashpartitioning(wr_order_number#13, 5), ENSURE_REQUIREMENTS, [id=#14] (18) Sort [codegen id : 8] Input [1]: [wr_order_number#13] @@ -232,7 +232,7 @@ Results [3]: [ws_order_number#5, sum#26, sum#27] (42) Exchange Input [3]: [ws_order_number#5, sum#26, sum#27] -Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#28] +Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#28] (43) HashAggregate [codegen id : 13] Input [3]: [ws_order_number#5, sum#26, sum#27] @@ -250,7 +250,7 @@ Results [3]: [sum#26, sum#27, count#30] (45) Exchange Input [3]: [sum#26, sum#27, count#30] -Arguments: SinglePartition, true, [id=#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#31] (46) HashAggregate [codegen id : 14] Input [3]: [sum#26, sum#27, count#30] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt index 213175dc26f97..30dabdd2d5523 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -77,7 +77,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] @@ -99,7 +99,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -123,7 +123,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -134,7 +134,7 @@ Results [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, Mak (23) Exchange Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21, i_item_id#9] @@ -150,7 +150,7 @@ Input [9]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemr (27) Exchange Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] -Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] +Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] Input [7]: [i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24, i_item_id#9] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt index 9730c76185719..c1bf12b7c2c5a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt @@ -75,7 +75,7 @@ Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] -Arguments: hashpartitioning(ws_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ws_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [ws_item_sk#2, ws_ext_sales_price#3] @@ -97,7 +97,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -121,7 +121,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -132,7 +132,7 @@ Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (23) Exchange Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt index 1df1f3ad5af25..15cde1a45a99b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -75,7 +75,7 @@ Input [4]: [cs_sold_date_sk#1, cs_item_sk#2, cs_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] -Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(cs_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [cs_item_sk#2, cs_ext_sales_price#3] @@ -97,7 +97,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -121,7 +121,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -132,7 +132,7 @@ Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (23) Exchange Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt index 1aae8564295f1..f724368c7992a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt @@ -127,7 +127,7 @@ Input [4]: [inv_item_sk#2, inv_warehouse_sk#3, inv_quantity_on_hand#4, w_warehou (17) Exchange Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] -Arguments: hashpartitioning(inv_item_sk#2, 5), true, [id=#10] +Arguments: hashpartitioning(inv_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#10] (18) Sort [codegen id : 4] Input [2]: [inv_item_sk#2, inv_quantity_on_hand#4] @@ -149,7 +149,7 @@ Condition : isnotnull(i_item_sk#11) (22) Exchange Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] -Arguments: hashpartitioning(i_item_sk#11, 5), true, [id=#16] +Arguments: hashpartitioning(i_item_sk#11, 5), ENSURE_REQUIREMENTS, [id=#16] (23) Sort [codegen id : 6] Input [5]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14, i_product_name#15] @@ -173,7 +173,7 @@ Results [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, (27) Exchange Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] -Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, i_category#14, 5), true, [id=#21] +Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, i_category#14, 5), ENSURE_REQUIREMENTS, [id=#21] (28) HashAggregate [codegen id : 8] Input [6]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, sum#19, count#20] @@ -215,7 +215,7 @@ Results [5]: [i_product_name#15, i_brand#12, i_class#13, sum#35, count#36] (34) Exchange Input [5]: [i_product_name#15, i_brand#12, i_class#13, sum#35, count#36] -Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, 5), true, [id=#37] +Arguments: hashpartitioning(i_product_name#15, i_brand#12, i_class#13, 5), ENSURE_REQUIREMENTS, [id=#37] (35) HashAggregate [codegen id : 17] Input [5]: [i_product_name#15, i_brand#12, i_class#13, sum#35, count#36] @@ -243,7 +243,7 @@ Results [4]: [i_product_name#15, i_brand#12, sum#46, count#47] (39) Exchange Input [4]: [i_product_name#15, i_brand#12, sum#46, count#47] -Arguments: hashpartitioning(i_product_name#15, i_brand#12, 5), true, [id=#48] +Arguments: hashpartitioning(i_product_name#15, i_brand#12, 5), ENSURE_REQUIREMENTS, [id=#48] (40) HashAggregate [codegen id : 26] Input [4]: [i_product_name#15, i_brand#12, sum#46, count#47] @@ -271,7 +271,7 @@ Results [3]: [i_product_name#15, sum#58, count#59] (44) Exchange Input [3]: [i_product_name#15, sum#58, count#59] -Arguments: hashpartitioning(i_product_name#15, 5), true, [id=#60] +Arguments: hashpartitioning(i_product_name#15, 5), ENSURE_REQUIREMENTS, [id=#60] (45) HashAggregate [codegen id : 35] Input [3]: [i_product_name#15, sum#58, count#59] @@ -299,7 +299,7 @@ Results [2]: [sum#71, count#72] (49) Exchange Input [2]: [sum#71, count#72] -Arguments: SinglePartition, true, [id=#73] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#73] (50) HashAggregate [codegen id : 44] Input [2]: [sum#71, count#72] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt index 75e07ce8cd680..2596471248a5e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt @@ -217,7 +217,7 @@ Results [10]: [i_item_id#21, s_state#18, sum#35, count#36, sum#37, count#38, sum (31) Exchange Input [10]: [i_item_id#21, s_state#18, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] -Arguments: hashpartitioning(i_item_id#21, s_state#18, 5), true, [id=#43] +Arguments: hashpartitioning(i_item_id#21, s_state#18, 5), ENSURE_REQUIREMENTS, [id=#43] (32) HashAggregate [codegen id : 6] Input [10]: [i_item_id#21, s_state#18, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] @@ -316,7 +316,7 @@ Results [9]: [i_item_id#21, sum#62, count#63, sum#64, count#65, sum#66, count#67 (53) Exchange Input [9]: [i_item_id#21, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] -Arguments: hashpartitioning(i_item_id#21, 5), true, [id=#70] +Arguments: hashpartitioning(i_item_id#21, 5), ENSURE_REQUIREMENTS, [id=#70] (54) HashAggregate [codegen id : 12] Input [9]: [i_item_id#21, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] @@ -411,7 +411,7 @@ Results [8]: [sum#90, count#91, sum#92, count#93, sum#94, count#95, sum#96, coun (74) Exchange Input [8]: [sum#90, count#91, sum#92, count#93, sum#94, count#95, sum#96, count#97] -Arguments: SinglePartition, true, [id=#98] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#98] (75) HashAggregate [codegen id : 18] Input [8]: [sum#90, count#91, sum#92, count#93, sum#94, count#95, sum#96, count#97] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt index ab246a3449557..cc58749d6fdd8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt @@ -133,7 +133,7 @@ Results [3]: [i_category#11, sum#14, count#15] (18) Exchange Input [3]: [i_category#11, sum#14, count#15] -Arguments: hashpartitioning(i_category#11, 5), true, [id=#16] +Arguments: hashpartitioning(i_category#11, 5), ENSURE_REQUIREMENTS, [id=#16] (19) HashAggregate [codegen id : 3] Input [3]: [i_category#11, sum#14, count#15] @@ -174,7 +174,7 @@ Input [3]: [ss_item_sk#2, ss_customer_sk#3, i_item_sk#9] (27) Exchange Input [1]: [ss_customer_sk#3] -Arguments: hashpartitioning(ss_customer_sk#3, 5), true, [id=#22] +Arguments: hashpartitioning(ss_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#22] (28) Sort [codegen id : 6] Input [1]: [ss_customer_sk#3] @@ -196,7 +196,7 @@ Condition : isnotnull(ca_address_sk#23) (32) Exchange Input [2]: [ca_address_sk#23, ca_state#24] -Arguments: hashpartitioning(ca_address_sk#23, 5), true, [id=#25] +Arguments: hashpartitioning(ca_address_sk#23, 5), ENSURE_REQUIREMENTS, [id=#25] (33) Sort [codegen id : 8] Input [2]: [ca_address_sk#23, ca_state#24] @@ -218,7 +218,7 @@ Condition : (isnotnull(c_current_addr_sk#27) AND isnotnull(c_customer_sk#26)) (37) Exchange Input [2]: [c_customer_sk#26, c_current_addr_sk#27] -Arguments: hashpartitioning(c_current_addr_sk#27, 5), true, [id=#28] +Arguments: hashpartitioning(c_current_addr_sk#27, 5), ENSURE_REQUIREMENTS, [id=#28] (38) Sort [codegen id : 10] Input [2]: [c_customer_sk#26, c_current_addr_sk#27] @@ -235,7 +235,7 @@ Input [4]: [ca_address_sk#23, ca_state#24, c_customer_sk#26, c_current_addr_sk#2 (41) Exchange Input [2]: [ca_state#24, c_customer_sk#26] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#29] +Arguments: hashpartitioning(c_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#29] (42) Sort [codegen id : 12] Input [2]: [ca_state#24, c_customer_sk#26] @@ -259,7 +259,7 @@ Results [2]: [ca_state#24, count#31] (46) Exchange Input [2]: [ca_state#24, count#31] -Arguments: hashpartitioning(ca_state#24, 5), true, [id=#32] +Arguments: hashpartitioning(ca_state#24, 5), ENSURE_REQUIREMENTS, [id=#32] (47) HashAggregate [codegen id : 14] Input [2]: [ca_state#24, count#31] @@ -319,7 +319,7 @@ Results [1]: [d_month_seq#5] (56) Exchange Input [1]: [d_month_seq#5] -Arguments: hashpartitioning(d_month_seq#5, 5), true, [id=#39] +Arguments: hashpartitioning(d_month_seq#5, 5), ENSURE_REQUIREMENTS, [id=#39] (57) HashAggregate [codegen id : 2] Input [1]: [d_month_seq#5] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt index c27fbd88d69b7..6fa7b04a3b463 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt @@ -76,7 +76,7 @@ Input [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_ext_sales_price#3, d_date_sk#4] (11) Exchange Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] -Arguments: hashpartitioning(ss_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] +Arguments: hashpartitioning(ss_item_sk#2, 5), true, [id=#7] (12) Sort [codegen id : 3] Input [2]: [ss_item_sk#2, ss_ext_sales_price#3] @@ -98,7 +98,7 @@ Condition : (i_category#13 IN (Sports,Books,Home) AND isnotnull(i_item_sk#8)) (16) Exchange Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] -Arguments: hashpartitioning(i_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#14] +Arguments: hashpartitioning(i_item_sk#8, 5), true, [id=#14] (17) Sort [codegen id : 5] Input [6]: [i_item_sk#8, i_item_id#9, i_item_desc#10, i_current_price#11, i_class#12, i_category#13] @@ -122,7 +122,7 @@ Results [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (21) Exchange Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] -Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), ENSURE_REQUIREMENTS, [id=#17] +Arguments: hashpartitioning(i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, 5), true, [id=#17] (22) HashAggregate [codegen id : 7] Input [6]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, sum#16] @@ -133,7 +133,7 @@ Results [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_ (23) Exchange Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] -Arguments: hashpartitioning(i_class#12, 5), ENSURE_REQUIREMENTS, [id=#22] +Arguments: hashpartitioning(i_class#12, 5), true, [id=#22] (24) Sort [codegen id : 8] Input [8]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, _w0#20, _w1#21] @@ -149,7 +149,7 @@ Input [9]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_pr (27) Exchange Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] -Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] +Arguments: rangepartitioning(i_category#13 ASC NULLS FIRST, i_class#12 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST, i_item_desc#10 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), true, [id=#25] (28) Sort [codegen id : 10] Input [7]: [i_item_id#9, i_item_desc#10, i_category#13, i_class#12, i_current_price#11, itemrevenue#19, revenueratio#24] From 5fe5f3b5ca159802ed535967dd29e01a7688ceb4 Mon Sep 17 00:00:00 2001 From: "tanel.kiis@gmail.com" Date: Tue, 26 Jan 2021 19:35:48 +0200 Subject: [PATCH 11/11] rerun plan stability --- .../approved-plans-v1_4/q16.sf100/explain.txt | 156 +++------------- .../approved-plans-v1_4/q61.sf100/explain.txt | 122 +++--------- .../approved-plans-v1_4/q94.sf100/explain.txt | 159 +++------------- .../approved-plans-v1_4/q95.sf100/explain.txt | 173 +++--------------- 4 files changed, 100 insertions(+), 510 deletions(-) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt index 0954004885a01..ffa5b4a9707d1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -1,50 +1,4 @@ == Physical Plan == -<<<<<<< HEAD -* Sort (44) -+- * HashAggregate (43) - +- Exchange (42) - +- * HashAggregate (41) - +- * HashAggregate (40) - +- * HashAggregate (39) - +- * Project (38) - +- * BroadcastHashJoin Inner BuildRight (37) - :- * Project (31) - : +- * BroadcastHashJoin Inner BuildRight (30) - : :- * Project (24) - : : +- * BroadcastHashJoin Inner BuildRight (23) - : : :- SortMergeJoin LeftAnti (17) - : : : :- * Project (12) - : : : : +- SortMergeJoin LeftSemi (11) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.catalog_sales (1) - : : : : +- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Project (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.catalog_sales (6) - : : : +- * Sort (16) - : : : +- Exchange (15) - : : : +- * ColumnarToRow (14) - : : : +- Scan parquet default.catalog_returns (13) - : : +- BroadcastExchange (22) - : : +- * Project (21) - : : +- * Filter (20) - : : +- * ColumnarToRow (19) - : : +- Scan parquet default.customer_address (18) - : +- BroadcastExchange (29) - : +- * Project (28) - : +- * Filter (27) - : +- * ColumnarToRow (26) - : +- Scan parquet default.date_dim (25) - +- BroadcastExchange (36) - +- * Project (35) - +- * Filter (34) - +- * ColumnarToRow (33) - +- Scan parquet default.call_center (32) -======= * Sort (46) +- * HashAggregate (45) +- Exchange (44) @@ -85,13 +39,12 @@ : +- * Project (30) : +- * Filter (29) : +- * ColumnarToRow (28) - : +- Scan parquet default.call_center (27) + : +- Scan parquet default.date_dim (27) +- BroadcastExchange (38) +- * Project (37) +- * Filter (36) +- * ColumnarToRow (35) - +- Scan parquet default.date_dim (34) ->>>>>>> master + +- Scan parquet default.call_center (34) (1) Scan parquet default.catalog_sales @@ -207,126 +160,67 @@ Join condition: None Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#16] -<<<<<<< HEAD -(25) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_date#18] -======= -(27) Scan parquet default.call_center -Output [2]: [cc_call_center_sk#19, cc_county#20] ->>>>>>> master +(27) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_date#20] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -<<<<<<< HEAD -(26) ColumnarToRow [codegen id : 9] -Input [2]: [d_date_sk#17, d_date#18] - -(27) Filter [codegen id : 9] -Input [2]: [d_date_sk#17, d_date#18] -Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 11719)) AND (d_date#18 <= 11779)) AND isnotnull(d_date_sk#17)) - -(28) Project [codegen id : 9] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_date#18] - -(29) BroadcastExchange -Input [1]: [d_date_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] - -(30) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_ship_date_sk#1] -Right keys [1]: [d_date_sk#17] -Join condition: None - -(31) Project [codegen id : 11] -Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#17] - -(32) Scan parquet default.call_center -Output [2]: [cc_call_center_sk#20, cc_county#21] -======= (28) ColumnarToRow [codegen id : 9] -Input [2]: [cc_call_center_sk#19, cc_county#20] +Input [2]: [d_date_sk#19, d_date#20] (29) Filter [codegen id : 9] -Input [2]: [cc_call_center_sk#19, cc_county#20] -Condition : ((isnotnull(cc_county#20) AND (cc_county#20 = Williamson County)) AND isnotnull(cc_call_center_sk#19)) +Input [2]: [d_date_sk#19, d_date#20] +Condition : (((isnotnull(d_date#20) AND (d_date#20 >= 11719)) AND (d_date#20 <= 11779)) AND isnotnull(d_date_sk#19)) (30) Project [codegen id : 9] -Output [1]: [cc_call_center_sk#19] -Input [2]: [cc_call_center_sk#19, cc_county#20] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_date#20] (31) BroadcastExchange -Input [1]: [cc_call_center_sk#19] +Input [1]: [d_date_sk#19] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (32) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_call_center_sk#3] -Right keys [1]: [cc_call_center_sk#19] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#19] Join condition: None (33) Project [codegen id : 11] -Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#19] +Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#19] -(34) Scan parquet default.date_dim -Output [2]: [d_date_sk#22, d_date#23] ->>>>>>> master +(34) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#22, cc_county#23] Batched: true Location [not included in comparison]/{warehouse_dir}/call_center] PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] ReadSchema: struct -<<<<<<< HEAD -(33) ColumnarToRow [codegen id : 10] -Input [2]: [cc_call_center_sk#20, cc_county#21] - -(34) Filter [codegen id : 10] -Input [2]: [cc_call_center_sk#20, cc_county#21] -Condition : ((isnotnull(cc_county#21) AND (cc_county#21 = Williamson County)) AND isnotnull(cc_call_center_sk#20)) - -(35) Project [codegen id : 10] -Output [1]: [cc_call_center_sk#20] -Input [2]: [cc_call_center_sk#20, cc_county#21] - -(36) BroadcastExchange -Input [1]: [cc_call_center_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] - -(37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_call_center_sk#3] -Right keys [1]: [cc_call_center_sk#20] -======= (35) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#22, d_date#23] +Input [2]: [cc_call_center_sk#22, cc_county#23] (36) Filter [codegen id : 10] -Input [2]: [d_date_sk#22, d_date#23] -Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 11719)) AND (d_date#23 <= 11779)) AND isnotnull(d_date_sk#22)) +Input [2]: [cc_call_center_sk#22, cc_county#23] +Condition : ((isnotnull(cc_county#23) AND (cc_county#23 = Williamson County)) AND isnotnull(cc_call_center_sk#22)) (37) Project [codegen id : 10] -Output [1]: [d_date_sk#22] -Input [2]: [d_date_sk#22, d_date#23] +Output [1]: [cc_call_center_sk#22] +Input [2]: [cc_call_center_sk#22, cc_county#23] (38) BroadcastExchange -Input [1]: [d_date_sk#22] +Input [1]: [cc_call_center_sk#22] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] (39) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [cs_ship_date_sk#1] -Right keys [1]: [d_date_sk#22] ->>>>>>> master +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#22] Join condition: None (40) Project [codegen id : 11] Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] -<<<<<<< HEAD -Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#20] -======= -Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#22] ->>>>>>> master +Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#22] (41) HashAggregate [codegen id : 11] Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt index e43607d8b22e5..db7a808bd1fef 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt @@ -117,125 +117,67 @@ Join condition: None Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5] Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6, d_date_sk#8] -<<<<<<< HEAD (11) Scan parquet default.promotion -Output [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] -======= -(11) Scan parquet default.item -Output [2]: [i_item_sk#12, i_category#13] ->>>>>>> master +Output [4]: [p_promo_sk#12, p_channel_dmail#13, p_channel_email#14, p_channel_tv#15] Batched: true Location [not included in comparison]/{warehouse_dir}/promotion] PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)] ReadSchema: struct (12) ColumnarToRow [codegen id : 2] -<<<<<<< HEAD -Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] +Input [4]: [p_promo_sk#12, p_channel_dmail#13, p_channel_email#14, p_channel_tv#15] (13) Filter [codegen id : 2] -Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] -Condition : ((((p_channel_dmail#12 = Y) OR (p_channel_email#13 = Y)) OR (p_channel_tv#14 = Y)) AND isnotnull(p_promo_sk#11)) +Input [4]: [p_promo_sk#12, p_channel_dmail#13, p_channel_email#14, p_channel_tv#15] +Condition : ((((p_channel_dmail#13 = Y) OR (p_channel_email#14 = Y)) OR (p_channel_tv#15 = Y)) AND isnotnull(p_promo_sk#12)) (14) Project [codegen id : 2] -Output [1]: [p_promo_sk#11] -Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] +Output [1]: [p_promo_sk#12] +Input [4]: [p_promo_sk#12, p_channel_dmail#13, p_channel_email#14, p_channel_tv#15] (15) BroadcastExchange -Input [1]: [p_promo_sk#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +Input [1]: [p_promo_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (16) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_promo_sk#5] -Right keys [1]: [p_promo_sk#11] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#12] Join condition: None (17) Project [codegen id : 7] -Output [4]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, p_promo_sk#11] +Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, p_promo_sk#12] (18) Scan parquet default.item -Output [2]: [i_item_sk#16, i_category#17] -======= -Input [2]: [i_item_sk#12, i_category#13] - -(13) Filter [codegen id : 2] -Input [2]: [i_item_sk#12, i_category#13] -Condition : ((isnotnull(i_category#13) AND (i_category#13 = Jewelry)) AND isnotnull(i_item_sk#12)) - -(14) Project [codegen id : 2] -Output [1]: [i_item_sk#12] -Input [2]: [i_item_sk#12, i_category#13] - -(15) BroadcastExchange -Input [1]: [i_item_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] - -(16) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#12] -Join condition: None - -(17) Project [codegen id : 7] -Output [4]: [ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5] -Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, i_item_sk#12] - -(18) Scan parquet default.promotion -Output [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] ->>>>>>> master +Output [2]: [i_item_sk#17, i_category#18] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry), IsNotNull(i_item_sk)] ReadSchema: struct (19) ColumnarToRow [codegen id : 3] -<<<<<<< HEAD -Input [2]: [i_item_sk#16, i_category#17] +Input [2]: [i_item_sk#17, i_category#18] (20) Filter [codegen id : 3] -Input [2]: [i_item_sk#16, i_category#17] -Condition : ((isnotnull(i_category#17) AND (i_category#17 = Jewelry)) AND isnotnull(i_item_sk#16)) +Input [2]: [i_item_sk#17, i_category#18] +Condition : ((isnotnull(i_category#18) AND (i_category#18 = Jewelry)) AND isnotnull(i_item_sk#17)) (21) Project [codegen id : 3] -Output [1]: [i_item_sk#16] -Input [2]: [i_item_sk#16, i_category#17] +Output [1]: [i_item_sk#17] +Input [2]: [i_item_sk#17, i_category#18] (22) BroadcastExchange -Input [1]: [i_item_sk#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] - -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#16] -Join condition: None - -(24) Project [codegen id : 7] -Output [3]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, i_item_sk#16] -======= -Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] - -(20) Filter [codegen id : 3] -Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] -Condition : ((((p_channel_dmail#16 = Y) OR (p_channel_email#17 = Y)) OR (p_channel_tv#18 = Y)) AND isnotnull(p_promo_sk#15)) - -(21) Project [codegen id : 3] -Output [1]: [p_promo_sk#15] -Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] - -(22) BroadcastExchange -Input [1]: [p_promo_sk#15] +Input [1]: [i_item_sk#17] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ss_promo_sk#4] -Right keys [1]: [p_promo_sk#15] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#17] Join condition: None (24) Project [codegen id : 7] Output [3]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5] -Input [5]: [ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, p_promo_sk#15] ->>>>>>> master +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5, i_item_sk#17] (25) Scan parquet default.store Output [2]: [s_store_sk#20, s_gmt_offset#21] @@ -371,31 +313,17 @@ Join condition: None Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5] Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5, ss_sold_date_sk#6, d_date_sk#8] -<<<<<<< HEAD (54) ReusedExchange [Reuses operator id: 22] -Output [1]: [i_item_sk#16] - -(55) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ss_item_sk#2] -Right keys [1]: [i_item_sk#16] -Join condition: None - -(56) Project [codegen id : 14] -Output [3]: [ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6] -Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, i_item_sk#16] -======= -(54) ReusedExchange [Reuses operator id: 15] -Output [1]: [i_item_sk#12] +Output [1]: [i_item_sk#17] (55) BroadcastHashJoin [codegen id : 14] Left keys [1]: [ss_item_sk#1] -Right keys [1]: [i_item_sk#12] +Right keys [1]: [i_item_sk#17] Join condition: None (56) Project [codegen id : 14] Output [3]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5] -Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5, i_item_sk#12] ->>>>>>> master +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5, i_item_sk#17] (57) ReusedExchange [Reuses operator id: 29] Output [1]: [s_store_sk#20] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt index 034fda678dde3..51db854545dae 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -1,53 +1,4 @@ == Physical Plan == -<<<<<<< HEAD -* Sort (47) -+- * HashAggregate (46) - +- Exchange (45) - +- * HashAggregate (44) - +- * HashAggregate (43) - +- Exchange (42) - +- * HashAggregate (41) - +- * Project (40) - +- * BroadcastHashJoin Inner BuildRight (39) - :- * Project (33) - : +- * BroadcastHashJoin Inner BuildRight (32) - : :- * Project (26) - : : +- * BroadcastHashJoin Inner BuildRight (25) - : : :- SortMergeJoin LeftAnti (19) - : : : :- * Sort (14) - : : : : +- Exchange (13) - : : : : +- * Project (12) - : : : : +- SortMergeJoin LeftSemi (11) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Sort (10) - : : : : +- Exchange (9) - : : : : +- * Project (8) - : : : : +- * ColumnarToRow (7) - : : : : +- Scan parquet default.web_sales (6) - : : : +- * Sort (18) - : : : +- Exchange (17) - : : : +- * ColumnarToRow (16) - : : : +- Scan parquet default.web_returns (15) - : : +- BroadcastExchange (24) - : : +- * Project (23) - : : +- * Filter (22) - : : +- * ColumnarToRow (21) - : : +- Scan parquet default.customer_address (20) - : +- BroadcastExchange (31) - : +- * Project (30) - : +- * Filter (29) - : +- * ColumnarToRow (28) - : +- Scan parquet default.date_dim (27) - +- BroadcastExchange (38) - +- * Project (37) - +- * Filter (36) - +- * ColumnarToRow (35) - +- Scan parquet default.web_site (34) -======= * Sort (49) +- * HashAggregate (48) +- Exchange (47) @@ -91,13 +42,12 @@ : +- * Project (32) : +- * Filter (31) : +- * ColumnarToRow (30) - : +- Scan parquet default.web_site (29) + : +- Scan parquet default.date_dim (29) +- BroadcastExchange (40) +- * Project (39) +- * Filter (38) +- * ColumnarToRow (37) - +- Scan parquet default.date_dim (36) ->>>>>>> master + +- Scan parquet default.web_site (36) (1) Scan parquet default.web_sales @@ -221,126 +171,67 @@ Join condition: None Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#17] -<<<<<<< HEAD -(27) Scan parquet default.date_dim -Output [2]: [d_date_sk#18, d_date#19] -======= -(29) Scan parquet default.web_site -Output [2]: [web_site_sk#20, web_company_name#21] ->>>>>>> master +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#20, d_date#21] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -<<<<<<< HEAD -(28) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#18, d_date#19] - -(29) Filter [codegen id : 10] -Input [2]: [d_date_sk#18, d_date#19] -Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 10623)) AND (d_date#19 <= 10683)) AND isnotnull(d_date_sk#18)) - -(30) Project [codegen id : 10] -Output [1]: [d_date_sk#18] -Input [2]: [d_date_sk#18, d_date#19] - -(31) BroadcastExchange -Input [1]: [d_date_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] - -(32) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#18] -Join condition: None - -(33) Project [codegen id : 12] -Output [4]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#18] - -(34) Scan parquet default.web_site -Output [2]: [web_site_sk#21, web_company_name#22] -======= (30) ColumnarToRow [codegen id : 10] -Input [2]: [web_site_sk#20, web_company_name#21] +Input [2]: [d_date_sk#20, d_date#21] (31) Filter [codegen id : 10] -Input [2]: [web_site_sk#20, web_company_name#21] -Condition : ((isnotnull(web_company_name#21) AND (web_company_name#21 = pri)) AND isnotnull(web_site_sk#20)) +Input [2]: [d_date_sk#20, d_date#21] +Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 10623)) AND (d_date#21 <= 10683)) AND isnotnull(d_date_sk#20)) (32) Project [codegen id : 10] -Output [1]: [web_site_sk#20] -Input [2]: [web_site_sk#20, web_company_name#21] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_date#21] (33) BroadcastExchange -Input [1]: [web_site_sk#20] +Input [1]: [d_date_sk#20] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (34) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#20] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#20] Join condition: None (35) Project [codegen id : 12] -Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#20] +Output [4]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#20] -(36) Scan parquet default.date_dim -Output [2]: [d_date_sk#23, d_date#24] ->>>>>>> master +(36) Scan parquet default.web_site +Output [2]: [web_site_sk#23, web_company_name#24] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] ReadSchema: struct -<<<<<<< HEAD -(35) ColumnarToRow [codegen id : 11] -Input [2]: [web_site_sk#21, web_company_name#22] - -(36) Filter [codegen id : 11] -Input [2]: [web_site_sk#21, web_company_name#22] -Condition : ((isnotnull(web_company_name#22) AND (web_company_name#22 = pri)) AND isnotnull(web_site_sk#21)) - -(37) Project [codegen id : 11] -Output [1]: [web_site_sk#21] -Input [2]: [web_site_sk#21, web_company_name#22] - -(38) BroadcastExchange -Input [1]: [web_site_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] - -(39) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#21] -======= (37) ColumnarToRow [codegen id : 11] -Input [2]: [d_date_sk#23, d_date#24] +Input [2]: [web_site_sk#23, web_company_name#24] (38) Filter [codegen id : 11] -Input [2]: [d_date_sk#23, d_date#24] -Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 10623)) AND (d_date#24 <= 10683)) AND isnotnull(d_date_sk#23)) +Input [2]: [web_site_sk#23, web_company_name#24] +Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri)) AND isnotnull(web_site_sk#23)) (39) Project [codegen id : 11] -Output [1]: [d_date_sk#23] -Input [2]: [d_date_sk#23, d_date#24] +Output [1]: [web_site_sk#23] +Input [2]: [web_site_sk#23, web_company_name#24] (40) BroadcastExchange -Input [1]: [d_date_sk#23] +Input [1]: [web_site_sk#23] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] (41) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#23] ->>>>>>> master +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#23] Join condition: None (42) Project [codegen id : 12] Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] -<<<<<<< HEAD -Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#21] -======= -Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#23] ->>>>>>> master +Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#23] (43) HashAggregate [codegen id : 12] Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt index c5718d20ca806..2ab05cd418261 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -1,67 +1,4 @@ == Physical Plan == -<<<<<<< HEAD -* Sort (61) -+- * HashAggregate (60) - +- Exchange (59) - +- * HashAggregate (58) - +- * HashAggregate (57) - +- Exchange (56) - +- * HashAggregate (55) - +- * Project (54) - +- * BroadcastHashJoin Inner BuildRight (53) - :- * Project (47) - : +- * BroadcastHashJoin Inner BuildRight (46) - : :- * Project (40) - : : +- * BroadcastHashJoin Inner BuildRight (39) - : : :- SortMergeJoin LeftSemi (33) - : : : :- * Sort (17) - : : : : +- Exchange (16) - : : : : +- SortMergeJoin LeftSemi (15) - : : : : :- * Sort (5) - : : : : : +- Exchange (4) - : : : : : +- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.web_sales (1) - : : : : +- * Project (14) - : : : : +- * SortMergeJoin Inner (13) - : : : : :- * Sort (10) - : : : : : +- Exchange (9) - : : : : : +- * Filter (8) - : : : : : +- * ColumnarToRow (7) - : : : : : +- Scan parquet default.web_sales (6) - : : : : +- * Sort (12) - : : : : +- ReusedExchange (11) - : : : +- * Project (32) - : : : +- * SortMergeJoin Inner (31) - : : : :- * Sort (25) - : : : : +- Exchange (24) - : : : : +- * Project (23) - : : : : +- * SortMergeJoin Inner (22) - : : : : :- * Sort (19) - : : : : : +- ReusedExchange (18) - : : : : +- * Sort (21) - : : : : +- ReusedExchange (20) - : : : +- * Sort (30) - : : : +- Exchange (29) - : : : +- * Filter (28) - : : : +- * ColumnarToRow (27) - : : : +- Scan parquet default.web_returns (26) - : : +- BroadcastExchange (38) - : : +- * Project (37) - : : +- * Filter (36) - : : +- * ColumnarToRow (35) - : : +- Scan parquet default.customer_address (34) - : +- BroadcastExchange (45) - : +- * Project (44) - : +- * Filter (43) - : +- * ColumnarToRow (42) - : +- Scan parquet default.date_dim (41) - +- BroadcastExchange (52) - +- * Project (51) - +- * Filter (50) - +- * ColumnarToRow (49) - +- Scan parquet default.web_site (48) -======= * Sort (64) +- * HashAggregate (63) +- Exchange (62) @@ -120,13 +57,12 @@ : +- * Project (47) : +- * Filter (46) : +- * ColumnarToRow (45) - : +- Scan parquet default.web_site (44) + : +- Scan parquet default.date_dim (44) +- BroadcastExchange (55) +- * Project (54) +- * Filter (53) +- * ColumnarToRow (52) - +- Scan parquet default.date_dim (51) ->>>>>>> master + +- Scan parquet default.web_site (51) (1) Scan parquet default.web_sales @@ -312,126 +248,67 @@ Join condition: None Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#21] -<<<<<<< HEAD -(41) Scan parquet default.date_dim -Output [2]: [d_date_sk#22, d_date#23] -======= -(44) Scan parquet default.web_site -Output [2]: [web_site_sk#24, web_company_name#25] ->>>>>>> master +(44) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_date#25] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] ReadSchema: struct -<<<<<<< HEAD -(42) ColumnarToRow [codegen id : 19] -Input [2]: [d_date_sk#22, d_date#23] - -(43) Filter [codegen id : 19] -Input [2]: [d_date_sk#22, d_date#23] -Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 10623)) AND (d_date#23 <= 10683)) AND isnotnull(d_date_sk#22)) - -(44) Project [codegen id : 19] -Output [1]: [d_date_sk#22] -Input [2]: [d_date_sk#22, d_date#23] - -(45) BroadcastExchange -Input [1]: [d_date_sk#22] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] - -(46) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#22] -Join condition: None - -(47) Project [codegen id : 21] -Output [4]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#22] - -(48) Scan parquet default.web_site -Output [2]: [web_site_sk#25, web_company_name#26] -======= (45) ColumnarToRow [codegen id : 19] -Input [2]: [web_site_sk#24, web_company_name#25] +Input [2]: [d_date_sk#24, d_date#25] (46) Filter [codegen id : 19] -Input [2]: [web_site_sk#24, web_company_name#25] -Condition : ((isnotnull(web_company_name#25) AND (web_company_name#25 = pri)) AND isnotnull(web_site_sk#24)) +Input [2]: [d_date_sk#24, d_date#25] +Condition : (((isnotnull(d_date#25) AND (d_date#25 >= 10623)) AND (d_date#25 <= 10683)) AND isnotnull(d_date_sk#24)) (47) Project [codegen id : 19] -Output [1]: [web_site_sk#24] -Input [2]: [web_site_sk#24, web_company_name#25] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_date#25] (48) BroadcastExchange -Input [1]: [web_site_sk#24] +Input [1]: [d_date_sk#24] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] (49) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#24] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#24] Join condition: None (50) Project [codegen id : 21] -Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#24] +Output [4]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#24] -(51) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_date#28] ->>>>>>> master +(51) Scan parquet default.web_site +Output [2]: [web_site_sk#27, web_company_name#28] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)] ReadSchema: struct -<<<<<<< HEAD -(49) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#25, web_company_name#26] - -(50) Filter [codegen id : 20] -Input [2]: [web_site_sk#25, web_company_name#26] -Condition : ((isnotnull(web_company_name#26) AND (web_company_name#26 = pri)) AND isnotnull(web_site_sk#25)) - -(51) Project [codegen id : 20] -Output [1]: [web_site_sk#25] -Input [2]: [web_site_sk#25, web_company_name#26] - -(52) BroadcastExchange -Input [1]: [web_site_sk#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] - -(53) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_web_site_sk#3] -Right keys [1]: [web_site_sk#25] -======= (52) ColumnarToRow [codegen id : 20] -Input [2]: [d_date_sk#27, d_date#28] +Input [2]: [web_site_sk#27, web_company_name#28] (53) Filter [codegen id : 20] -Input [2]: [d_date_sk#27, d_date#28] -Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 10623)) AND (d_date#28 <= 10683)) AND isnotnull(d_date_sk#27)) +Input [2]: [web_site_sk#27, web_company_name#28] +Condition : ((isnotnull(web_company_name#28) AND (web_company_name#28 = pri)) AND isnotnull(web_site_sk#27)) (54) Project [codegen id : 20] -Output [1]: [d_date_sk#27] -Input [2]: [d_date_sk#27, d_date#28] +Output [1]: [web_site_sk#27] +Input [2]: [web_site_sk#27, web_company_name#28] (55) BroadcastExchange -Input [1]: [d_date_sk#27] +Input [1]: [web_site_sk#27] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (56) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [ws_ship_date_sk#1] -Right keys [1]: [d_date_sk#27] ->>>>>>> master +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#27] Join condition: None (57) Project [codegen id : 21] Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] -<<<<<<< HEAD -Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#25] -======= -Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#27] ->>>>>>> master +Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#27] (58) HashAggregate [codegen id : 21] Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6]