From 6b7317049d3d8fa433b03f9754f94080175921d2 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Thu, 27 Aug 2020 20:16:48 +0900 Subject: [PATCH 01/16] Fix --- .../sql/catalyst/analysis/Analyzer.scala | 19 ++- .../sql/catalyst/optimizer/Optimizer.scala | 51 +++--- .../sql/catalyst/optimizer/subquery.scala | 150 +++++++++++------- .../catalyst/plans/logical/LogicalPlan.scala | 55 +++++++ .../plans/logical/basicLogicalOperators.scala | 2 +- .../optimizer/FoldablePropagationSuite.scala | 4 +- .../logical/LogicalPlanIntegritySuite.scala | 51 ++++++ .../spark/sql/streaming/StreamSuite.scala | 7 +- 8 files changed, 249 insertions(+), 90 deletions(-) create mode 100644 sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index 6e1f371b1a2b5..c79600b022d38 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -48,6 +48,7 @@ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.{PartitionOverwriteMode, StoreAssignmentPolicy} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap +import org.apache.spark.util.Utils /** * A trivial [[Analyzer]] with a dummy [[SessionCatalog]] and [[EmptyFunctionRegistry]]. @@ -136,6 +137,10 @@ class Analyzer( private val v1SessionCatalog: SessionCatalog = catalogManager.v1SessionCatalog + override protected def isPlanIntegral(plan: LogicalPlan): Boolean = { + !Utils.isTesting || LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan) + } + override def isView(nameParts: Seq[String]): Boolean = v1SessionCatalog.isView(nameParts) // Only for tests. @@ -2618,13 +2623,13 @@ class Analyzer( case ne: NamedExpression => // If a named expression is not in regularExpressions, add it to // extractedExprBuffer and replace it with an AttributeReference. + val attr = ne.toAttribute val missingExpr = - AttributeSet(Seq(expr)) -- (regularExpressions ++ extractedExprBuffer) + AttributeSet(Seq(attr)) -- (regularExpressions ++ extractedExprBuffer) if (missingExpr.nonEmpty) { extractedExprBuffer += ne } - // alias will be cleaned in the rule CleanupAliases - ne + attr case e: Expression if e.foldable => e // No need to create an attribute reference if it will be evaluated as a Literal. case e: Expression => @@ -2755,7 +2760,7 @@ class Analyzer( val windowOps = groupedWindowExpressions.foldLeft(child) { case (last, ((partitionSpec, orderSpec, _), windowExpressions)) => - Window(windowExpressions.toSeq, partitionSpec, orderSpec, last) + Window(windowExpressions, partitionSpec, orderSpec, last) } // Finally, we create a Project to output windowOps's output @@ -2777,8 +2782,8 @@ class Analyzer( // a resolved Aggregate will not have Window Functions. case f @ UnresolvedHaving(condition, a @ Aggregate(groupingExprs, aggregateExprs, child)) if child.resolved && - hasWindowFunction(aggregateExprs) && - a.expressions.forall(_.resolved) => + hasWindowFunction(aggregateExprs) && + a.expressions.forall(_.resolved) => val (windowExpressions, aggregateExpressions) = extract(aggregateExprs) // Create an Aggregate operator to evaluate aggregation functions. val withAggregate = Aggregate(groupingExprs, aggregateExpressions, child) @@ -2795,7 +2800,7 @@ class Analyzer( // Aggregate without Having clause. case a @ Aggregate(groupingExprs, aggregateExprs, child) if hasWindowFunction(aggregateExprs) && - a.expressions.forall(_.resolved) => + a.expressions.forall(_.resolved) => val (windowExpressions, aggregateExpressions) = extract(aggregateExprs) // Create an Aggregate operator to evaluate aggregation functions. val withAggregate = Aggregate(groupingExprs, aggregateExpressions, child) 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..099bbdeec226f 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 @@ -20,7 +20,6 @@ package org.apache.spark.sql.catalyst.optimizer import scala.collection.mutable import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.analysis._ import org.apache.spark.sql.catalyst.catalog.{InMemoryCatalog, SessionCatalog} import org.apache.spark.sql.catalyst.expressions._ @@ -46,7 +45,8 @@ abstract class Optimizer(catalogManager: CatalogManager) // - only host special expressions in supported operators override protected def isPlanIntegral(plan: LogicalPlan): Boolean = { !Utils.isTesting || (plan.resolved && - plan.find(PlanHelper.specialExpressionsInUnsupportedOperator(_).nonEmpty).isEmpty) + plan.find(PlanHelper.specialExpressionsInUnsupportedOperator(_).nonEmpty).isEmpty && + LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan)) } override protected val excludedOnceBatches: Set[String] = @@ -1584,23 +1584,36 @@ object ReplaceDistinctWithAggregate extends Rule[LogicalPlan] { * Replaces logical [[Deduplicate]] operator with an [[Aggregate]] operator. */ object ReplaceDeduplicateWithAggregate extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = plan transform { - case Deduplicate(keys, child) if !child.isStreaming => - val keyExprIds = keys.map(_.exprId) - val aggCols = child.output.map { attr => - if (keyExprIds.contains(attr.exprId)) { - attr - } else { - Alias(new First(attr).toAggregateExpression(), attr.name)(attr.exprId) - } - } - // SPARK-22951: Physical aggregate operators distinguishes global aggregation and grouping - // aggregations by checking the number of grouping keys. The key difference here is that a - // global aggregation always returns at least one row even if there are no input rows. Here - // we append a literal when the grouping key list is empty so that the result aggregate - // operator is properly treated as a grouping aggregation. - val nonemptyKeys = if (keys.isEmpty) Literal(1) :: Nil else keys - Aggregate(nonemptyKeys, aggCols, child) + def apply(plan: LogicalPlan): LogicalPlan = { + val rewritePlanMap = mutable.ArrayBuffer[(LogicalPlan, LogicalPlan)]() + val newPlan = plan transform { + case Deduplicate(keys, child) if !child.isStreaming => + val keyExprIds = keys.map(_.exprId) + val aggCols = child.output.map { attr => + if (keyExprIds.contains(attr.exprId)) { + attr -> attr + } else { + val alias = Alias(new First(attr).toAggregateExpression(), attr.name)(attr.exprId) + alias -> alias.newInstance() + } + }.unzip + // SPARK-22951: Physical aggregate operators distinguishes global aggregation and grouping + // aggregations by checking the number of grouping keys. The key difference here is that a + // global aggregation always returns at least one row even if there are no input rows. Here + // we append a literal when the grouping key list is empty so that the result aggregate + // operator is properly treated as a grouping aggregation. + val nonemptyKeys = if (keys.isEmpty) Literal(1) :: Nil else keys + val newAgg = Aggregate(nonemptyKeys, aggCols._1, child) + rewritePlanMap += newAgg -> Aggregate(nonemptyKeys, aggCols._2, child) + newAgg + } + + if (rewritePlanMap.nonEmpty) { + assert(!plan.fastEquals(newPlan)) + Analyzer.rewritePlan(newPlan, rewritePlanMap.toMap)._1 + } else { + plan + } } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index 7b696912aa465..aaef7a49a5472 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.catalyst.optimizer import scala.collection.mutable.ArrayBuffer import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.analysis.CleanupAliases +import org.apache.spark.sql.catalyst.analysis.{Analyzer, CleanupAliases} import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.expressions.SubExprUtils._ import org.apache.spark.sql.catalyst.expressions.aggregate._ @@ -458,7 +458,10 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { sys.error(s"Unexpected operator in scalar subquery: $lp") } - val resultMap = evalPlan(plan) + val resultMap = evalPlan(plan).mapValues { _.transform { + case a: Alias => a.newInstance() // Assigns a new `ExprId` + } + } // By convention, the scalar subquery result is the leftmost field. resultMap.get(plan.output.head.exprId) match { @@ -510,8 +513,9 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { */ private def constructLeftJoins( child: LogicalPlan, - subqueries: ArrayBuffer[ScalarSubquery]): LogicalPlan = { - subqueries.foldLeft(child) { + subqueries: ArrayBuffer[ScalarSubquery]): (LogicalPlan, Seq[(LogicalPlan, LogicalPlan)]) = { + val rewritePlanMap = ArrayBuffer[(LogicalPlan, LogicalPlan)]() + val newPlan = subqueries.foldLeft(child) { case (currentChild, ScalarSubquery(query, conditions, _)) => val origOutput = query.output.head @@ -539,16 +543,23 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { if (havingNode.isEmpty) { // CASE 2: Subquery with no HAVING clause - Project( - currentChild.output :+ - Alias( - If(IsNull(alwaysTrueRef), - resultWithZeroTups.get, - aggValRef), origOutput.name)(exprId = origOutput.exprId), - Join(currentChild, - Project(query.output :+ alwaysTrueExpr, query), - LeftOuter, conditions.reduceOption(And), JoinHint.NONE)) + val joinPlan = Join(currentChild, + Project(query.output :+ alwaysTrueExpr, query), + LeftOuter, conditions.reduceOption(And), JoinHint.NONE) + + def buildPlan(exprId: ExprId): LogicalPlan = { + Project( + currentChild.output :+ + Alias( + If(IsNull(alwaysTrueRef), + resultWithZeroTups.get, + aggValRef), origOutput.name)(exprId), + joinPlan) + } + val newPlan = buildPlan(origOutput.exprId) + rewritePlanMap += newPlan -> buildPlan(NamedExpression.newExprId) + newPlan } else { // CASE 3: Subquery with HAVING clause. Pull the HAVING clause above the join. // Need to modify any operators below the join to pass through all columns @@ -564,60 +575,85 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { case op => sys.error(s"Unexpected operator $op in corelated subquery") } - // CASE WHEN alwaysTrue IS NULL THEN resultOnZeroTups - // WHEN NOT (original HAVING clause expr) THEN CAST(null AS ) - // ELSE (aggregate value) END AS (original column name) - val caseExpr = Alias(CaseWhen(Seq( - (IsNull(alwaysTrueRef), resultWithZeroTups.get), - (Not(havingNode.get.condition), Literal.create(null, aggValRef.dataType))), - aggValRef), - origOutput.name)(exprId = origOutput.exprId) - - Project( - currentChild.output :+ caseExpr, - Join(currentChild, - Project(subqueryRoot.output :+ alwaysTrueExpr, subqueryRoot), - LeftOuter, conditions.reduceOption(And), JoinHint.NONE)) + val joinPlan = Join(currentChild, + Project(subqueryRoot.output :+ alwaysTrueExpr, subqueryRoot), + LeftOuter, conditions.reduceOption(And), JoinHint.NONE) + + def buildPlan(exprId: ExprId): LogicalPlan = { + // CASE WHEN alwaysTrue IS NULL THEN resultOnZeroTups + // WHEN NOT (original HAVING clause expr) THEN CAST(null AS ) + // ELSE (aggregate value) END AS (original column name) + val caseExpr = Alias(CaseWhen(Seq( + (IsNull(alwaysTrueRef), resultWithZeroTups.get), + (Not(havingNode.get.condition), Literal.create(null, aggValRef.dataType))), + aggValRef), + origOutput.name)(exprId) + + Project( + currentChild.output :+ caseExpr, + joinPlan) + } + val newPlan = buildPlan(origOutput.exprId) + rewritePlanMap += newPlan -> buildPlan(NamedExpression.newExprId) + newPlan } } } + + (newPlan, rewritePlanMap) } /** * Rewrite [[Filter]], [[Project]] and [[Aggregate]] plans containing correlated scalar * subqueries. */ - def apply(plan: LogicalPlan): LogicalPlan = plan transform { - case a @ Aggregate(grouping, expressions, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) - if (subqueries.nonEmpty) { - // We currently only allow correlated subqueries in an aggregate if they are part of the - // grouping expressions. As a result we need to replace all the scalar subqueries in the - // grouping expressions by their result. - val newGrouping = grouping.map { e => - subqueries.find(_.semanticEquals(e)).map(_.plan.output.head).getOrElse(e) + def apply(plan: LogicalPlan): LogicalPlan = { + val rewritePlanMap = ArrayBuffer[(LogicalPlan, LogicalPlan)]() + val newPlan = plan transform { + case a @ Aggregate(grouping, expressions, child) => + val subqueries = ArrayBuffer.empty[ScalarSubquery] + val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) + if (subqueries.nonEmpty) { + // We currently only allow correlated subqueries in an aggregate if they are part of the + // grouping expressions. As a result we need to replace all the scalar subqueries in the + // grouping expressions by their result. + val newGrouping = grouping.map { e => + subqueries.find(_.semanticEquals(e)).map(_.plan.output.head).getOrElse(e) + } + val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) + rewritePlanMap ++= rewriteMap + Aggregate(newGrouping, newExpressions, newChild) + } else { + a } - Aggregate(newGrouping, newExpressions, constructLeftJoins(child, subqueries)) - } else { - a - } - case p @ Project(expressions, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) - if (subqueries.nonEmpty) { - Project(newExpressions, constructLeftJoins(child, subqueries)) - } else { - p - } - case f @ Filter(condition, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newCondition = extractCorrelatedScalarSubqueries(condition, subqueries) - if (subqueries.nonEmpty) { - Project(f.output, Filter(newCondition, constructLeftJoins(child, subqueries))) - } else { - f - } + case p @ Project(expressions, child) => + val subqueries = ArrayBuffer.empty[ScalarSubquery] + val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) + if (subqueries.nonEmpty) { + val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) + rewritePlanMap ++= rewriteMap + Project(newExpressions, newChild) + } else { + p + } + case f @ Filter(condition, child) => + val subqueries = ArrayBuffer.empty[ScalarSubquery] + val newCondition = extractCorrelatedScalarSubqueries(condition, subqueries) + if (subqueries.nonEmpty) { + val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) + rewritePlanMap ++= rewriteMap + Project(f.output, Filter(newCondition, newChild)) + } else { + f + } + } + + if (rewritePlanMap.nonEmpty) { + assert(!plan.fastEquals(newPlan)) + Analyzer.rewritePlan(newPlan, rewritePlanMap.toMap)._1 + } else { + newPlan + } } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index 96c550616065a..9f9d028d88366 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -203,3 +203,58 @@ abstract class BinaryNode extends LogicalPlan { abstract class OrderPreservingUnaryNode extends UnaryNode { override final def outputOrdering: Seq[SortOrder] = child.outputOrdering } + +object LogicalPlanIntegrity { + + private def canGetOutputAttrs(p: LogicalPlan): Boolean = { + p.resolved && !p.expressions.exists { e => + e.collectFirst { + // We cannot call `output` in plans with a `ScalarSubquery` expr having no column, + // so, we filter out them in advance. + case s: ScalarSubquery if s.plan.schema.fields.isEmpty => true + }.isDefined + } + } + + /** + * Since some logical plans (e.g., `Union`) can build `AttributeReference`s in their `output`, + * this method checks if the same `ExprId` refers to a semantically-equal attribute + * in a plan output. + */ + def hasUniqueExprIdsForOutput(plan: LogicalPlan): Boolean = { + val allOutputAttrs = plan.collect { case p if canGetOutputAttrs(p) => + p.output.filter(_.resolved).map(_.canonicalized.asInstanceOf[Attribute]) + } + val groupedAttrsByExprId = allOutputAttrs + .flatten.groupBy(_.exprId).values.map(_.distinct) + groupedAttrsByExprId.forall(_.length == 1) + } + + /** + * This method checks if reference `ExprId`s are not reused when assigning a new `ExprId`. + * For example, it returns false if plan transformers create an alias having the same `ExprId` + * with one of reference attributes, e.g., `a#1 + 1 AS a#1`. + */ + def checkIfSameExprIdNotReused(plan: LogicalPlan): Boolean = { + plan.collect { case p if p.resolved => + val inputExprIds = p.inputSet.filter(_.resolved).map(_.exprId).toSet + val newExprIds = p.expressions.filter(_.resolved).flatMap { e => + e.collect { + // Only accepts the case of aliases renaming foldable expressions, e.g., + // `FoldablePropagation` generates this renaming pattern. + case a: Alias if !a.child.foldable => a.exprId + } + }.toSet + inputExprIds.intersect(newExprIds).isEmpty + }.forall(identity) + } + + /** + * This method checks if the same `ExprId` refers to an unique attribute in a plan tree. + * Some plan transformers (e.g., `RemoveNoopOperators`) rewrite logical + * plans based on this assumption. + */ + def checkIfExprIdsAreGloballyUnique(plan: LogicalPlan): Boolean = { + checkIfSameExprIdNotReused(plan) && hasUniqueExprIdsForOutput(plan) + } +} diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index 223ef652d2f80..01f6f96437d39 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -266,7 +266,7 @@ case class Union( firstAttr.withNullability(nullable) } else { AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - firstAttr.exprId, firstAttr.qualifier) + NamedExpression.newExprId, firstAttr.qualifier) } } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FoldablePropagationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FoldablePropagationSuite.scala index fe43e8e288673..92e4fa345e2ad 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FoldablePropagationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FoldablePropagationSuite.scala @@ -156,8 +156,8 @@ class FoldablePropagationSuite extends PlanTest { val query = expand.where(a1.isNotNull).select(a1, a2).analyze val optimized = Optimize.execute(query) val correctExpand = expand.copy(projections = Seq( - Seq(Literal(null), c2), - Seq(c1, Literal(null)))) + Seq(Literal(null), Literal(2)), + Seq(Literal(1), Literal(null)))) val correctAnswer = correctExpand.where(a1.isNotNull).select(a1, a2).analyze comparePlans(optimized, correctAnswer) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala new file mode 100644 index 0000000000000..87d487dbe1ac8 --- /dev/null +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.catalyst.plans.logical + +import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.dsl.plans._ +import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference} +import org.apache.spark.sql.catalyst.plans.PlanTest +import org.apache.spark.sql.types.LongType + +class LogicalPlanIntegritySuite extends PlanTest { + import LogicalPlanIntegrity._ + + case class OutputTestPlan(child: LogicalPlan, output: Seq[Attribute]) extends UnaryNode { + override val analyzed = true + } + + test("Checks if the same `ExprId` refers to a semantically-equal attribute in a plan output") { + val t = LocalRelation('a.int, 'b.int) + assert(hasUniqueExprIdsForOutput(OutputTestPlan(t, t.output))) + assert(!hasUniqueExprIdsForOutput(OutputTestPlan(t, t.output.zipWithIndex.map { + case (a, i) => AttributeReference(s"c$i", LongType)(a.exprId) + }))) + } + + test("Checks if reference ExprIds are not reused when assigning a new ExprId") { + val t = LocalRelation('a.int, 'b.int) + val Seq(a, b) = t.output + assert(checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")()))) + assert(!checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")(exprId = a.exprId)))) + assert(!checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")(exprId = b.exprId)))) + assert(checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")()))) + assert(!checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")(exprId = a.exprId)))) + assert(!checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")(exprId = b.exprId)))) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala index 9f3ff1a6708e4..8797e5ad64149 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala @@ -36,7 +36,6 @@ import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart} import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.plans.logical.Range import org.apache.spark.sql.catalyst.streaming.{InternalOutputModes, StreamingRelationV2} -import org.apache.spark.sql.catalyst.util.DateTimeConstants.MICROS_PER_MILLIS import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.{LocalLimitExec, SimpleMode, SparkPlan} import org.apache.spark.sql.execution.command.ExplainCommand @@ -47,7 +46,7 @@ import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.sources.StreamSourceProvider import org.apache.spark.sql.streaming.util.{BlockOnStopSourceProvider, StreamManualClock} -import org.apache.spark.sql.types.{IntegerType, StructField, StructType} +import org.apache.spark.sql.types.{IntegerType, LongType, StructField, StructType} import org.apache.spark.util.Utils class StreamSuite extends StreamTest { @@ -1268,7 +1267,7 @@ class StreamSuite extends StreamTest { } abstract class FakeSource extends StreamSourceProvider { - private val fakeSchema = StructType(StructField("a", IntegerType) :: Nil) + private val fakeSchema = StructType(StructField("a", LongType) :: Nil) override def sourceSchema( spark: SQLContext, @@ -1290,7 +1289,7 @@ class FakeDefaultSource extends FakeSource { new Source { private var offset = -1L - override def schema: StructType = StructType(StructField("a", IntegerType) :: Nil) + override def schema: StructType = StructType(StructField("a", LongType) :: Nil) override def getOffset: Option[Offset] = { if (offset >= 10) { From cf1e86f330b2b4ff30be46873e06549c8870e709 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 8 Sep 2020 10:22:08 +0900 Subject: [PATCH 02/16] Fix --- .../sql/catalyst/optimizer/Optimizer.scala | 49 ++---- .../sql/catalyst/optimizer/subquery.scala | 162 ++++++++---------- 2 files changed, 87 insertions(+), 124 deletions(-) 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 099bbdeec226f..5ca7457a5f1f8 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 @@ -1584,36 +1584,25 @@ object ReplaceDistinctWithAggregate extends Rule[LogicalPlan] { * Replaces logical [[Deduplicate]] operator with an [[Aggregate]] operator. */ object ReplaceDeduplicateWithAggregate extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = { - val rewritePlanMap = mutable.ArrayBuffer[(LogicalPlan, LogicalPlan)]() - val newPlan = plan transform { - case Deduplicate(keys, child) if !child.isStreaming => - val keyExprIds = keys.map(_.exprId) - val aggCols = child.output.map { attr => - if (keyExprIds.contains(attr.exprId)) { - attr -> attr - } else { - val alias = Alias(new First(attr).toAggregateExpression(), attr.name)(attr.exprId) - alias -> alias.newInstance() - } - }.unzip - // SPARK-22951: Physical aggregate operators distinguishes global aggregation and grouping - // aggregations by checking the number of grouping keys. The key difference here is that a - // global aggregation always returns at least one row even if there are no input rows. Here - // we append a literal when the grouping key list is empty so that the result aggregate - // operator is properly treated as a grouping aggregation. - val nonemptyKeys = if (keys.isEmpty) Literal(1) :: Nil else keys - val newAgg = Aggregate(nonemptyKeys, aggCols._1, child) - rewritePlanMap += newAgg -> Aggregate(nonemptyKeys, aggCols._2, child) - newAgg - } - - if (rewritePlanMap.nonEmpty) { - assert(!plan.fastEquals(newPlan)) - Analyzer.rewritePlan(newPlan, rewritePlanMap.toMap)._1 - } else { - plan - } + def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { + case d @ Deduplicate(keys, child) if !child.isStreaming => + val keyExprIds = keys.map(_.exprId) + val aggCols = child.output.map { attr => + if (keyExprIds.contains(attr.exprId)) { + attr + } else { + Alias(new First(attr).toAggregateExpression(), attr.name)() + } + } + // SPARK-22951: Physical aggregate operators distinguishes global aggregation and grouping + // aggregations by checking the number of grouping keys. The key difference here is that a + // global aggregation always returns at least one row even if there are no input rows. Here + // we append a literal when the grouping key list is empty so that the result aggregate + // operator is properly treated as a grouping aggregation. + val nonemptyKeys = if (keys.isEmpty) Literal(1) :: Nil else keys + val newAgg = Aggregate(nonemptyKeys, aggCols, child) + val attrMapping = d.output.zip(newAgg.output) + newAgg -> attrMapping } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index aaef7a49a5472..8476fce2bfd93 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.catalyst.optimizer import scala.collection.mutable.ArrayBuffer import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.analysis.{Analyzer, CleanupAliases} +import org.apache.spark.sql.catalyst.analysis.CleanupAliases import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.expressions.SubExprUtils._ import org.apache.spark.sql.catalyst.expressions.aggregate._ @@ -342,11 +342,12 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { */ private def extractCorrelatedScalarSubqueries[E <: Expression]( expression: E, - subqueries: ArrayBuffer[ScalarSubquery]): E = { + subqueries: ArrayBuffer[(ScalarSubquery, ExprId)]): E = { val newExpression = expression transform { case s: ScalarSubquery if s.children.nonEmpty => - subqueries += s - s.plan.output.head + val newExprId = NamedExpression.newExprId + subqueries += s -> newExprId + s.plan.output.head.withExprId(newExprId) } newExpression.asInstanceOf[E] } @@ -513,17 +514,16 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { */ private def constructLeftJoins( child: LogicalPlan, - subqueries: ArrayBuffer[ScalarSubquery]): (LogicalPlan, Seq[(LogicalPlan, LogicalPlan)]) = { - val rewritePlanMap = ArrayBuffer[(LogicalPlan, LogicalPlan)]() - val newPlan = subqueries.foldLeft(child) { - case (currentChild, ScalarSubquery(query, conditions, _)) => + subqueries: ArrayBuffer[(ScalarSubquery, ExprId)]): LogicalPlan = { + subqueries.foldLeft(child) { + case (currentChild, (ScalarSubquery(query, conditions, _), newExprId)) => val origOutput = query.output.head val resultWithZeroTups = evalSubqueryOnZeroTups(query) if (resultWithZeroTups.isEmpty) { // CASE 1: Subquery guaranteed not to have the COUNT bug Project( - currentChild.output :+ origOutput, + currentChild.output :+ Alias(origOutput, origOutput.name)(exprId = newExprId), Join(currentChild, query, LeftOuter, conditions.reduceOption(And), JoinHint.NONE)) } else { // Subquery might have the COUNT bug. Add appropriate corrections. @@ -543,23 +543,16 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { if (havingNode.isEmpty) { // CASE 2: Subquery with no HAVING clause - val joinPlan = Join(currentChild, - Project(query.output :+ alwaysTrueExpr, query), - LeftOuter, conditions.reduceOption(And), JoinHint.NONE) - - def buildPlan(exprId: ExprId): LogicalPlan = { - Project( - currentChild.output :+ - Alias( - If(IsNull(alwaysTrueRef), - resultWithZeroTups.get, - aggValRef), origOutput.name)(exprId), - joinPlan) - } + Project( + currentChild.output :+ + Alias( + If(IsNull(alwaysTrueRef), + resultWithZeroTups.get, + aggValRef), origOutput.name)(exprId = newExprId), + Join(currentChild, + Project(query.output :+ alwaysTrueExpr, query), + LeftOuter, conditions.reduceOption(And), JoinHint.NONE)) - val newPlan = buildPlan(origOutput.exprId) - rewritePlanMap += newPlan -> buildPlan(NamedExpression.newExprId) - newPlan } else { // CASE 3: Subquery with HAVING clause. Pull the HAVING clause above the join. // Need to modify any operators below the join to pass through all columns @@ -575,85 +568,66 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { case op => sys.error(s"Unexpected operator $op in corelated subquery") } - val joinPlan = Join(currentChild, - Project(subqueryRoot.output :+ alwaysTrueExpr, subqueryRoot), - LeftOuter, conditions.reduceOption(And), JoinHint.NONE) - - def buildPlan(exprId: ExprId): LogicalPlan = { - // CASE WHEN alwaysTrue IS NULL THEN resultOnZeroTups - // WHEN NOT (original HAVING clause expr) THEN CAST(null AS ) - // ELSE (aggregate value) END AS (original column name) - val caseExpr = Alias(CaseWhen(Seq( - (IsNull(alwaysTrueRef), resultWithZeroTups.get), - (Not(havingNode.get.condition), Literal.create(null, aggValRef.dataType))), - aggValRef), - origOutput.name)(exprId) - - Project( - currentChild.output :+ caseExpr, - joinPlan) - } + // CASE WHEN alwaysTrue IS NULL THEN resultOnZeroTups + // WHEN NOT (original HAVING clause expr) THEN CAST(null AS ) + // ELSE (aggregate value) END AS (original column name) + val caseExpr = Alias(CaseWhen(Seq( + (IsNull(alwaysTrueRef), resultWithZeroTups.get), + (Not(havingNode.get.condition), Literal.create(null, aggValRef.dataType))), + aggValRef), + origOutput.name)(exprId = newExprId) + + Project( + currentChild.output :+ caseExpr, + Join(currentChild, + Project(subqueryRoot.output :+ alwaysTrueExpr, subqueryRoot), + LeftOuter, conditions.reduceOption(And), JoinHint.NONE)) - val newPlan = buildPlan(origOutput.exprId) - rewritePlanMap += newPlan -> buildPlan(NamedExpression.newExprId) - newPlan } } } - - (newPlan, rewritePlanMap) } /** * Rewrite [[Filter]], [[Project]] and [[Aggregate]] plans containing correlated scalar * subqueries. */ - def apply(plan: LogicalPlan): LogicalPlan = { - val rewritePlanMap = ArrayBuffer[(LogicalPlan, LogicalPlan)]() - val newPlan = plan transform { - case a @ Aggregate(grouping, expressions, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) - if (subqueries.nonEmpty) { - // We currently only allow correlated subqueries in an aggregate if they are part of the - // grouping expressions. As a result we need to replace all the scalar subqueries in the - // grouping expressions by their result. - val newGrouping = grouping.map { e => - subqueries.find(_.semanticEquals(e)).map(_.plan.output.head).getOrElse(e) - } - val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) - rewritePlanMap ++= rewriteMap - Aggregate(newGrouping, newExpressions, newChild) - } else { - a - } - case p @ Project(expressions, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) - if (subqueries.nonEmpty) { - val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) - rewritePlanMap ++= rewriteMap - Project(newExpressions, newChild) - } else { - p + def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { + case a @ Aggregate(grouping, expressions, child) => + val subqueries = ArrayBuffer.empty[(ScalarSubquery, ExprId)] + val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) + if (subqueries.nonEmpty) { + // We currently only allow correlated subqueries in an aggregate if they are part of the + // grouping expressions. As a result we need to replace all the scalar subqueries in the + // grouping expressions by their result. + val newGrouping = grouping.map { e => + subqueries.find(_._1.semanticEquals(e)).map(_._1.plan.output.head).getOrElse(e) } - case f @ Filter(condition, child) => - val subqueries = ArrayBuffer.empty[ScalarSubquery] - val newCondition = extractCorrelatedScalarSubqueries(condition, subqueries) - if (subqueries.nonEmpty) { - val (newChild, rewriteMap) = constructLeftJoins(child, subqueries) - rewritePlanMap ++= rewriteMap - Project(f.output, Filter(newCondition, newChild)) - } else { - f - } - } - - if (rewritePlanMap.nonEmpty) { - assert(!plan.fastEquals(newPlan)) - Analyzer.rewritePlan(newPlan, rewritePlanMap.toMap)._1 - } else { - newPlan - } + val newAgg = Aggregate(newGrouping, newExpressions, constructLeftJoins(child, subqueries)) + val attrMapping = a.output.zip(newAgg.output) + newAgg -> attrMapping + } else { + a -> Nil + } + case p @ Project(expressions, child) => + val subqueries = ArrayBuffer.empty[(ScalarSubquery, ExprId)] + val newExpressions = expressions.map(extractCorrelatedScalarSubqueries(_, subqueries)) + if (subqueries.nonEmpty) { + val newProj = Project(newExpressions, constructLeftJoins(child, subqueries)) + val attrMapping = p.output.zip(newProj.output) + newProj -> attrMapping + } else { + p -> Nil + } + case f @ Filter(condition, child) => + val subqueries = ArrayBuffer.empty[(ScalarSubquery, ExprId)] + val newCondition = extractCorrelatedScalarSubqueries(condition, subqueries) + if (subqueries.nonEmpty) { + val newProj = Project(f.output, Filter(newCondition, constructLeftJoins(child, subqueries))) + val attrMapping = f.output.zip(newProj.output) + newProj -> attrMapping + } else { + f -> Nil + } } } From 8da2af537b4c7eeff5e045f5d07011d59879cdfd Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 8 Sep 2020 22:05:35 +0900 Subject: [PATCH 03/16] review --- .../apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index 9f9d028d88366..3a3de8de1a258 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -223,6 +223,9 @@ object LogicalPlanIntegrity { */ def hasUniqueExprIdsForOutput(plan: LogicalPlan): Boolean = { val allOutputAttrs = plan.collect { case p if canGetOutputAttrs(p) => + // NOTE: we still need to filter resolved expressions here because the output of + // some resolved logical plans can have unresolved references, + // e.g., outer references in `ExistenceJoin`. p.output.filter(_.resolved).map(_.canonicalized.asInstanceOf[Attribute]) } val groupedAttrsByExprId = allOutputAttrs From 2d0d265b1ce3eb2bc29308b453827f550a361a75 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Thu, 10 Sep 2020 21:50:47 +0900 Subject: [PATCH 04/16] review --- .../sql/catalyst/plans/logical/LogicalPlan.scala | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index 3a3de8de1a258..916979fa31edc 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -240,15 +240,10 @@ object LogicalPlanIntegrity { */ def checkIfSameExprIdNotReused(plan: LogicalPlan): Boolean = { plan.collect { case p if p.resolved => - val inputExprIds = p.inputSet.filter(_.resolved).map(_.exprId).toSet - val newExprIds = p.expressions.filter(_.resolved).flatMap { e => - e.collect { - // Only accepts the case of aliases renaming foldable expressions, e.g., - // `FoldablePropagation` generates this renaming pattern. - case a: Alias if !a.child.foldable => a.exprId - } - }.toSet - inputExprIds.intersect(newExprIds).isEmpty + p.expressions.forall { + case a: Alias => !a.references.contains(a.toAttribute) + case _ => true + } }.forall(identity) } From 8fece42872c4b870c7edef2ee90afacbe34fdd55 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Fri, 11 Sep 2020 10:12:42 +0900 Subject: [PATCH 05/16] Fix test failures --- .../spark/sql/catalyst/optimizer/Optimizer.scala | 1 + .../spark/sql/catalyst/plans/logical/LogicalPlan.scala | 10 ++++++++-- .../plans/logical/LogicalPlanIntegritySuite.scala | 2 +- .../spark/sql/execution/adaptive/AQEOptimizer.scala | 8 +++++++- 4 files changed, 17 insertions(+), 4 deletions(-) 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 5ca7457a5f1f8..f27c5a26741d4 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 @@ -43,6 +43,7 @@ abstract class Optimizer(catalogManager: CatalogManager) // Currently we check after the execution of each rule if a plan: // - is still resolved // - only host special expressions in supported operators + // - has globally-unique attribute IDs override protected def isPlanIntegral(plan: LogicalPlan): Boolean = { !Utils.isTesting || (plan.resolved && plan.find(PlanHelper.specialExpressionsInUnsupportedOperator(_).nonEmpty).isEmpty && diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index 916979fa31edc..cefc97a95d223 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -241,8 +241,14 @@ object LogicalPlanIntegrity { def checkIfSameExprIdNotReused(plan: LogicalPlan): Boolean = { plan.collect { case p if p.resolved => p.expressions.forall { - case a: Alias => !a.references.contains(a.toAttribute) - case _ => true + case a: Alias => + // Even if a plan is resolved, `a.references` can return unresolved references, + // e.g., in `Grouping`/`GroupingID`, so we need to filter out them and + // check if the same `exprId` in `Alias` does not exist + // among reference `exprId`s. + !a.references.filter(_.resolved).map(_.exprId).exists(_ == a.exprId) + case _ => + true } }.forall(identity) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala index 87d487dbe1ac8..6f342b8d94379 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanIntegritySuite.scala @@ -43,7 +43,7 @@ class LogicalPlanIntegritySuite extends PlanTest { val Seq(a, b) = t.output assert(checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")()))) assert(!checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")(exprId = a.exprId)))) - assert(!checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")(exprId = b.exprId)))) + assert(checkIfSameExprIdNotReused(t.select(Alias(a + 1, "a")(exprId = b.exprId)))) assert(checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")()))) assert(!checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")(exprId = a.exprId)))) assert(!checkIfSameExprIdNotReused(t.select(Alias(a + b, "ab")(exprId = b.exprId)))) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala index c82b264a600ef..0170f8b2f71c2 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.execution.adaptive -import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, LogicalPlanIntegrity, PlanHelper} import org.apache.spark.sql.catalyst.rules.RuleExecutor import org.apache.spark.sql.internal.SQLConf import org.apache.spark.util.Utils @@ -54,4 +54,10 @@ class AQEOptimizer(conf: SQLConf) extends RuleExecutor[LogicalPlan] { } } } + + override protected def isPlanIntegral(plan: LogicalPlan): Boolean = { + !Utils.isTesting || (plan.resolved && + plan.find(PlanHelper.specialExpressionsInUnsupportedOperator(_).nonEmpty).isEmpty && + LogicalPlanIntegrity.checkIfExprIdsAreGloballyUnique(plan)) + } } From 73ca79516c721b2e3a22d761c991749682e19b0d Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Thu, 17 Sep 2020 23:57:04 +0900 Subject: [PATCH 06/16] review --- .../org/apache/spark/sql/catalyst/analysis/Analyzer.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index c79600b022d38..f07f0fcf2b3f8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -2623,13 +2623,13 @@ class Analyzer( case ne: NamedExpression => // If a named expression is not in regularExpressions, add it to // extractedExprBuffer and replace it with an AttributeReference. - val attr = ne.toAttribute val missingExpr = - AttributeSet(Seq(attr)) -- (regularExpressions ++ extractedExprBuffer) + AttributeSet(Seq(expr)) -- (regularExpressions ++ extractedExprBuffer) if (missingExpr.nonEmpty) { extractedExprBuffer += ne } - attr + // alias will be cleaned in the rule CleanupAliases + ne case e: Expression if e.foldable => e // No need to create an attribute reference if it will be evaluated as a Literal. case e: Expression => From 93cd9e66c30f83251a971735135f57857e345570 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Fri, 18 Sep 2020 09:53:30 +0900 Subject: [PATCH 07/16] Add comments --- .../org/apache/spark/sql/catalyst/optimizer/subquery.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index 8476fce2bfd93..9173b2d8032b5 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -338,7 +338,11 @@ object PullupCorrelatedPredicates extends Rule[LogicalPlan] with PredicateHelper object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { /** * Extract all correlated scalar subqueries from an expression. The subqueries are collected using - * the given collector. The expression is rewritten and returned. + * the given collector. To avoid the reuse of `exprId`s, this method generates new `exprId` + * for the subqueries and rewrite references in the given `expression`. + * This method returns extracted subqueries and the corresponding `exprId`s and these values + * will be used later in `constructLeftJoins` for building the child plan that + * returns subquery output with the `exprId`s. */ private def extractCorrelatedScalarSubqueries[E <: Expression]( expression: E, From c78e517874562fed5a1cf1fbabe268de1a36ece2 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Fri, 18 Sep 2020 15:36:19 +0900 Subject: [PATCH 08/16] Fix --- .../sql/catalyst/analysis/ResolveUnion.scala | 29 +++++++++++++-- .../sql/catalyst/analysis/TypeCoercion.scala | 3 +- .../sql/catalyst/optimizer/Optimizer.scala | 22 ++++++++--- .../sql/catalyst/optimizer/subquery.scala | 5 +-- .../catalyst/plans/logical/LogicalPlan.scala | 15 ++++---- .../plans/logical/basicLogicalOperators.scala | 37 +++++++++++++------ .../analysis/DecimalPrecisionSuite.scala | 2 +- .../catalyst/analysis/ResolveUnionSuite.scala | 9 +++-- .../scala/org/apache/spark/sql/Dataset.scala | 2 +- .../spark/sql/execution/SparkStrategies.scala | 2 +- .../execution/basicPhysicalOperators.scala | 18 ++------- .../sql/execution/SparkPlannerSuite.scala | 2 +- 12 files changed, 90 insertions(+), 56 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index 693a5a4e75443..efbd7101d6915 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -18,17 +18,33 @@ package org.apache.spark.sql.catalyst.analysis import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.expressions.{Alias, Literal} +import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, Literal, NamedExpression} import org.apache.spark.sql.catalyst.optimizer.CombineUnions import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, Union} import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.SchemaUtils /** * Resolves different children of Union to a common set of columns. */ object ResolveUnion extends Rule[LogicalPlan] { + + private[catalyst] def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { + children.map(_.output).transpose.map { attrs => + val firstAttr = attrs.head + val nullable = attrs.exists(_.nullable) + val newDt = attrs.map(_.dataType).reduce(StructType.merge) + if (firstAttr.dataType == newDt) { + firstAttr.withNullability(nullable) + } else { + AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( + NamedExpression.newExprId, firstAttr.qualifier) + } + } + } + private def unionTwoSides( left: LogicalPlan, right: LogicalPlan, @@ -68,7 +84,8 @@ object ResolveUnion extends Rule[LogicalPlan] { } else { left } - Union(leftChild, rightChild) + val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) + Union(leftChild, rightChild, unionOutput) } // Check column name duplication @@ -88,13 +105,17 @@ object ResolveUnion extends Rule[LogicalPlan] { } def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsUp { - case e if !e.childrenResolved => e + case p if !p.childrenResolved => p - case Union(children, byName, allowMissingCol) if byName => + case Union(children, byName, allowMissingCol, _) if byName => val union = children.reduceLeft { (left, right) => checkColumnNames(left, right) unionTwoSides(left, right, allowMissingCol) } CombineUnions(union) + + case u @ Union(children, _, _, unionOutput) + if u.allChildrenCompatible && unionOutput.isEmpty => + u.copy(unionOutput = makeUnionOutput(children)) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index deaa49bf423b1..f71e2c5a3c505 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -359,7 +359,8 @@ object TypeCoercion { s -> Nil } else { val attrMapping = s.children.head.output.zip(newChildren.head.output) - s.copy(children = newChildren) -> attrMapping + val newOutput = ResolveUnion.makeUnionOutput(newChildren) + s.copy(children = newChildren, unionOutput = newOutput) -> attrMapping } } } 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 f27c5a26741d4..507381699642f 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 @@ -592,7 +592,8 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper val rewrites = buildRewrites(u.children.head, child) Project(projectList.map(pushToRight(_, rewrites)), child) } - u.copy(children = newFirstChild +: newOtherChildren) + val newChildren = newFirstChild +: newOtherChildren + u.copy(children = newChildren, unionOutput = ResolveUnion.makeUnionOutput(newChildren)) } else { p } @@ -967,17 +968,20 @@ object CombineUnions extends Rule[LogicalPlan] { // rules (by position and by name) could cause incorrect results. while (stack.nonEmpty) { stack.pop() match { - case Distinct(Union(children, byName, allowMissingCol)) + case Distinct(Union(children, byName, allowMissingCol, _)) if flattenDistinct && byName == topByName && allowMissingCol == topAllowMissingCol => stack.pushAll(children.reverse) - case Union(children, byName, allowMissingCol) + case Union(children, byName, allowMissingCol, _) if byName == topByName && allowMissingCol == topAllowMissingCol => stack.pushAll(children.reverse) case child => flattened += child } } - union.copy(children = flattened.toSeq) + union.copy( + children = flattened, + unionOutput = ResolveUnion.makeUnionOutput(flattened) + ) } } @@ -1689,7 +1693,8 @@ object RewriteExceptAll extends Rule[LogicalPlan] { val newColumnRight = Alias(Literal(-1L), "vcol")() val modifiedLeftPlan = Project(Seq(newColumnLeft) ++ left.output, left) val modifiedRightPlan = Project(Seq(newColumnRight) ++ right.output, right) - val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan) + val unionOutput = ResolveUnion.makeUnionOutput(Seq(modifiedLeftPlan, modifiedRightPlan)) + val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan, output = unionOutput) val aggSumCol = Alias(AggregateExpression(Sum(unionPlan.output.head.toAttribute), Complete, false), "sum")() val aggOutputColumns = left.output ++ Seq(aggSumCol) @@ -1753,7 +1758,12 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { val leftPlanWithAddedVirtualCols = Project(Seq(trueVcol1, nullVcol2) ++ left.output, left) val rightPlanWithAddedVirtualCols = Project(Seq(nullVcol1, trueVcol2) ++ right.output, right) - val unionPlan = Union(leftPlanWithAddedVirtualCols, rightPlanWithAddedVirtualCols) + val unionOutput = ResolveUnion.makeUnionOutput( + Seq(leftPlanWithAddedVirtualCols, rightPlanWithAddedVirtualCols)) + val unionPlan = Union( + leftPlanWithAddedVirtualCols, + rightPlanWithAddedVirtualCols, + output = unionOutput) // Expressions to compute count and minimum of both the counts. val vCol1AggrExpr = diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index 9173b2d8032b5..a168dcd7a83f5 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -463,10 +463,7 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { sys.error(s"Unexpected operator in scalar subquery: $lp") } - val resultMap = evalPlan(plan).mapValues { _.transform { - case a: Alias => a.newInstance() // Assigns a new `ExprId` - } - } + val resultMap = evalPlan(plan) // By convention, the scalar subquery result is the leftmost field. resultMap.get(plan.output.head.exprId) match { diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index cefc97a95d223..eee9fb7cff5a6 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -218,19 +218,18 @@ object LogicalPlanIntegrity { /** * Since some logical plans (e.g., `Union`) can build `AttributeReference`s in their `output`, - * this method checks if the same `ExprId` refers to a semantically-equal attribute - * in a plan output. + * this method checks if the same `ExprId` refers to attributes having the same data type + * in plan output. */ def hasUniqueExprIdsForOutput(plan: LogicalPlan): Boolean = { - val allOutputAttrs = plan.collect { case p if canGetOutputAttrs(p) => + val exprIds = plan.collect { case p if canGetOutputAttrs(p) => // NOTE: we still need to filter resolved expressions here because the output of // some resolved logical plans can have unresolved references, // e.g., outer references in `ExistenceJoin`. - p.output.filter(_.resolved).map(_.canonicalized.asInstanceOf[Attribute]) - } - val groupedAttrsByExprId = allOutputAttrs - .flatten.groupBy(_.exprId).values.map(_.distinct) - groupedAttrsByExprId.forall(_.length == 1) + p.output.filter(_.resolved).map { a => (a.exprId, a.dataType) } + }.flatten + val groupedDataTypesByExprId = exprIds.groupBy(_._1).values.map(_.distinct) + groupedDataTypesByExprId.forall(_.length == 1) } /** diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index 01f6f96437d39..b301b9e37b649 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -213,8 +213,13 @@ case class Except( /** Factory for constructing new `Union` nodes. */ object Union { + + def apply(left: LogicalPlan, right: LogicalPlan, output: Seq[Attribute]): Union = { + Union(left :: right :: Nil, unionOutput = output) + } + def apply(left: LogicalPlan, right: LogicalPlan): Union = { - Union (left :: right :: Nil) + Union(left :: right :: Nil) } } @@ -229,7 +234,8 @@ object Union { case class Union( children: Seq[LogicalPlan], byName: Boolean = false, - allowMissingCol: Boolean = false) extends LogicalPlan { + allowMissingCol: Boolean = false, + unionOutput: Seq[Attribute] = Seq.empty) extends LogicalPlan { assert(!allowMissingCol || byName, "`allowMissingCol` can be true only if `byName` is true.") override def maxRows: Option[Long] = { @@ -256,8 +262,7 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - // updating nullability to make all the children consistent - override def output: Seq[Attribute] = { + private def makeUnionOutput(): Seq[Attribute] = { children.map(_.output).transpose.map { attrs => val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) @@ -271,17 +276,27 @@ case class Union( } } - override lazy val resolved: Boolean = { + // updating nullability to make all the children consistent + override def output: Seq[Attribute] = { + assert(unionOutput.nonEmpty, "Union should have at least a single column") + unionOutput + } + + def allChildrenCompatible: Boolean = { // allChildrenCompatible needs to be evaluated after childrenResolved - def allChildrenCompatible: Boolean = - children.tail.forall( child => - // compare the attribute number with the first child - child.output.length == children.head.output.length && + childrenResolved && children.tail.forall { child => + // compare the attribute number with the first child + child.output.length == children.head.output.length && // compare the data types with the first child child.output.zip(children.head.output).forall { case (l, r) => l.dataType.sameType(r.dataType) - }) - children.length > 1 && !(byName || allowMissingCol) && childrenResolved && allChildrenCompatible + } + } + } + + override lazy val resolved: Boolean = { + children.length > 1 && !(byName || allowMissingCol) && allChildrenCompatible && + unionOutput.nonEmpty } /** diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala index d5991ff10ce6c..2351523f8f41c 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala @@ -73,7 +73,7 @@ class DecimalPrecisionSuite extends AnalysisTest with BeforeAndAfter { Union(Project(Seq(Alias(left, "l")()), relation), Project(Seq(Alias(right, "r")()), relation)) val (l, r) = analyzer.execute(plan).collect { - case Union(Seq(child1, child2), _, _) => (child1.output.head, child2.output.head) + case Union(Seq(child1, child2), _, _, _) => (child1.output.head, child2.output.head) }.head assert(l.dataType === expectedType) assert(r.dataType === expectedType) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala index 5c7ad0067a456..42bd4012b0a63 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala @@ -16,6 +16,8 @@ */ package org.apache.spark.sql.catalyst.analysis +import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules.RuleExecutor @@ -51,7 +53,8 @@ class ResolveUnionSuite extends AnalysisTest { val analyzed1 = analyzer.execute(union1) val projected1 = Project(Seq(table2.output(3), table2.output(0), table2.output(1), table2.output(2)), table2) - val expected1 = Union(table1 :: projected1 :: Nil) + val expectedOutput = Seq('i.int, 'u.decimal, 'b.byte, 'd.double) + val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed1, expected1) // Allow missing column @@ -60,7 +63,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr1 = Alias(Literal(null, ByteType), "b")() val projected2 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, table2.output(2)), table3) - val expected2 = Union(table1 :: projected2 :: Nil) + val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed2, expected2) // Allow missing column + Allow missing column @@ -69,7 +72,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr2 = Alias(Literal(null, DoubleType), "d")() val projected3 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, nullAttr2), table4) - val expected3 = Union(table1 :: projected2 :: projected3 :: Nil) + val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed3, expected3) } } diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala index 87b9aea80c823..0c4b5dc5a73cf 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala @@ -227,7 +227,7 @@ class Dataset[T] private[sql]( val plan = queryExecution.analyzed match { case c: Command => LocalRelation(c.output, withAction("command", queryExecution)(_.executeCollect())) - case u @ Union(children, _, _) if children.forall(_.isInstanceOf[Command]) => + case u @ Union(children, _, _, _) if children.forall(_.isInstanceOf[Command]) => LocalRelation(u.output, withAction("command", queryExecution)(_.executeCollect())) case _ => queryExecution.analyzed diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala index ba3d83714c302..abea4a7a8eaff 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala @@ -692,7 +692,7 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { case logical.GlobalLimit(IntegerLiteral(limit), child) => execution.GlobalLimitExec(limit, planLater(child)) :: Nil case union: logical.Union => - execution.UnionExec(union.children.map(planLater)) :: Nil + execution.UnionExec(union.children.map(planLater), union.unionOutput) :: Nil case g @ logical.Generate(generator, _, outer, _, _, child) => execution.GenerateExec( generator, g.requiredChildOutput, outer, diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 1f70fde3f7654..740564f120e1a 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -634,21 +634,9 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) * If we change how this is implemented physically, we'd need to update * [[org.apache.spark.sql.catalyst.plans.logical.Union.maxRowsPerPartition]]. */ -case class UnionExec(children: Seq[SparkPlan]) extends SparkPlan { - // updating nullability to make all the children consistent - override def output: Seq[Attribute] = { - children.map(_.output).transpose.map { attrs => - val firstAttr = attrs.head - val nullable = attrs.exists(_.nullable) - val newDt = attrs.map(_.dataType).reduce(StructType.merge) - if (firstAttr.dataType == newDt) { - firstAttr.withNullability(nullable) - } else { - AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - firstAttr.exprId, firstAttr.qualifier) - } - } - } +case class UnionExec(children: Seq[SparkPlan], unionOutput: Seq[Attribute]) extends SparkPlan { + + override def output: Seq[Attribute] = unionOutput protected override def doExecute(): RDD[InternalRow] = sparkContext.union(children.map(_.execute())) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala index b4cb7e3fce3cf..4ba25db374147 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala @@ -39,7 +39,7 @@ class SparkPlannerSuite extends SharedSparkSession { planLater(child) :: planLater(NeverPlanned) :: Nil case u: Union => planned += 1 - UnionExec(u.children.map(planLater)) :: planLater(NeverPlanned) :: Nil + UnionExec(u.children.map(planLater), u.unionOutput) :: planLater(NeverPlanned) :: Nil case LocalRelation(output, data, _) => planned += 1 LocalTableScanExec(output, data) :: planLater(NeverPlanned) :: Nil From 8b86bcfde3f7f78cf38007b991d623fcc6127988 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Wed, 23 Sep 2020 21:05:46 +0900 Subject: [PATCH 09/16] Update --- .../sql/catalyst/analysis/Analyzer.scala | 2 +- .../sql/catalyst/analysis/ResolveUnion.scala | 5 +- .../sql/catalyst/optimizer/Optimizer.scala | 78 +++++++++++-------- .../spark/sql/catalyst/plans/QueryPlan.scala | 10 +-- .../plans/logical/basicLogicalOperators.scala | 16 +--- .../execution/basicPhysicalOperators.scala | 6 +- 6 files changed, 62 insertions(+), 55 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index f07f0fcf2b3f8..77a6631b250e8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -2760,7 +2760,7 @@ class Analyzer( val windowOps = groupedWindowExpressions.foldLeft(child) { case (last, ((partitionSpec, orderSpec, _), windowExpressions)) => - Window(windowExpressions, partitionSpec, orderSpec, last) + Window(windowExpressions.toSeq, partitionSpec, orderSpec, last) } // Finally, we create a Project to output windowOps's output diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index efbd7101d6915..afd27b6e26a82 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -36,11 +36,12 @@ object ResolveUnion extends Rule[LogicalPlan] { val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) val newDt = attrs.map(_.dataType).reduce(StructType.merge) + val newExprId = NamedExpression.newExprId if (firstAttr.dataType == newDt) { - firstAttr.withNullability(nullable) + firstAttr.withExprId(newExprId).withNullability(nullable) } else { AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - NamedExpression.newExprId, firstAttr.qualifier) + newExprId, firstAttr.qualifier) } } } 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 507381699642f..e43799645a8e9 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 @@ -563,11 +563,10 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper } /** - * Rewrites an expression so that it can be pushed to the right side of a - * Union or Except operator. This method relies on the fact that the output attributes - * of a union/intersect/except are always equal to the left child's output. + * Rewrites an expression so that it can be pushed to the left/right side of a + * Union or Except operator. */ - private def pushToRight[A <: Expression](e: A, rewrites: AttributeMap[Attribute]) = { + private def rewriteExprs[A <: Expression](e: A, rewrites: AttributeMap[Attribute]) = { val result = e transform { case a: Attribute => rewrites(a) } match { @@ -581,21 +580,28 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper result.asInstanceOf[A] } - def apply(plan: LogicalPlan): LogicalPlan = plan transform { + def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { // Push down deterministic projection through UNION ALL case p @ Project(projectList, u: Union) => assert(u.children.nonEmpty) if (projectList.forall(_.deterministic)) { - val newFirstChild = Project(projectList, u.children.head) + val firstRewrites = buildRewrites(u, u.children.head) + val newFirstChild = Project( + projectList.map(rewriteExprs(_, firstRewrites)), u.children.head) val newOtherChildren = u.children.tail.map { child => - val rewrites = buildRewrites(u.children.head, child) - Project(projectList.map(pushToRight(_, rewrites)), child) + val otherRewrites = buildRewrites(u, child) + Project(projectList.map(rewriteExprs(_, otherRewrites)), child) } val newChildren = newFirstChild +: newOtherChildren - u.copy(children = newChildren, unionOutput = ResolveUnion.makeUnionOutput(newChildren)) + val newOutput = ResolveUnion.makeUnionOutput(newChildren) + val newPlan = u.copy(children = newChildren, unionOutput = newOutput) + val attrMapping = p.output.zip(newPlan.output).filter { + case (a1, a2) => a1.exprId != a2.exprId + } + newPlan -> attrMapping } else { - p + p -> Nil } } } @@ -666,7 +672,9 @@ object ColumnPruning extends Rule[LogicalPlan] { case p @ Project(_, u: Union) => if (!u.outputSet.subsetOf(p.references)) { val firstChild = u.children.head - val newOutput = prunedChild(firstChild, p.references).output + val firstRewrites = AttributeMap(u.output.zip(firstChild.output)) + val projRefs = AttributeSet(p.references.map(firstRewrites).toSeq) + val newOutput = prunedChild(firstChild, projRefs).output // pruning the columns of all children based on the pruned first child. val newChildren = u.children.map { p => val selected = p.output.zipWithIndex.filter { case (a, i) => @@ -674,7 +682,8 @@ object ColumnPruning extends Rule[LogicalPlan] { }.map(_._1) Project(selected, p) } - p.copy(child = u.withNewChildren(newChildren)) + val prunedUnionOutput = u.output.filter(p.references.contains) + p.copy(child = u.copy(children = newChildren, unionOutput = prunedUnionOutput)) } else { p } @@ -978,10 +987,7 @@ object CombineUnions extends Rule[LogicalPlan] { flattened += child } } - union.copy( - children = flattened, - unionOutput = ResolveUnion.makeUnionOutput(flattened) - ) + union.copy(children = flattened.toSeq) } } @@ -1685,8 +1691,8 @@ object ReplaceExceptWithAntiJoin extends Rule[LogicalPlan] { */ object RewriteExceptAll extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = plan transform { - case Except(left, right, true) => + def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { + case e @ Except(left, right, true) => assert(left.output.size == right.output.size) val newColumnLeft = Alias(Literal(1L), "vcol")() @@ -1697,18 +1703,23 @@ object RewriteExceptAll extends Rule[LogicalPlan] { val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan, output = unionOutput) val aggSumCol = Alias(AggregateExpression(Sum(unionPlan.output.head.toAttribute), Complete, false), "sum")() - val aggOutputColumns = left.output ++ Seq(aggSumCol) - val aggregatePlan = Aggregate(left.output, aggOutputColumns, unionPlan) + val newLeftOutput = unionPlan.output.drop(1) + val aggOutputColumns = newLeftOutput ++ Seq(aggSumCol) + val aggregatePlan = Aggregate(newLeftOutput, aggOutputColumns, unionPlan) val filteredAggPlan = Filter(GreaterThan(aggSumCol.toAttribute, Literal(0L)), aggregatePlan) val genRowPlan = Generate( - ReplicateRows(Seq(aggSumCol.toAttribute) ++ left.output), + ReplicateRows(Seq(aggSumCol.toAttribute) ++ newLeftOutput), unrequiredChildIndex = Nil, outer = false, qualifier = None, - left.output, + newLeftOutput, filteredAggPlan ) - Project(left.output, genRowPlan) + val newPlan = Project(newLeftOutput, genRowPlan) + val attrMapping = e.output.zip(newPlan.output).filter { + case (a1, a2) => a1.exprId != a2.exprId + } + newPlan -> attrMapping } } @@ -1743,8 +1754,8 @@ object RewriteExceptAll extends Rule[LogicalPlan] { * }}} */ object RewriteIntersectAll extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = plan transform { - case Intersect(left, right, true) => + def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { + case i @ Intersect(left, right, true) => assert(left.output.size == right.output.size) val trueVcol1 = Alias(Literal(true), "vcol1")() @@ -1776,22 +1787,27 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { vCol1AggrExpr.toAttribute ), "min_count")() - val aggregatePlan = Aggregate(left.output, - Seq(vCol1AggrExpr, vCol2AggrExpr) ++ left.output, unionPlan) + val newLeftOutput = unionPlan.output.drop(2) + val aggregatePlan = Aggregate(newLeftOutput, + Seq(vCol1AggrExpr, vCol2AggrExpr) ++ newLeftOutput, unionPlan) val filterPlan = Filter(And(GreaterThanOrEqual(vCol1AggrExpr.toAttribute, Literal(1L)), GreaterThanOrEqual(vCol2AggrExpr.toAttribute, Literal(1L))), aggregatePlan) - val projectMinPlan = Project(left.output ++ Seq(ifExpression), filterPlan) + val projectMinPlan = Project(newLeftOutput ++ Seq(ifExpression), filterPlan) // Apply the replicator to replicate rows based on min_count val genRowPlan = Generate( - ReplicateRows(Seq(ifExpression.toAttribute) ++ left.output), + ReplicateRows(Seq(ifExpression.toAttribute) ++ newLeftOutput), unrequiredChildIndex = Nil, outer = false, qualifier = None, - left.output, + newLeftOutput, projectMinPlan ) - Project(left.output, genRowPlan) + val newPlan = Project(newLeftOutput, genRowPlan) + val attrMapping = i.output.zip(newPlan.output).filter { + case (a1, a2) => a1.exprId != a2.exprId + } + newPlan -> attrMapping } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala index a89f055e2ac80..b08e8fabb9c6a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala @@ -201,11 +201,6 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT case (oldAttr, _) => plan.references.contains(oldAttr) } - val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { - rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) - } - newPlan = planAfterRule - if (attrMappingForCurrentPlan.nonEmpty) { assert(!attrMappingForCurrentPlan.groupBy(_._1.exprId) .exists(_._2.map(_._2.exprId).distinct.length > 1), @@ -222,6 +217,11 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT } } + val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { + rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) + } + newPlan = planAfterRule + attrMapping ++= newAttrMapping.filter { case (a1, a2) => a1.exprId != a2.exprId } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index b301b9e37b649..d7cb86e6b8042 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -262,19 +262,7 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - private def makeUnionOutput(): Seq[Attribute] = { - children.map(_.output).transpose.map { attrs => - val firstAttr = attrs.head - val nullable = attrs.exists(_.nullable) - val newDt = attrs.map(_.dataType).reduce(StructType.merge) - if (firstAttr.dataType == newDt) { - firstAttr.withNullability(nullable) - } else { - AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - NamedExpression.newExprId, firstAttr.qualifier) - } - } - } + override def producedAttributes: AttributeSet = AttributeSet(unionOutput) // updating nullability to make all the children consistent override def output: Seq[Attribute] = { @@ -282,7 +270,7 @@ case class Union( unionOutput } - def allChildrenCompatible: Boolean = { + lazy val allChildrenCompatible: Boolean = { // allChildrenCompatible needs to be evaluated after childrenResolved childrenResolved && children.tail.forall { child => // compare the attribute number with the first child diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 740564f120e1a..6bc775cf26b81 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -634,9 +634,11 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) * If we change how this is implemented physically, we'd need to update * [[org.apache.spark.sql.catalyst.plans.logical.Union.maxRowsPerPartition]]. */ -case class UnionExec(children: Seq[SparkPlan], unionOutput: Seq[Attribute]) extends SparkPlan { +case class UnionExec(children: Seq[SparkPlan], output: Seq[Attribute]) extends SparkPlan { - override def output: Seq[Attribute] = unionOutput + assert(output.nonEmpty, "Union should have at least a single column") + + override def producedAttributes: AttributeSet = AttributeSet(output) protected override def doExecute(): RDD[InternalRow] = sparkContext.union(children.map(_.execute())) From 4c8a81e3b291a5f0d0506f731596ca2dff1b6f34 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Thu, 24 Sep 2020 17:01:27 +0900 Subject: [PATCH 10/16] Bugfix --- R/pkg/tests/fulltests/test_sparkSQL.R | 14 +- .../sql/catalyst/analysis/Analyzer.scala | 5 + .../sql/catalyst/analysis/ResolveUnion.scala | 22 +- .../sql/catalyst/analysis/TypeCoercion.scala | 25 +- .../sql/catalyst/optimizer/Optimizer.scala | 8 +- .../optimizer/PropagateEmptyRelation.scala | 14 +- .../sql/catalyst/parser/AstBuilder.scala | 2 +- .../spark/sql/catalyst/plans/QueryPlan.scala | 17 +- .../plans/logical/basicLogicalOperators.scala | 15 +- .../sql/catalyst/analysis/AnalysisSuite.scala | 2 +- .../sql/catalyst/analysis/AnalysisTest.scala | 33 +- .../analysis/DataSourceV2AnalysisSuite.scala | 7 +- .../catalyst/analysis/ResolveUnionSuite.scala | 8 +- .../catalyst/analysis/TypeCoercionSuite.scala | 7 +- .../PropagateEmptyRelationSuite.scala | 11 +- .../RemoveRedundantAliasAndProjectSuite.scala | 2 +- .../optimizer/SetOperationSuite.scala | 12 +- .../joinReorder/JoinReorderSuite.scala | 16 +- .../sql/catalyst/parser/PlanParserSuite.scala | 11 +- .../plans/ConstraintPropagationSuite.scala | 30 +- .../spark/sql/execution/SparkStrategies.scala | 2 +- .../execution/basicPhysicalOperators.scala | 2 - .../sql-tests/results/explain-aqe.sql.out | 1 + .../sql-tests/results/explain.sql.out | 1 + .../q10.sf100/explain.txt | 95 +-- .../q10.sf100/simplified.txt | 2 +- .../approved-plans-modified/q10/explain.txt | 89 +- .../q10/simplified.txt | 2 +- .../q27.sf100/explain.txt | 5 +- .../q27.sf100/simplified.txt | 2 +- .../approved-plans-modified/q27/explain.txt | 5 +- .../q27/simplified.txt | 2 +- .../approved-plans-v1_4/q11.sf100/explain.txt | 501 +++++------ .../q11.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q11/explain.txt | 411 ++++----- .../approved-plans-v1_4/q11/simplified.txt | 53 +- .../q14a.sf100/explain.txt | 62 +- .../q14a.sf100/simplified.txt | 4 +- .../approved-plans-v1_4/q14a/explain.txt | 62 +- .../approved-plans-v1_4/q14a/simplified.txt | 4 +- .../q14b.sf100/explain.txt | 41 +- .../q14b.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q14b/explain.txt | 41 +- .../approved-plans-v1_4/q14b/simplified.txt | 2 +- .../approved-plans-v1_4/q2.sf100/explain.txt | 137 +-- .../q2.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q2/explain.txt | 125 +-- .../approved-plans-v1_4/q2/simplified.txt | 2 +- .../q23a.sf100/explain.txt | 59 +- .../q23a.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q23a/explain.txt | 61 +- .../approved-plans-v1_4/q23a/simplified.txt | 2 +- .../q23b.sf100/explain.txt | 41 +- .../q23b.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q23b/explain.txt | 43 +- .../approved-plans-v1_4/q23b/simplified.txt | 2 +- .../approved-plans-v1_4/q33.sf100/explain.txt | 29 +- .../q33.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q33/explain.txt | 29 +- .../approved-plans-v1_4/q33/simplified.txt | 2 +- .../approved-plans-v1_4/q36.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q36/explain.txt | 4 +- .../approved-plans-v1_4/q4.sf100/explain.txt | 791 +++++++++--------- .../q4.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q4/explain.txt | 655 ++++++++------- .../approved-plans-v1_4/q4/simplified.txt | 53 +- .../approved-plans-v1_4/q49.sf100/explain.txt | 21 +- .../q49.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q49/explain.txt | 21 +- .../approved-plans-v1_4/q49/simplified.txt | 2 +- .../approved-plans-v1_4/q5.sf100/explain.txt | 288 +++---- .../q5.sf100/simplified.txt | 8 +- .../approved-plans-v1_4/q5/explain.txt | 276 +++--- .../approved-plans-v1_4/q5/simplified.txt | 8 +- .../approved-plans-v1_4/q54.sf100/explain.txt | 305 +++---- .../q54.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q54/explain.txt | 277 +++--- .../approved-plans-v1_4/q54/simplified.txt | 2 +- .../approved-plans-v1_4/q56.sf100/explain.txt | 29 +- .../q56.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q56/explain.txt | 29 +- .../approved-plans-v1_4/q56/simplified.txt | 2 +- .../approved-plans-v1_4/q60.sf100/explain.txt | 29 +- .../q60.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q60/explain.txt | 29 +- .../approved-plans-v1_4/q60/simplified.txt | 2 +- .../approved-plans-v1_4/q66.sf100/explain.txt | 29 +- .../q66.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q66/explain.txt | 29 +- .../approved-plans-v1_4/q66/simplified.txt | 2 +- .../approved-plans-v1_4/q70.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q70/explain.txt | 4 +- .../approved-plans-v1_4/q71.sf100/explain.txt | 63 +- .../q71.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q71/explain.txt | 63 +- .../approved-plans-v1_4/q71/simplified.txt | 2 +- .../approved-plans-v1_4/q74.sf100/explain.txt | 493 +++++------ .../q74.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q74/explain.txt | 403 ++++----- .../approved-plans-v1_4/q74/simplified.txt | 53 +- .../approved-plans-v1_4/q75.sf100/explain.txt | 310 +++---- .../q75.sf100/simplified.txt | 8 +- .../approved-plans-v1_4/q75/explain.txt | 262 +++--- .../approved-plans-v1_4/q75/simplified.txt | 8 +- .../approved-plans-v1_4/q76.sf100/explain.txt | 29 +- .../q76.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q76/explain.txt | 29 +- .../approved-plans-v1_4/q76/simplified.txt | 2 +- .../approved-plans-v1_4/q77.sf100/explain.txt | 33 +- .../q77.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q77/explain.txt | 33 +- .../approved-plans-v1_4/q77/simplified.txt | 2 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 33 +- .../q80.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q80/explain.txt | 33 +- .../approved-plans-v1_4/q80/simplified.txt | 2 +- .../approved-plans-v1_4/q86.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q86/explain.txt | 4 +- .../q10a.sf100/explain.txt | 323 ++++--- .../q10a.sf100/simplified.txt | 137 ++- .../approved-plans-v2_7/q10a/explain.txt | 268 +++--- .../approved-plans-v2_7/q10a/simplified.txt | 119 +-- .../approved-plans-v2_7/q11.sf100/explain.txt | 493 +++++------ .../q11.sf100/simplified.txt | 75 +- .../approved-plans-v2_7/q11/explain.txt | 403 ++++----- .../approved-plans-v2_7/q11/simplified.txt | 53 +- .../approved-plans-v2_7/q14.sf100/explain.txt | 41 +- .../q14.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q14/explain.txt | 41 +- .../approved-plans-v2_7/q14/simplified.txt | 2 +- .../q14a.sf100/explain.txt | 504 +++++------ .../q14a.sf100/simplified.txt | 20 +- .../approved-plans-v2_7/q14a/explain.txt | 504 +++++------ .../approved-plans-v2_7/q14a/simplified.txt | 20 +- .../q18a.sf100/explain.txt | 5 +- .../q18a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q18a/explain.txt | 5 +- .../approved-plans-v2_7/q18a/simplified.txt | 2 +- .../q22a.sf100/explain.txt | 5 +- .../q22a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q22a/explain.txt | 5 +- .../approved-plans-v2_7/q22a/simplified.txt | 2 +- .../q27a.sf100/explain.txt | 5 +- .../q27a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q27a/explain.txt | 5 +- .../approved-plans-v2_7/q27a/simplified.txt | 2 +- .../q35a.sf100/explain.txt | 373 ++++----- .../q35a.sf100/simplified.txt | 115 ++- .../approved-plans-v2_7/q35a/explain.txt | 262 +++--- .../approved-plans-v2_7/q35a/simplified.txt | 121 +-- .../q36a.sf100/explain.txt | 76 +- .../q36a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q36a/explain.txt | 76 +- .../approved-plans-v2_7/q36a/simplified.txt | 4 +- .../approved-plans-v2_7/q49.sf100/explain.txt | 21 +- .../q49.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q49/explain.txt | 21 +- .../approved-plans-v2_7/q49/simplified.txt | 2 +- .../approved-plans-v2_7/q5a.sf100/explain.txt | 386 ++++----- .../q5a.sf100/simplified.txt | 12 +- .../approved-plans-v2_7/q5a/explain.txt | 374 +++++---- .../approved-plans-v2_7/q5a/simplified.txt | 12 +- .../q67a.sf100/explain.txt | 21 +- .../q67a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q67a/explain.txt | 21 +- .../approved-plans-v2_7/q67a/simplified.txt | 2 +- .../q70a.sf100/explain.txt | 76 +- .../q70a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q70a/explain.txt | 76 +- .../approved-plans-v2_7/q70a/simplified.txt | 4 +- .../approved-plans-v2_7/q74.sf100/explain.txt | 493 +++++------ .../q74.sf100/simplified.txt | 75 +- .../approved-plans-v2_7/q74/explain.txt | 403 ++++----- .../approved-plans-v2_7/q74/simplified.txt | 53 +- .../approved-plans-v2_7/q75.sf100/explain.txt | 310 +++---- .../q75.sf100/simplified.txt | 8 +- .../approved-plans-v2_7/q75/explain.txt | 262 +++--- .../approved-plans-v2_7/q75/simplified.txt | 8 +- .../q77a.sf100/explain.txt | 131 +-- .../q77a.sf100/simplified.txt | 6 +- .../approved-plans-v2_7/q77a/explain.txt | 131 +-- .../approved-plans-v2_7/q77a/simplified.txt | 6 +- .../q80a.sf100/explain.txt | 131 +-- .../q80a.sf100/simplified.txt | 6 +- .../approved-plans-v2_7/q80a/explain.txt | 131 +-- .../approved-plans-v2_7/q80a/simplified.txt | 6 +- .../q86a.sf100/explain.txt | 76 +- .../q86a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q86a/explain.txt | 76 +- .../approved-plans-v2_7/q86a/simplified.txt | 4 +- .../spark/sql/execution/PlannerSuite.scala | 7 +- .../sql/execution/SparkPlannerSuite.scala | 2 +- 192 files changed, 7449 insertions(+), 7201 deletions(-) diff --git a/R/pkg/tests/fulltests/test_sparkSQL.R b/R/pkg/tests/fulltests/test_sparkSQL.R index 1c65dabaf6656..1d234130acb58 100644 --- a/R/pkg/tests/fulltests/test_sparkSQL.R +++ b/R/pkg/tests/fulltests/test_sparkSQL.R @@ -2684,21 +2684,21 @@ test_that("union(), unionByName(), rbind(), except(), and intersect() on a DataF writeLines(lines, jsonPath2) df2 <- read.df(jsonPath2, "json") - unioned <- arrange(union(df, df2), df$age) + unioned <- arrange(union(df, df2), "age") expect_is(unioned, "SparkDataFrame") expect_equal(count(unioned), 6) expect_equal(first(unioned)$name, "Michael") - expect_equal(count(arrange(suppressWarnings(union(df, df2)), df$age)), 6) - expect_equal(count(arrange(suppressWarnings(unionAll(df, df2)), df$age)), 6) + expect_equal(count(arrange(suppressWarnings(union(df, df2)), "age")), 6) + expect_equal(count(arrange(suppressWarnings(unionAll(df, df2)), "age")), 6) df1 <- select(df2, "age", "name") - unioned1 <- arrange(unionByName(df1, df), df1$age) + unioned1 <- arrange(unionByName(df1, df), "age") expect_is(unioned, "SparkDataFrame") expect_equal(count(unioned), 6) # Here, we test if 'Michael' in df is correctly mapped to the same name. expect_equal(first(unioned)$name, "Michael") - unioned2 <- arrange(rbind(unioned, df, df2), df$age) + unioned2 <- arrange(rbind(unioned, df, df2), "age") expect_is(unioned2, "SparkDataFrame") expect_equal(count(unioned2), 12) expect_equal(first(unioned2)$name, "Michael") @@ -2723,12 +2723,12 @@ test_that("union(), unionByName(), rbind(), except(), and intersect() on a DataF testthat::expect_error(unionByName(df2, select(df2, "age"), FALSE)) testthat::expect_error(unionByName(df2, select(df2, "age"))) - excepted <- arrange(except(df, df2), desc(df$age)) + excepted <- arrange(except(df, df2), desc(column("age"))) expect_is(unioned, "SparkDataFrame") expect_equal(count(excepted), 2) expect_equal(first(excepted)$name, "Justin") - intersected <- arrange(intersect(df, df2), df$age) + intersected <- arrange(intersect(df, df2), "age") expect_is(unioned, "SparkDataFrame") expect_equal(count(intersected), 1) expect_equal(first(intersected)$name, "Andy") diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index 77a6631b250e8..b072ad2b0b227 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -1272,6 +1272,11 @@ class Analyzer( val newOutput = oldVersion.generatorOutput.map(_.newInstance()) Seq((oldVersion, oldVersion.copy(generatorOutput = newOutput))) + case oldVersion: Union + if oldVersion.producedAttributes.intersect(conflictingAttributes).nonEmpty => + val newOutput = oldVersion.unionOutput.get.map(_.newInstance()) + Seq((oldVersion, oldVersion.copy(unionOutput = Some(newOutput)))) + case oldVersion: Expand if oldVersion.producedAttributes.intersect(conflictingAttributes).nonEmpty => val producedAttributes = oldVersion.producedAttributes diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index afd27b6e26a82..f64ef87b866cd 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -17,8 +17,10 @@ package org.apache.spark.sql.catalyst.analysis +import scala.collection.mutable + import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, Literal, NamedExpression} +import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, ExprId, Literal, NamedExpression} import org.apache.spark.sql.catalyst.optimizer.CombineUnions import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, Union} import org.apache.spark.sql.catalyst.rules.Rule @@ -31,12 +33,15 @@ import org.apache.spark.sql.util.SchemaUtils */ object ResolveUnion extends Rule[LogicalPlan] { - private[catalyst] def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { + def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { + val seenExprIdSet = mutable.Map[ExprId, ExprId]() children.map(_.output).transpose.map { attrs => val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) val newDt = attrs.map(_.dataType).reduce(StructType.merge) - val newExprId = NamedExpression.newExprId + // If child's output has attributes having the same `exprId`, we needs to + // assign a unique `exprId` for them. + val newExprId = seenExprIdSet.getOrElseUpdate(firstAttr.exprId, NamedExpression.newExprId) if (firstAttr.dataType == newDt) { firstAttr.withExprId(newExprId).withNullability(nullable) } else { @@ -85,8 +90,13 @@ object ResolveUnion extends Rule[LogicalPlan] { } else { left } - val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) - Union(leftChild, rightChild, unionOutput) + val newUnion = Union(leftChild, rightChild) + if (newUnion.allChildrenCompatible) { + val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) + newUnion.copy(unionOutput = Some(unionOutput)) + } else { + newUnion + } } // Check column name duplication @@ -117,6 +127,6 @@ object ResolveUnion extends Rule[LogicalPlan] { case u @ Union(children, _, _, unionOutput) if u.allChildrenCompatible && unionOutput.isEmpty => - u.copy(unionOutput = makeUnionOutput(children)) + u.copy(unionOutput = Some(makeUnionOutput(children))) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index f71e2c5a3c505..4b71c7284d003 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -360,13 +360,14 @@ object TypeCoercion { } else { val attrMapping = s.children.head.output.zip(newChildren.head.output) val newOutput = ResolveUnion.makeUnionOutput(newChildren) - s.copy(children = newChildren, unionOutput = newOutput) -> attrMapping + s.copy(children = newChildren, unionOutput = Some(newOutput)) -> attrMapping } } } /** Build new children with the widest types for each attribute among all the children */ - private def buildNewChildrenWithWiderTypes(children: Seq[LogicalPlan]): Seq[LogicalPlan] = { + private[analysis] def buildNewChildrenWithWiderTypes(children: Seq[LogicalPlan]) + : Seq[LogicalPlan] = { require(children.forall(_.output.length == children.head.output.length)) // Get a sequence of data types, each of which is the widest type of this specific attribute @@ -1120,6 +1121,8 @@ object TypeCoercion { } trait TypeCoercionRule extends Rule[LogicalPlan] with Logging { + import TypeCoercion.WidenSetOperationTypes + /** * Applies any changes to [[AttributeReference]] data types that are made by the transform method * to instances higher in the query tree. @@ -1142,6 +1145,24 @@ trait TypeCoercionRule extends Rule[LogicalPlan] with Logging { // Don't propagate types from unresolved children. case q: LogicalPlan if !q.childrenResolved => q + case u: Union => + if (u.unionOutput.isDefined) { + // If this type coercion rule changes the input types of `Union`, we need to + // update data types in `unionOutput` accordingly. + val newChildren = WidenSetOperationTypes.buildNewChildrenWithWiderTypes(u.children) + val newOutputTypes = newChildren.head.output.map(_.dataType) + if (!u.output.zip(newOutputTypes).forall { case (a, dt) => a.dataType.sameType(dt)}) { + val newOutput = u.output.map(_.asInstanceOf[AttributeReference]).zip(newOutputTypes).map { + case (a, dt) => a.copy(dataType = dt)(exprId = a.exprId, qualifier = a.qualifier) + } + u.copy(children = newChildren, unionOutput = Some(newOutput)) + } else { + u + } + } else { + u + } + case q: LogicalPlan => val inputMap = q.inputSet.toSeq.map(a => (a.exprId, a)).toMap q transformExpressions { 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 e43799645a8e9..48512e47123fc 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 @@ -595,7 +595,7 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper } val newChildren = newFirstChild +: newOtherChildren val newOutput = ResolveUnion.makeUnionOutput(newChildren) - val newPlan = u.copy(children = newChildren, unionOutput = newOutput) + val newPlan = u.copy(children = newChildren, unionOutput = Some(newOutput)) val attrMapping = p.output.zip(newPlan.output).filter { case (a1, a2) => a1.exprId != a2.exprId } @@ -683,7 +683,7 @@ object ColumnPruning extends Rule[LogicalPlan] { Project(selected, p) } val prunedUnionOutput = u.output.filter(p.references.contains) - p.copy(child = u.copy(children = newChildren, unionOutput = prunedUnionOutput)) + p.copy(child = u.copy(children = newChildren, unionOutput = Some(prunedUnionOutput))) } else { p } @@ -1804,9 +1804,7 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { projectMinPlan ) val newPlan = Project(newLeftOutput, genRowPlan) - val attrMapping = i.output.zip(newPlan.output).filter { - case (a1, a2) => a1.exprId != a2.exprId - } + val attrMapping = i.output.zip(newPlan.output) newPlan -> attrMapping } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala index 2627202c09c45..9ff54cc8df1c5 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala @@ -55,17 +55,15 @@ object PropagateEmptyRelation extends Rule[LogicalPlan] with PredicateHelper wit if (newChildren.isEmpty) { empty(p) } else { - val newPlan = if (newChildren.size > 1) Union(newChildren) else newChildren.head - val outputs = newPlan.output.zip(p.output) - // the original Union may produce different output attributes than the new one so we alias - // them if needed - if (outputs.forall { case (newAttr, oldAttr) => newAttr.exprId == oldAttr.exprId }) { - newPlan + if (newChildren.size > 1) { + p.copy(children = newChildren) } else { - val outputAliases = outputs.map { case (newAttr, oldAttr) => + val newPlan = newChildren.head + val outputAliases = p.output.zip(newPlan.output).map { case (oldAttr, newAttr) => val newExplicitMetadata = if (oldAttr.metadata != newAttr.metadata) Some(oldAttr.metadata) else None - Alias(newAttr, oldAttr.name)(oldAttr.exprId, explicitMetadata = newExplicitMetadata) + Alias(newAttr, oldAttr.name)( + exprId = oldAttr.exprId, explicitMetadata = newExplicitMetadata) } Project(outputAliases, newPlan) } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala index f133235a2636e..27f655ed9be12 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala @@ -229,7 +229,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging if (inserts.length == 1) { inserts.head } else { - Union(inserts.toSeq) + Union(inserts.toSeq, unionOutput = Some(Nil)) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala index b08e8fabb9c6a..5ed6fea4cc51a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala @@ -220,12 +220,23 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) } - newPlan = planAfterRule - attrMapping ++= newAttrMapping.filter { + val newValidAttrMapping = newAttrMapping.filter { case (a1, a2) => a1.exprId != a2.exprId } - newPlan -> attrMapping.toSeq + // Updates the `attrMapping` entries that are obsoleted by generated entries in `rule`. + // For example, `attrMapping` has a mapping entry 'id#1 -> id#2' and `rule` + // generates a new entry 'id#2 -> id#3'. In this case, we need to update + // the corresponding old entry from 'id#1 -> id#2' to '#id#1 -> #id#3'. + val updatedAttrMap = AttributeMap(newValidAttrMapping) + val transferAttrMapping = attrMapping.map { + case (a1, a2) => (a1, updatedAttrMap.getOrElse(a2, a2)) + } + val newOtherAttrMapping = { + val existingAttrMappingSet = transferAttrMapping.map(_._2).toSet + newValidAttrMapping.filterNot { case (_, a) => existingAttrMappingSet.contains(a) } + } + planAfterRule -> (transferAttrMapping ++ newOtherAttrMapping).toSeq } } rewrite(this)._1 diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index d7cb86e6b8042..0701ececb92f8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -215,7 +215,7 @@ case class Except( object Union { def apply(left: LogicalPlan, right: LogicalPlan, output: Seq[Attribute]): Union = { - Union(left :: right :: Nil, unionOutput = output) + Union(left :: right :: Nil, unionOutput = Some(output)) } def apply(left: LogicalPlan, right: LogicalPlan): Union = { @@ -235,7 +235,7 @@ case class Union( children: Seq[LogicalPlan], byName: Boolean = false, allowMissingCol: Boolean = false, - unionOutput: Seq[Attribute] = Seq.empty) extends LogicalPlan { + unionOutput: Option[Seq[Attribute]] = None) extends LogicalPlan { assert(!allowMissingCol || byName, "`allowMissingCol` can be true only if `byName` is true.") override def maxRows: Option[Long] = { @@ -262,12 +262,13 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - override def producedAttributes: AttributeSet = AttributeSet(unionOutput) + override def producedAttributes: AttributeSet = + if (unionOutput.isDefined) AttributeSet(unionOutput.get) else AttributeSet.empty // updating nullability to make all the children consistent override def output: Seq[Attribute] = { - assert(unionOutput.nonEmpty, "Union should have at least a single column") - unionOutput + assert(unionOutput.isDefined, "Union should have at least a single column") + unionOutput.get } lazy val allChildrenCompatible: Boolean = { @@ -284,7 +285,7 @@ case class Union( override lazy val resolved: Boolean = { children.length > 1 && !(byName || allowMissingCol) && allChildrenCompatible && - unionOutput.nonEmpty + unionOutput.isDefined } /** @@ -319,7 +320,7 @@ case class Union( override protected lazy val validConstraints: ExpressionSet = { children - .map(child => rewriteConstraints(children.head.output, child.output, child.constraints)) + .map(child => rewriteConstraints(output, child.output, child.constraints)) .reduce(merge(_, _)) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala index 3a5c4b9769685..cb4e4a5aec5a4 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala @@ -62,7 +62,7 @@ class AnalysisSuite extends AnalysisTest with Matchers { a.select(UnresolvedStar(None)).select($"a").union(b.select(UnresolvedStar(None))) } - assertAnalysisSuccess(plan) + assertAnalysisSuccess(plan, maxIterations = Some(150)) } test("check project's resolved") { diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala index 4473c20b2cca6..5189d3a42ca94 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala @@ -36,8 +36,14 @@ trait AnalysisTest extends PlanTest { protected def extendedAnalysisRules: Seq[Rule[LogicalPlan]] = Nil - private def makeAnalyzer(caseSensitive: Boolean): Analyzer = { - val conf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) + private def makeAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None): Analyzer = { + val conf = { + val sqlConf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) + if (maxIterations.isDefined) { + sqlConf.setConf(SQLConf.ANALYZER_MAX_ITERATIONS, maxIterations.get) + } + sqlConf + } val catalog = new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf) catalog.createDatabase( CatalogDatabase("default", "", new URI("loc"), Map.empty), @@ -52,15 +58,20 @@ trait AnalysisTest extends PlanTest { } } - protected def getAnalyzer(caseSensitive: Boolean) = { - if (caseSensitive) caseSensitiveAnalyzer else caseInsensitiveAnalyzer + protected def getAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None) = { + if (maxIterations.isEmpty) { + if (caseSensitive) caseSensitiveAnalyzer else caseInsensitiveAnalyzer + } else { + makeAnalyzer(caseSensitive, maxIterations) + } } protected def checkAnalysis( inputPlan: LogicalPlan, expectedPlan: LogicalPlan, - caseSensitive: Boolean = true): Unit = { - val analyzer = getAnalyzer(caseSensitive) + caseSensitive: Boolean = true, + maxIterations: Option[Int] = None): Unit = { + val analyzer = getAnalyzer(caseSensitive, maxIterations) val actualPlan = analyzer.executeAndCheck(inputPlan, new QueryPlanningTracker) comparePlans(actualPlan, expectedPlan) } @@ -75,8 +86,9 @@ trait AnalysisTest extends PlanTest { protected def assertAnalysisSuccess( inputPlan: LogicalPlan, - caseSensitive: Boolean = true): Unit = { - val analyzer = getAnalyzer(caseSensitive) + caseSensitive: Boolean = true, + maxIterations: Option[Int] = None): Unit = { + val analyzer = getAnalyzer(caseSensitive, maxIterations) val analysisAttempt = analyzer.execute(inputPlan) try analyzer.checkAnalysis(analysisAttempt) catch { case a: AnalysisException => @@ -94,8 +106,9 @@ trait AnalysisTest extends PlanTest { protected def assertAnalysisError( inputPlan: LogicalPlan, expectedErrors: Seq[String], - caseSensitive: Boolean = true): Unit = { - val analyzer = getAnalyzer(caseSensitive) + caseSensitive: Boolean = true, + maxIterations: Option[Int] = None): Unit = { + val analyzer = getAnalyzer(caseSensitive, maxIterations) val e = intercept[AnalysisException] { analyzer.checkAnalysis(analyzer.execute(inputPlan)) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala index e466d558db1ef..3d9b13a1ebdf6 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala @@ -123,12 +123,13 @@ abstract class DataSourceV2ANSIAnalysisSuite extends DataSourceV2AnalysisBaseSui override def checkAnalysis( inputPlan: LogicalPlan, expectedPlan: LogicalPlan, - caseSensitive: Boolean): Unit = { + caseSensitive: Boolean, + maxIterations: Option[Int] = None): Unit = { val expectedPlanWithAnsiCast = expectedPlan transformAllExpressions { case c: Cast => AnsiCast(c.child, c.dataType, c.timeZoneId) case other => other } - super.checkAnalysis(inputPlan, expectedPlanWithAnsiCast, caseSensitive) + super.checkAnalysis(inputPlan, expectedPlanWithAnsiCast, caseSensitive, maxIterations) } } @@ -203,7 +204,7 @@ abstract class DataSourceV2AnalysisBaseSuite extends AnalysisTest { protected def getSQLConf(caseSensitive: Boolean): SQLConf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) - override def getAnalyzer(caseSensitive: Boolean): Analyzer = { + override def getAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None): Analyzer = { val conf = getSQLConf(caseSensitive) val catalog = new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf) catalog.createDatabase( diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala index 42bd4012b0a63..dff222e668e69 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala @@ -17,7 +17,6 @@ package org.apache.spark.sql.catalyst.analysis import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules.RuleExecutor @@ -54,7 +53,7 @@ class ResolveUnionSuite extends AnalysisTest { val projected1 = Project(Seq(table2.output(3), table2.output(0), table2.output(1), table2.output(2)), table2) val expectedOutput = Seq('i.int, 'u.decimal, 'b.byte, 'd.double) - val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = expectedOutput) + val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = Some(expectedOutput)) comparePlans(analyzed1, expected1) // Allow missing column @@ -63,7 +62,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr1 = Alias(Literal(null, ByteType), "b")() val projected2 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, table2.output(2)), table3) - val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = expectedOutput) + val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = Some(expectedOutput)) comparePlans(analyzed2, expected2) // Allow missing column + Allow missing column @@ -72,7 +71,8 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr2 = Alias(Literal(null, DoubleType), "d")() val projected3 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, nullAttr2), table4) - val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, unionOutput = expectedOutput) + val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, + unionOutput = Some(expectedOutput)) comparePlans(analyzed3, expected3) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala index 7b80de908fa08..39eec899bc0eb 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala @@ -1417,16 +1417,19 @@ class TypeCoercionSuite extends AnalysisTest { } test("SPARK-32638: corrects references when adding aliases in WidenSetOperationTypes") { + def resolve(p: LogicalPlan): LogicalPlan = { + getAnalyzer(false).ResolveReferences(ResolveUnion(widenSetOperationTypes(p))) + } val t1 = LocalRelation(AttributeReference("v", DecimalType(10, 0))()) val t2 = LocalRelation(AttributeReference("v", DecimalType(11, 0))()) val p1 = t1.select(t1.output.head).as("p1") val p2 = t2.select(t2.output.head).as("p2") val union = p1.union(p2) - val wp1 = widenSetOperationTypes(union.select(p1.output.head, $"p2.v")) + val wp1 = resolve(union.select(p1.output.head, $"p2.v")) assert(wp1.isInstanceOf[Project]) // The attribute `p1.output.head` should be replaced in the root `Project`. assert(wp1.expressions.forall(_.find(_ == p1.output.head).isEmpty)) - val wp2 = widenSetOperationTypes(Aggregate(Nil, sum(p1.output.head).as("v") :: Nil, union)) + val wp2 = resolve(Aggregate(Nil, sum($"v").as("v") :: Nil, union)) assert(wp2.isInstanceOf[Aggregate]) assert(wp2.missingInput.isEmpty) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala index 5c980abdd8f53..e225d4ffe0ab7 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala @@ -23,7 +23,7 @@ import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions.Literal import org.apache.spark.sql.catalyst.plans._ -import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Project} +import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Project, Union} import org.apache.spark.sql.catalyst.rules.RuleExecutor import org.apache.spark.sql.types.{IntegerType, MetadataBuilder, StructType} @@ -73,7 +73,8 @@ class PropagateEmptyRelationSuite extends PlanTest { test("SPARK-32241: remove empty relation children from Union") { val query = testRelation1.union(testRelation2.where(false)) val optimized = Optimize.execute(query.analyze) - val correctAnswer = testRelation1 + val a = testRelation1.output.head + val correctAnswer = testRelation1.select(a.as(a.name)) comparePlans(optimized, correctAnswer) val query2 = testRelation1.where(false).union(testRelation2) @@ -83,16 +84,16 @@ class PropagateEmptyRelationSuite extends PlanTest { val query3 = testRelation1.union(testRelation2.where(false)).union(testRelation3) val optimized3 = Optimize.execute(query3.analyze) - val correctAnswer3 = testRelation1.union(testRelation3) + val correctAnswer3 = testRelation1.union(testRelation3).analyze comparePlans(optimized3, correctAnswer3) val query4 = testRelation1.where(false).union(testRelation2).union(testRelation3) val optimized4 = Optimize.execute(query4.analyze) - val correctAnswer4 = testRelation2.union(testRelation3).select('b.as('a)).analyze + val correctAnswer4 = Union(testRelation2, testRelation3, testRelation1.output.head :: Nil) comparePlans(optimized4, correctAnswer4) // Nullability can change from nullable to non-nullable - val query5 = testRelation1.where(false).union(testRelation3) + val query5 = testRelation1.where(false).union(testRelation3).analyze val optimized5 = Optimize.execute(query5.analyze) assert(query5.output.head.nullable, "Original output should be nullable") assert(!optimized5.output.head.nullable, "New output should be non-nullable") diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala index 2e0ab7f64f4d6..68a3c1851a3a3 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala @@ -97,7 +97,7 @@ class RemoveRedundantAliasAndProjectSuite extends PlanTest with PredicateHelper val r2 = LocalRelation('b.int) val query = r1.select('a as 'a).union(r2.select('b as 'b)).select('a).analyze val optimized = Optimize.execute(query) - val expected = r1.union(r2) + val expected = r1.union(r2).analyze comparePlans(optimized, expected) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala index 2eea840e21a31..9d80779b59817 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala @@ -17,13 +17,14 @@ package org.apache.spark.sql.catalyst.optimizer -import org.apache.spark.sql.catalyst.analysis.EliminateSubqueryAliases +import org.apache.spark.sql.catalyst.analysis.{EliminateSubqueryAliases, ResolveUnion} import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions.{And, GreaterThan, GreaterThanOrEqual, If, Literal, Rand, ReplicateRows} import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules._ +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.BooleanType class SetOperationSuite extends PlanTest { @@ -92,8 +93,10 @@ class SetOperationSuite extends PlanTest { // query3 query2 val unionQuery1 = Distinct(Union(Distinct(Union(query1, query2)), query3)).analyze val optimized1 = Optimize.execute(unionQuery1) + val children1 = query1 :: query2 :: query3 :: Nil + val unionOutput1 = ResolveUnion.makeUnionOutput(children1) val distinctUnionCorrectAnswer1 = - Distinct(Union(query1 :: query2 :: query3 :: Nil)) + Distinct(Union(query1 :: query2 :: query3 :: Nil, unionOutput = Some(unionOutput1))) comparePlans(distinctUnionCorrectAnswer1, optimized1) // query1 @@ -106,8 +109,9 @@ class SetOperationSuite extends PlanTest { val unionQuery2 = Distinct(Union(Union(query1, query2), Distinct(Union(query2, query3)))).analyze val optimized2 = Optimize.execute(unionQuery2) - val distinctUnionCorrectAnswer2 = - Distinct(Union(query1 :: query2 :: query2 :: query3 :: Nil)) + val children2 = query1 :: query2 :: query2 :: query3 :: Nil + val unionOutput2 = ResolveUnion.makeUnionOutput(children2) + val distinctUnionCorrectAnswer2 = Distinct(Union(children2, unionOutput = Some(unionOutput2))) comparePlans(distinctUnionCorrectAnswer2, optimized2) } 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..ba2429ca502c5 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 @@ -259,9 +259,11 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB (nameToAttr("t1.v-1-10") === nameToAttr("t3.v-1-100"))) .select(nameToAttr("t1.v-1-10")) - val originalPlan = bottomJoins - .union(t4.select(nameToAttr("t4.v-1-10"))) - .join(t5, Inner, Some(nameToAttr("t1.v-1-10") === nameToAttr("t5.v-1-5"))) + val originalPlan = { + val p = bottomJoins.union(t4.select(nameToAttr("t4.v-1-10"))).analyze + val leftKey = p.output.head // t1.v-1-10 + p.join(t5, Inner, Some(leftKey === nameToAttr("t5.v-1-5"))) + } // Should be able to reorder the bottom part. // Best order: @@ -280,9 +282,11 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB .join(t2, Inner, Some(nameToAttr("t1.k-1-2") === nameToAttr("t2.k-1-5"))) .select(nameToAttr("t1.v-1-10")) - val bestPlan = bestBottomPlan - .union(t4.select(nameToAttr("t4.v-1-10"))) - .join(t5, Inner, Some(nameToAttr("t1.v-1-10") === nameToAttr("t5.v-1-5"))) + val bestPlan = { + val p = bestBottomPlan.union(t4.select(nameToAttr("t4.v-1-10"))).analyze + val leftKey = p.output.head // t1.v-1-10 + p.join(t5, Inner, Some(leftKey === nameToAttr("t5.v-1-5"))) + } assertEqualJoinPlans(Optimize, originalPlan, bestPlan) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala index 88afcb10d9c20..e3570300e0b8c 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala @@ -243,8 +243,9 @@ class PlanParserSuite extends AnalysisTest { "mismatched input 'from' expecting") assertEqual( "from a insert into tbl1 select * insert into tbl2 select * where s < 10", - table("a").select(star()).insertInto("tbl1").union( - table("a").where('s < 10).select(star()).insertInto("tbl2"))) + Union( + table("a").select(star()).insertInto("tbl1"), + table("a").where('s < 10).select(star()).insertInto("tbl2"), Nil)) assertEqual( "select * from (from a select * select *)", table("a").select(star()) @@ -310,7 +311,9 @@ class PlanParserSuite extends AnalysisTest { // Multi insert val plan2 = table("t").where('x > 5).select(star()) assertEqual("from t insert into s select * limit 1 insert into u select * where x > 5", - plan.limit(1).insertInto("s").union(plan2.insertInto("u"))) + Union( + plan.limit(1).insertInto("s"), + plan2.insertInto("u"), Nil)) } test("aggregation") { @@ -413,7 +416,7 @@ class PlanParserSuite extends AnalysisTest { .generate(jsonTuple, alias = Some("jtup"), outputNames = Seq("q", "z")) .select(star()) .insertInto("t2"), - from.where('s < 10).select(star()).insertInto("t3"))) + from.where('s < 10).select(star()).insertInto("t3"), Nil)) // Unresolved generator. val expected = table("t") diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala index 5ad748b6113d6..5edd74e5cc1ba 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala @@ -157,28 +157,32 @@ class ConstraintPropagationSuite extends SparkFunSuite with PlanTest { .union(tr2.where('e.attr > 10) .union(tr3.where('i.attr > 10))) .analyze.constraints.isEmpty) - - verifyConstraints(tr1 + val query1 = tr1 .where('a.attr > 10) .union(tr2.where('d.attr > 10) .union(tr3.where('g.attr > 10))) - .analyze.constraints, - ExpressionSet(Seq(resolveColumn(tr1, "a") > 10, - IsNotNull(resolveColumn(tr1, "a"))))) + .analyze + verifyConstraints(query1.constraints, + ExpressionSet(Seq(resolveColumn(query1, "a") > 10, + IsNotNull(resolveColumn(query1, "a"))))) - val a = resolveColumn(tr1, "a") - verifyConstraints(tr1 + val query2 = tr1 .where('a.attr > 10) .union(tr2.where('d.attr > 11)) - .analyze.constraints, - ExpressionSet(Seq(a > 10 || a > 11, IsNotNull(a)))) + .analyze + verifyConstraints(query2.constraints, + ExpressionSet(Seq(resolveColumn(query2, "a") > 10 || resolveColumn(query2, "a") > 11, + IsNotNull(resolveColumn(query2, "a"))))) - val b = resolveColumn(tr1, "b") - verifyConstraints(tr1 + + val query3 = tr1 .where('a.attr > 10 && 'b.attr < 10) .union(tr2.where('d.attr > 11 && 'e.attr < 11)) - .analyze.constraints, - ExpressionSet(Seq(a > 10 || a > 11, b < 10 || b < 11, IsNotNull(a), IsNotNull(b)))) + .analyze + verifyConstraints(query3.constraints, + ExpressionSet(Seq(resolveColumn(query3, "a") > 10 || resolveColumn(query3, "a") > 11, + resolveColumn(query3, "b") < 10 || resolveColumn(query3, "b") < 11, + IsNotNull(resolveColumn(query3, "a")), IsNotNull(resolveColumn(query3, "b"))))) } test("propagating constraints in intersect") { diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala index abea4a7a8eaff..40acf2298c880 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala @@ -692,7 +692,7 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { case logical.GlobalLimit(IntegerLiteral(limit), child) => execution.GlobalLimitExec(limit, planLater(child)) :: Nil case union: logical.Union => - execution.UnionExec(union.children.map(planLater), union.unionOutput) :: Nil + execution.UnionExec(union.children.map(planLater), union.unionOutput.get) :: Nil case g @ logical.Generate(generator, _, outer, _, _, child) => execution.GenerateExec( generator, g.requiredChildOutput, outer, diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 6bc775cf26b81..9fdcaa9e2be8c 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -636,8 +636,6 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) */ case class UnionExec(children: Seq[SparkPlan], output: Seq[Attribute]) extends SparkPlan { - assert(output.nonEmpty, "Union should have at least a single column") - override def producedAttributes: AttributeSet = AttributeSet(output) protected override def doExecute(): RDD[InternalRow] = diff --git a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out index 3a850160b43e0..22603ad0b1228 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out @@ -239,6 +239,7 @@ Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) (5) Union +Arguments: [key#x, val#x] (6) HashAggregate Input [2]: [key#x, val#x] diff --git a/sql/core/src/test/resources/sql-tests/results/explain.sql.out b/sql/core/src/test/resources/sql-tests/results/explain.sql.out index 6b3b71f85ced2..9bb97decea60a 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain.sql.out @@ -216,6 +216,7 @@ Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) (7) Union +Arguments: [key#x, val#x] (8) HashAggregate [codegen id : 3] Input [2]: [key#x, val#x] 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..ad9442139da10 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 @@ -147,57 +147,58 @@ 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] (22) Union +Arguments: [customer_sk#15] (23) Exchange -Input [1]: [customer_sk#11] -Arguments: hashpartitioning(customer_sk#11, 5), true, [id=#15] +Input [1]: [customer_sk#15] +Arguments: hashpartitioning(customer_sk#15, 5), true, [id=#16] (24) Sort [codegen id : 7] -Input [1]: [customer_sk#11] -Arguments: [customer_sk#11 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#15] +Arguments: [customer_sk#15 ASC NULLS FIRST], false, 0 (25) SortMergeJoin Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#11] +Right keys [1]: [customer_sk#15] Join condition: None (26) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Output [2]: [ss_sold_date_sk#17, ss_customer_sk#18] 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] +Input [2]: [ss_sold_date_sk#17, ss_customer_sk#18] (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)) +Input [2]: [ss_sold_date_sk#17, ss_customer_sk#18] +Condition : (isnotnull(ss_sold_date_sk#17) AND isnotnull(ss_customer_sk#18)) (29) ReusedExchange [Reuses operator id: 13] Output [1]: [d_date_sk#7] (30) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#16] +Left keys [1]: [ss_sold_date_sk#17] Right keys [1]: [d_date_sk#7] 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] +Output [1]: [ss_customer_sk#18 AS customer_sk#19] +Input [3]: [ss_sold_date_sk#17, ss_customer_sk#18, d_date_sk#7] (32) Exchange -Input [1]: [customer_sk#18] -Arguments: hashpartitioning(customer_sk#18, 5), true, [id=#19] +Input [1]: [customer_sk#19] +Arguments: hashpartitioning(customer_sk#19, 5), true, [id=#20] (33) Sort [codegen id : 10] -Input [1]: [customer_sk#18] -Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#19] +Arguments: [customer_sk#19 ASC NULLS FIRST], false, 0 (34) SortMergeJoin Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#18] +Right keys [1]: [customer_sk#19] Join condition: None (35) Project [codegen id : 12] @@ -205,82 +206,82 @@ 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] +Output [2]: [ca_address_sk#21, ca_county#22] 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] +Input [2]: [ca_address_sk#21, ca_county#22] (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)) +Input [2]: [ca_address_sk#21, ca_county#22] +Condition : (ca_county#22 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#21)) (39) Project [codegen id : 11] -Output [1]: [ca_address_sk#20] -Input [2]: [ca_address_sk#20, ca_county#21] +Output [1]: [ca_address_sk#21] +Input [2]: [ca_address_sk#21, ca_county#22] (40) BroadcastExchange -Input [1]: [ca_address_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +Input [1]: [ca_address_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (41) BroadcastHashJoin [codegen id : 12] Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#20] +Right keys [1]: [ca_address_sk#21] 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] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#21] (43) BroadcastExchange Input [1]: [c_current_cdemo_sk#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] (44) 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] +Output [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct (45) ColumnarToRow -Input [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] +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] (46) Filter -Input [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] -Condition : isnotnull(cd_demo_sk#24) +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Condition : isnotnull(cd_demo_sk#25) (47) BroadcastHashJoin [codegen id : 13] Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#24] +Right keys [1]: [cd_demo_sk#25] 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] +Output [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] (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] -Keys [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 [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#33] -Results [9]: [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, count#34] +Aggregate Attributes [1]: [count#34] +Results [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] (50) Exchange -Input [9]: [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, count#34] -Arguments: hashpartitioning(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, 5), true, [id=#35] +Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] +Arguments: hashpartitioning(cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), true, [id=#36] (51) HashAggregate [codegen id : 14] -Input [9]: [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, count#34] -Keys [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 [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#36] -Results [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, count(1)#36 AS cnt1#37, cd_purchase_estimate#28, count(1)#36 AS cnt2#38, cd_credit_rating#29, count(1)#36 AS cnt3#39, cd_dep_count#30, count(1)#36 AS cnt4#40, cd_dep_employed_count#31, count(1)#36 AS cnt5#41, cd_dep_college_count#32, count(1)#36 AS cnt6#42] +Aggregate Attributes [1]: [count(1)#37] +Results [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, count(1)#37 AS cnt1#38, cd_purchase_estimate#29, count(1)#37 AS cnt2#39, cd_credit_rating#30, count(1)#37 AS cnt3#40, cd_dep_count#31, count(1)#37 AS cnt4#41, cd_dep_employed_count#32, count(1)#37 AS cnt5#42, cd_dep_college_count#33, count(1)#37 AS cnt6#43] (52) TakeOrderedAndProject -Input [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_employed_count#31, cnt5#41, cd_dep_college_count#32, cnt6#42] -Arguments: 100, [cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_education_status#27 ASC NULLS FIRST, cd_purchase_estimate#28 ASC NULLS FIRST, cd_credit_rating#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_employed_count#31, cnt5#41, cd_dep_college_count#32, cnt6#42] +Input [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#38, cd_purchase_estimate#29, cnt2#39, cd_credit_rating#30, cnt3#40, cd_dep_count#31, cnt4#41, cd_dep_employed_count#32, cnt5#42, cd_dep_college_count#33, cnt6#43] +Arguments: 100, [cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_education_status#28 ASC NULLS FIRST, cd_purchase_estimate#29 ASC NULLS FIRST, cd_credit_rating#30 ASC NULLS FIRST, cd_dep_count#31 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#38, cd_purchase_estimate#29, cnt2#39, cd_credit_rating#30, cnt3#40, cd_dep_count#31, cnt4#41, cd_dep_employed_count#32, cnt5#42, cd_dep_college_count#33, cnt6#43] 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..8b6129b024b7f 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 @@ -29,7 +29,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Sort [customer_sk] InputAdapter Exchange [customer_sk] #4 - Union + Union [customer_sk] WholeStageCodegen (4) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt index 20f60b396c78e..dbd55e486a555 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt @@ -135,49 +135,50 @@ Output [1]: [cs_ship_customer_sk#12 AS customer_sk#13] Input [3]: [cs_sold_date_sk#11, cs_ship_customer_sk#12, d_date_sk#6] (20) Union +Arguments: [customer_sk#14] (21) BroadcastExchange -Input [1]: [customer_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +Input [1]: [customer_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] (22) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#10] +Right keys [1]: [customer_sk#14] Join condition: None (23) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#15, ss_customer_sk#16] +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 (24) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#15, ss_customer_sk#16] +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] (25) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#15, ss_customer_sk#16] -Condition : (isnotnull(ss_sold_date_sk#15) AND isnotnull(ss_customer_sk#16)) +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Condition : (isnotnull(ss_sold_date_sk#16) AND isnotnull(ss_customer_sk#17)) (26) ReusedExchange [Reuses operator id: 11] Output [1]: [d_date_sk#6] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#15] +Left keys [1]: [ss_sold_date_sk#16] Right keys [1]: [d_date_sk#6] Join condition: None (28) Project [codegen id : 6] -Output [1]: [ss_customer_sk#16 AS customer_sk#17] -Input [3]: [ss_sold_date_sk#15, ss_customer_sk#16, d_date_sk#6] +Output [1]: [ss_customer_sk#17 AS customer_sk#18] +Input [3]: [ss_sold_date_sk#16, ss_customer_sk#17, d_date_sk#6] (29) BroadcastExchange -Input [1]: [customer_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] +Input [1]: [customer_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (30) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#17] +Right keys [1]: [customer_sk#18] Join condition: None (31) Project [codegen id : 9] @@ -185,82 +186,82 @@ 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] (32) Scan parquet default.customer_address -Output [2]: [ca_address_sk#19, ca_county#20] +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 (33) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#19, ca_county#20] +Input [2]: [ca_address_sk#20, ca_county#21] (34) Filter [codegen id : 7] -Input [2]: [ca_address_sk#19, ca_county#20] -Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19)) +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)) (35) Project [codegen id : 7] -Output [1]: [ca_address_sk#19] -Input [2]: [ca_address_sk#19, ca_county#20] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_county#21] (36) BroadcastExchange -Input [1]: [ca_address_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] (37) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#19] +Right keys [1]: [ca_address_sk#20] Join condition: None (38) Project [codegen id : 9] Output [1]: [c_current_cdemo_sk#2] -Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#19] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] (39) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct (40) ColumnarToRow [codegen id : 8] -Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] (41) Filter [codegen id : 8] -Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Condition : isnotnull(cd_demo_sk#22) +Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Condition : isnotnull(cd_demo_sk#23) (42) BroadcastExchange -Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] +Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (43) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#22] +Right keys [1]: [cd_demo_sk#23] Join condition: None (44) Project [codegen id : 9] -Output [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Input [10]: [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, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Output [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] (45) HashAggregate [codegen id : 9] -Input [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] -Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#32] -Results [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] +Aggregate Attributes [1]: [count#33] +Results [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] (46) Exchange -Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] -Arguments: hashpartitioning(cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#34] +Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] +Arguments: hashpartitioning(cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, 5), true, [id=#35] (47) HashAggregate [codegen id : 10] -Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] -Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] +Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#35] -Results [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, count(1)#35 AS cnt1#36, cd_purchase_estimate#26, count(1)#35 AS cnt2#37, cd_credit_rating#27, count(1)#35 AS cnt3#38, cd_dep_count#28, count(1)#35 AS cnt4#39, cd_dep_employed_count#29, count(1)#35 AS cnt5#40, cd_dep_college_count#30, count(1)#35 AS cnt6#41] +Aggregate Attributes [1]: [count(1)#36] +Results [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, count(1)#36 AS cnt1#37, cd_purchase_estimate#27, count(1)#36 AS cnt2#38, cd_credit_rating#28, count(1)#36 AS cnt3#39, cd_dep_count#29, count(1)#36 AS cnt4#40, cd_dep_employed_count#30, count(1)#36 AS cnt5#41, cd_dep_college_count#31, count(1)#36 AS cnt6#42] (48) TakeOrderedAndProject -Input [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41] -Arguments: 100, [cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_education_status#25 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#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], [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41] +Input [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#37, cd_purchase_estimate#27, cnt2#38, cd_credit_rating#28, cnt3#39, cd_dep_count#29, cnt4#40, cd_dep_employed_count#30, cnt5#41, cd_dep_college_count#31, cnt6#42] +Arguments: 100, [cd_gender#24 ASC NULLS FIRST, cd_marital_status#25 ASC NULLS FIRST, cd_education_status#26 ASC NULLS FIRST, cd_purchase_estimate#27 ASC NULLS FIRST, cd_credit_rating#28 ASC NULLS FIRST, cd_dep_count#29 ASC NULLS FIRST, cd_dep_employed_count#30 ASC NULLS FIRST, cd_dep_college_count#31 ASC NULLS FIRST], [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#37, cd_purchase_estimate#27, cnt2#38, cd_credit_rating#28, cnt3#39, cd_dep_count#29, cnt4#40, cd_dep_employed_count#30, cnt5#41, cd_dep_college_count#31, cnt6#42] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt index af1d5a891165b..5df74f059c414 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt @@ -18,7 +18,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] InputAdapter BroadcastExchange #2 - Union + Union [customer_sk] WholeStageCodegen (2) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] 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..ebb713b4de0e5 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 @@ -421,8 +421,9 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union +Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] -Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] 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..1a1a7eb200ba5 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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union + Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt index c9724bed3e593..954d62987ca8f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt @@ -421,8 +421,9 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union +Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] -Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt index 7f4d66577e9c0..6db3a0becf658 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union + Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter 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..62443718c2308 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 @@ -1,91 +1,92 @@ == Physical Plan == -TakeOrderedAndProject (87) -+- * Project (86) - +- * SortMergeJoin Inner (85) - :- * Project (67) - : +- * SortMergeJoin Inner (66) - : :- * Project (46) - : : +- * SortMergeJoin Inner (45) - : : :- * Sort (24) - : : : +- Exchange (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (44) - : : +- Exchange (43) - : : +- * HashAggregate (42) - : : +- Exchange (41) - : : +- * HashAggregate (40) - : : +- * Project (39) - : : +- * SortMergeJoin Inner (38) - : : :- * 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) - : : +- * Sort (37) - : : +- ReusedExchange (36) - : +- * Sort (65) - : +- Exchange (64) - : +- * Project (63) - : +- * Filter (62) - : +- * HashAggregate (61) - : +- Exchange (60) - : +- * HashAggregate (59) - : +- * Project (58) - : +- * SortMergeJoin Inner (57) - : :- * Sort (54) - : : +- Exchange (53) - : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildRight (51) - : : :- * Filter (49) - : : : +- * ColumnarToRow (48) - : : : +- Scan parquet default.web_sales (47) - : : +- ReusedExchange (50) - : +- * Sort (56) - : +- ReusedExchange (55) - +- * Sort (84) - +- Exchange (83) - +- * HashAggregate (82) - +- Exchange (81) - +- * HashAggregate (80) - +- * Project (79) - +- * SortMergeJoin Inner (78) - :- * Sort (75) - : +- Exchange (74) - : +- * Project (73) - : +- * BroadcastHashJoin Inner BuildRight (72) - : :- * Filter (70) - : : +- * ColumnarToRow (69) - : : +- Scan parquet default.web_sales (68) - : +- ReusedExchange (71) - +- * Sort (77) - +- ReusedExchange (76) +TakeOrderedAndProject (88) ++- * Project (87) + +- * SortMergeJoin Inner (86) + :- * Project (68) + : +- * SortMergeJoin Inner (67) + : :- * Project (47) + : : +- * SortMergeJoin Inner (46) + : : :- * Sort (25) + : : : +- Exchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (45) + : : +- Exchange (44) + : : +- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * SortMergeJoin Inner (39) + : : :- * Sort (36) + : : : +- Exchange (35) + : : : +- * Project (34) + : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : :- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.store_sales (26) + : : : +- BroadcastExchange (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.date_dim (29) + : : +- * Sort (38) + : : +- ReusedExchange (37) + : +- * Sort (66) + : +- Exchange (65) + : +- * Project (64) + : +- * Filter (63) + : +- * HashAggregate (62) + : +- Exchange (61) + : +- * HashAggregate (60) + : +- * Project (59) + : +- * SortMergeJoin Inner (58) + : :- * Sort (55) + : : +- Exchange (54) + : : +- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- * Sort (57) + : +- ReusedExchange (56) + +- * Sort (85) + +- Exchange (84) + +- * HashAggregate (83) + +- Exchange (82) + +- * HashAggregate (81) + +- * Project (80) + +- * SortMergeJoin Inner (79) + :- * Sort (76) + : +- Exchange (75) + : +- * Project (74) + : +- * BroadcastHashJoin Inner BuildRight (73) + : :- * Filter (71) + : : +- * ColumnarToRow (70) + : : +- Scan parquet default.web_sales (69) + : +- ReusedExchange (72) + +- * Sort (78) + +- ReusedExchange (77) (1) Scan parquet default.store_sales @@ -190,293 +191,297 @@ Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue( Input [2]: [customer_id#22, year_total#23] Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) -(23) Exchange +(23) Project [codegen id : 7] +Output [2]: [customer_id#22 AS customer_id#24, year_total#23 AS year_total#25] Input [2]: [customer_id#22, year_total#23] -Arguments: hashpartitioning(customer_id#22, 5), true, [id=#24] -(24) Sort [codegen id : 8] -Input [2]: [customer_id#22, year_total#23] -Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 +(24) Exchange +Input [2]: [customer_id#24, year_total#25] +Arguments: hashpartitioning(customer_id#24, 5), true, [id=#26] + +(25) Sort [codegen id : 8] +Input [2]: [customer_id#24, year_total#25] +Arguments: [customer_id#24 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales +(26) 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 -(26) ColumnarToRow [codegen id : 10] +(27) 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] -(27) Filter [codegen id : 10] +(28) 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)) -(28) Scan parquet default.date_dim +(29) 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 -(29) ColumnarToRow [codegen id : 9] +(30) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#5, d_year#6] -(30) Filter [codegen id : 9] +(31) 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)) -(31) BroadcastExchange +(32) BroadcastExchange Input [2]: [d_date_sk#5, d_year#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] -(32) BroadcastHashJoin [codegen id : 10] +(33) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#5] Join condition: None -(33) Project [codegen id : 10] +(34) 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] -(34) Exchange +(35) 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] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#28] -(35) Sort [codegen id : 11] +(36) 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 -(36) ReusedExchange [Reuses operator id: 15] +(37) 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] -(37) Sort [codegen id : 13] +(38) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(38) SortMergeJoin [codegen id : 14] +(39) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None -(39) Project [codegen id : 14] +(40) 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] -(40) HashAggregate [codegen id : 14] +(41) 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)))] -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] +Aggregate Attributes [1]: [sum#29] +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#30] -(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] +(42) 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#30] +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=#31] -(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] +(43) 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#30] 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] +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)))#32] +Results [3]: [c_customer_id#10 AS customer_id#33, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#34, 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)))#32,18,2) AS year_total#35] -(43) Exchange -Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] -Arguments: hashpartitioning(customer_id#31, 5), true, [id=#34] +(44) Exchange +Input [3]: [customer_id#33, customer_preferred_cust_flag#34, year_total#35] +Arguments: hashpartitioning(customer_id#33, 5), true, [id=#36] -(44) Sort [codegen id : 16] -Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] -Arguments: [customer_id#31 ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 16] +Input [3]: [customer_id#33, customer_preferred_cust_flag#34, year_total#35] +Arguments: [customer_id#33 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#31] +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#33] Join condition: None -(46) Project [codegen id : 17] -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) Project [codegen id : 17] +Output [4]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35] +Input [5]: [customer_id#24, year_total#25, customer_id#33, customer_preferred_cust_flag#34, year_total#35] -(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] +(48) 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 [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] +(49) 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 [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) 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)) -(50) ReusedExchange [Reuses operator id: 7] +(51) 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] +(52) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#37] Right keys [1]: [d_date_sk#5] 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] +(53) 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] -(53) Exchange -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) Exchange +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] -(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] -Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 +(55) Sort [codegen id : 20] +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 -(55) ReusedExchange [Reuses operator id: 15] +(56) 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] -(56) Sort [codegen id : 22] +(57) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(57) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#36] +(58) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#38] 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] +(59) 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] -(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] +(60) 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] 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#6, sum#41] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#42] +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#43] -(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] +(61) 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#43] +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=#44] -(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] +(62) 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#43] 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] - -(62) Filter [codegen id : 24] -Input [2]: [customer_id#44, year_total#45] -Condition : (isnotnull(year_total#45) AND (year_total#45 > 0.00)) +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45] +Results [2]: [c_customer_id#10 AS customer_id#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45,18,2) AS year_total#47] -(63) Project [codegen id : 24] -Output [2]: [customer_id#44 AS customer_id#46, year_total#45 AS year_total#47] -Input [2]: [customer_id#44, year_total#45] - -(64) Exchange +(63) Filter [codegen id : 24] Input [2]: [customer_id#46, year_total#47] -Arguments: hashpartitioning(customer_id#46, 5), true, [id=#48] +Condition : (isnotnull(year_total#47) AND (year_total#47 > 0.00)) -(65) Sort [codegen id : 25] +(64) Project [codegen id : 24] +Output [2]: [customer_id#46 AS customer_id#48, year_total#47 AS year_total#49] Input [2]: [customer_id#46, year_total#47] -Arguments: [customer_id#46 ASC NULLS FIRST], false, 0 -(66) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#46] +(65) Exchange +Input [2]: [customer_id#48, year_total#49] +Arguments: hashpartitioning(customer_id#48, 5), true, [id=#50] + +(66) Sort [codegen id : 25] +Input [2]: [customer_id#48, year_total#49] +Arguments: [customer_id#48 ASC NULLS FIRST], false, 0 + +(67) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#48] Join condition: None -(67) Project [codegen id : 26] -Output [5]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, year_total#47] -Input [6]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, customer_id#46, year_total#47] +(68) Project [codegen id : 26] +Output [5]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, year_total#49] +Input [6]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, customer_id#48, year_total#49] -(68) 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] +(69) 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 -(69) ColumnarToRow [codegen id : 28] -Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] +(70) ColumnarToRow [codegen id : 28] +Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] -(70) Filter [codegen id : 28] -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)) +(71) Filter [codegen id : 28] +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)) -(71) ReusedExchange [Reuses operator id: 31] +(72) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#5, d_year#6] -(72) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#35] +(73) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#37] 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#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) Project [codegen id : 28] +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] -(74) Exchange -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) Exchange +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=#51] -(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] -Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 +(76) Sort [codegen id : 29] +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 -(76) ReusedExchange [Reuses operator id: 15] +(77) 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] -(77) Sort [codegen id : 31] +(78) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(78) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#36] +(79) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#38] 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] +(80) 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#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] -(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] +(81) 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#39, ws_ext_list_price#40, 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#6, sum#51] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#52] +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#53] -(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] +(82) 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#53] +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=#54] -(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] +(83) 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#53] 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] - -(83) Exchange -Input [2]: [customer_id#54, year_total#55] -Arguments: hashpartitioning(customer_id#54, 5), true, [id=#56] - -(84) Sort [codegen id : 34] -Input [2]: [customer_id#54, year_total#55] -Arguments: [customer_id#54 ASC NULLS FIRST], false, 0 - -(85) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#54] -Join condition: (CASE WHEN (year_total#47 > 0.00) THEN CheckOverflow((promote_precision(year_total#55) / promote_precision(year_total#47)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#33) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE null END) - -(86) Project [codegen id : 35] -Output [1]: [customer_preferred_cust_flag#32] -Input [7]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, year_total#47, customer_id#54, year_total#55] - -(87) TakeOrderedAndProject -Input [1]: [customer_preferred_cust_flag#32] -Arguments: 100, [customer_preferred_cust_flag#32 ASC NULLS FIRST], [customer_preferred_cust_flag#32] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55] +Results [2]: [c_customer_id#10 AS customer_id#56, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55,18,2) AS year_total#57] + +(84) Exchange +Input [2]: [customer_id#56, year_total#57] +Arguments: hashpartitioning(customer_id#56, 5), true, [id=#58] + +(85) Sort [codegen id : 34] +Input [2]: [customer_id#56, year_total#57] +Arguments: [customer_id#56 ASC NULLS FIRST], false, 0 + +(86) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#56] +Join condition: (CASE WHEN (year_total#49 > 0.00) THEN CheckOverflow((promote_precision(year_total#57) / promote_precision(year_total#49)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#25 > 0.00) THEN CheckOverflow((promote_precision(year_total#35) / promote_precision(year_total#25)), DecimalType(38,20), true) ELSE null END) + +(87) Project [codegen id : 35] +Output [1]: [customer_preferred_cust_flag#34] +Input [7]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, year_total#49, customer_id#56, year_total#57] + +(88) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#34] +Arguments: 100, [customer_preferred_cust_flag#34 ASC NULLS FIRST], [customer_preferred_cust_flag#34] 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..7ceaae76e2b9c 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 @@ -16,43 +16,44 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt index 246a5d5b0b586..d7d0f8b888b3b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt @@ -1,77 +1,78 @@ == Physical Plan == -TakeOrderedAndProject (73) -+- * Project (72) - +- * BroadcastHashJoin Inner BuildRight (71) - :- * Project (57) - : +- * BroadcastHashJoin Inner BuildRight (56) - : :- * Project (37) - : : +- * BroadcastHashJoin Inner BuildRight (36) - : : :- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (35) - : : +- * HashAggregate (34) - : : +- Exchange (33) - : : +- * HashAggregate (32) - : : +- * Project (31) - : : +- * BroadcastHashJoin Inner BuildRight (30) - : : :- * Project (25) - : : : +- * BroadcastHashJoin Inner BuildRight (24) - : : : :- * Filter (22) - : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.customer (20) - : : : +- ReusedExchange (23) - : : +- BroadcastExchange (29) - : : +- * Filter (28) - : : +- * ColumnarToRow (27) - : : +- Scan parquet default.date_dim (26) - : +- BroadcastExchange (55) - : +- * Project (54) - : +- * Filter (53) - : +- * HashAggregate (52) - : +- Exchange (51) - : +- * HashAggregate (50) - : +- * Project (49) - : +- * BroadcastHashJoin Inner BuildRight (48) - : :- * Project (46) - : : +- * BroadcastHashJoin Inner BuildRight (45) - : : :- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.customer (38) - : : +- BroadcastExchange (44) - : : +- * Filter (43) - : : +- * ColumnarToRow (42) - : : +- Scan parquet default.web_sales (41) - : +- ReusedExchange (47) - +- BroadcastExchange (70) - +- * HashAggregate (69) - +- Exchange (68) - +- * HashAggregate (67) - +- * Project (66) - +- * BroadcastHashJoin Inner BuildRight (65) - :- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Filter (60) - : : +- * ColumnarToRow (59) - : : +- Scan parquet default.customer (58) - : +- ReusedExchange (61) - +- ReusedExchange (64) +TakeOrderedAndProject (74) ++- * Project (73) + +- * BroadcastHashJoin Inner BuildRight (72) + :- * Project (58) + : +- * BroadcastHashJoin Inner BuildRight (57) + : :- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (20) + : : : +- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.customer (21) + : : : +- ReusedExchange (24) + : : +- BroadcastExchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.date_dim (27) + : +- BroadcastExchange (56) + : +- * Project (55) + : +- * Filter (54) + : +- * HashAggregate (53) + : +- Exchange (52) + : +- * HashAggregate (51) + : +- * Project (50) + : +- * BroadcastHashJoin Inner BuildRight (49) + : :- * Project (47) + : : +- * BroadcastHashJoin Inner BuildRight (46) + : : :- * Filter (41) + : : : +- * ColumnarToRow (40) + : : : +- Scan parquet default.customer (39) + : : +- BroadcastExchange (45) + : : +- * Filter (44) + : : +- * ColumnarToRow (43) + : : +- Scan parquet default.web_sales (42) + : +- ReusedExchange (48) + +- BroadcastExchange (71) + +- * HashAggregate (70) + +- Exchange (69) + +- * HashAggregate (68) + +- * Project (67) + +- * BroadcastHashJoin Inner BuildRight (66) + :- * Project (64) + : +- * BroadcastHashJoin Inner BuildRight (63) + : :- * Filter (61) + : : +- * ColumnarToRow (60) + : : +- Scan parquet default.customer (59) + : +- ReusedExchange (62) + +- ReusedExchange (65) (1) Scan parquet default.customer @@ -164,252 +165,256 @@ Results [2]: [c_customer_id#2 AS customer_id#21, MakeDecimal(sum(UnscaledValue(C Input [2]: [customer_id#21, year_total#22] Condition : (isnotnull(year_total#22) AND (year_total#22 > 0.00)) -(20) Scan parquet default.customer +(20) Project [codegen id : 16] +Output [2]: [customer_id#21 AS customer_id#23, year_total#22 AS year_total#24] +Input [2]: [customer_id#21, year_total#22] + +(21) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] +(22) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(22) Filter [codegen id : 6] +(23) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(23) ReusedExchange [Reuses operator id: 7] +(24) ReusedExchange [Reuses operator id: 7] Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(24) BroadcastHashJoin [codegen id : 6] +(25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(25) Project [codegen id : 6] +(26) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12] Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(26) Scan parquet default.date_dim +(27) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] 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 -(27) ColumnarToRow [codegen id : 5] +(28) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] -(28) Filter [codegen id : 5] +(29) Filter [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) -(29) BroadcastExchange +(30) BroadcastExchange Input [2]: [d_date_sk#14, d_year#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] -(30) BroadcastHashJoin [codegen id : 6] +(31) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#14] Join condition: None -(31) Project [codegen id : 6] +(32) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, d_date_sk#14, d_year#15] -(32) HashAggregate [codegen id : 6] +(33) HashAggregate [codegen id : 6] Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#24] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +Aggregate Attributes [1]: [sum#26] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] -(33) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#26] +(34) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#28] -(34) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +(35) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27] -Results [3]: [c_customer_id#2 AS customer_id#28, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#29, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27,18,2) AS year_total#30] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29] +Results [3]: [c_customer_id#2 AS customer_id#30, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#31, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29,18,2) AS year_total#32] -(35) BroadcastExchange -Input [3]: [customer_id#28, customer_preferred_cust_flag#29, year_total#30] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#31] +(36) BroadcastExchange +Input [3]: [customer_id#30, customer_preferred_cust_flag#31, year_total#32] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#33] -(36) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#28] +(37) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#30] Join condition: None -(37) Project [codegen id : 16] -Output [4]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30] -Input [5]: [customer_id#21, year_total#22, customer_id#28, customer_preferred_cust_flag#29, year_total#30] +(38) Project [codegen id : 16] +Output [4]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32] +Input [5]: [customer_id#23, year_total#24, customer_id#30, customer_preferred_cust_flag#31, year_total#32] -(38) Scan parquet default.customer +(39) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 10] +(40) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(40) Filter [codegen id : 10] +(41) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(41) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +(42) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(42) ColumnarToRow [codegen id : 8] -Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +(43) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(43) Filter [codegen id : 8] -Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -Condition : (isnotnull(ws_bill_customer_sk#33) AND isnotnull(ws_sold_date_sk#32)) +(44) Filter [codegen id : 8] +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +Condition : (isnotnull(ws_bill_customer_sk#35) AND isnotnull(ws_sold_date_sk#34)) -(44) BroadcastExchange -Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#36] +(45) BroadcastExchange +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#38] -(45) BroadcastHashJoin [codegen id : 10] +(46) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#33] +Right keys [1]: [ws_bill_customer_sk#35] Join condition: None -(46) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +(47) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(47) ReusedExchange [Reuses operator id: 13] +(48) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#14, d_year#15] -(48) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#32] +(49) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#34] Right keys [1]: [d_date_sk#14] Join condition: None -(49) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35, d_date_sk#14, d_year#15] +(50) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] -(50) HashAggregate [codegen id : 10] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] +(51) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#37] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#39] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] -(51) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#39] +(52) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#41] -(52) HashAggregate [codegen id : 11] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] +(53) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#40] -Results [2]: [c_customer_id#2 AS customer_id#41, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#40,18,2) AS year_total#42] - -(53) Filter [codegen id : 11] -Input [2]: [customer_id#41, year_total#42] -Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42] +Results [2]: [c_customer_id#2 AS customer_id#43, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42,18,2) AS year_total#44] -(54) Project [codegen id : 11] -Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] -Input [2]: [customer_id#41, year_total#42] +(54) Filter [codegen id : 11] +Input [2]: [customer_id#43, year_total#44] +Condition : (isnotnull(year_total#44) AND (year_total#44 > 0.00)) -(55) BroadcastExchange +(55) Project [codegen id : 11] +Output [2]: [customer_id#43 AS customer_id#45, year_total#44 AS year_total#46] Input [2]: [customer_id#43, year_total#44] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#45] -(56) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#43] +(56) BroadcastExchange +Input [2]: [customer_id#45, year_total#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] + +(57) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#45] Join condition: None -(57) Project [codegen id : 16] -Output [5]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, year_total#44] -Input [6]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, customer_id#43, year_total#44] +(58) Project [codegen id : 16] +Output [5]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, year_total#46] +Input [6]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, customer_id#45, year_total#46] -(58) Scan parquet default.customer +(59) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(59) ColumnarToRow [codegen id : 14] +(60) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(60) Filter [codegen id : 14] +(61) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(61) ReusedExchange [Reuses operator id: 44] -Output [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +(62) ReusedExchange [Reuses operator id: 45] +Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(62) BroadcastHashJoin [codegen id : 14] +(63) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#33] +Right keys [1]: [ws_bill_customer_sk#35] Join condition: None -(63) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +(64) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(64) ReusedExchange [Reuses operator id: 29] +(65) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#14, d_year#15] -(65) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#32] +(66) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#34] Right keys [1]: [d_date_sk#14] Join condition: None -(66) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35, d_date_sk#14, d_year#15] +(67) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] -(67) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] +(68) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#46] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#48] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] -(68) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#48] +(69) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#50] -(69) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] +(70) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#49] -Results [2]: [c_customer_id#2 AS customer_id#50, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#49,18,2) AS year_total#51] - -(70) BroadcastExchange -Input [2]: [customer_id#50, year_total#51] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#52] - -(71) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#50] -Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#51) / promote_precision(year_total#44)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#22 > 0.00) THEN CheckOverflow((promote_precision(year_total#30) / promote_precision(year_total#22)), DecimalType(38,20), true) ELSE null END) - -(72) Project [codegen id : 16] -Output [1]: [customer_preferred_cust_flag#29] -Input [7]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, year_total#44, customer_id#50, year_total#51] - -(73) TakeOrderedAndProject -Input [1]: [customer_preferred_cust_flag#29] -Arguments: 100, [customer_preferred_cust_flag#29 ASC NULLS FIRST], [customer_preferred_cust_flag#29] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51] +Results [2]: [c_customer_id#2 AS customer_id#52, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51,18,2) AS year_total#53] + +(71) BroadcastExchange +Input [2]: [customer_id#52, year_total#53] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#54] + +(72) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#52] +Join condition: (CASE WHEN (year_total#46 > 0.00) THEN CheckOverflow((promote_precision(year_total#53) / promote_precision(year_total#46)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#32) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE null END) + +(73) Project [codegen id : 16] +Output [1]: [customer_preferred_cust_flag#31] +Input [7]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, year_total#46, customer_id#52, year_total#53] + +(74) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#31] +Arguments: 100, [customer_preferred_cust_flag#31 ASC NULLS FIRST], [customer_preferred_cust_flag#31] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt index 3850cea62922e..705d31a439d7f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt @@ -6,34 +6,35 @@ TakeOrderedAndProject [customer_preferred_cust_flag] BroadcastHashJoin [customer_id,customer_id] Project [customer_id,year_total,customer_preferred_cust_flag,year_total] BroadcastHashJoin [customer_id,customer_id] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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..bc728c51d526d 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 @@ -696,32 +696,33 @@ Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#7, i_class 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 +Arguments: [sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85] (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#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85] +Arguments: [List(sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85, 0), List(sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, null, 1), List(sales#80, number_sales#81, channel#82, i_brand_id#83, null, null, 3), List(sales#80, number_sales#81, channel#82, null, null, null, 7), List(sales#80, number_sales#81, null, null, null, null, 15)], [sales#80, number_sales#81, channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] (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] -Keys [5]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#85, isEmpty#86, sum#87] -Results [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] +Input [7]: [sales#80, number_sales#81, channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] +Keys [5]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] +Functions [2]: [partial_sum(sales#80), partial_sum(number_sales#81)] +Aggregate Attributes [3]: [sum#91, isEmpty#92, sum#93] +Results [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] (129) Exchange -Input [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] -Arguments: hashpartitioning(channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, 5), true, [id=#91] +Input [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] +Arguments: hashpartitioning(channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, 5), true, [id=#97] (130) HashAggregate [codegen id : 119] -Input [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] -Keys [5]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#92, sum(number_sales#43)#93] -Results [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales#42)#92 AS sum(sales)#94, sum(number_sales#43)#93 AS sum(number_sales)#95] +Input [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] +Keys [5]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] +Functions [2]: [sum(sales#80), sum(number_sales#81)] +Aggregate Attributes [2]: [sum(sales#80)#98, sum(number_sales#81)#99] +Results [6]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales#80)#98 AS sum(sales)#100, sum(number_sales#81)#99 AS sum(number_sales)#101] (131) TakeOrderedAndProject -Input [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales)#94, sum(number_sales)#95] -Arguments: 100, [channel#80 ASC NULLS FIRST, i_brand_id#81 ASC NULLS FIRST, i_class_id#82 ASC NULLS FIRST, i_category_id#83 ASC NULLS FIRST], [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales)#94, sum(number_sales)#95] +Input [6]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales)#100, sum(number_sales)#101] +Arguments: 100, [channel#86 ASC NULLS FIRST, i_brand_id#87 ASC NULLS FIRST, i_class_id#88 ASC NULLS FIRST, i_category_id#89 ASC NULLS FIRST], [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales)#100, sum(number_sales)#101] ===== Subqueries ===== @@ -788,7 +789,7 @@ Input [2]: [d_date_sk#10, d_year#11] (139) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#96] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] (140) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -796,7 +797,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (141) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#97, ss_list_price#4 AS list_price#98] +Output [2]: [ss_quantity#3 AS quantity#103, ss_list_price#4 AS list_price#104] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (142) Scan parquet default.catalog_sales @@ -822,7 +823,7 @@ 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] +Output [2]: [cs_quantity#48 AS quantity#105, cs_list_price#49 AS list_price#106] Input [4]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49, d_date_sk#10] (148) Scan parquet default.web_sales @@ -848,28 +849,29 @@ 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] +Output [2]: [ws_quantity#64 AS quantity#107, ws_list_price#65 AS list_price#108] Input [4]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65, d_date_sk#10] (154) Union +Arguments: [quantity#109, list_price#110] (155) HashAggregate [codegen id : 7] -Input [2]: [quantity#97, list_price#98] +Input [2]: [quantity#109, list_price#110] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#103, count#104] -Results [2]: [sum#105, count#106] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#111, count#112] +Results [2]: [sum#113, count#114] (156) Exchange -Input [2]: [sum#105, count#106] -Arguments: SinglePartition, true, [id=#107] +Input [2]: [sum#113, count#114] +Arguments: SinglePartition, true, [id=#115] (157) HashAggregate [codegen id : 8] -Input [2]: [sum#105, count#106] +Input [2]: [sum#113, count#114] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))#108] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))#108 AS average_sales#109] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))#116] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))#116 AS average_sales#117] Subquery:2 Hosting operator id = 105 Hosting Expression = ReusedSubquery Subquery scalar-subquery#45, [id=#46] 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..2a549de175854 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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] InputAdapter - Union + Union [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] WholeStageCodegen (39) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt index 3f0cc9e7acb1e..85ea5e118b9d0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt @@ -616,32 +616,33 @@ Output [6]: [sales#71, number_sales#72, web AS channel#74, i_brand_id#6, i_class Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#73] (110) Union +Arguments: [sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80] (111) Expand [codegen id : 79] -Input [6]: [sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Arguments: [List(sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 0), List(sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, null, 1), List(sales#39, number_sales#40, channel#44, i_brand_id#6, null, null, 3), List(sales#39, number_sales#40, channel#44, null, null, null, 7), List(sales#39, number_sales#40, null, null, null, null, 15)], [sales#39, number_sales#40, channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] +Input [6]: [sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80] +Arguments: [List(sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80, 0), List(sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, null, 1), List(sales#75, number_sales#76, channel#77, i_brand_id#78, null, null, 3), List(sales#75, number_sales#76, channel#77, null, null, null, 7), List(sales#75, number_sales#76, null, null, null, null, 15)], [sales#75, number_sales#76, channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] (112) HashAggregate [codegen id : 79] -Input [7]: [sales#39, number_sales#40, channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] -Keys [5]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#80, isEmpty#81, sum#82] -Results [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] +Input [7]: [sales#75, number_sales#76, channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] +Keys [5]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] +Functions [2]: [partial_sum(sales#75), partial_sum(number_sales#76)] +Aggregate Attributes [3]: [sum#86, isEmpty#87, sum#88] +Results [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] (113) Exchange -Input [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] -Arguments: hashpartitioning(channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, 5), true, [id=#86] +Input [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] +Arguments: hashpartitioning(channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, 5), true, [id=#92] (114) HashAggregate [codegen id : 80] -Input [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] -Keys [5]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#87, sum(number_sales#40)#88] -Results [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales#39)#87 AS sum(sales)#89, sum(number_sales#40)#88 AS sum(number_sales)#90] +Input [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] +Keys [5]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] +Functions [2]: [sum(sales#75), sum(number_sales#76)] +Aggregate Attributes [2]: [sum(sales#75)#93, sum(number_sales#76)#94] +Results [6]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales#75)#93 AS sum(sales)#95, sum(number_sales#76)#94 AS sum(number_sales)#96] (115) TakeOrderedAndProject -Input [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales)#89, sum(number_sales)#90] -Arguments: 100, [channel#75 ASC NULLS FIRST, i_brand_id#76 ASC NULLS FIRST, i_class_id#77 ASC NULLS FIRST, i_category_id#78 ASC NULLS FIRST], [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales)#89, sum(number_sales)#90] +Input [6]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales)#95, sum(number_sales)#96] +Arguments: 100, [channel#81 ASC NULLS FIRST, i_brand_id#82 ASC NULLS FIRST, i_class_id#83 ASC NULLS FIRST, i_category_id#84 ASC NULLS FIRST], [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales)#95, sum(number_sales)#96] ===== Subqueries ===== @@ -708,7 +709,7 @@ Input [2]: [d_date_sk#10, d_year#11] (123) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#97] (124) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -716,7 +717,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (125) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#92, ss_list_price#4 AS list_price#93] +Output [2]: [ss_quantity#3 AS quantity#98, ss_list_price#4 AS list_price#99] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (126) Scan parquet default.catalog_sales @@ -742,7 +743,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (131) Project [codegen id : 4] -Output [2]: [cs_quantity#45 AS quantity#94, cs_list_price#46 AS list_price#95] +Output [2]: [cs_quantity#45 AS quantity#100, cs_list_price#46 AS list_price#101] Input [4]: [cs_sold_date_sk#16, cs_quantity#45, cs_list_price#46, d_date_sk#10] (132) Scan parquet default.web_sales @@ -768,28 +769,29 @@ Right keys [1]: [d_date_sk#10] Join condition: None (137) Project [codegen id : 6] -Output [2]: [ws_quantity#60 AS quantity#96, ws_list_price#61 AS list_price#97] +Output [2]: [ws_quantity#60 AS quantity#102, ws_list_price#61 AS list_price#103] Input [4]: [ws_sold_date_sk#20, ws_quantity#60, ws_list_price#61, d_date_sk#10] (138) Union +Arguments: [quantity#104, list_price#105] (139) HashAggregate [codegen id : 7] -Input [2]: [quantity#92, list_price#93] +Input [2]: [quantity#104, list_price#105] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#98, count#99] -Results [2]: [sum#100, count#101] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#106, count#107] +Results [2]: [sum#108, count#109] (140) Exchange -Input [2]: [sum#100, count#101] -Arguments: SinglePartition, true, [id=#102] +Input [2]: [sum#108, count#109] +Arguments: SinglePartition, true, [id=#110] (141) HashAggregate [codegen id : 8] -Input [2]: [sum#100, count#101] +Input [2]: [sum#108, count#109] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#103] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#103 AS average_sales#104] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))#111] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))#111 AS average_sales#112] Subquery:2 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#42, [id=#43] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt index dfa8c1bcc1579..1bee1e990d52b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] InputAdapter - Union + Union [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] WholeStageCodegen (26) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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..424c068f9cb3e 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 @@ -736,24 +736,25 @@ 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] (133) Union +Arguments: [quantity#82, list_price#83] (134) HashAggregate [codegen id : 7] -Input [2]: [quantity#72, list_price#73] +Input [2]: [quantity#82, list_price#83] Keys: [] -Functions [1]: [partial_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))] -Aggregate Attributes [2]: [sum#82, count#83] -Results [2]: [sum#84, count#85] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#84, count#85] +Results [2]: [sum#86, count#87] (135) Exchange -Input [2]: [sum#84, count#85] -Arguments: SinglePartition, true, [id=#86] +Input [2]: [sum#86, count#87] +Arguments: SinglePartition, true, [id=#88] (136) HashAggregate [codegen id : 8] -Input [2]: [sum#84, count#85] +Input [2]: [sum#86, count#87] Keys: [] -Functions [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))] -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] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89 AS average_sales#90] Subquery:2 Hosting operator id = 67 Hosting Expression = Subquery scalar-subquery#30, [id=#31] * Project (140) @@ -763,22 +764,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#29, d_year#11, d_moy#91, d_dom#92] 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#29, d_year#11, d_moy#91, d_dom#92] (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#29, d_year#11, d_moy#91, d_dom#92] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 2000)) AND (d_moy#91 = 12)) AND (d_dom#92 = 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] +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] @@ -790,21 +791,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#29, d_year#11, d_moy#91, d_dom#92] 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#29, d_year#11, d_moy#91, d_dom#92] (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#29, d_year#11, d_moy#91, d_dom#92] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1999)) AND (d_moy#91 = 12)) AND (d_dom#92 = 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] +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] 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..911c66b997afd 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 @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt index 1f31ded51f1ef..0e0ccc64c05f1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt @@ -689,24 +689,25 @@ Output [2]: [ws_quantity#75 AS quantity#77, ws_list_price#76 AS list_price#78] Input [4]: [ws_sold_date_sk#20, ws_quantity#75, ws_list_price#76, d_date_sk#10] (123) Union +Arguments: [quantity#79, list_price#80] (124) HashAggregate [codegen id : 7] -Input [2]: [quantity#69, list_price#70] +Input [2]: [quantity#79, list_price#80] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#79, count#80] -Results [2]: [sum#81, count#82] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#81, count#82] +Results [2]: [sum#83, count#84] (125) Exchange -Input [2]: [sum#81, count#82] -Arguments: SinglePartition, true, [id=#83] +Input [2]: [sum#83, count#84] +Arguments: SinglePartition, true, [id=#85] (126) HashAggregate [codegen id : 8] -Input [2]: [sum#81, count#82] +Input [2]: [sum#83, count#84] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84 AS average_sales#85] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86 AS average_sales#87] Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#29, [id=#30] * Project (130) @@ -716,22 +717,22 @@ Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquer (127) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] 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 (128) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] (129) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 2000)) AND (d_moy#86 = 12)) AND (d_dom#87 = 11)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 2000)) AND (d_moy#88 = 12)) AND (d_dom#89 = 11)) (130) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] Subquery:3 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#44, [id=#45] @@ -743,21 +744,21 @@ Subquery:4 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] 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 (132) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] (133) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1999)) AND (d_moy#86 = 12)) AND (d_dom#87 = 11)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1999)) AND (d_moy#88 = 12)) AND (d_dom#89 = 11)) (134) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt index 7bbf83e3de707..c3079dd2643bb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt index fe5966bb4dfb3..0648683149ca8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt @@ -80,154 +80,155 @@ Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_ Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6] (9) Union +Arguments: [sold_date_sk#9, sales_price#10] (10) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Output [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] (12) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] -Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Condition : (isnotnull(d_date_sk#11) AND isnotnull(d_week_seq#12)) (13) BroadcastExchange -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [sold_date_sk#3] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [sold_date_sk#9] +Right keys [1]: [d_date_sk#11] Join condition: None (15) Project [codegen id : 4] -Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] -Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] +Output [3]: [sales_price#10, d_week_seq#12, d_day_name#13] +Input [5]: [sold_date_sk#9, sales_price#10, d_date_sk#11, d_week_seq#12, d_day_name#13] (16) HashAggregate [codegen id : 4] -Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] -Keys [1]: [d_week_seq#10] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] -Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Input [3]: [sales_price#10, d_week_seq#12, d_day_name#13] +Keys [1]: [d_week_seq#12] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] +Aggregate Attributes [7]: [sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Results [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] (17) Exchange -Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] -Arguments: hashpartitioning(d_week_seq#10, 5), true, [id=#27] +Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(d_week_seq#12, 5), true, [id=#29] (18) HashAggregate [codegen id : 6] -Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] -Keys [1]: [d_week_seq#10] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34] -Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] +Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [1]: [d_week_seq#12] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36] +Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36,17,2) AS sat_sales#43] (19) Scan parquet default.date_dim -Output [2]: [d_week_seq#42, d_year#43] +Output [2]: [d_week_seq#44, d_year#45] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [2]: [d_week_seq#42, d_year#43] +Input [2]: [d_week_seq#44, d_year#45] (21) Filter [codegen id : 5] -Input [2]: [d_week_seq#42, d_year#43] -Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) +Input [2]: [d_week_seq#44, d_year#45] +Condition : ((isnotnull(d_year#45) AND (d_year#45 = 2001)) AND isnotnull(d_week_seq#44)) (22) Project [codegen id : 5] -Output [1]: [d_week_seq#42] -Input [2]: [d_week_seq#42, d_year#43] +Output [1]: [d_week_seq#44] +Input [2]: [d_week_seq#44, d_year#45] (23) BroadcastExchange -Input [1]: [d_week_seq#42] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] +Input [1]: [d_week_seq#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [d_week_seq#10] -Right keys [1]: [d_week_seq#42] +Left keys [1]: [d_week_seq#12] +Right keys [1]: [d_week_seq#44] Join condition: None (25) Project [codegen id : 6] -Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] -Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] +Output [8]: [d_week_seq#12 AS d_week_seq1#47, sun_sales#37 AS sun_sales1#48, mon_sales#38 AS mon_sales1#49, tue_sales#39 AS tue_sales1#50, wed_sales#40 AS wed_sales1#51, thu_sales#41 AS thu_sales1#52, fri_sales#42 AS fri_sales1#53, sat_sales#43 AS sat_sales1#54] +Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#44] (26) Exchange -Input [8]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52] -Arguments: hashpartitioning(d_week_seq1#45, 5), true, [id=#53] +Input [8]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54] +Arguments: hashpartitioning(d_week_seq1#47, 5), true, [id=#55] (27) Sort [codegen id : 7] -Input [8]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52] -Arguments: [d_week_seq1#45 ASC NULLS FIRST], false, 0 +Input [8]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54] +Arguments: [d_week_seq1#47 ASC NULLS FIRST], false, 0 (28) ReusedExchange [Reuses operator id: 17] -Output [8]: [d_week_seq#10, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] +Output [8]: [d_week_seq#12, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] (29) HashAggregate [codegen id : 13] -Input [8]: [d_week_seq#10, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] -Keys [1]: [d_week_seq#10] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#61, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#67] -Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#61,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#62,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#63,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#64,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#65,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#66,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#67,17,2) AS sat_sales#41] +Input [8]: [d_week_seq#12, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] +Keys [1]: [d_week_seq#12] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END))#69, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))#70] +Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END))#64,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END))#65,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END))#66,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END))#67,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END))#68,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END))#69,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))#70,17,2) AS sat_sales#43] (30) Scan parquet default.date_dim -Output [2]: [d_week_seq#68, d_year#69] +Output [2]: [d_week_seq#71, d_year#72] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] ReadSchema: struct (31) ColumnarToRow [codegen id : 12] -Input [2]: [d_week_seq#68, d_year#69] +Input [2]: [d_week_seq#71, d_year#72] (32) Filter [codegen id : 12] -Input [2]: [d_week_seq#68, d_year#69] -Condition : ((isnotnull(d_year#69) AND (d_year#69 = 2002)) AND isnotnull(d_week_seq#68)) +Input [2]: [d_week_seq#71, d_year#72] +Condition : ((isnotnull(d_year#72) AND (d_year#72 = 2002)) AND isnotnull(d_week_seq#71)) (33) Project [codegen id : 12] -Output [1]: [d_week_seq#68] -Input [2]: [d_week_seq#68, d_year#69] +Output [1]: [d_week_seq#71] +Input [2]: [d_week_seq#71, d_year#72] (34) BroadcastExchange -Input [1]: [d_week_seq#68] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#70] +Input [1]: [d_week_seq#71] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#73] (35) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [d_week_seq#10] -Right keys [1]: [d_week_seq#68] +Left keys [1]: [d_week_seq#12] +Right keys [1]: [d_week_seq#71] Join condition: None (36) Project [codegen id : 13] -Output [8]: [d_week_seq#10 AS d_week_seq2#71, sun_sales#35 AS sun_sales2#72, mon_sales#36 AS mon_sales2#73, tue_sales#37 AS tue_sales2#74, wed_sales#38 AS wed_sales2#75, thu_sales#39 AS thu_sales2#76, fri_sales#40 AS fri_sales2#77, sat_sales#41 AS sat_sales2#78] -Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#68] +Output [8]: [d_week_seq#12 AS d_week_seq2#74, sun_sales#37 AS sun_sales2#75, mon_sales#38 AS mon_sales2#76, tue_sales#39 AS tue_sales2#77, wed_sales#40 AS wed_sales2#78, thu_sales#41 AS thu_sales2#79, fri_sales#42 AS fri_sales2#80, sat_sales#43 AS sat_sales2#81] +Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#71] (37) Exchange -Input [8]: [d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] -Arguments: hashpartitioning((d_week_seq2#71 - 53), 5), true, [id=#79] +Input [8]: [d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] +Arguments: hashpartitioning((d_week_seq2#74 - 53), 5), true, [id=#82] (38) Sort [codegen id : 14] -Input [8]: [d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] -Arguments: [(d_week_seq2#71 - 53) ASC NULLS FIRST], false, 0 +Input [8]: [d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] +Arguments: [(d_week_seq2#74 - 53) ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 15] -Left keys [1]: [d_week_seq1#45] -Right keys [1]: [(d_week_seq2#71 - 53)] +Left keys [1]: [d_week_seq1#47] +Right keys [1]: [(d_week_seq2#74 - 53)] Join condition: None (40) Project [codegen id : 15] -Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#72)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#80, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#73)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#81, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#74)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#82, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#75)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#83, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#76)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#84, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#77)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#85, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#78)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#86] -Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] +Output [8]: [d_week_seq1#47, round(CheckOverflow((promote_precision(sun_sales1#48) / promote_precision(sun_sales2#75)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#83, round(CheckOverflow((promote_precision(mon_sales1#49) / promote_precision(mon_sales2#76)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#84, round(CheckOverflow((promote_precision(tue_sales1#50) / promote_precision(tue_sales2#77)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#85, round(CheckOverflow((promote_precision(wed_sales1#51) / promote_precision(wed_sales2#78)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#86, round(CheckOverflow((promote_precision(thu_sales1#52) / promote_precision(thu_sales2#79)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#87, round(CheckOverflow((promote_precision(fri_sales1#53) / promote_precision(fri_sales2#80)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#88, round(CheckOverflow((promote_precision(sat_sales1#54) / promote_precision(sat_sales2#81)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#89] +Input [16]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54, d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] (41) Exchange -Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#80, round((mon_sales1 / mon_sales2), 2)#81, round((tue_sales1 / tue_sales2), 2)#82, round((wed_sales1 / wed_sales2), 2)#83, round((thu_sales1 / thu_sales2), 2)#84, round((fri_sales1 / fri_sales2), 2)#85, round((sat_sales1 / sat_sales2), 2)#86] -Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), true, [id=#87] +Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#83, round((mon_sales1 / mon_sales2), 2)#84, round((tue_sales1 / tue_sales2), 2)#85, round((wed_sales1 / wed_sales2), 2)#86, round((thu_sales1 / thu_sales2), 2)#87, round((fri_sales1 / fri_sales2), 2)#88, round((sat_sales1 / sat_sales2), 2)#89] +Arguments: rangepartitioning(d_week_seq1#47 ASC NULLS FIRST, 5), true, [id=#90] (42) Sort [codegen id : 16] -Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#80, round((mon_sales1 / mon_sales2), 2)#81, round((tue_sales1 / tue_sales2), 2)#82, round((wed_sales1 / wed_sales2), 2)#83, round((thu_sales1 / thu_sales2), 2)#84, round((fri_sales1 / fri_sales2), 2)#85, round((sat_sales1 / sat_sales2), 2)#86] -Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 +Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#83, round((mon_sales1 / mon_sales2), 2)#84, round((tue_sales1 / tue_sales2), 2)#85, round((wed_sales1 / wed_sales2), 2)#86, round((thu_sales1 / thu_sales2), 2)#87, round((fri_sales1 / fri_sales2), 2)#88, round((sat_sales1 / sat_sales2), 2)#89] +Arguments: [d_week_seq1#47 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt index 3df7e4c8e6f3f..b3d0992d9f97e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (16) Project [sales_price,d_week_seq,d_day_name] BroadcastHashJoin [sold_date_sk,d_date_sk] InputAdapter - Union + Union [sold_date_sk,sales_price] WholeStageCodegen (1) Project [ws_sold_date_sk,ws_ext_sales_price] Filter [ws_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt index 7eff75a0220a4..9f2dd31a5d146 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt @@ -77,142 +77,143 @@ Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_ Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6] (9) Union +Arguments: [sold_date_sk#9, sales_price#10] (10) Scan parquet default.date_dim -Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Output [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] (12) Filter [codegen id : 3] -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] -Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Condition : (isnotnull(d_date_sk#11) AND isnotnull(d_week_seq#12)) (13) BroadcastExchange -Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] +Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] (14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [sold_date_sk#3] -Right keys [1]: [d_date_sk#9] +Left keys [1]: [sold_date_sk#9] +Right keys [1]: [d_date_sk#11] Join condition: None (15) Project [codegen id : 4] -Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] -Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] +Output [3]: [sales_price#10, d_week_seq#12, d_day_name#13] +Input [5]: [sold_date_sk#9, sales_price#10, d_date_sk#11, d_week_seq#12, d_day_name#13] (16) HashAggregate [codegen id : 4] -Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] -Keys [1]: [d_week_seq#10] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] -Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Input [3]: [sales_price#10, d_week_seq#12, d_day_name#13] +Keys [1]: [d_week_seq#12] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] +Aggregate Attributes [7]: [sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Results [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] (17) Exchange -Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] -Arguments: hashpartitioning(d_week_seq#10, 5), true, [id=#27] +Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(d_week_seq#12, 5), true, [id=#29] (18) HashAggregate [codegen id : 12] -Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] -Keys [1]: [d_week_seq#10] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34] -Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] +Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [1]: [d_week_seq#12] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36] +Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36,17,2) AS sat_sales#43] (19) Scan parquet default.date_dim -Output [2]: [d_week_seq#42, d_year#43] +Output [2]: [d_week_seq#44, d_year#45] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [2]: [d_week_seq#42, d_year#43] +Input [2]: [d_week_seq#44, d_year#45] (21) Filter [codegen id : 5] -Input [2]: [d_week_seq#42, d_year#43] -Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) +Input [2]: [d_week_seq#44, d_year#45] +Condition : ((isnotnull(d_year#45) AND (d_year#45 = 2001)) AND isnotnull(d_week_seq#44)) (22) Project [codegen id : 5] -Output [1]: [d_week_seq#42] -Input [2]: [d_week_seq#42, d_year#43] +Output [1]: [d_week_seq#44] +Input [2]: [d_week_seq#44, d_year#45] (23) BroadcastExchange -Input [1]: [d_week_seq#42] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] +Input [1]: [d_week_seq#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] (24) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [d_week_seq#10] -Right keys [1]: [d_week_seq#42] +Left keys [1]: [d_week_seq#12] +Right keys [1]: [d_week_seq#44] Join condition: None (25) Project [codegen id : 12] -Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] -Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] +Output [8]: [d_week_seq#12 AS d_week_seq1#47, sun_sales#37 AS sun_sales1#48, mon_sales#38 AS mon_sales1#49, tue_sales#39 AS tue_sales1#50, wed_sales#40 AS wed_sales1#51, thu_sales#41 AS thu_sales1#52, fri_sales#42 AS fri_sales1#53, sat_sales#43 AS sat_sales1#54] +Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#44] (26) ReusedExchange [Reuses operator id: 17] -Output [8]: [d_week_seq#10, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59] +Output [8]: [d_week_seq#12, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61] (27) HashAggregate [codegen id : 11] -Input [8]: [d_week_seq#10, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59] -Keys [1]: [d_week_seq#10] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#60, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#61, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#66] -Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#60,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#61,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#62,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#63,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#64,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#65,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#66,17,2) AS sat_sales#41] +Input [8]: [d_week_seq#12, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61] +Keys [1]: [d_week_seq#12] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))#69] +Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END))#63,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END))#64,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END))#65,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END))#66,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END))#67,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END))#68,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))#69,17,2) AS sat_sales#43] (28) Scan parquet default.date_dim -Output [2]: [d_week_seq#67, d_year#68] +Output [2]: [d_week_seq#70, d_year#71] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] ReadSchema: struct (29) ColumnarToRow [codegen id : 10] -Input [2]: [d_week_seq#67, d_year#68] +Input [2]: [d_week_seq#70, d_year#71] (30) Filter [codegen id : 10] -Input [2]: [d_week_seq#67, d_year#68] -Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2002)) AND isnotnull(d_week_seq#67)) +Input [2]: [d_week_seq#70, d_year#71] +Condition : ((isnotnull(d_year#71) AND (d_year#71 = 2002)) AND isnotnull(d_week_seq#70)) (31) Project [codegen id : 10] -Output [1]: [d_week_seq#67] -Input [2]: [d_week_seq#67, d_year#68] +Output [1]: [d_week_seq#70] +Input [2]: [d_week_seq#70, d_year#71] (32) BroadcastExchange -Input [1]: [d_week_seq#67] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#69] +Input [1]: [d_week_seq#70] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#72] (33) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_week_seq#10] -Right keys [1]: [d_week_seq#67] +Left keys [1]: [d_week_seq#12] +Right keys [1]: [d_week_seq#70] Join condition: None (34) Project [codegen id : 11] -Output [8]: [d_week_seq#10 AS d_week_seq2#70, sun_sales#35 AS sun_sales2#71, mon_sales#36 AS mon_sales2#72, tue_sales#37 AS tue_sales2#73, wed_sales#38 AS wed_sales2#74, thu_sales#39 AS thu_sales2#75, fri_sales#40 AS fri_sales2#76, sat_sales#41 AS sat_sales2#77] -Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#67] +Output [8]: [d_week_seq#12 AS d_week_seq2#73, sun_sales#37 AS sun_sales2#74, mon_sales#38 AS mon_sales2#75, tue_sales#39 AS tue_sales2#76, wed_sales#40 AS wed_sales2#77, thu_sales#41 AS thu_sales2#78, fri_sales#42 AS fri_sales2#79, sat_sales#43 AS sat_sales2#80] +Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#70] (35) BroadcastExchange -Input [8]: [d_week_seq2#70, sun_sales2#71, mon_sales2#72, tue_sales2#73, wed_sales2#74, thu_sales2#75, fri_sales2#76, sat_sales2#77] -Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#78] +Input [8]: [d_week_seq2#73, sun_sales2#74, mon_sales2#75, tue_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80] +Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#81] (36) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [d_week_seq1#45] -Right keys [1]: [(d_week_seq2#70 - 53)] +Left keys [1]: [d_week_seq1#47] +Right keys [1]: [(d_week_seq2#73 - 53)] Join condition: None (37) Project [codegen id : 12] -Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#71)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#79, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#72)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#80, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#73)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#81, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#74)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#82, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#75)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#83, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#76)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#84, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#77)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#85] -Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#70, sun_sales2#71, mon_sales2#72, tue_sales2#73, wed_sales2#74, thu_sales2#75, fri_sales2#76, sat_sales2#77] +Output [8]: [d_week_seq1#47, round(CheckOverflow((promote_precision(sun_sales1#48) / promote_precision(sun_sales2#74)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#82, round(CheckOverflow((promote_precision(mon_sales1#49) / promote_precision(mon_sales2#75)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#83, round(CheckOverflow((promote_precision(tue_sales1#50) / promote_precision(tue_sales2#76)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#84, round(CheckOverflow((promote_precision(wed_sales1#51) / promote_precision(wed_sales2#77)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#85, round(CheckOverflow((promote_precision(thu_sales1#52) / promote_precision(thu_sales2#78)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#86, round(CheckOverflow((promote_precision(fri_sales1#53) / promote_precision(fri_sales2#79)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#87, round(CheckOverflow((promote_precision(sat_sales1#54) / promote_precision(sat_sales2#80)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#88] +Input [16]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54, d_week_seq2#73, sun_sales2#74, mon_sales2#75, tue_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80] (38) Exchange -Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#79, round((mon_sales1 / mon_sales2), 2)#80, round((tue_sales1 / tue_sales2), 2)#81, round((wed_sales1 / wed_sales2), 2)#82, round((thu_sales1 / thu_sales2), 2)#83, round((fri_sales1 / fri_sales2), 2)#84, round((sat_sales1 / sat_sales2), 2)#85] -Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), true, [id=#86] +Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#82, round((mon_sales1 / mon_sales2), 2)#83, round((tue_sales1 / tue_sales2), 2)#84, round((wed_sales1 / wed_sales2), 2)#85, round((thu_sales1 / thu_sales2), 2)#86, round((fri_sales1 / fri_sales2), 2)#87, round((sat_sales1 / sat_sales2), 2)#88] +Arguments: rangepartitioning(d_week_seq1#47 ASC NULLS FIRST, 5), true, [id=#89] (39) Sort [codegen id : 13] -Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#79, round((mon_sales1 / mon_sales2), 2)#80, round((tue_sales1 / tue_sales2), 2)#81, round((wed_sales1 / wed_sales2), 2)#82, round((thu_sales1 / thu_sales2), 2)#83, round((fri_sales1 / fri_sales2), 2)#84, round((sat_sales1 / sat_sales2), 2)#85] -Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 +Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#82, round((mon_sales1 / mon_sales2), 2)#83, round((tue_sales1 / tue_sales2), 2)#84, round((wed_sales1 / wed_sales2), 2)#85, round((thu_sales1 / thu_sales2), 2)#86, round((fri_sales1 / fri_sales2), 2)#87, round((sat_sales1 / sat_sales2), 2)#88] +Arguments: [d_week_seq1#47 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt index 424a535e14847..b260506021d88 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt @@ -15,7 +15,7 @@ WholeStageCodegen (13) Project [sales_price,d_week_seq,d_day_name] BroadcastHashJoin [sold_date_sk,d_date_sk] InputAdapter - Union + Union [sold_date_sk,sales_price] WholeStageCodegen (1) Project [ws_sold_date_sk,ws_ext_sales_price] Filter [ws_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt index c5988072f758d..4a9afe3f27dde 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt @@ -482,27 +482,28 @@ Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#45 as decima Input [4]: [ws_sold_date_sk#42, ws_quantity#45, ws_list_price#46, d_date_sk#9] (88) Union +Arguments: [sales#56] (89) HashAggregate [codegen id : 37] -Input [1]: [sales#41] +Input [1]: [sales#56] Keys: [] -Functions [1]: [partial_sum(sales#41)] -Aggregate Attributes [2]: [sum#56, isEmpty#57] -Results [2]: [sum#58, isEmpty#59] +Functions [1]: [partial_sum(sales#56)] +Aggregate Attributes [2]: [sum#57, isEmpty#58] +Results [2]: [sum#59, isEmpty#60] (90) Exchange -Input [2]: [sum#58, isEmpty#59] -Arguments: SinglePartition, true, [id=#60] +Input [2]: [sum#59, isEmpty#60] +Arguments: SinglePartition, true, [id=#61] (91) HashAggregate [codegen id : 38] -Input [2]: [sum#58, isEmpty#59] +Input [2]: [sum#59, isEmpty#60] Keys: [] -Functions [1]: [sum(sales#41)] -Aggregate Attributes [1]: [sum(sales#41)#61] -Results [1]: [sum(sales#41)#61 AS sum(sales)#62] +Functions [1]: [sum(sales#56)] +Aggregate Attributes [1]: [sum(sales#56)#62] +Results [1]: [sum(sales#56)#62 AS sum(sales)#63] (92) CollectLimit -Input [1]: [sum(sales)#62] +Input [1]: [sum(sales)#63] Arguments: 100 ===== Subqueries ===== @@ -568,7 +569,7 @@ Input [2]: [d_date_sk#9, d_year#11] (100) BroadcastExchange Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#63] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#64] (101) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#7] @@ -581,7 +582,7 @@ Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price (103) Exchange Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#64] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#65] (104) Sort [codegen id : 3] Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] @@ -603,7 +604,7 @@ Condition : isnotnull(c_customer_sk#29) (108) Exchange Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#65] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#66] (109) Sort [codegen id : 5] Input [1]: [c_customer_sk#29] @@ -622,33 +623,33 @@ Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk# 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#66, isEmpty#67] -Results [3]: [c_customer_sk#29, sum#68, isEmpty#69] +Aggregate Attributes [2]: [sum#67, isEmpty#68] +Results [3]: [c_customer_sk#29, sum#69, isEmpty#70] (113) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#29, sum#68, isEmpty#69] +Input [3]: [c_customer_sk#29, sum#69, isEmpty#70] 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))#70] -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))#70 AS csales#71] +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))#71] +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))#71 AS csales#72] (114) HashAggregate [codegen id : 6] -Input [1]: [csales#71] +Input [1]: [csales#72] Keys: [] -Functions [1]: [partial_max(csales#71)] -Aggregate Attributes [1]: [max#72] -Results [1]: [max#73] +Functions [1]: [partial_max(csales#72)] +Aggregate Attributes [1]: [max#73] +Results [1]: [max#74] (115) Exchange -Input [1]: [max#73] -Arguments: SinglePartition, true, [id=#74] +Input [1]: [max#74] +Arguments: SinglePartition, true, [id=#75] (116) HashAggregate [codegen id : 7] -Input [1]: [max#73] +Input [1]: [max#74] Keys: [] -Functions [1]: [max(csales#71)] -Aggregate Attributes [1]: [max(csales#71)#75] -Results [1]: [max(csales#71)#75 AS tpcds_cmax#76] +Functions [1]: [max(csales#72)] +Aggregate Attributes [1]: [max(csales#72)#76] +Results [1]: [max(csales#72)#76 AS tpcds_cmax#77] Subquery:2 Hosting operator id = 80 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt index 9ee444cdd988c..d52842b48a33e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt @@ -6,7 +6,7 @@ CollectLimit WholeStageCodegen (37) HashAggregate [sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [sales] WholeStageCodegen (18) Project [cs_quantity,cs_list_price] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt index 6d2b5b0013d8f..be5a0b0cdc318 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt @@ -379,27 +379,28 @@ Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#44 as decima Input [4]: [ws_sold_date_sk#41, ws_quantity#44, ws_list_price#45, d_date_sk#8] (68) Union +Arguments: [sales#52] (69) HashAggregate [codegen id : 19] -Input [1]: [sales#40] +Input [1]: [sales#52] Keys: [] -Functions [1]: [partial_sum(sales#40)] -Aggregate Attributes [2]: [sum#52, isEmpty#53] -Results [2]: [sum#54, isEmpty#55] +Functions [1]: [partial_sum(sales#52)] +Aggregate Attributes [2]: [sum#53, isEmpty#54] +Results [2]: [sum#55, isEmpty#56] (70) Exchange -Input [2]: [sum#54, isEmpty#55] -Arguments: SinglePartition, true, [id=#56] +Input [2]: [sum#55, isEmpty#56] +Arguments: SinglePartition, true, [id=#57] (71) HashAggregate [codegen id : 20] -Input [2]: [sum#54, isEmpty#55] +Input [2]: [sum#55, isEmpty#56] Keys: [] -Functions [1]: [sum(sales#40)] -Aggregate Attributes [1]: [sum(sales#40)#57] -Results [1]: [sum(sales#40)#57 AS sum(sales)#58] +Functions [1]: [sum(sales#52)] +Aggregate Attributes [1]: [sum(sales#52)#58] +Results [1]: [sum(sales#52)#58 AS sum(sales)#59] (72) CollectLimit -Input [1]: [sum(sales)#58] +Input [1]: [sum(sales)#59] Arguments: 100 ===== Subqueries ===== @@ -459,7 +460,7 @@ Condition : isnotnull(c_customer_sk#26) (79) BroadcastExchange Input [1]: [c_customer_sk#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#59] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#60] (80) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_customer_sk#23] @@ -490,7 +491,7 @@ Input [2]: [d_date_sk#8, d_year#10] (86) BroadcastExchange Input [1]: [d_date_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#60] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#61] (87) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_sold_date_sk#6] @@ -505,37 +506,37 @@ Input [5]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk# Input [3]: [ss_quantity#24, ss_sales_price#25, c_customer_sk#26] Keys [1]: [c_customer_sk#26] Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#61, isEmpty#62] -Results [3]: [c_customer_sk#26, sum#63, isEmpty#64] +Aggregate Attributes [2]: [sum#62, isEmpty#63] +Results [3]: [c_customer_sk#26, sum#64, isEmpty#65] (90) Exchange -Input [3]: [c_customer_sk#26, sum#63, isEmpty#64] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#65] +Input [3]: [c_customer_sk#26, sum#64, isEmpty#65] +Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#66] (91) HashAggregate [codegen id : 4] -Input [3]: [c_customer_sk#26, sum#63, isEmpty#64] +Input [3]: [c_customer_sk#26, sum#64, isEmpty#65] Keys [1]: [c_customer_sk#26] Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66 AS csales#67] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#67] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#67 AS csales#68] (92) HashAggregate [codegen id : 4] -Input [1]: [csales#67] +Input [1]: [csales#68] Keys: [] -Functions [1]: [partial_max(csales#67)] -Aggregate Attributes [1]: [max#68] -Results [1]: [max#69] +Functions [1]: [partial_max(csales#68)] +Aggregate Attributes [1]: [max#69] +Results [1]: [max#70] (93) Exchange -Input [1]: [max#69] -Arguments: SinglePartition, true, [id=#70] +Input [1]: [max#70] +Arguments: SinglePartition, true, [id=#71] (94) HashAggregate [codegen id : 5] -Input [1]: [max#69] +Input [1]: [max#70] Keys: [] -Functions [1]: [max(csales#67)] -Aggregate Attributes [1]: [max(csales#67)#71] -Results [1]: [max(csales#67)#71 AS tpcds_cmax#72] +Functions [1]: [max(csales#68)] +Aggregate Attributes [1]: [max(csales#68)#72] +Results [1]: [max(csales#68)#72 AS tpcds_cmax#73] Subquery:2 Hosting operator id = 60 Hosting Expression = ReusedSubquery Subquery scalar-subquery#35, [id=#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt index d860e18574f2a..dd19be71cd6e7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt @@ -6,7 +6,7 @@ CollectLimit WholeStageCodegen (19) HashAggregate [sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [sales] WholeStageCodegen (9) Project [cs_quantity,cs_list_price] BroadcastHashJoin [cs_sold_date_sk,d_date_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..6ba16c626e030 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 @@ -711,10 +711,11 @@ Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_qua Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#56 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#57 as decimal(12,2)))), DecimalType(18,2), true))#73 AS sales#74] (129) Union +Arguments: [c_last_name#75, c_first_name#76, sales#77] (130) TakeOrderedAndProject -Input [3]: [c_last_name#42, c_first_name#41, sales#52] -Arguments: 100, [c_last_name#42 ASC NULLS FIRST, c_first_name#41 ASC NULLS FIRST, sales#52 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, sales#52] +Input [3]: [c_last_name#75, c_first_name#76, sales#77] +Arguments: 100, [c_last_name#75 ASC NULLS FIRST, c_first_name#76 ASC NULLS FIRST, sales#77 ASC NULLS FIRST], [c_last_name#75, c_first_name#76, sales#77] ===== Subqueries ===== @@ -779,7 +780,7 @@ Input [2]: [d_date_sk#9, d_year#11] (138) BroadcastExchange Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#75] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#78] (139) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#7] @@ -792,7 +793,7 @@ Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price (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] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#79] (142) Sort [codegen id : 3] Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] @@ -814,7 +815,7 @@ Condition : isnotnull(c_customer_sk#29) (146) Exchange Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#77] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#80] (147) Sort [codegen id : 5] Input [1]: [c_customer_sk#29] @@ -833,33 +834,33 @@ Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk# 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#29, sum#80, isEmpty#81] +Aggregate Attributes [2]: [sum#81, isEmpty#82] +Results [3]: [c_customer_sk#29, sum#83, isEmpty#84] (151) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#29, sum#80, isEmpty#81] +Input [3]: [c_customer_sk#29, sum#83, isEmpty#84] 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] +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))#85] +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))#85 AS csales#86] (152) HashAggregate [codegen id : 6] -Input [1]: [csales#83] +Input [1]: [csales#86] Keys: [] -Functions [1]: [partial_max(csales#83)] -Aggregate Attributes [1]: [max#84] -Results [1]: [max#85] +Functions [1]: [partial_max(csales#86)] +Aggregate Attributes [1]: [max#87] +Results [1]: [max#88] (153) Exchange -Input [1]: [max#85] -Arguments: SinglePartition, true, [id=#86] +Input [1]: [max#88] +Arguments: SinglePartition, true, [id=#89] (154) HashAggregate [codegen id : 7] -Input [1]: [max#85] +Input [1]: [max#88] Keys: [] -Functions [1]: [max(csales#83)] -Aggregate Attributes [1]: [max(csales#83)#87] -Results [1]: [max(csales#83)#87 AS tpcds_cmax#88] +Functions [1]: [max(csales#86)] +Aggregate Attributes [1]: [max(csales#86)#90] +Results [1]: [max(csales#86)#90 AS tpcds_cmax#91] Subquery:2 Hosting operator id = 73 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 e8891f032a091..55f738d37e0eb 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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] - Union + Union [c_last_name,c_first_name,sales] WholeStageCodegen (28) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [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)),sales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt index b5213786c93bc..f4c4ea181cb6f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt @@ -540,10 +540,11 @@ Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_qua Results [3]: [c_last_name#39, c_first_name#38, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#55 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#56 as decimal(12,2)))), DecimalType(18,2), true))#70 AS sales#71] (96) Union +Arguments: [c_last_name#72, c_first_name#73, sales#74] (97) TakeOrderedAndProject -Input [3]: [c_last_name#39, c_first_name#38, sales#51] -Arguments: 100, [c_last_name#39 ASC NULLS FIRST, c_first_name#38 ASC NULLS FIRST, sales#51 ASC NULLS FIRST], [c_last_name#39, c_first_name#38, sales#51] +Input [3]: [c_last_name#72, c_first_name#73, sales#74] +Arguments: 100, [c_last_name#72 ASC NULLS FIRST, c_first_name#73 ASC NULLS FIRST, sales#74 ASC NULLS FIRST], [c_last_name#72, c_first_name#73, sales#74] ===== Subqueries ===== @@ -602,7 +603,7 @@ Condition : isnotnull(c_customer_sk#26) (104) BroadcastExchange Input [1]: [c_customer_sk#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#75] (105) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_customer_sk#23] @@ -633,7 +634,7 @@ Input [2]: [d_date_sk#8, d_year#10] (111) BroadcastExchange Input [1]: [d_date_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#76] (112) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_sold_date_sk#6] @@ -648,37 +649,37 @@ Input [5]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk# Input [3]: [ss_quantity#24, ss_sales_price#25, c_customer_sk#26] Keys [1]: [c_customer_sk#26] Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#74, isEmpty#75] -Results [3]: [c_customer_sk#26, sum#76, isEmpty#77] +Aggregate Attributes [2]: [sum#77, isEmpty#78] +Results [3]: [c_customer_sk#26, sum#79, isEmpty#80] (115) Exchange -Input [3]: [c_customer_sk#26, sum#76, isEmpty#77] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#78] +Input [3]: [c_customer_sk#26, sum#79, isEmpty#80] +Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#81] (116) HashAggregate [codegen id : 4] -Input [3]: [c_customer_sk#26, sum#76, isEmpty#77] +Input [3]: [c_customer_sk#26, sum#79, isEmpty#80] Keys [1]: [c_customer_sk#26] Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#79] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#79 AS csales#80] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] (117) HashAggregate [codegen id : 4] -Input [1]: [csales#80] +Input [1]: [csales#83] Keys: [] -Functions [1]: [partial_max(csales#80)] -Aggregate Attributes [1]: [max#81] -Results [1]: [max#82] +Functions [1]: [partial_max(csales#83)] +Aggregate Attributes [1]: [max#84] +Results [1]: [max#85] (118) Exchange -Input [1]: [max#82] -Arguments: SinglePartition, true, [id=#83] +Input [1]: [max#85] +Arguments: SinglePartition, true, [id=#86] (119) HashAggregate [codegen id : 5] -Input [1]: [max#82] +Input [1]: [max#85] Keys: [] -Functions [1]: [max(csales#80)] -Aggregate Attributes [1]: [max(csales#80)#84] -Results [1]: [max(csales#80)#84 AS tpcds_cmax#85] +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 = 49 Hosting Expression = ReusedSubquery Subquery scalar-subquery#35, [id=#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt index f879f38d556e7..3223fc64cedc8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] - Union + Union [c_last_name,c_first_name,sales] WholeStageCodegen (14) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [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)),sales,sum,isEmpty] InputAdapter 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..19a984476f929 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 @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_manufact_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_manufact_id#10, total_sales#22] -Keys [1]: [i_manufact_id#10] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_manufact_id#10, sum#43, isEmpty#44] +Input [2]: [i_manufact_id#41, total_sales#42] +Keys [1]: [i_manufact_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_manufact_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_manufact_id#10, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_manufact_id#10, 5), true, [id=#45] +Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_manufact_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_manufact_id#10, sum#43, isEmpty#44] -Keys [1]: [i_manufact_id#10] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_manufact_id#10, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Keys [1]: [i_manufact_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_manufact_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_manufact_id#10, total_sales#47] -Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_manufact_id#10, total_sales#47] +Input [2]: [i_manufact_id#41, total_sales#49] +Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_manufact_id#41, total_sales#49] 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..2a38ee527e84c 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_manufact_id] WholeStageCodegen (19) HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_manufact_id,total_sales] WholeStageCodegen (6) HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt index 8d1558a01cfde..b5b7982a171f0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_manufact_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_manufact_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_manufact_id#13, total_sales#22] -Keys [1]: [i_manufact_id#13] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_manufact_id#13, sum#43, isEmpty#44] +Input [2]: [i_manufact_id#41, total_sales#42] +Keys [1]: [i_manufact_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_manufact_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_manufact_id#13, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_manufact_id#13, 5), true, [id=#45] +Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_manufact_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_manufact_id#13, sum#43, isEmpty#44] -Keys [1]: [i_manufact_id#13] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_manufact_id#13, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Keys [1]: [i_manufact_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_manufact_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_manufact_id#13, total_sales#47] -Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_manufact_id#13, total_sales#47] +Input [2]: [i_manufact_id#41, total_sales#49] +Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_manufact_id#41, total_sales#49] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt index 14787f0bbce7b..82f777448f71f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_manufact_id] WholeStageCodegen (19) HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_manufact_id,total_sales] WholeStageCodegen (6) HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter 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/q36/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt index 73174b7351002..1c1439e129fc8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/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/q4.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt index fb5e991043bf8..aff16f5cfc30f 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 @@ -1,130 +1,131 @@ == Physical Plan == -TakeOrderedAndProject (126) -+- * Project (125) - +- * SortMergeJoin Inner (124) - :- * Project (106) - : +- * SortMergeJoin Inner (105) - : :- * Project (85) - : : +- * SortMergeJoin Inner (84) - : : :- * Project (66) - : : : +- * SortMergeJoin Inner (65) - : : : :- * SortMergeJoin Inner (45) - : : : : :- * Sort (24) - : : : : : +- Exchange (23) - : : : : : +- * Filter (22) - : : : : : +- * 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 (12) - : : : : +- * Sort (44) - : : : : +- Exchange (43) - : : : : +- * HashAggregate (42) - : : : : +- Exchange (41) - : : : : +- * HashAggregate (40) - : : : : +- * Project (39) - : : : : +- * SortMergeJoin Inner (38) - : : : : :- * 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) - : : : : +- * Sort (37) - : : : : +- ReusedExchange (36) - : : : +- * Sort (64) - : : : +- Exchange (63) - : : : +- * Project (62) - : : : +- * Filter (61) - : : : +- * HashAggregate (60) - : : : +- Exchange (59) - : : : +- * HashAggregate (58) - : : : +- * Project (57) - : : : +- * SortMergeJoin Inner (56) - : : : :- * Sort (53) - : : : : +- Exchange (52) - : : : : +- * Project (51) - : : : : +- * BroadcastHashJoin Inner BuildRight (50) - : : : : :- * Filter (48) - : : : : : +- * ColumnarToRow (47) - : : : : : +- Scan parquet default.catalog_sales (46) - : : : : +- ReusedExchange (49) - : : : +- * Sort (55) - : : : +- ReusedExchange (54) - : : +- * Sort (83) - : : +- Exchange (82) - : : +- * HashAggregate (81) - : : +- Exchange (80) - : : +- * HashAggregate (79) - : : +- * Project (78) - : : +- * SortMergeJoin Inner (77) - : : :- * Sort (74) - : : : +- Exchange (73) - : : : +- * Project (72) - : : : +- * BroadcastHashJoin Inner BuildRight (71) - : : : :- * Filter (69) - : : : : +- * ColumnarToRow (68) - : : : : +- Scan parquet default.catalog_sales (67) - : : : +- ReusedExchange (70) - : : +- * Sort (76) - : : +- ReusedExchange (75) - : +- * Sort (104) - : +- Exchange (103) - : +- * Project (102) - : +- * Filter (101) - : +- * HashAggregate (100) - : +- Exchange (99) - : +- * HashAggregate (98) - : +- * Project (97) - : +- * SortMergeJoin Inner (96) - : :- * Sort (93) - : : +- Exchange (92) - : : +- * Project (91) - : : +- * BroadcastHashJoin Inner BuildRight (90) - : : :- * Filter (88) - : : : +- * ColumnarToRow (87) - : : : +- Scan parquet default.web_sales (86) - : : +- ReusedExchange (89) - : +- * Sort (95) - : +- ReusedExchange (94) - +- * Sort (123) - +- Exchange (122) - +- * HashAggregate (121) - +- Exchange (120) - +- * HashAggregate (119) - +- * Project (118) - +- * SortMergeJoin Inner (117) - :- * Sort (114) - : +- Exchange (113) - : +- * Project (112) - : +- * BroadcastHashJoin Inner BuildRight (111) - : :- * Filter (109) - : : +- * ColumnarToRow (108) - : : +- Scan parquet default.web_sales (107) - : +- ReusedExchange (110) - +- * Sort (116) - +- ReusedExchange (115) +TakeOrderedAndProject (127) ++- * Project (126) + +- * SortMergeJoin Inner (125) + :- * Project (107) + : +- * SortMergeJoin Inner (106) + : :- * Project (86) + : : +- * SortMergeJoin Inner (85) + : : :- * Project (67) + : : : +- * SortMergeJoin Inner (66) + : : : :- * SortMergeJoin Inner (46) + : : : : :- * Sort (25) + : : : : : +- Exchange (24) + : : : : : +- * Project (23) + : : : : : +- * Filter (22) + : : : : : +- * 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 (12) + : : : : +- * Sort (45) + : : : : +- Exchange (44) + : : : : +- * HashAggregate (43) + : : : : +- Exchange (42) + : : : : +- * HashAggregate (41) + : : : : +- * Project (40) + : : : : +- * SortMergeJoin Inner (39) + : : : : :- * Sort (36) + : : : : : +- Exchange (35) + : : : : : +- * Project (34) + : : : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : : : :- * Filter (28) + : : : : : : +- * ColumnarToRow (27) + : : : : : : +- Scan parquet default.store_sales (26) + : : : : : +- BroadcastExchange (32) + : : : : : +- * Filter (31) + : : : : : +- * ColumnarToRow (30) + : : : : : +- Scan parquet default.date_dim (29) + : : : : +- * Sort (38) + : : : : +- ReusedExchange (37) + : : : +- * Sort (65) + : : : +- Exchange (64) + : : : +- * Project (63) + : : : +- * Filter (62) + : : : +- * HashAggregate (61) + : : : +- Exchange (60) + : : : +- * HashAggregate (59) + : : : +- * Project (58) + : : : +- * SortMergeJoin Inner (57) + : : : :- * Sort (54) + : : : : +- Exchange (53) + : : : : +- * Project (52) + : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : :- * Filter (49) + : : : : : +- * ColumnarToRow (48) + : : : : : +- Scan parquet default.catalog_sales (47) + : : : : +- ReusedExchange (50) + : : : +- * Sort (56) + : : : +- ReusedExchange (55) + : : +- * Sort (84) + : : +- Exchange (83) + : : +- * HashAggregate (82) + : : +- Exchange (81) + : : +- * HashAggregate (80) + : : +- * Project (79) + : : +- * SortMergeJoin Inner (78) + : : :- * Sort (75) + : : : +- Exchange (74) + : : : +- * Project (73) + : : : +- * BroadcastHashJoin Inner BuildRight (72) + : : : :- * Filter (70) + : : : : +- * ColumnarToRow (69) + : : : : +- Scan parquet default.catalog_sales (68) + : : : +- ReusedExchange (71) + : : +- * Sort (77) + : : +- ReusedExchange (76) + : +- * Sort (105) + : +- Exchange (104) + : +- * Project (103) + : +- * Filter (102) + : +- * HashAggregate (101) + : +- Exchange (100) + : +- * HashAggregate (99) + : +- * Project (98) + : +- * SortMergeJoin Inner (97) + : :- * Sort (94) + : : +- Exchange (93) + : : +- * Project (92) + : : +- * BroadcastHashJoin Inner BuildRight (91) + : : :- * Filter (89) + : : : +- * ColumnarToRow (88) + : : : +- Scan parquet default.web_sales (87) + : : +- ReusedExchange (90) + : +- * Sort (96) + : +- ReusedExchange (95) + +- * Sort (124) + +- Exchange (123) + +- * HashAggregate (122) + +- Exchange (121) + +- * HashAggregate (120) + +- * Project (119) + +- * SortMergeJoin Inner (118) + :- * Sort (115) + : +- Exchange (114) + : +- * Project (113) + : +- * BroadcastHashJoin Inner BuildRight (112) + : :- * Filter (110) + : : +- * ColumnarToRow (109) + : : +- Scan parquet default.web_sales (108) + : +- ReusedExchange (111) + +- * Sort (117) + +- ReusedExchange (116) (1) Scan parquet default.store_sales @@ -229,467 +230,471 @@ Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_pre Input [2]: [customer_id#26, year_total#27] Condition : (isnotnull(year_total#27) AND (year_total#27 > 0.000000)) -(23) Exchange +(23) Project [codegen id : 7] +Output [2]: [customer_id#26 AS customer_id#28, year_total#27 AS year_total#29] Input [2]: [customer_id#26, year_total#27] -Arguments: hashpartitioning(customer_id#26, 5), true, [id=#28] -(24) Sort [codegen id : 8] -Input [2]: [customer_id#26, year_total#27] -Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 +(24) Exchange +Input [2]: [customer_id#28, year_total#29] +Arguments: hashpartitioning(customer_id#28, 5), true, [id=#30] + +(25) Sort [codegen id : 8] +Input [2]: [customer_id#28, year_total#29] +Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales +(26) 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] +(27) 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] +(28) 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 +(29) 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 -(29) ColumnarToRow [codegen id : 9] +(30) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#7, d_year#8] -(30) Filter [codegen id : 9] +(31) 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)) -(31) BroadcastExchange +(32) BroadcastExchange Input [2]: [d_date_sk#7, d_year#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] -(32) BroadcastHashJoin [codegen id : 10] +(33) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#7] Join condition: None -(33) Project [codegen id : 10] +(34) 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] -(34) Exchange +(35) 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] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#32] -(35) Sort [codegen id : 11] +(36) 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 -(36) ReusedExchange [Reuses operator id: 15] +(37) 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] -(37) Sort [codegen id : 13] +(38) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(38) SortMergeJoin [codegen id : 14] +(39) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#11] Join condition: None -(39) Project [codegen id : 14] +(40) 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] -(40) HashAggregate [codegen id : 14] +(41) 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))] -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] +Aggregate Attributes [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#35, isEmpty#36] -(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] +(42) 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#35, isEmpty#36] +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=#37] -(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] +(43) 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#35, isEmpty#36] 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] +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))#38] +Results [8]: [c_customer_id#12 AS customer_id#39, c_first_name#13 AS customer_first_name#40, c_last_name#14 AS customer_last_name#41, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#42, c_birth_country#16 AS customer_birth_country#43, c_login#17 AS customer_login#44, c_email_address#18 AS customer_email_address#45, 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))#38 AS year_total#46] -(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] -Arguments: hashpartitioning(customer_id#37, 5), true, [id=#45] +(44) Exchange +Input [8]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46] +Arguments: hashpartitioning(customer_id#39, 5), true, [id=#47] -(44) Sort [codegen id : 16] -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] -Arguments: [customer_id#37 ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 16] +Input [8]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46] +Arguments: [customer_id#39 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#26] -Right keys [1]: [customer_id#37] +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#28] +Right keys [1]: [customer_id#39] Join condition: None -(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] +(47) Scan parquet default.catalog_sales +Output [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] 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] -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) ColumnarToRow [codegen id : 19] +Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] -(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) Filter [codegen id : 19] +Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +Condition : (isnotnull(cs_bill_customer_sk#49) AND isnotnull(cs_sold_date_sk#48)) -(49) ReusedExchange [Reuses operator id: 7] +(50) 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] +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#48] Right keys [1]: [d_date_sk#7] 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] +(52) Project [codegen id : 19] +Output [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Input [8]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_date_sk#7, d_year#8] -(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] -Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#52] +(53) Exchange +Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Arguments: hashpartitioning(cs_bill_customer_sk#49, 5), true, [id=#54] -(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] -Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 +(54) Sort [codegen id : 20] +Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Arguments: [cs_bill_customer_sk#49 ASC NULLS FIRST], false, 0 -(54) ReusedExchange [Reuses operator id: 15] +(55) 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] -(55) Sort [codegen id : 22] +(56) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(56) SortMergeJoin [codegen id : 23] -Left keys [1]: [cs_bill_customer_sk#47] +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [cs_bill_customer_sk#49] 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] +(58) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Input [14]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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#8] +(59) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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#8, sum#55, isEmpty#56] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [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#57, isEmpty#58] -(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] +(60) 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#57, isEmpty#58] +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=#59] -(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] +(61) 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#57, isEmpty#58] 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] - -(61) Filter [codegen id : 24] -Input [2]: [customer_id#59, year_total#60] -Condition : (isnotnull(year_total#60) AND (year_total#60 > 0.000000)) +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 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#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#60] +Results [2]: [c_customer_id#12 AS customer_id#61, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#60 AS year_total#62] -(62) Project [codegen id : 24] -Output [2]: [customer_id#59 AS customer_id#61, year_total#60 AS year_total#62] -Input [2]: [customer_id#59, year_total#60] - -(63) Exchange +(62) Filter [codegen id : 24] Input [2]: [customer_id#61, year_total#62] -Arguments: hashpartitioning(customer_id#61, 5), true, [id=#63] +Condition : (isnotnull(year_total#62) AND (year_total#62 > 0.000000)) -(64) Sort [codegen id : 25] +(63) Project [codegen id : 24] +Output [2]: [customer_id#61 AS customer_id#63, year_total#62 AS year_total#64] Input [2]: [customer_id#61, year_total#62] -Arguments: [customer_id#61 ASC NULLS FIRST], false, 0 -(65) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#26] -Right keys [1]: [customer_id#61] +(64) Exchange +Input [2]: [customer_id#63, year_total#64] +Arguments: hashpartitioning(customer_id#63, 5), true, [id=#65] + +(65) Sort [codegen id : 25] +Input [2]: [customer_id#63, year_total#64] +Arguments: [customer_id#63 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#28] +Right keys [1]: [customer_id#63] Join condition: None -(66) Project [codegen id : 26] -Output [11]: [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] -Input [12]: [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, customer_id#61, year_total#62] +(67) Project [codegen id : 26] +Output [11]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, year_total#64] +Input [12]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, customer_id#63, year_total#64] -(67) 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] +(68) Scan parquet default.catalog_sales +Output [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(68) ColumnarToRow [codegen id : 28] -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] +(69) ColumnarToRow [codegen id : 28] +Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] -(69) Filter [codegen id : 28] -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) Filter [codegen id : 28] +Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +Condition : (isnotnull(cs_bill_customer_sk#49) AND isnotnull(cs_sold_date_sk#48)) -(70) ReusedExchange [Reuses operator id: 31] +(71) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#7, d_year#8] -(71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [cs_sold_date_sk#46] +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#48] 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#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) Project [codegen id : 28] +Output [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Input [8]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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#8] -Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#64] +(74) Exchange +Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Arguments: hashpartitioning(cs_bill_customer_sk#49, 5), true, [id=#66] -(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] -Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 +(75) Sort [codegen id : 29] +Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Arguments: [cs_bill_customer_sk#49 ASC NULLS FIRST], false, 0 -(75) ReusedExchange [Reuses operator id: 15] +(76) 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] -(76) Sort [codegen id : 31] +(77) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(77) SortMergeJoin [codegen id : 32] -Left keys [1]: [cs_bill_customer_sk#47] +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [cs_bill_customer_sk#49] 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] +(79) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +Input [14]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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#8] +(80) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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#8, sum#67, isEmpty#68] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [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#69, isEmpty#70] -(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] +(81) 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#69, isEmpty#70] +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=#71] -(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] +(82) 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#69, isEmpty#70] 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] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 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#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#72] +Results [2]: [c_customer_id#12 AS customer_id#73, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#72 AS year_total#74] -(82) Exchange -Input [2]: [customer_id#71, year_total#72] -Arguments: hashpartitioning(customer_id#71, 5), true, [id=#73] +(83) Exchange +Input [2]: [customer_id#73, year_total#74] +Arguments: hashpartitioning(customer_id#73, 5), true, [id=#75] -(83) Sort [codegen id : 34] -Input [2]: [customer_id#71, year_total#72] -Arguments: [customer_id#71 ASC NULLS FIRST], false, 0 +(84) Sort [codegen id : 34] +Input [2]: [customer_id#73, year_total#74] +Arguments: [customer_id#73 ASC NULLS FIRST], false, 0 -(84) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#26] -Right keys [1]: [customer_id#71] -Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#27 > 0.000000) THEN CheckOverflow((promote_precision(year_total#44) / promote_precision(year_total#27)), DecimalType(38,14), true) ELSE null END) +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#28] +Right keys [1]: [customer_id#73] +Join condition: (CASE WHEN (year_total#64 > 0.000000) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#64)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#29 > 0.000000) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#29)), DecimalType(38,14), true) ELSE null END) -(85) Project [codegen id : 35] -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) Project [codegen id : 35] +Output [10]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74] +Input [13]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, year_total#64, customer_id#73, year_total#74] -(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] +(87) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] 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] -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) ColumnarToRow [codegen id : 37] +Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] -(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) Filter [codegen id : 37] +Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +Condition : (isnotnull(ws_bill_customer_sk#77) AND isnotnull(ws_sold_date_sk#76)) -(89) ReusedExchange [Reuses operator id: 7] +(90) 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] +(91) BroadcastHashJoin [codegen id : 37] +Left keys [1]: [ws_sold_date_sk#76] Right keys [1]: [d_date_sk#7] 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] +(92) Project [codegen id : 37] +Output [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Input [8]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_date_sk#7, d_year#8] -(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] -Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#80] +(93) Exchange +Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Arguments: hashpartitioning(ws_bill_customer_sk#77, 5), true, [id=#82] -(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] -Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 +(94) Sort [codegen id : 38] +Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Arguments: [ws_bill_customer_sk#77 ASC NULLS FIRST], false, 0 -(94) ReusedExchange [Reuses operator id: 15] +(95) 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] -(95) Sort [codegen id : 40] +(96) Sort [codegen id : 40] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(96) SortMergeJoin [codegen id : 41] -Left keys [1]: [ws_bill_customer_sk#75] +(97) SortMergeJoin [codegen id : 41] +Left keys [1]: [ws_bill_customer_sk#77] 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] +(98) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Input [14]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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#8] +(99) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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#8, sum#83, isEmpty#84] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [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#85, isEmpty#86] -(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] +(100) 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#85, isEmpty#86] +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=#87] -(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] +(101) 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#85, isEmpty#86] 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] - -(101) Filter [codegen id : 42] -Input [2]: [customer_id#87, year_total#88] -Condition : (isnotnull(year_total#88) AND (year_total#88 > 0.000000)) - -(102) Project [codegen id : 42] -Output [2]: [customer_id#87 AS customer_id#89, year_total#88 AS year_total#90] -Input [2]: [customer_id#87, year_total#88] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 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#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#88] +Results [2]: [c_customer_id#12 AS customer_id#89, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#88 AS year_total#90] -(103) Exchange +(102) Filter [codegen id : 42] Input [2]: [customer_id#89, year_total#90] -Arguments: hashpartitioning(customer_id#89, 5), true, [id=#91] +Condition : (isnotnull(year_total#90) AND (year_total#90 > 0.000000)) -(104) Sort [codegen id : 43] +(103) Project [codegen id : 42] +Output [2]: [customer_id#89 AS customer_id#91, year_total#90 AS year_total#92] Input [2]: [customer_id#89, year_total#90] -Arguments: [customer_id#89 ASC NULLS FIRST], false, 0 -(105) SortMergeJoin [codegen id : 44] -Left keys [1]: [customer_id#26] -Right keys [1]: [customer_id#89] +(104) Exchange +Input [2]: [customer_id#91, year_total#92] +Arguments: hashpartitioning(customer_id#91, 5), true, [id=#93] + +(105) Sort [codegen id : 43] +Input [2]: [customer_id#91, year_total#92] +Arguments: [customer_id#91 ASC NULLS FIRST], false, 0 + +(106) SortMergeJoin [codegen id : 44] +Left keys [1]: [customer_id#28] +Right keys [1]: [customer_id#91] Join condition: None -(106) Project [codegen id : 44] -Output [11]: [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, year_total#90] -Input [12]: [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, customer_id#89, year_total#90] +(107) Project [codegen id : 44] +Output [11]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, year_total#92] +Input [12]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, customer_id#91, year_total#92] -(107) 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] +(108) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(108) ColumnarToRow [codegen id : 46] -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] +(109) ColumnarToRow [codegen id : 46] +Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] -(109) Filter [codegen id : 46] -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) Filter [codegen id : 46] +Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +Condition : (isnotnull(ws_bill_customer_sk#77) AND isnotnull(ws_sold_date_sk#76)) -(110) ReusedExchange [Reuses operator id: 31] +(111) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#7, d_year#8] -(111) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#74] +(112) BroadcastHashJoin [codegen id : 46] +Left keys [1]: [ws_sold_date_sk#76] 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#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) Project [codegen id : 46] +Output [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Input [8]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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#8] -Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#92] +(114) Exchange +Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Arguments: hashpartitioning(ws_bill_customer_sk#77, 5), true, [id=#94] -(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] -Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 +(115) Sort [codegen id : 47] +Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Arguments: [ws_bill_customer_sk#77 ASC NULLS FIRST], false, 0 -(115) ReusedExchange [Reuses operator id: 15] +(116) 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] -(116) Sort [codegen id : 49] +(117) Sort [codegen id : 49] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(117) SortMergeJoin [codegen id : 50] -Left keys [1]: [ws_bill_customer_sk#75] +(118) SortMergeJoin [codegen id : 50] +Left keys [1]: [ws_bill_customer_sk#77] 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] +(119) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +Input [14]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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#8] +(120) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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#8, sum#95, isEmpty#96] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [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#97, isEmpty#98] -(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] +(121) 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#97, isEmpty#98] +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=#99] -(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] +(122) 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#97, isEmpty#98] 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] - -(122) Exchange -Input [2]: [customer_id#99, year_total#100] -Arguments: hashpartitioning(customer_id#99, 5), true, [id=#101] - -(123) Sort [codegen id : 52] -Input [2]: [customer_id#99, year_total#100] -Arguments: [customer_id#99 ASC NULLS FIRST], false, 0 - -(124) SortMergeJoin [codegen id : 53] -Left keys [1]: [customer_id#26] -Right keys [1]: [customer_id#99] -Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#90 > 0.000000) THEN CheckOverflow((promote_precision(year_total#100) / promote_precision(year_total#90)), DecimalType(38,14), true) ELSE null END) - -(125) Project [codegen id : 53] -Output [7]: [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] -Input [13]: [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, year_total#90, customer_id#99, year_total#100] - -(126) TakeOrderedAndProject -Input [7]: [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] -Arguments: 100, [customer_id#37 ASC NULLS FIRST, customer_first_name#38 ASC NULLS FIRST, customer_last_name#39 ASC NULLS FIRST, customer_preferred_cust_flag#40 ASC NULLS FIRST, customer_birth_country#41 ASC NULLS FIRST, customer_login#42 ASC NULLS FIRST, customer_email_address#43 ASC NULLS FIRST], [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] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 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#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#100] +Results [2]: [c_customer_id#12 AS customer_id#101, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#100 AS year_total#102] + +(123) Exchange +Input [2]: [customer_id#101, year_total#102] +Arguments: hashpartitioning(customer_id#101, 5), true, [id=#103] + +(124) Sort [codegen id : 52] +Input [2]: [customer_id#101, year_total#102] +Arguments: [customer_id#101 ASC NULLS FIRST], false, 0 + +(125) SortMergeJoin [codegen id : 53] +Left keys [1]: [customer_id#28] +Right keys [1]: [customer_id#101] +Join condition: (CASE WHEN (year_total#64 > 0.000000) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#64)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#92 > 0.000000) THEN CheckOverflow((promote_precision(year_total#102) / promote_precision(year_total#92)), DecimalType(38,14), true) ELSE null END) + +(126) Project [codegen id : 53] +Output [7]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] +Input [13]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, year_total#92, customer_id#101, year_total#102] + +(127) TakeOrderedAndProject +Input [7]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] +Arguments: 100, [customer_id#39 ASC NULLS FIRST, customer_first_name#40 ASC NULLS FIRST, customer_last_name#41 ASC NULLS FIRST, customer_preferred_cust_flag#42 ASC NULLS FIRST, customer_birth_country#43 ASC NULLS FIRST, customer_login#44 ASC NULLS FIRST, customer_email_address#45 ASC NULLS FIRST], [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] 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..41d3762fecc1b 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 @@ -23,43 +23,44 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt index 79a7abdcff5db..f1ea24f01e36b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt @@ -1,111 +1,112 @@ == Physical Plan == -TakeOrderedAndProject (107) -+- * Project (106) - +- * BroadcastHashJoin Inner BuildRight (105) - :- * Project (91) - : +- * BroadcastHashJoin Inner BuildRight (90) - : :- * Project (71) - : : +- * BroadcastHashJoin Inner BuildRight (70) - : : :- * Project (56) - : : : +- * BroadcastHashJoin Inner BuildRight (55) - : : : :- * BroadcastHashJoin Inner BuildRight (36) - : : : : :- * Filter (19) - : : : : : +- * HashAggregate (18) - : : : : : +- Exchange (17) - : : : : : +- * HashAggregate (16) - : : : : : +- * Project (15) - : : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : : :- * Project (9) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : : : :- * Filter (3) - : : : : : : : +- * ColumnarToRow (2) - : : : : : : : +- Scan parquet default.customer (1) - : : : : : : +- BroadcastExchange (7) - : : : : : : +- * Filter (6) - : : : : : : +- * ColumnarToRow (5) - : : : : : : +- Scan parquet default.store_sales (4) - : : : : : +- BroadcastExchange (13) - : : : : : +- * Filter (12) - : : : : : +- * ColumnarToRow (11) - : : : : : +- Scan parquet default.date_dim (10) - : : : : +- BroadcastExchange (35) - : : : : +- * HashAggregate (34) - : : : : +- Exchange (33) - : : : : +- * HashAggregate (32) - : : : : +- * Project (31) - : : : : +- * BroadcastHashJoin Inner BuildRight (30) - : : : : :- * Project (25) - : : : : : +- * BroadcastHashJoin Inner BuildRight (24) - : : : : : :- * Filter (22) - : : : : : : +- * ColumnarToRow (21) - : : : : : : +- Scan parquet default.customer (20) - : : : : : +- ReusedExchange (23) - : : : : +- BroadcastExchange (29) - : : : : +- * Filter (28) - : : : : +- * ColumnarToRow (27) - : : : : +- Scan parquet default.date_dim (26) - : : : +- BroadcastExchange (54) - : : : +- * Project (53) - : : : +- * Filter (52) - : : : +- * HashAggregate (51) - : : : +- Exchange (50) - : : : +- * HashAggregate (49) - : : : +- * Project (48) - : : : +- * BroadcastHashJoin Inner BuildRight (47) - : : : :- * Project (45) - : : : : +- * BroadcastHashJoin Inner BuildRight (44) - : : : : :- * Filter (39) - : : : : : +- * ColumnarToRow (38) - : : : : : +- Scan parquet default.customer (37) - : : : : +- BroadcastExchange (43) - : : : : +- * Filter (42) - : : : : +- * ColumnarToRow (41) - : : : : +- Scan parquet default.catalog_sales (40) - : : : +- ReusedExchange (46) - : : +- BroadcastExchange (69) - : : +- * HashAggregate (68) - : : +- Exchange (67) - : : +- * HashAggregate (66) - : : +- * Project (65) - : : +- * BroadcastHashJoin Inner BuildRight (64) - : : :- * Project (62) - : : : +- * BroadcastHashJoin Inner BuildRight (61) - : : : :- * Filter (59) - : : : : +- * ColumnarToRow (58) - : : : : +- Scan parquet default.customer (57) - : : : +- ReusedExchange (60) - : : +- ReusedExchange (63) - : +- BroadcastExchange (89) - : +- * Project (88) - : +- * Filter (87) - : +- * HashAggregate (86) - : +- Exchange (85) - : +- * HashAggregate (84) - : +- * Project (83) - : +- * BroadcastHashJoin Inner BuildRight (82) - : :- * Project (80) - : : +- * BroadcastHashJoin Inner BuildRight (79) - : : :- * Filter (74) - : : : +- * ColumnarToRow (73) - : : : +- Scan parquet default.customer (72) - : : +- BroadcastExchange (78) - : : +- * Filter (77) - : : +- * ColumnarToRow (76) - : : +- Scan parquet default.web_sales (75) - : +- ReusedExchange (81) - +- BroadcastExchange (104) - +- * HashAggregate (103) - +- Exchange (102) - +- * HashAggregate (101) - +- * Project (100) - +- * BroadcastHashJoin Inner BuildRight (99) - :- * Project (97) - : +- * BroadcastHashJoin Inner BuildRight (96) - : :- * Filter (94) - : : +- * ColumnarToRow (93) - : : +- Scan parquet default.customer (92) - : +- ReusedExchange (95) - +- ReusedExchange (98) +TakeOrderedAndProject (108) ++- * Project (107) + +- * BroadcastHashJoin Inner BuildRight (106) + :- * Project (92) + : +- * BroadcastHashJoin Inner BuildRight (91) + : :- * Project (72) + : : +- * BroadcastHashJoin Inner BuildRight (71) + : : :- * Project (57) + : : : +- * BroadcastHashJoin Inner BuildRight (56) + : : : :- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Project (20) + : : : : : +- * Filter (19) + : : : : : +- * HashAggregate (18) + : : : : : +- Exchange (17) + : : : : : +- * HashAggregate (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.customer (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_sales (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.date_dim (10) + : : : : +- BroadcastExchange (36) + : : : : +- * HashAggregate (35) + : : : : +- Exchange (34) + : : : : +- * HashAggregate (33) + : : : : +- * Project (32) + : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : :- * Project (26) + : : : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : : : :- * Filter (23) + : : : : : : +- * ColumnarToRow (22) + : : : : : : +- Scan parquet default.customer (21) + : : : : : +- ReusedExchange (24) + : : : : +- BroadcastExchange (30) + : : : : +- * Filter (29) + : : : : +- * ColumnarToRow (28) + : : : : +- Scan parquet default.date_dim (27) + : : : +- BroadcastExchange (55) + : : : +- * Project (54) + : : : +- * Filter (53) + : : : +- * HashAggregate (52) + : : : +- Exchange (51) + : : : +- * HashAggregate (50) + : : : +- * Project (49) + : : : +- * BroadcastHashJoin Inner BuildRight (48) + : : : :- * Project (46) + : : : : +- * BroadcastHashJoin Inner BuildRight (45) + : : : : :- * Filter (40) + : : : : : +- * ColumnarToRow (39) + : : : : : +- Scan parquet default.customer (38) + : : : : +- BroadcastExchange (44) + : : : : +- * Filter (43) + : : : : +- * ColumnarToRow (42) + : : : : +- Scan parquet default.catalog_sales (41) + : : : +- ReusedExchange (47) + : : +- BroadcastExchange (70) + : : +- * HashAggregate (69) + : : +- Exchange (68) + : : +- * HashAggregate (67) + : : +- * Project (66) + : : +- * BroadcastHashJoin Inner BuildRight (65) + : : :- * Project (63) + : : : +- * BroadcastHashJoin Inner BuildRight (62) + : : : :- * Filter (60) + : : : : +- * ColumnarToRow (59) + : : : : +- Scan parquet default.customer (58) + : : : +- ReusedExchange (61) + : : +- ReusedExchange (64) + : +- BroadcastExchange (90) + : +- * Project (89) + : +- * Filter (88) + : +- * HashAggregate (87) + : +- Exchange (86) + : +- * HashAggregate (85) + : +- * Project (84) + : +- * BroadcastHashJoin Inner BuildRight (83) + : :- * Project (81) + : : +- * BroadcastHashJoin Inner BuildRight (80) + : : :- * Filter (75) + : : : +- * ColumnarToRow (74) + : : : +- Scan parquet default.customer (73) + : : +- BroadcastExchange (79) + : : +- * Filter (78) + : : +- * ColumnarToRow (77) + : : +- Scan parquet default.web_sales (76) + : +- ReusedExchange (82) + +- BroadcastExchange (105) + +- * HashAggregate (104) + +- Exchange (103) + +- * HashAggregate (102) + +- * Project (101) + +- * BroadcastHashJoin Inner BuildRight (100) + :- * Project (98) + : +- * BroadcastHashJoin Inner BuildRight (97) + : :- * Filter (95) + : : +- * ColumnarToRow (94) + : : +- Scan parquet default.customer (93) + : +- ReusedExchange (96) + +- ReusedExchange (99) (1) Scan parquet default.customer @@ -198,409 +199,413 @@ Results [2]: [c_customer_id#2 AS customer_id#25, sum(CheckOverflow((promote_prec Input [2]: [customer_id#25, year_total#26] Condition : (isnotnull(year_total#26) AND (year_total#26 > 0.000000)) -(20) Scan parquet default.customer +(20) Project [codegen id : 24] +Output [2]: [customer_id#25 AS customer_id#27, year_total#26 AS year_total#28] +Input [2]: [customer_id#25, year_total#26] + +(21) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] +(22) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(22) Filter [codegen id : 6] +(23) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(23) ReusedExchange [Reuses operator id: 7] +(24) ReusedExchange [Reuses operator id: 7] Output [6]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] -(24) BroadcastHashJoin [codegen id : 6] +(25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(25) Project [codegen id : 6] +(26) Project [codegen id : 6] Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] -(26) Scan parquet default.date_dim +(27) Scan parquet default.date_dim Output [2]: [d_date_sk#16, d_year#17] 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 -(27) ColumnarToRow [codegen id : 5] +(28) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#16, d_year#17] -(28) Filter [codegen id : 5] +(29) Filter [codegen id : 5] Input [2]: [d_date_sk#16, d_year#17] Condition : ((isnotnull(d_year#17) AND (d_year#17 = 2002)) AND isnotnull(d_date_sk#16)) -(29) BroadcastExchange +(30) BroadcastExchange Input [2]: [d_date_sk#16, d_year#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] -(30) BroadcastHashJoin [codegen id : 6] +(31) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#16] Join condition: None -(31) Project [codegen id : 6] +(32) Project [codegen id : 6] Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_year#17] Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_date_sk#16, d_year#17] -(32) HashAggregate [codegen id : 6] +(33) HashAggregate [codegen id : 6] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#28, isEmpty#29] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] +Aggregate Attributes [2]: [sum#30, isEmpty#31] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] -(33) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#32] +(34) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#34] -(34) HashAggregate [codegen id : 7] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] +(35) HashAggregate [codegen id : 7] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 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#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#33] -Results [8]: [c_customer_id#2 AS customer_id#34, c_first_name#3 AS customer_first_name#35, c_last_name#4 AS customer_last_name#36, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#37, c_birth_country#6 AS customer_birth_country#38, c_login#7 AS customer_login#39, c_email_address#8 AS customer_email_address#40, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#33 AS year_total#41] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#35] +Results [8]: [c_customer_id#2 AS customer_id#36, c_first_name#3 AS customer_first_name#37, c_last_name#4 AS customer_last_name#38, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#39, c_birth_country#6 AS customer_birth_country#40, c_login#7 AS customer_login#41, c_email_address#8 AS customer_email_address#42, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#35 AS year_total#43] -(35) BroadcastExchange -Input [8]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] +(36) BroadcastExchange +Input [8]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#44] -(36) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#25] -Right keys [1]: [customer_id#34] +(37) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#36] Join condition: None -(37) Scan parquet default.customer +(38) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 10] +(39) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(39) Filter [codegen id : 10] +(40) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(40) Scan parquet default.catalog_sales -Output [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +(41) Scan parquet default.catalog_sales +Output [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 8] -Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +(42) ColumnarToRow [codegen id : 8] +Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -(42) Filter [codegen id : 8] -Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -Condition : (isnotnull(cs_bill_customer_sk#44) AND isnotnull(cs_sold_date_sk#43)) +(43) Filter [codegen id : 8] +Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +Condition : (isnotnull(cs_bill_customer_sk#46) AND isnotnull(cs_sold_date_sk#45)) -(43) BroadcastExchange -Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#49] +(44) BroadcastExchange +Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#51] -(44) BroadcastHashJoin [codegen id : 10] +(45) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cs_bill_customer_sk#44] +Right keys [1]: [cs_bill_customer_sk#46] Join condition: None -(45) Project [codegen id : 10] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +(46) Project [codegen id : 10] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -(46) ReusedExchange [Reuses operator id: 13] +(47) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#16, d_year#17] -(47) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#43] +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#45] Right keys [1]: [d_date_sk#16] Join condition: None -(48) Project [codegen id : 10] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_date_sk#16, d_year#17] +(49) Project [codegen id : 10] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_date_sk#16, d_year#17] -(49) HashAggregate [codegen id : 10] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] +(50) HashAggregate [codegen id : 10] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#50, isEmpty#51] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#52, isEmpty#53] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] -(50) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#54] +(51) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#56] -(51) HashAggregate [codegen id : 11] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] +(52) HashAggregate [codegen id : 11] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 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#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#55] -Results [2]: [c_customer_id#2 AS customer_id#56, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#55 AS year_total#57] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 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#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#57] +Results [2]: [c_customer_id#2 AS customer_id#58, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#57 AS year_total#59] -(52) Filter [codegen id : 11] -Input [2]: [customer_id#56, year_total#57] -Condition : (isnotnull(year_total#57) AND (year_total#57 > 0.000000)) - -(53) Project [codegen id : 11] -Output [2]: [customer_id#56 AS customer_id#58, year_total#57 AS year_total#59] -Input [2]: [customer_id#56, year_total#57] +(53) Filter [codegen id : 11] +Input [2]: [customer_id#58, year_total#59] +Condition : (isnotnull(year_total#59) AND (year_total#59 > 0.000000)) -(54) BroadcastExchange +(54) Project [codegen id : 11] +Output [2]: [customer_id#58 AS customer_id#60, year_total#59 AS year_total#61] Input [2]: [customer_id#58, year_total#59] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#60] -(55) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#25] -Right keys [1]: [customer_id#58] +(55) BroadcastExchange +Input [2]: [customer_id#60, year_total#61] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#62] + +(56) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#60] Join condition: None -(56) Project [codegen id : 24] -Output [11]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, year_total#59] -Input [12]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, customer_id#58, year_total#59] +(57) Project [codegen id : 24] +Output [11]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, year_total#61] +Input [12]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, customer_id#60, year_total#61] -(57) Scan parquet default.customer +(58) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(58) ColumnarToRow [codegen id : 14] +(59) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(59) Filter [codegen id : 14] +(60) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(60) ReusedExchange [Reuses operator id: 43] -Output [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +(61) ReusedExchange [Reuses operator id: 44] +Output [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -(61) BroadcastHashJoin [codegen id : 14] +(62) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cs_bill_customer_sk#44] +Right keys [1]: [cs_bill_customer_sk#46] Join condition: None -(62) Project [codegen id : 14] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +(63) Project [codegen id : 14] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -(63) ReusedExchange [Reuses operator id: 29] +(64) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#16, d_year#17] -(64) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [cs_sold_date_sk#43] +(65) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [cs_sold_date_sk#45] Right keys [1]: [d_date_sk#16] Join condition: None -(65) Project [codegen id : 14] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_date_sk#16, d_year#17] +(66) Project [codegen id : 14] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_date_sk#16, d_year#17] -(66) HashAggregate [codegen id : 14] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] +(67) HashAggregate [codegen id : 14] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#61, isEmpty#62] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#63, isEmpty#64] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] -(67) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#65] +(68) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#67] -(68) HashAggregate [codegen id : 15] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] +(69) HashAggregate [codegen id : 15] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 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#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#66] -Results [2]: [c_customer_id#2 AS customer_id#67, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#66 AS year_total#68] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 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#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#68] +Results [2]: [c_customer_id#2 AS customer_id#69, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#68 AS year_total#70] -(69) BroadcastExchange -Input [2]: [customer_id#67, year_total#68] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#69] +(70) BroadcastExchange +Input [2]: [customer_id#69, year_total#70] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#71] -(70) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#25] -Right keys [1]: [customer_id#67] -Join condition: (CASE WHEN (year_total#59 > 0.000000) THEN CheckOverflow((promote_precision(year_total#68) / promote_precision(year_total#59)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#26 > 0.000000) THEN CheckOverflow((promote_precision(year_total#41) / promote_precision(year_total#26)), DecimalType(38,14), true) ELSE null END) +(71) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#69] +Join condition: (CASE WHEN (year_total#61 > 0.000000) THEN CheckOverflow((promote_precision(year_total#70) / promote_precision(year_total#61)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#28 > 0.000000) THEN CheckOverflow((promote_precision(year_total#43) / promote_precision(year_total#28)), DecimalType(38,14), true) ELSE null END) -(71) Project [codegen id : 24] -Output [10]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68] -Input [13]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, year_total#59, customer_id#67, year_total#68] +(72) Project [codegen id : 24] +Output [10]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70] +Input [13]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, year_total#61, customer_id#69, year_total#70] -(72) Scan parquet default.customer +(73) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(73) ColumnarToRow [codegen id : 18] +(74) ColumnarToRow [codegen id : 18] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(74) Filter [codegen id : 18] +(75) Filter [codegen id : 18] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(75) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +(76) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(76) ColumnarToRow [codegen id : 16] -Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +(77) ColumnarToRow [codegen id : 16] +Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -(77) Filter [codegen id : 16] -Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -Condition : (isnotnull(ws_bill_customer_sk#71) AND isnotnull(ws_sold_date_sk#70)) +(78) Filter [codegen id : 16] +Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +Condition : (isnotnull(ws_bill_customer_sk#73) AND isnotnull(ws_sold_date_sk#72)) -(78) BroadcastExchange -Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#76] +(79) BroadcastExchange +Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#78] -(79) BroadcastHashJoin [codegen id : 18] +(80) BroadcastHashJoin [codegen id : 18] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#71] +Right keys [1]: [ws_bill_customer_sk#73] Join condition: None -(80) Project [codegen id : 18] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +(81) Project [codegen id : 18] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -(81) ReusedExchange [Reuses operator id: 13] +(82) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#16, d_year#17] -(82) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [ws_sold_date_sk#70] +(83) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ws_sold_date_sk#72] Right keys [1]: [d_date_sk#16] Join condition: None -(83) Project [codegen id : 18] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_date_sk#16, d_year#17] +(84) Project [codegen id : 18] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_date_sk#16, d_year#17] -(84) HashAggregate [codegen id : 18] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] +(85) HashAggregate [codegen id : 18] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#77, isEmpty#78] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#79, isEmpty#80] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] -(85) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#81] +(86) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#83] -(86) HashAggregate [codegen id : 19] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] +(87) HashAggregate [codegen id : 19] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 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#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#82] -Results [2]: [c_customer_id#2 AS customer_id#83, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#82 AS year_total#84] - -(87) Filter [codegen id : 19] -Input [2]: [customer_id#83, year_total#84] -Condition : (isnotnull(year_total#84) AND (year_total#84 > 0.000000)) +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 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#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84] +Results [2]: [c_customer_id#2 AS customer_id#85, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84 AS year_total#86] -(88) Project [codegen id : 19] -Output [2]: [customer_id#83 AS customer_id#85, year_total#84 AS year_total#86] -Input [2]: [customer_id#83, year_total#84] +(88) Filter [codegen id : 19] +Input [2]: [customer_id#85, year_total#86] +Condition : (isnotnull(year_total#86) AND (year_total#86 > 0.000000)) -(89) BroadcastExchange +(89) Project [codegen id : 19] +Output [2]: [customer_id#85 AS customer_id#87, year_total#86 AS year_total#88] Input [2]: [customer_id#85, year_total#86] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#87] -(90) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#25] -Right keys [1]: [customer_id#85] +(90) BroadcastExchange +Input [2]: [customer_id#87, year_total#88] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#89] + +(91) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#87] Join condition: None -(91) Project [codegen id : 24] -Output [11]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, year_total#86] -Input [12]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, customer_id#85, year_total#86] +(92) Project [codegen id : 24] +Output [11]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, year_total#88] +Input [12]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, customer_id#87, year_total#88] -(92) Scan parquet default.customer +(93) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(93) ColumnarToRow [codegen id : 22] +(94) ColumnarToRow [codegen id : 22] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(94) Filter [codegen id : 22] +(95) Filter [codegen id : 22] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(95) ReusedExchange [Reuses operator id: 78] -Output [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +(96) ReusedExchange [Reuses operator id: 79] +Output [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -(96) BroadcastHashJoin [codegen id : 22] +(97) BroadcastHashJoin [codegen id : 22] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#71] +Right keys [1]: [ws_bill_customer_sk#73] Join condition: None -(97) Project [codegen id : 22] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +(98) Project [codegen id : 22] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -(98) ReusedExchange [Reuses operator id: 29] +(99) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#16, d_year#17] -(99) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_sold_date_sk#70] +(100) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#72] Right keys [1]: [d_date_sk#16] Join condition: None -(100) Project [codegen id : 22] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_date_sk#16, d_year#17] +(101) Project [codegen id : 22] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_date_sk#16, d_year#17] -(101) HashAggregate [codegen id : 22] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] +(102) HashAggregate [codegen id : 22] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#88, isEmpty#89] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#90, isEmpty#91] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] -(102) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#92] +(103) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#94] -(103) HashAggregate [codegen id : 23] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] +(104) HashAggregate [codegen id : 23] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 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#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#93] -Results [2]: [c_customer_id#2 AS customer_id#94, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#93 AS year_total#95] - -(104) BroadcastExchange -Input [2]: [customer_id#94, year_total#95] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#96] - -(105) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#25] -Right keys [1]: [customer_id#94] -Join condition: (CASE WHEN (year_total#59 > 0.000000) THEN CheckOverflow((promote_precision(year_total#68) / promote_precision(year_total#59)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#86 > 0.000000) THEN CheckOverflow((promote_precision(year_total#95) / promote_precision(year_total#86)), DecimalType(38,14), true) ELSE null END) - -(106) Project [codegen id : 24] -Output [7]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] -Input [13]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, year_total#86, customer_id#94, year_total#95] - -(107) TakeOrderedAndProject -Input [7]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] -Arguments: 100, [customer_id#34 ASC NULLS FIRST, customer_first_name#35 ASC NULLS FIRST, customer_last_name#36 ASC NULLS FIRST, customer_preferred_cust_flag#37 ASC NULLS FIRST, customer_birth_country#38 ASC NULLS FIRST, customer_login#39 ASC NULLS FIRST, customer_email_address#40 ASC NULLS FIRST], [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 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#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#95] +Results [2]: [c_customer_id#2 AS customer_id#96, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#95 AS year_total#97] + +(105) BroadcastExchange +Input [2]: [customer_id#96, year_total#97] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#98] + +(106) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#96] +Join condition: (CASE WHEN (year_total#61 > 0.000000) THEN CheckOverflow((promote_precision(year_total#70) / promote_precision(year_total#61)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#88 > 0.000000) THEN CheckOverflow((promote_precision(year_total#97) / promote_precision(year_total#88)), DecimalType(38,14), true) ELSE null END) + +(107) Project [codegen id : 24] +Output [7]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] +Input [13]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, year_total#88, customer_id#96, year_total#97] + +(108) TakeOrderedAndProject +Input [7]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] +Arguments: 100, [customer_id#36 ASC NULLS FIRST, customer_first_name#37 ASC NULLS FIRST, customer_last_name#38 ASC NULLS FIRST, customer_preferred_cust_flag#39 ASC NULLS FIRST, customer_birth_country#40 ASC NULLS FIRST, customer_login#41 ASC NULLS FIRST, customer_email_address#42 ASC NULLS FIRST], [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt index 017b34451ef7e..28fcbb7fb2ab6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt @@ -9,34 +9,35 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,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] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,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] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt index 114b5e0568223..a22571168c014 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt @@ -453,26 +453,27 @@ Output [5]: [store AS channel#112, item#106, return_ratio#107, return_rank#110, Input [5]: [item#106, return_ratio#107, currency_ratio#108, return_rank#110, currency_rank#111] (83) Union +Arguments: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (84) HashAggregate [codegen id : 31] -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (85) Exchange -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Arguments: hashpartitioning(channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39, 5), true, [id=#113] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Arguments: hashpartitioning(channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117, 5), true, [id=#118] (86) HashAggregate [codegen id : 32] -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (87) TakeOrderedAndProject -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Arguments: 100, [channel#40 ASC NULLS FIRST, return_rank#38 ASC NULLS FIRST, currency_rank#39 ASC NULLS FIRST], [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Arguments: 100, [channel#113 ASC NULLS FIRST, return_rank#116 ASC NULLS FIRST, currency_rank#117 ASC NULLS FIRST], [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt index ab300ca150457..d8c5e9679b1cf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (31) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union + Union [channel,item,return_ratio,return_rank,currency_rank] WholeStageCodegen (10) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt index 8d10c1641ef46..1dd5ee2bda48d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt @@ -408,26 +408,27 @@ Output [5]: [store AS channel#109, item#103, return_ratio#104, return_rank#107, Input [5]: [item#103, return_ratio#104, currency_ratio#105, return_rank#107, currency_rank#108] (74) Union +Arguments: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (75) HashAggregate [codegen id : 22] -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (76) Exchange -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Arguments: hashpartitioning(channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38, 5), true, [id=#110] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Arguments: hashpartitioning(channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114, 5), true, [id=#115] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (78) TakeOrderedAndProject -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Arguments: 100, [channel#39 ASC NULLS FIRST, return_rank#37 ASC NULLS FIRST, currency_rank#38 ASC NULLS FIRST], [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Arguments: 100, [channel#110 ASC NULLS FIRST, return_rank#113 ASC NULLS FIRST, currency_rank#114 ASC NULLS FIRST], [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt index c15f2394e1a44..e156919a29dd1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (22) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union + Union [channel,item,return_ratio,return_rank,currency_rank] WholeStageCodegen (7) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt index 55bd25c501294..811082c1c0844 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt @@ -118,333 +118,337 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union +Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +Output [2]: [d_date_sk#27, d_date#28] 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-06), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [d_date_sk#27, d_date#28] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 11192)) AND (d_date#22 <= 11206)) AND isnotnull(d_date_sk#21)) +Input [2]: [d_date_sk#27, d_date#28] +Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 11192)) AND (d_date#28 <= 11206)) AND isnotnull(d_date_sk#27)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [d_date_sk#27] +Input [2]: [d_date_sk#27, d_date#28] (14) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#6] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#22] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] -Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] +Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] +Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] (17) Scan parquet default.store -Output [2]: [s_store_sk#24, s_store_id#25] +Output [2]: [s_store_sk#30, s_store_id#31] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] +Input [2]: [s_store_sk#30, s_store_id#31] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] -Condition : isnotnull(s_store_sk#24) +Input [2]: [s_store_sk#30, s_store_id#31] +Condition : isnotnull(s_store_sk#30) (20) BroadcastExchange -Input [2]: [s_store_sk#24, s_store_id#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] +Input [2]: [s_store_sk#30, s_store_id#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#5] -Right keys [1]: [cast(s_store_sk#24 as bigint)] +Left keys [1]: [store_sk#21] +Right keys [1]: [cast(s_store_sk#30 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] +Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Keys [1]: [s_store_id#25] -Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] -Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Keys [1]: [s_store_id#31] +Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] +Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] (24) Exchange -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Keys [1]: [s_store_id#25] -Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#40, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS RETURNS#41, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#42, store channel AS channel#43, concat(store, s_store_id#25) AS id#44] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Keys [1]: [s_store_id#31] +Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#46, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS RETURNS#47, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#48, store channel AS channel#49, concat(store, s_store_id#31) AS id#50] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] -Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] -Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (34) Union +Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#50] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [date_sk#72] +Right keys [1]: [d_date_sk#27] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] -Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] +Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] +Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Condition : isnotnull(cp_catalog_page_sk#65) +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Condition : isnotnull(cp_catalog_page_sk#77) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#49] -Right keys [1]: [cp_catalog_page_sk#65] +Left keys [1]: [page_sk#71] +Right keys [1]: [cp_catalog_page_sk#77] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] -Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] +Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] (45) Exchange -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#81, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS RETURNS#82, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#66) AS id#85] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#93, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS RETURNS#94, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#95, catalog channel AS channel#96, concat(catalog_page, cp_catalog_page_id#78) AS id#97] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] -Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] (53) Filter [codegen id : 14] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Condition : isnotnull(wr_returned_date_sk#96) +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Condition : isnotnull(wr_returned_date_sk#108) (54) Exchange -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Arguments: hashpartitioning(wr_item_sk#97, wr_order_number#98, 5), true, [id=#101] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Arguments: hashpartitioning(wr_item_sk#109, wr_order_number#110, 5), true, [id=#113] (55) Sort [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Arguments: [wr_item_sk#97 ASC NULLS FIRST, wr_order_number#98 ASC NULLS FIRST], false, 0 +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Arguments: [wr_item_sk#109 ASC NULLS FIRST, wr_order_number#110 ASC NULLS FIRST], false, 0 (56) Scan parquet default.web_sales -Output [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Output [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (57) ColumnarToRow [codegen id : 16] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] (58) Filter [codegen id : 16] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Condition : ((isnotnull(ws_item_sk#102) AND isnotnull(ws_order_number#103)) AND isnotnull(ws_web_site_sk#87)) +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Condition : ((isnotnull(ws_item_sk#114) AND isnotnull(ws_order_number#115)) AND isnotnull(ws_web_site_sk#99)) (59) Exchange -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Arguments: hashpartitioning(cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint), 5), true, [id=#104] +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Arguments: hashpartitioning(cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint), 5), true, [id=#116] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Arguments: [cast(ws_item_sk#102 as bigint) ASC NULLS FIRST, cast(ws_order_number#103 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Arguments: [cast(ws_item_sk#114 as bigint) ASC NULLS FIRST, cast(ws_order_number#115 as bigint) ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#97, wr_order_number#98] -Right keys [2]: [cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint)] +Left keys [2]: [wr_item_sk#109, wr_order_number#110] +Right keys [2]: [cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint)] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#105, wr_returned_date_sk#96 AS date_sk#106, 0.00 AS sales_price#107, 0.00 AS profit#108, wr_return_amt#99 AS return_amt#109, wr_net_loss#100 AS net_loss#110] -Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#117, wr_returned_date_sk#108 AS date_sk#118, 0.00 AS sales_price#119, 0.00 AS profit#120, wr_return_amt#111 AS return_amt#121, wr_net_loss#112 AS net_loss#122] +Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] (63) Union +Arguments: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128] (64) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (65) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#91] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#124] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (66) Project [codegen id : 21] -Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] -Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] +Output [5]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128] +Input [7]: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128, d_date_sk#27] (67) Scan parquet default.web_site -Output [2]: [web_site_sk#111, web_site_id#112] +Output [2]: [web_site_sk#129, web_site_id#130] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (68) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#111, web_site_id#112] +Input [2]: [web_site_sk#129, web_site_id#130] (69) Filter [codegen id : 20] -Input [2]: [web_site_sk#111, web_site_id#112] -Condition : isnotnull(web_site_sk#111) +Input [2]: [web_site_sk#129, web_site_id#130] +Condition : isnotnull(web_site_sk#129) (70) BroadcastExchange -Input [2]: [web_site_sk#111, web_site_id#112] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#113] +Input [2]: [web_site_sk#129, web_site_id#130] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#131] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#90] -Right keys [1]: [web_site_sk#111] +Left keys [1]: [wsr_web_site_sk#123] +Right keys [1]: [web_site_sk#129] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] -Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#111, web_site_id#112] +Output [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] +Input [7]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_sk#129, web_site_id#130] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] -Keys [1]: [web_site_id#112] -Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum#114, sum#115, sum#116, sum#117] -Results [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Input [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] +Keys [1]: [web_site_id#130] +Functions [4]: [partial_sum(UnscaledValue(sales_price#125)), partial_sum(UnscaledValue(return_amt#127)), partial_sum(UnscaledValue(profit#126)), partial_sum(UnscaledValue(net_loss#128))] +Aggregate Attributes [4]: [sum#132, sum#133, sum#134, sum#135] +Results [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] (74) Exchange -Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] -Arguments: hashpartitioning(web_site_id#112, 5), true, [id=#122] +Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Arguments: hashpartitioning(web_site_id#130, 5), true, [id=#140] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] -Keys [1]: [web_site_id#112] -Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#123, sum(UnscaledValue(return_amt#94))#124, sum(UnscaledValue(profit#93))#125, sum(UnscaledValue(net_loss#95))#126] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#92))#123,17,2) AS sales#127, MakeDecimal(sum(UnscaledValue(return_amt#94))#124,17,2) AS RETURNS#128, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#125,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#126,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#129, web channel AS channel#130, concat(web_site, web_site_id#112) AS id#131] +Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Keys [1]: [web_site_id#130] +Functions [4]: [sum(UnscaledValue(sales_price#125)), sum(UnscaledValue(return_amt#127)), sum(UnscaledValue(profit#126)), sum(UnscaledValue(net_loss#128))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#125))#141, sum(UnscaledValue(return_amt#127))#142, sum(UnscaledValue(profit#126))#143, sum(UnscaledValue(net_loss#128))#144] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#125))#141,17,2) AS sales#145, MakeDecimal(sum(UnscaledValue(return_amt#127))#142,17,2) AS RETURNS#146, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#126))#143,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#128))#144,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#147, web channel AS channel#148, concat(web_site, web_site_id#130) AS id#149] (76) Union +Arguments: [sales#150, returns#151, profit#152, channel#153, id#154] (77) Expand [codegen id : 23] -Input [5]: [sales#40, RETURNS#41, profit#42, channel#43, id#44] -Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#132, id#133, spark_grouping_id#134] +Input [5]: [sales#150, returns#151, profit#152, channel#153, id#154] +Arguments: [List(sales#150, returns#151, profit#152, channel#153, id#154, 0), List(sales#150, returns#151, profit#152, channel#153, null, 1), List(sales#150, returns#151, profit#152, null, null, 3)], [sales#150, returns#151, profit#152, channel#155, id#156, spark_grouping_id#157] (78) HashAggregate [codegen id : 23] -Input [6]: [sales#40, returns#41, profit#42, channel#132, id#133, spark_grouping_id#134] -Keys [3]: [channel#132, id#133, spark_grouping_id#134] -Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] -Aggregate Attributes [6]: [sum#135, isEmpty#136, sum#137, isEmpty#138, sum#139, isEmpty#140] -Results [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] +Input [6]: [sales#150, returns#151, profit#152, channel#155, id#156, spark_grouping_id#157] +Keys [3]: [channel#155, id#156, spark_grouping_id#157] +Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] +Aggregate Attributes [6]: [sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] +Results [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] (79) Exchange -Input [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] -Arguments: hashpartitioning(channel#132, id#133, spark_grouping_id#134, 5), true, [id=#147] +Input [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Arguments: hashpartitioning(channel#155, id#156, spark_grouping_id#157, 5), true, [id=#170] (80) HashAggregate [codegen id : 24] -Input [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] -Keys [3]: [channel#132, id#133, spark_grouping_id#134] -Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] -Aggregate Attributes [3]: [sum(sales#40)#148, sum(returns#41)#149, sum(profit#42)#150] -Results [5]: [channel#132, id#133, sum(sales#40)#148 AS sales#151, sum(returns#41)#149 AS returns#152, sum(profit#42)#150 AS profit#153] +Input [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Keys [3]: [channel#155, id#156, spark_grouping_id#157] +Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] +Aggregate Attributes [3]: [sum(sales#150)#171, sum(returns#151)#172, sum(profit#152)#173] +Results [5]: [channel#155, id#156, sum(sales#150)#171 AS sales#174, sum(returns#151)#172 AS returns#175, sum(profit#152)#173 AS profit#176] (81) TakeOrderedAndProject -Input [5]: [channel#132, id#133, sales#151, returns#152, profit#153] -Arguments: 100, [channel#132 ASC NULLS FIRST, id#133 ASC NULLS FIRST], [channel#132, id#133, sales#151, returns#152, profit#153] +Input [5]: [channel#155, id#156, sales#174, returns#175, profit#176] +Arguments: 100, [channel#155 ASC NULLS FIRST, id#156 ASC NULLS FIRST], [channel#155, id#156, sales#174, returns#175, profit#176] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt index 80b07a3712d36..1317d75129924 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] InputAdapter @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -58,7 +58,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -91,7 +91,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt index 15f0cda0b5f9f..2521aee61eaa7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt @@ -115,321 +115,325 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union +Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +Output [2]: [d_date_sk#27, d_date#28] 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-06), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [d_date_sk#27, d_date#28] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 11192)) AND (d_date#22 <= 11206)) AND isnotnull(d_date_sk#21)) +Input [2]: [d_date_sk#27, d_date#28] +Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 11192)) AND (d_date#28 <= 11206)) AND isnotnull(d_date_sk#27)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [d_date_sk#27] +Input [2]: [d_date_sk#27, d_date#28] (14) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#6] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#22] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] -Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] +Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] +Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] (17) Scan parquet default.store -Output [2]: [s_store_sk#24, s_store_id#25] +Output [2]: [s_store_sk#30, s_store_id#31] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] +Input [2]: [s_store_sk#30, s_store_id#31] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] -Condition : isnotnull(s_store_sk#24) +Input [2]: [s_store_sk#30, s_store_id#31] +Condition : isnotnull(s_store_sk#30) (20) BroadcastExchange -Input [2]: [s_store_sk#24, s_store_id#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] +Input [2]: [s_store_sk#30, s_store_id#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#5] -Right keys [1]: [cast(s_store_sk#24 as bigint)] +Left keys [1]: [store_sk#21] +Right keys [1]: [cast(s_store_sk#30 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] +Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Keys [1]: [s_store_id#25] -Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] -Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Keys [1]: [s_store_id#31] +Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] +Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] (24) Exchange -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Keys [1]: [s_store_id#25] -Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#40, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS RETURNS#41, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#42, store channel AS channel#43, concat(store, s_store_id#25) AS id#44] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Keys [1]: [s_store_id#31] +Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#46, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS RETURNS#47, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#48, store channel AS channel#49, concat(store, s_store_id#31) AS id#50] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] -Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] -Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (34) Union +Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#50] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [date_sk#72] +Right keys [1]: [d_date_sk#27] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] -Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] +Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] +Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Condition : isnotnull(cp_catalog_page_sk#65) +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Condition : isnotnull(cp_catalog_page_sk#77) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#49] -Right keys [1]: [cp_catalog_page_sk#65] +Left keys [1]: [page_sk#71] +Right keys [1]: [cp_catalog_page_sk#77] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] -Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] +Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] (45) Exchange -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#81, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS RETURNS#82, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#66) AS id#85] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#93, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS RETURNS#94, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#95, catalog channel AS channel#96, concat(catalog_page, cp_catalog_page_id#78) AS id#97] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] -Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] (53) Filter [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Condition : isnotnull(wr_returned_date_sk#96) +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Condition : isnotnull(wr_returned_date_sk#108) (54) Scan parquet default.web_sales -Output [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Output [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 14] -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] (56) Filter [codegen id : 14] -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] -Condition : ((isnotnull(ws_item_sk#101) AND isnotnull(ws_order_number#102)) AND isnotnull(ws_web_site_sk#87)) +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Condition : ((isnotnull(ws_item_sk#113) AND isnotnull(ws_order_number#114)) AND isnotnull(ws_web_site_sk#99)) (57) BroadcastExchange -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#103] +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#115] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#97, wr_order_number#98] -Right keys [2]: [cast(ws_item_sk#101 as bigint), cast(ws_order_number#102 as bigint)] +Left keys [2]: [wr_item_sk#109, wr_order_number#110] +Right keys [2]: [cast(ws_item_sk#113 as bigint), cast(ws_order_number#114 as bigint)] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#104, wr_returned_date_sk#96 AS date_sk#105, 0.00 AS sales_price#106, 0.00 AS profit#107, wr_return_amt#99 AS return_amt#108, wr_net_loss#100 AS net_loss#109] -Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#116, wr_returned_date_sk#108 AS date_sk#117, 0.00 AS sales_price#118, 0.00 AS profit#119, wr_return_amt#111 AS return_amt#120, wr_net_loss#112 AS net_loss#121] +Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] (60) Union +Arguments: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127] (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#91] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#123] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] -Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] +Output [5]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127] +Input [7]: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127, d_date_sk#27] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#110, web_site_id#111] +Output [2]: [web_site_sk#128, web_site_id#129] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#110, web_site_id#111] +Input [2]: [web_site_sk#128, web_site_id#129] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#110, web_site_id#111] -Condition : isnotnull(web_site_sk#110) +Input [2]: [web_site_sk#128, web_site_id#129] +Condition : isnotnull(web_site_sk#128) (67) BroadcastExchange -Input [2]: [web_site_sk#110, web_site_id#111] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#112] +Input [2]: [web_site_sk#128, web_site_id#129] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#130] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#90] -Right keys [1]: [web_site_sk#110] +Left keys [1]: [wsr_web_site_sk#122] +Right keys [1]: [web_site_sk#128] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] -Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#110, web_site_id#111] +Output [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] +Input [7]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_sk#128, web_site_id#129] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] -Keys [1]: [web_site_id#111] -Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum#113, sum#114, sum#115, sum#116] -Results [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Input [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] +Keys [1]: [web_site_id#129] +Functions [4]: [partial_sum(UnscaledValue(sales_price#124)), partial_sum(UnscaledValue(return_amt#126)), partial_sum(UnscaledValue(profit#125)), partial_sum(UnscaledValue(net_loss#127))] +Aggregate Attributes [4]: [sum#131, sum#132, sum#133, sum#134] +Results [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] (71) Exchange -Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] -Arguments: hashpartitioning(web_site_id#111, 5), true, [id=#121] +Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Arguments: hashpartitioning(web_site_id#129, 5), true, [id=#139] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] -Keys [1]: [web_site_id#111] -Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#122, sum(UnscaledValue(return_amt#94))#123, sum(UnscaledValue(profit#93))#124, sum(UnscaledValue(net_loss#95))#125] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#92))#122,17,2) AS sales#126, MakeDecimal(sum(UnscaledValue(return_amt#94))#123,17,2) AS RETURNS#127, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#124,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#125,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#128, web channel AS channel#129, concat(web_site, web_site_id#111) AS id#130] +Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Keys [1]: [web_site_id#129] +Functions [4]: [sum(UnscaledValue(sales_price#124)), sum(UnscaledValue(return_amt#126)), sum(UnscaledValue(profit#125)), sum(UnscaledValue(net_loss#127))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#124))#140, sum(UnscaledValue(return_amt#126))#141, sum(UnscaledValue(profit#125))#142, sum(UnscaledValue(net_loss#127))#143] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#124))#140,17,2) AS sales#144, MakeDecimal(sum(UnscaledValue(return_amt#126))#141,17,2) AS RETURNS#145, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#125))#142,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#127))#143,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#146, web channel AS channel#147, concat(web_site, web_site_id#129) AS id#148] (73) Union +Arguments: [sales#149, returns#150, profit#151, channel#152, id#153] (74) Expand [codegen id : 20] -Input [5]: [sales#40, RETURNS#41, profit#42, channel#43, id#44] -Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#131, id#132, spark_grouping_id#133] +Input [5]: [sales#149, returns#150, profit#151, channel#152, id#153] +Arguments: [List(sales#149, returns#150, profit#151, channel#152, id#153, 0), List(sales#149, returns#150, profit#151, channel#152, null, 1), List(sales#149, returns#150, profit#151, null, null, 3)], [sales#149, returns#150, profit#151, channel#154, id#155, spark_grouping_id#156] (75) HashAggregate [codegen id : 20] -Input [6]: [sales#40, returns#41, profit#42, channel#131, id#132, spark_grouping_id#133] -Keys [3]: [channel#131, id#132, spark_grouping_id#133] -Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] -Aggregate Attributes [6]: [sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] -Results [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] +Input [6]: [sales#149, returns#150, profit#151, channel#154, id#155, spark_grouping_id#156] +Keys [3]: [channel#154, id#155, spark_grouping_id#156] +Functions [3]: [partial_sum(sales#149), partial_sum(returns#150), partial_sum(profit#151)] +Aggregate Attributes [6]: [sum#157, isEmpty#158, sum#159, isEmpty#160, sum#161, isEmpty#162] +Results [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] (76) Exchange -Input [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] -Arguments: hashpartitioning(channel#131, id#132, spark_grouping_id#133, 5), true, [id=#146] +Input [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] +Arguments: hashpartitioning(channel#154, id#155, spark_grouping_id#156, 5), true, [id=#169] (77) HashAggregate [codegen id : 21] -Input [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] -Keys [3]: [channel#131, id#132, spark_grouping_id#133] -Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] -Aggregate Attributes [3]: [sum(sales#40)#147, sum(returns#41)#148, sum(profit#42)#149] -Results [5]: [channel#131, id#132, sum(sales#40)#147 AS sales#150, sum(returns#41)#148 AS returns#151, sum(profit#42)#149 AS profit#152] +Input [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] +Keys [3]: [channel#154, id#155, spark_grouping_id#156] +Functions [3]: [sum(sales#149), sum(returns#150), sum(profit#151)] +Aggregate Attributes [3]: [sum(sales#149)#170, sum(returns#150)#171, sum(profit#151)#172] +Results [5]: [channel#154, id#155, sum(sales#149)#170 AS sales#173, sum(returns#150)#171 AS returns#174, sum(profit#151)#172 AS profit#175] (78) TakeOrderedAndProject -Input [5]: [channel#131, id#132, sales#150, returns#151, profit#152] -Arguments: 100, [channel#131 ASC NULLS FIRST, id#132 ASC NULLS FIRST], [channel#131, id#132, sales#150, returns#151, profit#152] +Input [5]: [channel#154, id#155, sales#173, returns#174, profit#175] +Arguments: 100, [channel#154 ASC NULLS FIRST, id#155 ASC NULLS FIRST], [channel#154, id#155, sales#173, returns#174, profit#175] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt index 9b7cc3360367c..f50bfd019faf5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] InputAdapter @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -58,7 +58,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -91,7 +91,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt index d78565986bc0a..784e657f4dce2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt @@ -109,297 +109,298 @@ Output [3]: [ws_sold_date_sk#7 AS sold_date_sk#10, ws_bill_customer_sk#9 AS cust Input [3]: [ws_sold_date_sk#7, ws_item_sk#8, ws_bill_customer_sk#9] (9) Union +Arguments: [sold_date_sk#13, customer_sk#14, item_sk#15] (10) Scan parquet default.item -Output [3]: [i_item_sk#13, i_class#14, i_category#15] +Output [3]: [i_item_sk#16, i_class#17, i_category#18] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women), EqualTo(i_class,maternity), IsNotNull(i_item_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Input [3]: [i_item_sk#16, i_class#17, i_category#18] (12) Filter [codegen id : 3] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] -Condition : ((((isnotnull(i_category#15) AND isnotnull(i_class#14)) AND (i_category#15 = Women)) AND (i_class#14 = maternity)) AND isnotnull(i_item_sk#13)) +Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Condition : ((((isnotnull(i_category#18) AND isnotnull(i_class#17)) AND (i_category#18 = Women)) AND (i_class#17 = maternity)) AND isnotnull(i_item_sk#16)) (13) Project [codegen id : 3] -Output [1]: [i_item_sk#13] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Output [1]: [i_item_sk#16] +Input [3]: [i_item_sk#16, i_class#17, i_category#18] (14) BroadcastExchange -Input [1]: [i_item_sk#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [item_sk#6] -Right keys [1]: [i_item_sk#13] +Left keys [1]: [item_sk#15] +Right keys [1]: [i_item_sk#16] Join condition: None (16) Project [codegen id : 5] -Output [2]: [sold_date_sk#4, customer_sk#5] -Input [4]: [sold_date_sk#4, customer_sk#5, item_sk#6, i_item_sk#13] +Output [2]: [sold_date_sk#13, customer_sk#14] +Input [4]: [sold_date_sk#13, customer_sk#14, item_sk#15, i_item_sk#16] (17) Scan parquet default.date_dim -Output [3]: [d_date_sk#17, d_year#18, d_moy#19] +Output [3]: [d_date_sk#20, d_year#21, d_moy#22] 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), IsNotNull(d_date_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (19) Filter [codegen id : 4] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] -Condition : ((((isnotnull(d_moy#19) AND isnotnull(d_year#18)) AND (d_moy#19 = 12)) AND (d_year#18 = 1998)) AND isnotnull(d_date_sk#17)) +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 12)) AND (d_year#21 = 1998)) AND isnotnull(d_date_sk#20)) (20) Project [codegen id : 4] -Output [1]: [d_date_sk#17] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (21) BroadcastExchange -Input [1]: [d_date_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [sold_date_sk#4] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [sold_date_sk#13] +Right keys [1]: [d_date_sk#20] Join condition: None (23) Project [codegen id : 5] -Output [1]: [customer_sk#5] -Input [3]: [sold_date_sk#4, customer_sk#5, d_date_sk#17] +Output [1]: [customer_sk#14] +Input [3]: [sold_date_sk#13, customer_sk#14, d_date_sk#20] (24) Exchange -Input [1]: [customer_sk#5] -Arguments: hashpartitioning(customer_sk#5, 5), true, [id=#21] +Input [1]: [customer_sk#14] +Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#24] (25) Sort [codegen id : 6] -Input [1]: [customer_sk#5] -Arguments: [customer_sk#5 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#14] +Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 (26) Scan parquet default.customer -Output [2]: [c_customer_sk#22, c_current_addr_sk#23] +Output [2]: [c_customer_sk#25, c_current_addr_sk#26] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] (28) Filter [codegen id : 7] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Condition : (isnotnull(c_customer_sk#22) AND isnotnull(c_current_addr_sk#23)) +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Condition : (isnotnull(c_customer_sk#25) AND isnotnull(c_current_addr_sk#26)) (29) Exchange -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Arguments: hashpartitioning(c_customer_sk#22, 5), true, [id=#24] +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Arguments: hashpartitioning(c_customer_sk#25, 5), true, [id=#27] (30) Sort [codegen id : 8] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 (31) SortMergeJoin [codegen id : 9] -Left keys [1]: [customer_sk#5] -Right keys [1]: [c_customer_sk#22] +Left keys [1]: [customer_sk#14] +Right keys [1]: [c_customer_sk#25] Join condition: None (32) Project [codegen id : 9] -Output [2]: [c_customer_sk#22, c_current_addr_sk#23] -Input [3]: [customer_sk#5, c_customer_sk#22, c_current_addr_sk#23] +Output [2]: [c_customer_sk#25, c_current_addr_sk#26] +Input [3]: [customer_sk#14, c_customer_sk#25, c_current_addr_sk#26] (33) HashAggregate [codegen id : 9] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Keys [2]: [c_customer_sk#25, c_current_addr_sk#26] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#22, c_current_addr_sk#23] +Results [2]: [c_customer_sk#25, c_current_addr_sk#26] (34) HashAggregate [codegen id : 9] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Keys [2]: [c_customer_sk#25, c_current_addr_sk#26] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#22, c_current_addr_sk#23] +Results [2]: [c_customer_sk#25, c_current_addr_sk#26] (35) Sort [codegen id : 9] -Input [2]: [c_customer_sk#22, c_current_addr_sk#23] -Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 (36) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Output [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (37) ColumnarToRow [codegen id : 10] -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] (38) Filter [codegen id : 10] -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] -Condition : (isnotnull(ss_customer_sk#26) AND isnotnull(ss_sold_date_sk#25)) +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Condition : (isnotnull(ss_customer_sk#29) AND isnotnull(ss_sold_date_sk#28)) (39) Exchange -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#26, 5), true, [id=#28] +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Arguments: hashpartitioning(ss_customer_sk#29, 5), true, [id=#31] (40) Sort [codegen id : 11] -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] -Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Arguments: [ss_customer_sk#29 ASC NULLS FIRST], false, 0 (41) SortMergeJoin [codegen id : 12] -Left keys [1]: [c_customer_sk#22] -Right keys [1]: [ss_customer_sk#26] +Left keys [1]: [c_customer_sk#25] +Right keys [1]: [ss_customer_sk#29] Join condition: None (42) Project [codegen id : 12] -Output [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] -Input [5]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Output [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] +Input [5]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] (43) Exchange -Input [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] -Arguments: hashpartitioning(c_current_addr_sk#23, 5), true, [id=#29] +Input [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] +Arguments: hashpartitioning(c_current_addr_sk#26, 5), true, [id=#32] (44) Sort [codegen id : 13] -Input [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] -Arguments: [c_current_addr_sk#23 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] +Arguments: [c_current_addr_sk#26 ASC NULLS FIRST], false, 0 (45) Scan parquet default.customer_address -Output [3]: [ca_address_sk#30, ca_county#31, ca_state#32] +Output [3]: [ca_address_sk#33, ca_county#34, ca_state#35] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] ReadSchema: struct (46) ColumnarToRow [codegen id : 14] -Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] +Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] (47) Filter [codegen id : 14] -Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] -Condition : ((isnotnull(ca_address_sk#30) AND isnotnull(ca_county#31)) AND isnotnull(ca_state#32)) +Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] +Condition : ((isnotnull(ca_address_sk#33) AND isnotnull(ca_county#34)) AND isnotnull(ca_state#35)) (48) Exchange -Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] -Arguments: hashpartitioning(ca_address_sk#30, 5), true, [id=#33] +Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] +Arguments: hashpartitioning(ca_address_sk#33, 5), true, [id=#36] (49) Sort [codegen id : 15] -Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] -Arguments: [ca_address_sk#30 ASC NULLS FIRST], false, 0 +Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] +Arguments: [ca_address_sk#33 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 18] -Left keys [1]: [c_current_addr_sk#23] -Right keys [1]: [ca_address_sk#30] +Left keys [1]: [c_current_addr_sk#26] +Right keys [1]: [ca_address_sk#33] Join condition: None (51) Project [codegen id : 18] -Output [5]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#31, ca_state#32] -Input [7]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_address_sk#30, ca_county#31, ca_state#32] +Output [5]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#34, ca_state#35] +Input [7]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_address_sk#33, ca_county#34, ca_state#35] (52) Scan parquet default.store -Output [2]: [s_county#34, s_state#35] +Output [2]: [s_county#37, s_state#38] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] ReadSchema: struct (53) ColumnarToRow [codegen id : 16] -Input [2]: [s_county#34, s_state#35] +Input [2]: [s_county#37, s_state#38] (54) Filter [codegen id : 16] -Input [2]: [s_county#34, s_state#35] -Condition : (isnotnull(s_county#34) AND isnotnull(s_state#35)) +Input [2]: [s_county#37, s_state#38] +Condition : (isnotnull(s_county#37) AND isnotnull(s_state#38)) (55) BroadcastExchange -Input [2]: [s_county#34, s_state#35] -Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#36] +Input [2]: [s_county#37, s_state#38] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#39] (56) BroadcastHashJoin [codegen id : 18] -Left keys [2]: [ca_county#31, ca_state#32] -Right keys [2]: [s_county#34, s_state#35] +Left keys [2]: [ca_county#34, ca_state#35] +Right keys [2]: [s_county#37, s_state#38] Join condition: None (57) Project [codegen id : 18] -Output [3]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27] -Input [7]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#31, ca_state#32, s_county#34, s_state#35] +Output [3]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30] +Input [7]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#34, ca_state#35, s_county#37, s_state#38] (58) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_month_seq#37] +Output [2]: [d_date_sk#20, d_month_seq#40] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] ReadSchema: struct (59) ColumnarToRow [codegen id : 17] -Input [2]: [d_date_sk#17, d_month_seq#37] +Input [2]: [d_date_sk#20, d_month_seq#40] (60) Filter [codegen id : 17] -Input [2]: [d_date_sk#17, d_month_seq#37] -Condition : (((isnotnull(d_month_seq#37) AND (d_month_seq#37 >= Subquery scalar-subquery#38, [id=#39])) AND (d_month_seq#37 <= Subquery scalar-subquery#40, [id=#41])) AND isnotnull(d_date_sk#17)) +Input [2]: [d_date_sk#20, d_month_seq#40] +Condition : (((isnotnull(d_month_seq#40) AND (d_month_seq#40 >= Subquery scalar-subquery#41, [id=#42])) AND (d_month_seq#40 <= Subquery scalar-subquery#43, [id=#44])) AND isnotnull(d_date_sk#20)) (61) Project [codegen id : 17] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_month_seq#37] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_month_seq#40] (62) BroadcastExchange -Input [1]: [d_date_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#45] (63) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [ss_sold_date_sk#25] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [ss_sold_date_sk#28] +Right keys [1]: [d_date_sk#20] Join condition: None (64) Project [codegen id : 18] -Output [2]: [c_customer_sk#22, ss_ext_sales_price#27] -Input [4]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, d_date_sk#17] +Output [2]: [c_customer_sk#25, ss_ext_sales_price#30] +Input [4]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, d_date_sk#20] (65) HashAggregate [codegen id : 18] -Input [2]: [c_customer_sk#22, ss_ext_sales_price#27] -Keys [1]: [c_customer_sk#22] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#27))] -Aggregate Attributes [1]: [sum#43] -Results [2]: [c_customer_sk#22, sum#44] +Input [2]: [c_customer_sk#25, ss_ext_sales_price#30] +Keys [1]: [c_customer_sk#25] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#30))] +Aggregate Attributes [1]: [sum#46] +Results [2]: [c_customer_sk#25, sum#47] (66) Exchange -Input [2]: [c_customer_sk#22, sum#44] -Arguments: hashpartitioning(c_customer_sk#22, 5), true, [id=#45] +Input [2]: [c_customer_sk#25, sum#47] +Arguments: hashpartitioning(c_customer_sk#25, 5), true, [id=#48] (67) HashAggregate [codegen id : 19] -Input [2]: [c_customer_sk#22, sum#44] -Keys [1]: [c_customer_sk#22] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#27))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#27))#46] -Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#27))#46,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#47] +Input [2]: [c_customer_sk#25, sum#47] +Keys [1]: [c_customer_sk#25] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#30))#49] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#30))#49,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#50] (68) HashAggregate [codegen id : 19] -Input [1]: [segment#47] -Keys [1]: [segment#47] +Input [1]: [segment#50] +Keys [1]: [segment#50] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#48] -Results [2]: [segment#47, count#49] +Aggregate Attributes [1]: [count#51] +Results [2]: [segment#50, count#52] (69) Exchange -Input [2]: [segment#47, count#49] -Arguments: hashpartitioning(segment#47, 5), true, [id=#50] +Input [2]: [segment#50, count#52] +Arguments: hashpartitioning(segment#50, 5), true, [id=#53] (70) HashAggregate [codegen id : 20] -Input [2]: [segment#47, count#49] -Keys [1]: [segment#47] +Input [2]: [segment#50, count#52] +Keys [1]: [segment#50] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#51] -Results [3]: [segment#47, count(1)#51 AS num_customers#52, (segment#47 * 50) AS segment_base#53] +Aggregate Attributes [1]: [count(1)#54] +Results [3]: [segment#50, count(1)#54 AS num_customers#55, (segment#50 * 50) AS segment_base#56] (71) TakeOrderedAndProject -Input [3]: [segment#47, num_customers#52, segment_base#53] -Arguments: 100, [segment#47 ASC NULLS FIRST, num_customers#52 ASC NULLS FIRST], [segment#47, num_customers#52, segment_base#53] +Input [3]: [segment#50, num_customers#55, segment_base#56] +Arguments: 100, [segment#50 ASC NULLS FIRST, num_customers#55 ASC NULLS FIRST], [segment#50, num_customers#55, segment_base#56] ===== Subqueries ===== -Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#38, [id=#39] +Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#41, [id=#42] * HashAggregate (78) +- Exchange (77) +- * HashAggregate (76) @@ -410,42 +411,42 @@ Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquer (72) Scan parquet default.date_dim -Output [3]: [d_month_seq#37, d_year#18, d_moy#19] +Output [3]: [d_month_seq#40, d_year#21, d_moy#22] 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,12)] ReadSchema: struct (73) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] (74) Filter [codegen id : 1] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] -Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) (75) Project [codegen id : 1] -Output [1]: [(d_month_seq#37 + 1) AS (d_month_seq + 1)#54] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Output [1]: [(d_month_seq#40 + 1) AS (d_month_seq + 1)#57] +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] (76) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 1)#54] -Keys [1]: [(d_month_seq + 1)#54] +Input [1]: [(d_month_seq + 1)#57] +Keys [1]: [(d_month_seq + 1)#57] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#54] +Results [1]: [(d_month_seq + 1)#57] (77) Exchange -Input [1]: [(d_month_seq + 1)#54] -Arguments: hashpartitioning((d_month_seq + 1)#54, 5), true, [id=#55] +Input [1]: [(d_month_seq + 1)#57] +Arguments: hashpartitioning((d_month_seq + 1)#57, 5), true, [id=#58] (78) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 1)#54] -Keys [1]: [(d_month_seq + 1)#54] +Input [1]: [(d_month_seq + 1)#57] +Keys [1]: [(d_month_seq + 1)#57] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#54] +Results [1]: [(d_month_seq + 1)#57] -Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#40, [id=#41] +Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#43, [id=#44] * HashAggregate (85) +- Exchange (84) +- * HashAggregate (83) @@ -456,39 +457,39 @@ Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquer (79) Scan parquet default.date_dim -Output [3]: [d_month_seq#37, d_year#18, d_moy#19] +Output [3]: [d_month_seq#40, d_year#21, d_moy#22] 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,12)] ReadSchema: struct (80) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] (81) Filter [codegen id : 1] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] -Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) (82) Project [codegen id : 1] -Output [1]: [(d_month_seq#37 + 3) AS (d_month_seq + 3)#56] -Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Output [1]: [(d_month_seq#40 + 3) AS (d_month_seq + 3)#59] +Input [3]: [d_month_seq#40, d_year#21, d_moy#22] (83) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 3)#56] -Keys [1]: [(d_month_seq + 3)#56] +Input [1]: [(d_month_seq + 3)#59] +Keys [1]: [(d_month_seq + 3)#59] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#56] +Results [1]: [(d_month_seq + 3)#59] (84) Exchange -Input [1]: [(d_month_seq + 3)#56] -Arguments: hashpartitioning((d_month_seq + 3)#56, 5), true, [id=#57] +Input [1]: [(d_month_seq + 3)#59] +Arguments: hashpartitioning((d_month_seq + 3)#59, 5), true, [id=#60] (85) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 3)#56] -Keys [1]: [(d_month_seq + 3)#56] +Input [1]: [(d_month_seq + 3)#59] +Keys [1]: [(d_month_seq + 3)#59] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#56] +Results [1]: [(d_month_seq + 3)#59] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt index cb7130f53c9a9..1c1f3ecb168f1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt @@ -42,7 +42,7 @@ TakeOrderedAndProject [segment,num_customers,segment_base] Project [sold_date_sk,customer_sk] BroadcastHashJoin [item_sk,i_item_sk] InputAdapter - Union + Union [sold_date_sk,customer_sk,item_sk] WholeStageCodegen (1) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] Filter [cs_item_sk,cs_sold_date_sk,cs_bill_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt index 2e93e26056615..e967b975da37c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt @@ -102,269 +102,270 @@ Output [3]: [ws_sold_date_sk#7 AS sold_date_sk#10, ws_bill_customer_sk#9 AS cust Input [3]: [ws_sold_date_sk#7, ws_item_sk#8, ws_bill_customer_sk#9] (9) Union +Arguments: [sold_date_sk#13, customer_sk#14, item_sk#15] (10) Scan parquet default.item -Output [3]: [i_item_sk#13, i_class#14, i_category#15] +Output [3]: [i_item_sk#16, i_class#17, i_category#18] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women), EqualTo(i_class,maternity), IsNotNull(i_item_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Input [3]: [i_item_sk#16, i_class#17, i_category#18] (12) Filter [codegen id : 3] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] -Condition : ((((isnotnull(i_category#15) AND isnotnull(i_class#14)) AND (i_category#15 = Women)) AND (i_class#14 = maternity)) AND isnotnull(i_item_sk#13)) +Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Condition : ((((isnotnull(i_category#18) AND isnotnull(i_class#17)) AND (i_category#18 = Women)) AND (i_class#17 = maternity)) AND isnotnull(i_item_sk#16)) (13) Project [codegen id : 3] -Output [1]: [i_item_sk#13] -Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Output [1]: [i_item_sk#16] +Input [3]: [i_item_sk#16, i_class#17, i_category#18] (14) BroadcastExchange -Input [1]: [i_item_sk#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] (15) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [item_sk#6] -Right keys [1]: [i_item_sk#13] +Left keys [1]: [item_sk#15] +Right keys [1]: [i_item_sk#16] Join condition: None (16) Project [codegen id : 6] -Output [2]: [sold_date_sk#4, customer_sk#5] -Input [4]: [sold_date_sk#4, customer_sk#5, item_sk#6, i_item_sk#13] +Output [2]: [sold_date_sk#13, customer_sk#14] +Input [4]: [sold_date_sk#13, customer_sk#14, item_sk#15, i_item_sk#16] (17) Scan parquet default.date_dim -Output [3]: [d_date_sk#17, d_year#18, d_moy#19] +Output [3]: [d_date_sk#20, d_year#21, d_moy#22] 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), IsNotNull(d_date_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (19) Filter [codegen id : 4] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] -Condition : ((((isnotnull(d_moy#19) AND isnotnull(d_year#18)) AND (d_moy#19 = 12)) AND (d_year#18 = 1998)) AND isnotnull(d_date_sk#17)) +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 12)) AND (d_year#21 = 1998)) AND isnotnull(d_date_sk#20)) (20) Project [codegen id : 4] -Output [1]: [d_date_sk#17] -Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] (21) BroadcastExchange -Input [1]: [d_date_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sold_date_sk#4] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [sold_date_sk#13] +Right keys [1]: [d_date_sk#20] Join condition: None (23) Project [codegen id : 6] -Output [1]: [customer_sk#5] -Input [3]: [sold_date_sk#4, customer_sk#5, d_date_sk#17] +Output [1]: [customer_sk#14] +Input [3]: [sold_date_sk#13, customer_sk#14, d_date_sk#20] (24) Scan parquet default.customer -Output [2]: [c_customer_sk#21, c_current_addr_sk#22] +Output [2]: [c_customer_sk#24, c_current_addr_sk#25] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct (25) ColumnarToRow [codegen id : 5] -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] (26) Filter [codegen id : 5] -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] -Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_current_addr_sk#22)) +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Condition : (isnotnull(c_customer_sk#24) AND isnotnull(c_current_addr_sk#25)) (27) BroadcastExchange -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] (28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [customer_sk#5] -Right keys [1]: [c_customer_sk#21] +Left keys [1]: [customer_sk#14] +Right keys [1]: [c_customer_sk#24] Join condition: None (29) Project [codegen id : 6] -Output [2]: [c_customer_sk#21, c_current_addr_sk#22] -Input [3]: [customer_sk#5, c_customer_sk#21, c_current_addr_sk#22] +Output [2]: [c_customer_sk#24, c_current_addr_sk#25] +Input [3]: [customer_sk#14, c_customer_sk#24, c_current_addr_sk#25] (30) HashAggregate [codegen id : 6] -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] -Keys [2]: [c_customer_sk#21, c_current_addr_sk#22] +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Keys [2]: [c_customer_sk#24, c_current_addr_sk#25] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#21, c_current_addr_sk#22] +Results [2]: [c_customer_sk#24, c_current_addr_sk#25] (31) Exchange -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] -Arguments: hashpartitioning(c_customer_sk#21, c_current_addr_sk#22, 5), true, [id=#24] +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Arguments: hashpartitioning(c_customer_sk#24, c_current_addr_sk#25, 5), true, [id=#27] (32) HashAggregate [codegen id : 11] -Input [2]: [c_customer_sk#21, c_current_addr_sk#22] -Keys [2]: [c_customer_sk#21, c_current_addr_sk#22] +Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Keys [2]: [c_customer_sk#24, c_current_addr_sk#25] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#21, c_current_addr_sk#22] +Results [2]: [c_customer_sk#24, c_current_addr_sk#25] (33) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Output [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct (34) ColumnarToRow [codegen id : 7] -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] (35) Filter [codegen id : 7] -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] -Condition : (isnotnull(ss_customer_sk#26) AND isnotnull(ss_sold_date_sk#25)) +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Condition : (isnotnull(ss_customer_sk#29) AND isnotnull(ss_sold_date_sk#28)) (36) BroadcastExchange -Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#28] +Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [c_customer_sk#21] -Right keys [1]: [ss_customer_sk#26] +Left keys [1]: [c_customer_sk#24] +Right keys [1]: [ss_customer_sk#29] Join condition: None (38) Project [codegen id : 11] -Output [4]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27] -Input [5]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Output [4]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30] +Input [5]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] (39) Scan parquet default.customer_address -Output [3]: [ca_address_sk#29, ca_county#30, ca_state#31] +Output [3]: [ca_address_sk#32, ca_county#33, ca_state#34] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] ReadSchema: struct (40) ColumnarToRow [codegen id : 8] -Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] +Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] (41) Filter [codegen id : 8] -Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] -Condition : ((isnotnull(ca_address_sk#29) AND isnotnull(ca_county#30)) AND isnotnull(ca_state#31)) +Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] +Condition : ((isnotnull(ca_address_sk#32) AND isnotnull(ca_county#33)) AND isnotnull(ca_state#34)) (42) BroadcastExchange -Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#35] (43) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [c_current_addr_sk#22] -Right keys [1]: [ca_address_sk#29] +Left keys [1]: [c_current_addr_sk#25] +Right keys [1]: [ca_address_sk#32] Join condition: None (44) Project [codegen id : 11] -Output [5]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#30, ca_state#31] -Input [7]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_address_sk#29, ca_county#30, ca_state#31] +Output [5]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#33, ca_state#34] +Input [7]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_address_sk#32, ca_county#33, ca_state#34] (45) Scan parquet default.store -Output [2]: [s_county#33, s_state#34] +Output [2]: [s_county#36, s_state#37] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] ReadSchema: struct (46) ColumnarToRow [codegen id : 9] -Input [2]: [s_county#33, s_state#34] +Input [2]: [s_county#36, s_state#37] (47) Filter [codegen id : 9] -Input [2]: [s_county#33, s_state#34] -Condition : (isnotnull(s_county#33) AND isnotnull(s_state#34)) +Input [2]: [s_county#36, s_state#37] +Condition : (isnotnull(s_county#36) AND isnotnull(s_state#37)) (48) BroadcastExchange -Input [2]: [s_county#33, s_state#34] -Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#35] +Input [2]: [s_county#36, s_state#37] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#38] (49) BroadcastHashJoin [codegen id : 11] -Left keys [2]: [ca_county#30, ca_state#31] -Right keys [2]: [s_county#33, s_state#34] +Left keys [2]: [ca_county#33, ca_state#34] +Right keys [2]: [s_county#36, s_state#37] Join condition: None (50) Project [codegen id : 11] -Output [3]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27] -Input [7]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#30, ca_state#31, s_county#33, s_state#34] +Output [3]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30] +Input [7]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#33, ca_state#34, s_county#36, s_state#37] (51) Scan parquet default.date_dim -Output [2]: [d_date_sk#17, d_month_seq#36] +Output [2]: [d_date_sk#20, d_month_seq#39] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#17, d_month_seq#36] +Input [2]: [d_date_sk#20, d_month_seq#39] (53) Filter [codegen id : 10] -Input [2]: [d_date_sk#17, d_month_seq#36] -Condition : (((isnotnull(d_month_seq#36) AND (d_month_seq#36 >= Subquery scalar-subquery#37, [id=#38])) AND (d_month_seq#36 <= Subquery scalar-subquery#39, [id=#40])) AND isnotnull(d_date_sk#17)) +Input [2]: [d_date_sk#20, d_month_seq#39] +Condition : (((isnotnull(d_month_seq#39) AND (d_month_seq#39 >= Subquery scalar-subquery#40, [id=#41])) AND (d_month_seq#39 <= Subquery scalar-subquery#42, [id=#43])) AND isnotnull(d_date_sk#20)) (54) Project [codegen id : 10] -Output [1]: [d_date_sk#17] -Input [2]: [d_date_sk#17, d_month_seq#36] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_month_seq#39] (55) BroadcastExchange -Input [1]: [d_date_sk#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#41] +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] (56) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#25] -Right keys [1]: [d_date_sk#17] +Left keys [1]: [ss_sold_date_sk#28] +Right keys [1]: [d_date_sk#20] Join condition: None (57) Project [codegen id : 11] -Output [2]: [c_customer_sk#21, ss_ext_sales_price#27] -Input [4]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, d_date_sk#17] +Output [2]: [c_customer_sk#24, ss_ext_sales_price#30] +Input [4]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, d_date_sk#20] (58) HashAggregate [codegen id : 11] -Input [2]: [c_customer_sk#21, ss_ext_sales_price#27] -Keys [1]: [c_customer_sk#21] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#27))] -Aggregate Attributes [1]: [sum#42] -Results [2]: [c_customer_sk#21, sum#43] +Input [2]: [c_customer_sk#24, ss_ext_sales_price#30] +Keys [1]: [c_customer_sk#24] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#30))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [c_customer_sk#24, sum#46] (59) Exchange -Input [2]: [c_customer_sk#21, sum#43] -Arguments: hashpartitioning(c_customer_sk#21, 5), true, [id=#44] +Input [2]: [c_customer_sk#24, sum#46] +Arguments: hashpartitioning(c_customer_sk#24, 5), true, [id=#47] (60) HashAggregate [codegen id : 12] -Input [2]: [c_customer_sk#21, sum#43] -Keys [1]: [c_customer_sk#21] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#27))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#27))#45] -Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#27))#45,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#46] +Input [2]: [c_customer_sk#24, sum#46] +Keys [1]: [c_customer_sk#24] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#30))#48] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#30))#48,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#49] (61) HashAggregate [codegen id : 12] -Input [1]: [segment#46] -Keys [1]: [segment#46] +Input [1]: [segment#49] +Keys [1]: [segment#49] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#47] -Results [2]: [segment#46, count#48] +Aggregate Attributes [1]: [count#50] +Results [2]: [segment#49, count#51] (62) Exchange -Input [2]: [segment#46, count#48] -Arguments: hashpartitioning(segment#46, 5), true, [id=#49] +Input [2]: [segment#49, count#51] +Arguments: hashpartitioning(segment#49, 5), true, [id=#52] (63) HashAggregate [codegen id : 13] -Input [2]: [segment#46, count#48] -Keys [1]: [segment#46] +Input [2]: [segment#49, count#51] +Keys [1]: [segment#49] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#50] -Results [3]: [segment#46, count(1)#50 AS num_customers#51, (segment#46 * 50) AS segment_base#52] +Aggregate Attributes [1]: [count(1)#53] +Results [3]: [segment#49, count(1)#53 AS num_customers#54, (segment#49 * 50) AS segment_base#55] (64) TakeOrderedAndProject -Input [3]: [segment#46, num_customers#51, segment_base#52] -Arguments: 100, [segment#46 ASC NULLS FIRST, num_customers#51 ASC NULLS FIRST], [segment#46, num_customers#51, segment_base#52] +Input [3]: [segment#49, num_customers#54, segment_base#55] +Arguments: 100, [segment#49 ASC NULLS FIRST, num_customers#54 ASC NULLS FIRST], [segment#49, num_customers#54, segment_base#55] ===== Subqueries ===== -Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#37, [id=#38] +Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#40, [id=#41] * HashAggregate (71) +- Exchange (70) +- * HashAggregate (69) @@ -375,42 +376,42 @@ Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquer (65) Scan parquet default.date_dim -Output [3]: [d_month_seq#36, d_year#18, d_moy#19] +Output [3]: [d_month_seq#39, d_year#21, d_moy#22] 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,12)] ReadSchema: struct (66) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] (67) Filter [codegen id : 1] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] -Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) (68) Project [codegen id : 1] -Output [1]: [(d_month_seq#36 + 1) AS (d_month_seq + 1)#53] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Output [1]: [(d_month_seq#39 + 1) AS (d_month_seq + 1)#56] +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] (69) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 1)#53] -Keys [1]: [(d_month_seq + 1)#53] +Input [1]: [(d_month_seq + 1)#56] +Keys [1]: [(d_month_seq + 1)#56] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#53] +Results [1]: [(d_month_seq + 1)#56] (70) Exchange -Input [1]: [(d_month_seq + 1)#53] -Arguments: hashpartitioning((d_month_seq + 1)#53, 5), true, [id=#54] +Input [1]: [(d_month_seq + 1)#56] +Arguments: hashpartitioning((d_month_seq + 1)#56, 5), true, [id=#57] (71) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 1)#53] -Keys [1]: [(d_month_seq + 1)#53] +Input [1]: [(d_month_seq + 1)#56] +Keys [1]: [(d_month_seq + 1)#56] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#53] +Results [1]: [(d_month_seq + 1)#56] -Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#39, [id=#40] +Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#42, [id=#43] * HashAggregate (78) +- Exchange (77) +- * HashAggregate (76) @@ -421,39 +422,39 @@ Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquer (72) Scan parquet default.date_dim -Output [3]: [d_month_seq#36, d_year#18, d_moy#19] +Output [3]: [d_month_seq#39, d_year#21, d_moy#22] 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,12)] ReadSchema: struct (73) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] (74) Filter [codegen id : 1] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] -Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) (75) Project [codegen id : 1] -Output [1]: [(d_month_seq#36 + 3) AS (d_month_seq + 3)#55] -Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Output [1]: [(d_month_seq#39 + 3) AS (d_month_seq + 3)#58] +Input [3]: [d_month_seq#39, d_year#21, d_moy#22] (76) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 3)#55] -Keys [1]: [(d_month_seq + 3)#55] +Input [1]: [(d_month_seq + 3)#58] +Keys [1]: [(d_month_seq + 3)#58] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#55] +Results [1]: [(d_month_seq + 3)#58] (77) Exchange -Input [1]: [(d_month_seq + 3)#55] -Arguments: hashpartitioning((d_month_seq + 3)#55, 5), true, [id=#56] +Input [1]: [(d_month_seq + 3)#58] +Arguments: hashpartitioning((d_month_seq + 3)#58, 5), true, [id=#59] (78) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 3)#55] -Keys [1]: [(d_month_seq + 3)#55] +Input [1]: [(d_month_seq + 3)#58] +Keys [1]: [(d_month_seq + 3)#58] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#55] +Results [1]: [(d_month_seq + 3)#58] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt index dd92c52db4c7e..9e30650c82e2e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt @@ -30,7 +30,7 @@ TakeOrderedAndProject [segment,num_customers,segment_base] Project [sold_date_sk,customer_sk] BroadcastHashJoin [item_sk,i_item_sk] InputAdapter - Union + Union [sold_date_sk,customer_sk,item_sk] WholeStageCodegen (1) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] Filter [cs_item_sk,cs_sold_date_sk,cs_bill_customer_sk] 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..08dd4f8e2b568 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 @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#13, total_sales#22] -Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_item_id#13, sum#43, isEmpty#44] +Input [2]: [i_item_id#41, total_sales#42] +Keys [1]: [i_item_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_item_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Keys [1]: [i_item_id#13] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Keys [1]: [i_item_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_item_id#13, total_sales#47] -Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] +Input [2]: [i_item_id#41, total_sales#49] +Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] 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..d60caea0dd63d 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_item_id] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_item_id,total_sales] WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt index d0d64721100c3..08dd4f8e2b568 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#13, total_sales#22] -Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_item_id#13, sum#43, isEmpty#44] +Input [2]: [i_item_id#41, total_sales#42] +Keys [1]: [i_item_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_item_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Keys [1]: [i_item_id#13] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Keys [1]: [i_item_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_item_id#13, total_sales#47] -Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] +Input [2]: [i_item_id#41, total_sales#49] +Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt index 5825c6f6e757a..d60caea0dd63d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_item_id] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_item_id,total_sales] WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter 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..7ff60649a86ad 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 @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#13, total_sales#22] -Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_item_id#13, sum#43, isEmpty#44] +Input [2]: [i_item_id#41, total_sales#42] +Keys [1]: [i_item_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_item_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Keys [1]: [i_item_id#13] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Keys [1]: [i_item_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_item_id#13, total_sales#47] -Arguments: 100, [i_item_id#13 ASC NULLS FIRST, total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] +Input [2]: [i_item_id#41, total_sales#49] +Arguments: 100, [i_item_id#41 ASC NULLS FIRST, total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] 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..131be7594dba5 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [i_item_id,total_sales] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_item_id,total_sales] WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt index f838f8f1a18af..7ff60649a86ad 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt @@ -353,26 +353,27 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union +Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#13, total_sales#22] -Keys [1]: [i_item_id#13] -Functions [1]: [partial_sum(total_sales#22)] -Aggregate Attributes [2]: [sum#41, isEmpty#42] -Results [3]: [i_item_id#13, sum#43, isEmpty#44] +Input [2]: [i_item_id#41, total_sales#42] +Keys [1]: [i_item_id#41] +Functions [1]: [partial_sum(total_sales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [3]: [i_item_id#41, sum#45, isEmpty#46] (65) Exchange -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#13, sum#43, isEmpty#44] -Keys [1]: [i_item_id#13] -Functions [1]: [sum(total_sales#22)] -Aggregate Attributes [1]: [sum(total_sales#22)#46] -Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] +Input [3]: [i_item_id#41, sum#45, isEmpty#46] +Keys [1]: [i_item_id#41] +Functions [1]: [sum(total_sales#42)] +Aggregate Attributes [1]: [sum(total_sales#42)#48] +Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] (67) TakeOrderedAndProject -Input [2]: [i_item_id#13, total_sales#47] -Arguments: 100, [i_item_id#13 ASC NULLS FIRST, total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] +Input [2]: [i_item_id#41, total_sales#49] +Arguments: 100, [i_item_id#41 ASC NULLS FIRST, total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt index fb9e4e50775dd..131be7594dba5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [i_item_id,total_sales] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [i_item_id,total_sales] WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt index 5db04537d6371..20e9a17c06a80 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt @@ -285,26 +285,27 @@ Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((pro Results [32]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, DHL,BARIAN AS ship_carriers#301, d_year#15 AS year#302, sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#277 AS jan_sales#303, sum(CASE WHEN (d_moy#16 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#278 AS feb_sales#304, sum(CASE WHEN (d_moy#16 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#279 AS mar_sales#305, sum(CASE WHEN (d_moy#16 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#280 AS apr_sales#306, sum(CASE WHEN (d_moy#16 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#281 AS may_sales#307, sum(CASE WHEN (d_moy#16 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#282 AS jun_sales#308, sum(CASE WHEN (d_moy#16 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#283 AS jul_sales#309, sum(CASE WHEN (d_moy#16 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#284 AS aug_sales#310, sum(CASE WHEN (d_moy#16 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#285 AS sep_sales#311, sum(CASE WHEN (d_moy#16 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#286 AS oct_sales#312, sum(CASE WHEN (d_moy#16 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#287 AS nov_sales#313, sum(CASE WHEN (d_moy#16 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#288 AS dec_sales#314, sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#289 AS jan_net#315, sum(CASE WHEN (d_moy#16 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS feb_net#316, sum(CASE WHEN (d_moy#16 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS mar_net#317, sum(CASE WHEN (d_moy#16 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS apr_net#318, sum(CASE WHEN (d_moy#16 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS may_net#319, sum(CASE WHEN (d_moy#16 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS jun_net#320, sum(CASE WHEN (d_moy#16 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jul_net#321, sum(CASE WHEN (d_moy#16 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS aug_net#322, sum(CASE WHEN (d_moy#16 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS sep_net#323, sum(CASE WHEN (d_moy#16 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS oct_net#324, sum(CASE WHEN (d_moy#16 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS nov_net#325, sum(CASE WHEN (d_moy#16 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS dec_net#326] (51) Union +Arguments: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, ... 8 more fields] (52) HashAggregate [codegen id : 13] -Input [32]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#149, feb_sales#150, mar_sales#151, apr_sales#152, may_sales#153, jun_sales#154, jul_sales#155, aug_sales#156, sep_sales#157, oct_sales#158, nov_sales#159, dec_sales#160, jan_net#161, feb_net#162, mar_net#163, apr_net#164, may_net#165, jun_net#166, jul_net#167, aug_net#168, sep_net#169, oct_net#170, nov_net#171, dec_net#172] -Keys [8]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148] -Functions [36]: [partial_sum(jan_sales#149), partial_sum(feb_sales#150), partial_sum(mar_sales#151), partial_sum(apr_sales#152), partial_sum(may_sales#153), partial_sum(jun_sales#154), partial_sum(jul_sales#155), partial_sum(aug_sales#156), partial_sum(sep_sales#157), partial_sum(oct_sales#158), partial_sum(nov_sales#159), partial_sum(dec_sales#160), partial_sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#161), partial_sum(feb_net#162), partial_sum(mar_net#163), partial_sum(apr_net#164), partial_sum(may_net#165), partial_sum(jun_net#166), partial_sum(jul_net#167), partial_sum(aug_net#168), partial_sum(sep_net#169), partial_sum(oct_net#170), partial_sum(nov_net#171), partial_sum(dec_net#172)] -Aggregate Attributes [72]: [sum#327, isEmpty#328, sum#329, isEmpty#330, sum#331, isEmpty#332, sum#333, isEmpty#334, sum#335, isEmpty#336, sum#337, isEmpty#338, sum#339, isEmpty#340, sum#341, isEmpty#342, sum#343, isEmpty#344, sum#345, isEmpty#346, sum#347, isEmpty#348, sum#349, isEmpty#350, sum#351, isEmpty#352, sum#353, isEmpty#354, sum#355, isEmpty#356, sum#357, isEmpty#358, sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398] -Results [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Input [32]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, may_net#351, jun_net#352, jul_net#353, aug_net#354, sep_net#355, oct_net#356, nov_net#357, dec_net#358] +Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] +Functions [36]: [partial_sum(jan_sales#335), partial_sum(feb_sales#336), partial_sum(mar_sales#337), partial_sum(apr_sales#338), partial_sum(may_sales#339), partial_sum(jun_sales#340), partial_sum(jul_sales#341), partial_sum(aug_sales#342), partial_sum(sep_sales#343), partial_sum(oct_sales#344), partial_sum(nov_sales#345), partial_sum(dec_sales#346), partial_sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#347), partial_sum(feb_net#348), partial_sum(mar_net#349), partial_sum(apr_net#350), partial_sum(may_net#351), partial_sum(jun_net#352), partial_sum(jul_net#353), partial_sum(aug_net#354), partial_sum(sep_net#355), partial_sum(oct_net#356), partial_sum(nov_net#357), partial_sum(dec_net#358)] +Aggregate Attributes [72]: [sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430] +Results [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] (53) Exchange -Input [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] -Arguments: hashpartitioning(w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, 5), true, [id=#471] +Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Arguments: hashpartitioning(w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, 5), true, [id=#503] (54) HashAggregate [codegen id : 14] -Input [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] -Keys [8]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148] -Functions [36]: [sum(jan_sales#149), sum(feb_sales#150), sum(mar_sales#151), sum(apr_sales#152), sum(may_sales#153), sum(jun_sales#154), sum(jul_sales#155), sum(aug_sales#156), sum(sep_sales#157), sum(oct_sales#158), sum(nov_sales#159), sum(dec_sales#160), sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#161), sum(feb_net#162), sum(mar_net#163), sum(apr_net#164), sum(may_net#165), sum(jun_net#166), sum(jul_net#167), sum(aug_net#168), sum(sep_net#169), sum(oct_net#170), sum(nov_net#171), sum(dec_net#172)] -Aggregate Attributes [36]: [sum(jan_sales#149)#472, sum(feb_sales#150)#473, sum(mar_sales#151)#474, sum(apr_sales#152)#475, sum(may_sales#153)#476, sum(jun_sales#154)#477, sum(jul_sales#155)#478, sum(aug_sales#156)#479, sum(sep_sales#157)#480, sum(oct_sales#158)#481, sum(nov_sales#159)#482, sum(dec_sales#160)#483, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495, sum(jan_net#161)#496, sum(feb_net#162)#497, sum(mar_net#163)#498, sum(apr_net#164)#499, sum(may_net#165)#500, sum(jun_net#166)#501, sum(jul_net#167)#502, sum(aug_net#168)#503, sum(sep_net#169)#504, sum(oct_net#170)#505, sum(nov_net#171)#506, sum(dec_net#172)#507] -Results [44]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum(jan_sales#149)#472 AS jan_sales#508, sum(feb_sales#150)#473 AS feb_sales#509, sum(mar_sales#151)#474 AS mar_sales#510, sum(apr_sales#152)#475 AS apr_sales#511, sum(may_sales#153)#476 AS may_sales#512, sum(jun_sales#154)#477 AS jun_sales#513, sum(jul_sales#155)#478 AS jul_sales#514, sum(aug_sales#156)#479 AS aug_sales#515, sum(sep_sales#157)#480 AS sep_sales#516, sum(oct_sales#158)#481 AS oct_sales#517, sum(nov_sales#159)#482 AS nov_sales#518, sum(dec_sales#160)#483 AS dec_sales#519, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484 AS jan_sales_per_sq_foot#520, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485 AS feb_sales_per_sq_foot#521, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486 AS mar_sales_per_sq_foot#522, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487 AS apr_sales_per_sq_foot#523, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488 AS may_sales_per_sq_foot#524, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489 AS jun_sales_per_sq_foot#525, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490 AS jul_sales_per_sq_foot#526, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491 AS aug_sales_per_sq_foot#527, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492 AS sep_sales_per_sq_foot#528, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493 AS oct_sales_per_sq_foot#529, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494 AS nov_sales_per_sq_foot#530, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495 AS dec_sales_per_sq_foot#531, sum(jan_net#161)#496 AS jan_net#532, sum(feb_net#162)#497 AS feb_net#533, sum(mar_net#163)#498 AS mar_net#534, sum(apr_net#164)#499 AS apr_net#535, sum(may_net#165)#500 AS may_net#536, sum(jun_net#166)#501 AS jun_net#537, sum(jul_net#167)#502 AS jul_net#538, sum(aug_net#168)#503 AS aug_net#539, sum(sep_net#169)#504 AS sep_net#540, sum(oct_net#170)#505 AS oct_net#541, sum(nov_net#171)#506 AS nov_net#542, sum(dec_net#172)#507 AS dec_net#543] +Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] +Functions [36]: [sum(jan_sales#335), sum(feb_sales#336), sum(mar_sales#337), sum(apr_sales#338), sum(may_sales#339), sum(jun_sales#340), sum(jul_sales#341), sum(aug_sales#342), sum(sep_sales#343), sum(oct_sales#344), sum(nov_sales#345), sum(dec_sales#346), sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#347), sum(feb_net#348), sum(mar_net#349), sum(apr_net#350), sum(may_net#351), sum(jun_net#352), sum(jul_net#353), sum(aug_net#354), sum(sep_net#355), sum(oct_net#356), sum(nov_net#357), sum(dec_net#358)] +Aggregate Attributes [36]: [sum(jan_sales#335)#504, sum(feb_sales#336)#505, sum(mar_sales#337)#506, sum(apr_sales#338)#507, sum(may_sales#339)#508, sum(jun_sales#340)#509, sum(jul_sales#341)#510, sum(aug_sales#342)#511, sum(sep_sales#343)#512, sum(oct_sales#344)#513, sum(nov_sales#345)#514, sum(dec_sales#346)#515, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527, sum(jan_net#347)#528, sum(feb_net#348)#529, sum(mar_net#349)#530, sum(apr_net#350)#531, sum(may_net#351)#532, sum(jun_net#352)#533, sum(jul_net#353)#534, sum(aug_net#354)#535, sum(sep_net#355)#536, sum(oct_net#356)#537, sum(nov_net#357)#538, sum(dec_net#358)#539] +Results [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum(jan_sales#335)#504 AS jan_sales#540, sum(feb_sales#336)#505 AS feb_sales#541, sum(mar_sales#337)#506 AS mar_sales#542, sum(apr_sales#338)#507 AS apr_sales#543, sum(may_sales#339)#508 AS may_sales#544, sum(jun_sales#340)#509 AS jun_sales#545, sum(jul_sales#341)#510 AS jul_sales#546, sum(aug_sales#342)#511 AS aug_sales#547, sum(sep_sales#343)#512 AS sep_sales#548, sum(oct_sales#344)#513 AS oct_sales#549, sum(nov_sales#345)#514 AS nov_sales#550, sum(dec_sales#346)#515 AS dec_sales#551, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516 AS jan_sales_per_sq_foot#552, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517 AS feb_sales_per_sq_foot#553, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518 AS mar_sales_per_sq_foot#554, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519 AS apr_sales_per_sq_foot#555, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520 AS may_sales_per_sq_foot#556, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521 AS jun_sales_per_sq_foot#557, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522 AS jul_sales_per_sq_foot#558, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523 AS aug_sales_per_sq_foot#559, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524 AS sep_sales_per_sq_foot#560, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525 AS oct_sales_per_sq_foot#561, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526 AS nov_sales_per_sq_foot#562, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527 AS dec_sales_per_sq_foot#563, sum(jan_net#347)#528 AS jan_net#564, sum(feb_net#348)#529 AS feb_net#565, sum(mar_net#349)#530 AS mar_net#566, sum(apr_net#350)#531 AS apr_net#567, sum(may_net#351)#532 AS may_net#568, sum(jun_net#352)#533 AS jun_net#569, sum(jul_net#353)#534 AS jul_net#570, sum(aug_net#354)#535 AS aug_net#571, sum(sep_net#355)#536 AS sep_net#572, sum(oct_net#356)#537 AS oct_net#573, sum(nov_net#357)#538 AS nov_net#574, sum(dec_net#358)#539 AS dec_net#575] (55) TakeOrderedAndProject -Input [44]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, may_sales_per_sq_foot#524, jun_sales_per_sq_foot#525, jul_sales_per_sq_foot#526, aug_sales_per_sq_foot#527, sep_sales_per_sq_foot#528, oct_sales_per_sq_foot#529, nov_sales_per_sq_foot#530, dec_sales_per_sq_foot#531, jan_net#532, feb_net#533, mar_net#534, apr_net#535, may_net#536, jun_net#537, jul_net#538, aug_net#539, sep_net#540, oct_net#541, nov_net#542, dec_net#543] -Arguments: 100, [w_warehouse_name#19 ASC NULLS FIRST], [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, ... 20 more fields] +Input [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, may_sales_per_sq_foot#556, jun_sales_per_sq_foot#557, jul_sales_per_sq_foot#558, aug_sales_per_sq_foot#559, sep_sales_per_sq_foot#560, oct_sales_per_sq_foot#561, nov_sales_per_sq_foot#562, dec_sales_per_sq_foot#563, jan_net#564, feb_net#565, mar_net#566, apr_net#567, may_net#568, jun_net#569, jul_net#570, aug_net#571, sep_net#572, oct_net#573, nov_net#574, dec_net#575] +Arguments: 100, [w_warehouse_name#327 ASC NULLS FIRST], [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, ... 20 more fields] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt index ddfb04d8df5e3..6c2c2d75edae1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_stat WholeStageCodegen (13) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] WholeStageCodegen (6) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt index fc18efd3d32c1..8f8d119e78451 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt @@ -285,26 +285,27 @@ Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((pro Results [32]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, DHL,BARIAN AS ship_carriers#301, d_year#17 AS year#302, sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#277 AS jan_sales#303, sum(CASE WHEN (d_moy#18 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#278 AS feb_sales#304, sum(CASE WHEN (d_moy#18 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#279 AS mar_sales#305, sum(CASE WHEN (d_moy#18 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#280 AS apr_sales#306, sum(CASE WHEN (d_moy#18 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#281 AS may_sales#307, sum(CASE WHEN (d_moy#18 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#282 AS jun_sales#308, sum(CASE WHEN (d_moy#18 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#283 AS jul_sales#309, sum(CASE WHEN (d_moy#18 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#284 AS aug_sales#310, sum(CASE WHEN (d_moy#18 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#285 AS sep_sales#311, sum(CASE WHEN (d_moy#18 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#286 AS oct_sales#312, sum(CASE WHEN (d_moy#18 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#287 AS nov_sales#313, sum(CASE WHEN (d_moy#18 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#288 AS dec_sales#314, sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#289 AS jan_net#315, sum(CASE WHEN (d_moy#18 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS feb_net#316, sum(CASE WHEN (d_moy#18 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS mar_net#317, sum(CASE WHEN (d_moy#18 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS apr_net#318, sum(CASE WHEN (d_moy#18 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS may_net#319, sum(CASE WHEN (d_moy#18 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS jun_net#320, sum(CASE WHEN (d_moy#18 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jul_net#321, sum(CASE WHEN (d_moy#18 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS aug_net#322, sum(CASE WHEN (d_moy#18 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS sep_net#323, sum(CASE WHEN (d_moy#18 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS oct_net#324, sum(CASE WHEN (d_moy#18 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS nov_net#325, sum(CASE WHEN (d_moy#18 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS dec_net#326] (51) Union +Arguments: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, ... 8 more fields] (52) HashAggregate [codegen id : 13] -Input [32]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#149, feb_sales#150, mar_sales#151, apr_sales#152, may_sales#153, jun_sales#154, jul_sales#155, aug_sales#156, sep_sales#157, oct_sales#158, nov_sales#159, dec_sales#160, jan_net#161, feb_net#162, mar_net#163, apr_net#164, may_net#165, jun_net#166, jul_net#167, aug_net#168, sep_net#169, oct_net#170, nov_net#171, dec_net#172] -Keys [8]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148] -Functions [36]: [partial_sum(jan_sales#149), partial_sum(feb_sales#150), partial_sum(mar_sales#151), partial_sum(apr_sales#152), partial_sum(may_sales#153), partial_sum(jun_sales#154), partial_sum(jul_sales#155), partial_sum(aug_sales#156), partial_sum(sep_sales#157), partial_sum(oct_sales#158), partial_sum(nov_sales#159), partial_sum(dec_sales#160), partial_sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#161), partial_sum(feb_net#162), partial_sum(mar_net#163), partial_sum(apr_net#164), partial_sum(may_net#165), partial_sum(jun_net#166), partial_sum(jul_net#167), partial_sum(aug_net#168), partial_sum(sep_net#169), partial_sum(oct_net#170), partial_sum(nov_net#171), partial_sum(dec_net#172)] -Aggregate Attributes [72]: [sum#327, isEmpty#328, sum#329, isEmpty#330, sum#331, isEmpty#332, sum#333, isEmpty#334, sum#335, isEmpty#336, sum#337, isEmpty#338, sum#339, isEmpty#340, sum#341, isEmpty#342, sum#343, isEmpty#344, sum#345, isEmpty#346, sum#347, isEmpty#348, sum#349, isEmpty#350, sum#351, isEmpty#352, sum#353, isEmpty#354, sum#355, isEmpty#356, sum#357, isEmpty#358, sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398] -Results [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Input [32]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, may_net#351, jun_net#352, jul_net#353, aug_net#354, sep_net#355, oct_net#356, nov_net#357, dec_net#358] +Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] +Functions [36]: [partial_sum(jan_sales#335), partial_sum(feb_sales#336), partial_sum(mar_sales#337), partial_sum(apr_sales#338), partial_sum(may_sales#339), partial_sum(jun_sales#340), partial_sum(jul_sales#341), partial_sum(aug_sales#342), partial_sum(sep_sales#343), partial_sum(oct_sales#344), partial_sum(nov_sales#345), partial_sum(dec_sales#346), partial_sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#347), partial_sum(feb_net#348), partial_sum(mar_net#349), partial_sum(apr_net#350), partial_sum(may_net#351), partial_sum(jun_net#352), partial_sum(jul_net#353), partial_sum(aug_net#354), partial_sum(sep_net#355), partial_sum(oct_net#356), partial_sum(nov_net#357), partial_sum(dec_net#358)] +Aggregate Attributes [72]: [sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430] +Results [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] (53) Exchange -Input [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] -Arguments: hashpartitioning(w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, 5), true, [id=#471] +Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Arguments: hashpartitioning(w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, 5), true, [id=#503] (54) HashAggregate [codegen id : 14] -Input [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] -Keys [8]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148] -Functions [36]: [sum(jan_sales#149), sum(feb_sales#150), sum(mar_sales#151), sum(apr_sales#152), sum(may_sales#153), sum(jun_sales#154), sum(jul_sales#155), sum(aug_sales#156), sum(sep_sales#157), sum(oct_sales#158), sum(nov_sales#159), sum(dec_sales#160), sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#161), sum(feb_net#162), sum(mar_net#163), sum(apr_net#164), sum(may_net#165), sum(jun_net#166), sum(jul_net#167), sum(aug_net#168), sum(sep_net#169), sum(oct_net#170), sum(nov_net#171), sum(dec_net#172)] -Aggregate Attributes [36]: [sum(jan_sales#149)#472, sum(feb_sales#150)#473, sum(mar_sales#151)#474, sum(apr_sales#152)#475, sum(may_sales#153)#476, sum(jun_sales#154)#477, sum(jul_sales#155)#478, sum(aug_sales#156)#479, sum(sep_sales#157)#480, sum(oct_sales#158)#481, sum(nov_sales#159)#482, sum(dec_sales#160)#483, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495, sum(jan_net#161)#496, sum(feb_net#162)#497, sum(mar_net#163)#498, sum(apr_net#164)#499, sum(may_net#165)#500, sum(jun_net#166)#501, sum(jul_net#167)#502, sum(aug_net#168)#503, sum(sep_net#169)#504, sum(oct_net#170)#505, sum(nov_net#171)#506, sum(dec_net#172)#507] -Results [44]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum(jan_sales#149)#472 AS jan_sales#508, sum(feb_sales#150)#473 AS feb_sales#509, sum(mar_sales#151)#474 AS mar_sales#510, sum(apr_sales#152)#475 AS apr_sales#511, sum(may_sales#153)#476 AS may_sales#512, sum(jun_sales#154)#477 AS jun_sales#513, sum(jul_sales#155)#478 AS jul_sales#514, sum(aug_sales#156)#479 AS aug_sales#515, sum(sep_sales#157)#480 AS sep_sales#516, sum(oct_sales#158)#481 AS oct_sales#517, sum(nov_sales#159)#482 AS nov_sales#518, sum(dec_sales#160)#483 AS dec_sales#519, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484 AS jan_sales_per_sq_foot#520, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485 AS feb_sales_per_sq_foot#521, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486 AS mar_sales_per_sq_foot#522, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487 AS apr_sales_per_sq_foot#523, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488 AS may_sales_per_sq_foot#524, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489 AS jun_sales_per_sq_foot#525, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490 AS jul_sales_per_sq_foot#526, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491 AS aug_sales_per_sq_foot#527, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492 AS sep_sales_per_sq_foot#528, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493 AS oct_sales_per_sq_foot#529, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494 AS nov_sales_per_sq_foot#530, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495 AS dec_sales_per_sq_foot#531, sum(jan_net#161)#496 AS jan_net#532, sum(feb_net#162)#497 AS feb_net#533, sum(mar_net#163)#498 AS mar_net#534, sum(apr_net#164)#499 AS apr_net#535, sum(may_net#165)#500 AS may_net#536, sum(jun_net#166)#501 AS jun_net#537, sum(jul_net#167)#502 AS jul_net#538, sum(aug_net#168)#503 AS aug_net#539, sum(sep_net#169)#504 AS sep_net#540, sum(oct_net#170)#505 AS oct_net#541, sum(nov_net#171)#506 AS nov_net#542, sum(dec_net#172)#507 AS dec_net#543] +Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] +Functions [36]: [sum(jan_sales#335), sum(feb_sales#336), sum(mar_sales#337), sum(apr_sales#338), sum(may_sales#339), sum(jun_sales#340), sum(jul_sales#341), sum(aug_sales#342), sum(sep_sales#343), sum(oct_sales#344), sum(nov_sales#345), sum(dec_sales#346), sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#347), sum(feb_net#348), sum(mar_net#349), sum(apr_net#350), sum(may_net#351), sum(jun_net#352), sum(jul_net#353), sum(aug_net#354), sum(sep_net#355), sum(oct_net#356), sum(nov_net#357), sum(dec_net#358)] +Aggregate Attributes [36]: [sum(jan_sales#335)#504, sum(feb_sales#336)#505, sum(mar_sales#337)#506, sum(apr_sales#338)#507, sum(may_sales#339)#508, sum(jun_sales#340)#509, sum(jul_sales#341)#510, sum(aug_sales#342)#511, sum(sep_sales#343)#512, sum(oct_sales#344)#513, sum(nov_sales#345)#514, sum(dec_sales#346)#515, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527, sum(jan_net#347)#528, sum(feb_net#348)#529, sum(mar_net#349)#530, sum(apr_net#350)#531, sum(may_net#351)#532, sum(jun_net#352)#533, sum(jul_net#353)#534, sum(aug_net#354)#535, sum(sep_net#355)#536, sum(oct_net#356)#537, sum(nov_net#357)#538, sum(dec_net#358)#539] +Results [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum(jan_sales#335)#504 AS jan_sales#540, sum(feb_sales#336)#505 AS feb_sales#541, sum(mar_sales#337)#506 AS mar_sales#542, sum(apr_sales#338)#507 AS apr_sales#543, sum(may_sales#339)#508 AS may_sales#544, sum(jun_sales#340)#509 AS jun_sales#545, sum(jul_sales#341)#510 AS jul_sales#546, sum(aug_sales#342)#511 AS aug_sales#547, sum(sep_sales#343)#512 AS sep_sales#548, sum(oct_sales#344)#513 AS oct_sales#549, sum(nov_sales#345)#514 AS nov_sales#550, sum(dec_sales#346)#515 AS dec_sales#551, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516 AS jan_sales_per_sq_foot#552, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517 AS feb_sales_per_sq_foot#553, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518 AS mar_sales_per_sq_foot#554, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519 AS apr_sales_per_sq_foot#555, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520 AS may_sales_per_sq_foot#556, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521 AS jun_sales_per_sq_foot#557, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522 AS jul_sales_per_sq_foot#558, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523 AS aug_sales_per_sq_foot#559, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524 AS sep_sales_per_sq_foot#560, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525 AS oct_sales_per_sq_foot#561, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526 AS nov_sales_per_sq_foot#562, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527 AS dec_sales_per_sq_foot#563, sum(jan_net#347)#528 AS jan_net#564, sum(feb_net#348)#529 AS feb_net#565, sum(mar_net#349)#530 AS mar_net#566, sum(apr_net#350)#531 AS apr_net#567, sum(may_net#351)#532 AS may_net#568, sum(jun_net#352)#533 AS jun_net#569, sum(jul_net#353)#534 AS jul_net#570, sum(aug_net#354)#535 AS aug_net#571, sum(sep_net#355)#536 AS sep_net#572, sum(oct_net#356)#537 AS oct_net#573, sum(nov_net#357)#538 AS nov_net#574, sum(dec_net#358)#539 AS dec_net#575] (55) TakeOrderedAndProject -Input [44]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, may_sales_per_sq_foot#524, jun_sales_per_sq_foot#525, jul_sales_per_sq_foot#526, aug_sales_per_sq_foot#527, sep_sales_per_sq_foot#528, oct_sales_per_sq_foot#529, nov_sales_per_sq_foot#530, dec_sales_per_sq_foot#531, jan_net#532, feb_net#533, mar_net#534, apr_net#535, may_net#536, jun_net#537, jul_net#538, aug_net#539, sep_net#540, oct_net#541, nov_net#542, dec_net#543] -Arguments: 100, [w_warehouse_name#9 ASC NULLS FIRST], [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, ... 20 more fields] +Input [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, may_sales_per_sq_foot#556, jun_sales_per_sq_foot#557, jul_sales_per_sq_foot#558, aug_sales_per_sq_foot#559, sep_sales_per_sq_foot#560, oct_sales_per_sq_foot#561, nov_sales_per_sq_foot#562, dec_sales_per_sq_foot#563, jan_net#564, feb_net#565, mar_net#566, apr_net#567, may_net#568, jun_net#569, jul_net#570, aug_net#571, sep_net#572, oct_net#573, nov_net#574, dec_net#575] +Arguments: 100, [w_warehouse_name#327 ASC NULLS FIRST], [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, ... 20 more fields] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt index ac7379973630f..d78aba27797e5 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_stat WholeStageCodegen (13) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] WholeStageCodegen (6) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter 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..4a6a7429cc4e7 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 @@ -240,7 +240,7 @@ 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] +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((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 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 (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/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt index 05b533aa65a63..106cbe896dc6f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt @@ -240,7 +240,7 @@ 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] +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((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 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 (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/q71.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt index 9471377a18a19..007583a61d58e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt @@ -163,70 +163,71 @@ Output [3]: [ss_ext_sales_price#27 AS ext_price#28, ss_item_sk#26 AS sold_item_s Input [5]: [ss_sold_date_sk#24, ss_sold_time_sk#25, ss_item_sk#26, ss_ext_sales_price#27, d_date_sk#10] (28) Union +Arguments: [ext_price#31, sold_item_sk#32, time_sk#33] (29) BroadcastHashJoin [codegen id : 9] Left keys [1]: [i_item_sk#1] -Right keys [1]: [sold_item_sk#15] +Right keys [1]: [sold_item_sk#32] Join condition: None (30) Project [codegen id : 9] -Output [4]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#14, sold_item_sk#15, time_sk#16] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#31, sold_item_sk#32, time_sk#33] (31) Scan parquet default.time_dim -Output [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [Or(EqualTo(t_meal_time,breakfast),EqualTo(t_meal_time,dinner)), IsNotNull(t_time_sk)] ReadSchema: struct (32) ColumnarToRow [codegen id : 8] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] (33) Filter [codegen id : 8] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] -Condition : (((t_meal_time#34 = breakfast) OR (t_meal_time#34 = dinner)) AND isnotnull(t_time_sk#31)) +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Condition : (((t_meal_time#37 = breakfast) OR (t_meal_time#37 = dinner)) AND isnotnull(t_time_sk#34)) (34) Project [codegen id : 8] -Output [3]: [t_time_sk#31, t_hour#32, t_minute#33] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] (35) BroadcastExchange -Input [3]: [t_time_sk#31, t_hour#32, t_minute#33] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] +Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [time_sk#16] -Right keys [1]: [t_time_sk#31] +Left keys [1]: [time_sk#33] +Right keys [1]: [t_time_sk#34] Join condition: None (37) Project [codegen id : 9] -Output [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] -Input [7]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16, t_time_sk#31, t_hour#32, t_minute#33] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33, t_time_sk#34, t_hour#35, t_minute#36] (38) HashAggregate [codegen id : 9] -Input [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] -Functions [1]: [partial_sum(UnscaledValue(ext_price#14))] -Aggregate Attributes [1]: [sum#36] -Results [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [partial_sum(UnscaledValue(ext_price#31))] +Aggregate Attributes [1]: [sum#39] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] (39) Exchange -Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, 5), true, [id=#38] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), true, [id=#41] (40) HashAggregate [codegen id : 10] -Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] -Functions [1]: [sum(UnscaledValue(ext_price#14))] -Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#14))#39] -Results [5]: [i_brand_id#2 AS brand_id#40, i_brand#3 AS brand#41, t_hour#32, t_minute#33, MakeDecimal(sum(UnscaledValue(ext_price#14))#39,17,2) AS ext_price#42] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [sum(UnscaledValue(ext_price#31))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#31))#42] +Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#31))#42,17,2) AS ext_price#45] (41) Exchange -Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] -Arguments: rangepartitioning(ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST, 5), true, [id=#43] +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), true, [id=#46] (42) Sort [codegen id : 11] -Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] -Arguments: [ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST], true, 0 +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt index 7fb18bbd622ff..e3c87b5444244 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (11) InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] InputAdapter - Union + Union [ext_price,sold_item_sk,time_sk] WholeStageCodegen (3) Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt index 9471377a18a19..007583a61d58e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt @@ -163,70 +163,71 @@ Output [3]: [ss_ext_sales_price#27 AS ext_price#28, ss_item_sk#26 AS sold_item_s Input [5]: [ss_sold_date_sk#24, ss_sold_time_sk#25, ss_item_sk#26, ss_ext_sales_price#27, d_date_sk#10] (28) Union +Arguments: [ext_price#31, sold_item_sk#32, time_sk#33] (29) BroadcastHashJoin [codegen id : 9] Left keys [1]: [i_item_sk#1] -Right keys [1]: [sold_item_sk#15] +Right keys [1]: [sold_item_sk#32] Join condition: None (30) Project [codegen id : 9] -Output [4]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#14, sold_item_sk#15, time_sk#16] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#31, sold_item_sk#32, time_sk#33] (31) Scan parquet default.time_dim -Output [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [Or(EqualTo(t_meal_time,breakfast),EqualTo(t_meal_time,dinner)), IsNotNull(t_time_sk)] ReadSchema: struct (32) ColumnarToRow [codegen id : 8] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] (33) Filter [codegen id : 8] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] -Condition : (((t_meal_time#34 = breakfast) OR (t_meal_time#34 = dinner)) AND isnotnull(t_time_sk#31)) +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Condition : (((t_meal_time#37 = breakfast) OR (t_meal_time#37 = dinner)) AND isnotnull(t_time_sk#34)) (34) Project [codegen id : 8] -Output [3]: [t_time_sk#31, t_hour#32, t_minute#33] -Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] (35) BroadcastExchange -Input [3]: [t_time_sk#31, t_hour#32, t_minute#33] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] +Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [time_sk#16] -Right keys [1]: [t_time_sk#31] +Left keys [1]: [time_sk#33] +Right keys [1]: [t_time_sk#34] Join condition: None (37) Project [codegen id : 9] -Output [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] -Input [7]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16, t_time_sk#31, t_hour#32, t_minute#33] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33, t_time_sk#34, t_hour#35, t_minute#36] (38) HashAggregate [codegen id : 9] -Input [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] -Functions [1]: [partial_sum(UnscaledValue(ext_price#14))] -Aggregate Attributes [1]: [sum#36] -Results [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [partial_sum(UnscaledValue(ext_price#31))] +Aggregate Attributes [1]: [sum#39] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] (39) Exchange -Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, 5), true, [id=#38] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), true, [id=#41] (40) HashAggregate [codegen id : 10] -Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] -Functions [1]: [sum(UnscaledValue(ext_price#14))] -Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#14))#39] -Results [5]: [i_brand_id#2 AS brand_id#40, i_brand#3 AS brand#41, t_hour#32, t_minute#33, MakeDecimal(sum(UnscaledValue(ext_price#14))#39,17,2) AS ext_price#42] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [sum(UnscaledValue(ext_price#31))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#31))#42] +Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#31))#42,17,2) AS ext_price#45] (41) Exchange -Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] -Arguments: rangepartitioning(ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST, 5), true, [id=#43] +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), true, [id=#46] (42) Sort [codegen id : 11] -Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] -Arguments: [ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST], true, 0 +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt index 7fb18bbd622ff..e3c87b5444244 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (11) InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] InputAdapter - Union + Union [ext_price,sold_item_sk,time_sk] WholeStageCodegen (3) Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] 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..741a1f802592a 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 @@ -1,90 +1,91 @@ == Physical Plan == -TakeOrderedAndProject (86) -+- * Project (85) - +- * SortMergeJoin Inner (84) - :- * Project (66) - : +- * SortMergeJoin Inner (65) - : :- * SortMergeJoin Inner (45) - : : :- * Sort (24) - : : : +- Exchange (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (44) - : : +- Exchange (43) - : : +- * HashAggregate (42) - : : +- Exchange (41) - : : +- * HashAggregate (40) - : : +- * Project (39) - : : +- * SortMergeJoin Inner (38) - : : :- * 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) - : : +- * Sort (37) - : : +- ReusedExchange (36) - : +- * Sort (64) - : +- Exchange (63) - : +- * Project (62) - : +- * Filter (61) - : +- * HashAggregate (60) - : +- Exchange (59) - : +- * HashAggregate (58) - : +- * Project (57) - : +- * SortMergeJoin Inner (56) - : :- * Sort (53) - : : +- Exchange (52) - : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (48) - : : : +- * ColumnarToRow (47) - : : : +- Scan parquet default.web_sales (46) - : : +- ReusedExchange (49) - : +- * Sort (55) - : +- ReusedExchange (54) - +- * Sort (83) - +- Exchange (82) - +- * HashAggregate (81) - +- Exchange (80) - +- * HashAggregate (79) - +- * Project (78) - +- * SortMergeJoin Inner (77) - :- * Sort (74) - : +- Exchange (73) - : +- * Project (72) - : +- * BroadcastHashJoin Inner BuildRight (71) - : :- * Filter (69) - : : +- * ColumnarToRow (68) - : : +- Scan parquet default.web_sales (67) - : +- ReusedExchange (70) - +- * Sort (76) - +- ReusedExchange (75) +TakeOrderedAndProject (87) ++- * Project (86) + +- * SortMergeJoin Inner (85) + :- * Project (67) + : +- * SortMergeJoin Inner (66) + : :- * SortMergeJoin Inner (46) + : : :- * Sort (25) + : : : +- Exchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (45) + : : +- Exchange (44) + : : +- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * SortMergeJoin Inner (39) + : : :- * Sort (36) + : : : +- Exchange (35) + : : : +- * Project (34) + : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : :- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.store_sales (26) + : : : +- BroadcastExchange (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.date_dim (29) + : : +- * Sort (38) + : : +- ReusedExchange (37) + : +- * Sort (65) + : +- Exchange (64) + : +- * Project (63) + : +- * Filter (62) + : +- * HashAggregate (61) + : +- Exchange (60) + : +- * HashAggregate (59) + : +- * Project (58) + : +- * SortMergeJoin Inner (57) + : :- * Sort (54) + : : +- Exchange (53) + : : +- * Project (52) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) + : +- * Sort (56) + : +- ReusedExchange (55) + +- * Sort (84) + +- Exchange (83) + +- * HashAggregate (82) + +- Exchange (81) + +- * HashAggregate (80) + +- * Project (79) + +- * SortMergeJoin Inner (78) + :- * Sort (75) + : +- Exchange (74) + : +- * Project (73) + : +- * BroadcastHashJoin Inner BuildRight (72) + : :- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.web_sales (68) + : +- ReusedExchange (71) + +- * Sort (77) + +- ReusedExchange (76) (1) Scan parquet default.store_sales @@ -189,289 +190,293 @@ Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#17, year_total#18] Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) -(23) Exchange +(23) Project [codegen id : 7] +Output [2]: [customer_id#17 AS customer_id#19, year_total#18 AS year_total#20] Input [2]: [customer_id#17, year_total#18] -Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] -(24) Sort [codegen id : 8] -Input [2]: [customer_id#17, year_total#18] -Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 +(24) Exchange +Input [2]: [customer_id#19, year_total#20] +Arguments: hashpartitioning(customer_id#19, 5), true, [id=#21] + +(25) Sort [codegen id : 8] +Input [2]: [customer_id#19, year_total#20] +Arguments: [customer_id#19 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales +(26) 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] +(27) ColumnarToRow [codegen id : 10] Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -(27) Filter [codegen id : 10] +(28) 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 +(29) 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 -(29) ColumnarToRow [codegen id : 9] +(30) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#4, d_year#5] -(30) Filter [codegen id : 9] +(31) 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)) -(31) BroadcastExchange +(32) BroadcastExchange Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] -(32) BroadcastHashJoin [codegen id : 10] +(33) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None -(33) Project [codegen id : 10] +(34) 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] -(34) Exchange +(35) Exchange Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] -(35) Sort [codegen id : 11] +(36) 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 -(36) ReusedExchange [Reuses operator id: 15] +(37) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(37) Sort [codegen id : 13] +(38) Sort [codegen id : 13] 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] +(39) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None -(39) Project [codegen id : 14] +(40) 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] -(40) HashAggregate [codegen id : 14] +(41) 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))] -Aggregate Attributes [1]: [sum#22] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +Aggregate Attributes [1]: [sum#24] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] -(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] +(42) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#26] -(42) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +(43) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] 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] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#27] +Results [4]: [c_customer_id#9 AS customer_id#28, c_first_name#10 AS customer_first_name#29, c_last_name#11 AS customer_last_name#30, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#27,17,2) AS year_total#31] -(43) Exchange -Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] -Arguments: hashpartitioning(customer_id#26, 5), true, [id=#30] +(44) Exchange +Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] +Arguments: hashpartitioning(customer_id#28, 5), true, [id=#32] -(44) Sort [codegen id : 16] -Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] -Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 16] +Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] +Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#26] +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#28] Join condition: None -(46) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(47) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] 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] -Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(48) ColumnarToRow [codegen id : 19] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -(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) Filter [codegen id : 19] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) -(49) ReusedExchange [Reuses operator id: 7] +(50) 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] +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#33] 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#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) Project [codegen id : 19] +Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] -(52) Exchange -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) Exchange +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#36] -(53) Sort [codegen id : 20] -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) Sort [codegen id : 20] +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 -(54) ReusedExchange [Reuses operator id: 15] +(55) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(55) Sort [codegen id : 22] +(56) Sort [codegen id : 22] 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 -(56) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#32] +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#34] 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] +(58) Project [codegen id : 23] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, 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] +(59) HashAggregate [codegen id : 23] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, 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#5, sum#36] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum#37] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] -(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] +(60) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#39] -(60) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] +(61) HashAggregate [codegen id : 24] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] 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] - -(61) Filter [codegen id : 24] -Input [2]: [customer_id#39, year_total#40] -Condition : (isnotnull(year_total#40) AND (year_total#40 > 0.00)) +Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#40] +Results [2]: [c_customer_id#9 AS customer_id#41, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#40,17,2) AS year_total#42] -(62) Project [codegen id : 24] -Output [2]: [customer_id#39 AS customer_id#41, year_total#40 AS year_total#42] -Input [2]: [customer_id#39, year_total#40] - -(63) Exchange +(62) Filter [codegen id : 24] Input [2]: [customer_id#41, year_total#42] -Arguments: hashpartitioning(customer_id#41, 5), true, [id=#43] +Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) -(64) Sort [codegen id : 25] +(63) Project [codegen id : 24] +Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] Input [2]: [customer_id#41, year_total#42] -Arguments: [customer_id#41 ASC NULLS FIRST], false, 0 -(65) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#41] +(64) Exchange +Input [2]: [customer_id#43, year_total#44] +Arguments: hashpartitioning(customer_id#43, 5), true, [id=#45] + +(65) Sort [codegen id : 25] +Input [2]: [customer_id#43, year_total#44] +Arguments: [customer_id#43 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#43] Join condition: None -(66) Project [codegen id : 26] -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) Project [codegen id : 26] +Output [7]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44] +Input [8]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, customer_id#43, year_total#44] -(67) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(68) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] 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] -Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(69) ColumnarToRow [codegen id : 28] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -(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) Filter [codegen id : 28] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) -(70) ReusedExchange [Reuses operator id: 31] +(71) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#4, d_year#5] -(71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#31] +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#33] 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#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) Project [codegen id : 28] +Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] -(73) Exchange -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) Exchange +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#46] -(74) Sort [codegen id : 29] -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) Sort [codegen id : 29] +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 -(75) ReusedExchange [Reuses operator id: 15] +(76) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(76) Sort [codegen id : 31] +(77) Sort [codegen id : 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 -(77) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#32] +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#34] 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] +(79) Project [codegen id : 32] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, 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] +(80) HashAggregate [codegen id : 32] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, 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#5, sum#46] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum#47] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] -(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] +(81) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#49] -(81) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] +(82) HashAggregate [codegen id : 33] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] 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] - -(82) Exchange -Input [2]: [customer_id#49, year_total#50] -Arguments: hashpartitioning(customer_id#49, 5), true, [id=#51] - -(83) Sort [codegen id : 34] -Input [2]: [customer_id#49, year_total#50] -Arguments: [customer_id#49 ASC NULLS FIRST], false, 0 - -(84) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#49] -Join condition: (CASE WHEN (year_total#42 > 0.00) THEN CheckOverflow((promote_precision(year_total#50) / promote_precision(year_total#42)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#29) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) - -(85) Project [codegen id : 35] -Output [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] -Input [9]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42, customer_id#49, year_total#50] - -(86) TakeOrderedAndProject -Input [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] -Arguments: 100, [customer_id#26 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST], [customer_id#26, customer_first_name#27, customer_last_name#28] +Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#50] +Results [2]: [c_customer_id#9 AS customer_id#51, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#50,17,2) AS year_total#52] + +(83) Exchange +Input [2]: [customer_id#51, year_total#52] +Arguments: hashpartitioning(customer_id#51, 5), true, [id=#53] + +(84) Sort [codegen id : 34] +Input [2]: [customer_id#51, year_total#52] +Arguments: [customer_id#51 ASC NULLS FIRST], false, 0 + +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#51] +Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#52) / promote_precision(year_total#44)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#20 > 0.00) THEN CheckOverflow((promote_precision(year_total#31) / promote_precision(year_total#20)), DecimalType(37,20), true) ELSE null END) + +(86) Project [codegen id : 35] +Output [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] +Input [9]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44, customer_id#51, year_total#52] + +(87) TakeOrderedAndProject +Input [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] +Arguments: 100, [customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30] 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..e8d7eaccdf114 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 @@ -15,43 +15,44 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt index 4c9bad96e2027..5bdf305dfd857 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt @@ -1,76 +1,77 @@ == Physical Plan == -TakeOrderedAndProject (72) -+- * Project (71) - +- * BroadcastHashJoin Inner BuildRight (70) - :- * Project (56) - : +- * BroadcastHashJoin Inner BuildRight (55) - : :- * BroadcastHashJoin Inner BuildRight (36) - : : :- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (35) - : : +- * HashAggregate (34) - : : +- Exchange (33) - : : +- * HashAggregate (32) - : : +- * Project (31) - : : +- * BroadcastHashJoin Inner BuildRight (30) - : : :- * Project (25) - : : : +- * BroadcastHashJoin Inner BuildRight (24) - : : : :- * Filter (22) - : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.customer (20) - : : : +- ReusedExchange (23) - : : +- BroadcastExchange (29) - : : +- * Filter (28) - : : +- * ColumnarToRow (27) - : : +- Scan parquet default.date_dim (26) - : +- BroadcastExchange (54) - : +- * Project (53) - : +- * Filter (52) - : +- * HashAggregate (51) - : +- Exchange (50) - : +- * HashAggregate (49) - : +- * Project (48) - : +- * BroadcastHashJoin Inner BuildRight (47) - : :- * Project (45) - : : +- * BroadcastHashJoin Inner BuildRight (44) - : : :- * Filter (39) - : : : +- * ColumnarToRow (38) - : : : +- Scan parquet default.customer (37) - : : +- BroadcastExchange (43) - : : +- * Filter (42) - : : +- * ColumnarToRow (41) - : : +- Scan parquet default.web_sales (40) - : +- ReusedExchange (46) - +- BroadcastExchange (69) - +- * HashAggregate (68) - +- Exchange (67) - +- * HashAggregate (66) - +- * Project (65) - +- * BroadcastHashJoin Inner BuildRight (64) - :- * Project (62) - : +- * BroadcastHashJoin Inner BuildRight (61) - : :- * Filter (59) - : : +- * ColumnarToRow (58) - : : +- Scan parquet default.customer (57) - : +- ReusedExchange (60) - +- ReusedExchange (63) +TakeOrderedAndProject (73) ++- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (57) + : +- * BroadcastHashJoin Inner BuildRight (56) + : :- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (20) + : : : +- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.customer (21) + : : : +- ReusedExchange (24) + : : +- BroadcastExchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.date_dim (27) + : +- BroadcastExchange (55) + : +- * Project (54) + : +- * Filter (53) + : +- * HashAggregate (52) + : +- Exchange (51) + : +- * HashAggregate (50) + : +- * Project (49) + : +- * BroadcastHashJoin Inner BuildRight (48) + : :- * Project (46) + : : +- * BroadcastHashJoin Inner BuildRight (45) + : : :- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.customer (38) + : : +- BroadcastExchange (44) + : : +- * Filter (43) + : : +- * ColumnarToRow (42) + : : +- Scan parquet default.web_sales (41) + : +- ReusedExchange (47) + +- BroadcastExchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Filter (60) + : : +- * ColumnarToRow (59) + : : +- Scan parquet default.customer (58) + : +- ReusedExchange (61) + +- ReusedExchange (64) (1) Scan parquet default.customer @@ -163,248 +164,252 @@ Results [2]: [c_customer_id#2 AS customer_id#16, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#16, year_total#17] Condition : (isnotnull(year_total#17) AND (year_total#17 > 0.00)) -(20) Scan parquet default.customer +(20) Project [codegen id : 16] +Output [2]: [customer_id#16 AS customer_id#18, year_total#17 AS year_total#19] +Input [2]: [customer_id#16, year_total#17] + +(21) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] +(22) ColumnarToRow [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(22) Filter [codegen id : 6] +(23) Filter [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(23) ReusedExchange [Reuses operator id: 7] +(24) ReusedExchange [Reuses operator id: 7] Output [3]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(24) BroadcastHashJoin [codegen id : 6] +(25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(25) Project [codegen id : 6] +(26) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7] Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(26) Scan parquet default.date_dim +(27) 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,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(27) ColumnarToRow [codegen id : 5] +(28) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] -(28) Filter [codegen id : 5] +(29) Filter [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] Condition : (((isnotnull(d_year#10) AND (d_year#10 = 2002)) AND d_year#10 IN (2001,2002)) AND isnotnull(d_date_sk#9)) -(29) BroadcastExchange +(30) BroadcastExchange Input [2]: [d_date_sk#9, d_year#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(30) BroadcastHashJoin [codegen id : 6] +(31) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#5] Right keys [1]: [d_date_sk#9] Join condition: None -(31) Project [codegen id : 6] +(32) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7, d_date_sk#9, d_year#10] -(32) HashAggregate [codegen id : 6] +(33) HashAggregate [codegen id : 6] Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum#19] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +Aggregate Attributes [1]: [sum#21] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] -(33) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#21] +(34) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#23] -(34) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +(35) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#22] -Results [4]: [c_customer_id#2 AS customer_id#23, c_first_name#3 AS customer_first_name#24, c_last_name#4 AS customer_last_name#25, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#22,17,2) AS year_total#26] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#24] +Results [4]: [c_customer_id#2 AS customer_id#25, c_first_name#3 AS customer_first_name#26, c_last_name#4 AS customer_last_name#27, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#24,17,2) AS year_total#28] -(35) BroadcastExchange -Input [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#27] +(36) BroadcastExchange +Input [4]: [customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] -(36) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#23] +(37) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#25] Join condition: None -(37) Scan parquet default.customer +(38) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 10] +(39) ColumnarToRow [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(39) Filter [codegen id : 10] +(40) Filter [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(40) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(41) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 8] -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(42) ColumnarToRow [codegen id : 8] +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(42) Filter [codegen id : 8] -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -Condition : (isnotnull(ws_bill_customer_sk#29) AND isnotnull(ws_sold_date_sk#28)) +(43) Filter [codegen id : 8] +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +Condition : (isnotnull(ws_bill_customer_sk#31) AND isnotnull(ws_sold_date_sk#30)) -(43) BroadcastExchange -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] +(44) BroadcastExchange +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#33] -(44) BroadcastHashJoin [codegen id : 10] +(45) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#29] +Right keys [1]: [ws_bill_customer_sk#31] Join condition: None -(45) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(46) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(46) ReusedExchange [Reuses operator id: 13] +(47) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#9, d_year#10] -(47) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#28] +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#30] Right keys [1]: [d_date_sk#9] Join condition: None -(48) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] +(49) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] -(49) HashAggregate [codegen id : 10] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +(50) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum#32] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum#34] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] -(50) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#34] +(51) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#36] -(51) HashAggregate [codegen id : 11] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +(52) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#35] -Results [2]: [c_customer_id#2 AS customer_id#36, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#35,17,2) AS year_total#37] - -(52) Filter [codegen id : 11] -Input [2]: [customer_id#36, year_total#37] -Condition : (isnotnull(year_total#37) AND (year_total#37 > 0.00)) +Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#37] +Results [2]: [c_customer_id#2 AS customer_id#38, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#37,17,2) AS year_total#39] -(53) Project [codegen id : 11] -Output [2]: [customer_id#36 AS customer_id#38, year_total#37 AS year_total#39] -Input [2]: [customer_id#36, year_total#37] +(53) Filter [codegen id : 11] +Input [2]: [customer_id#38, year_total#39] +Condition : (isnotnull(year_total#39) AND (year_total#39 > 0.00)) -(54) BroadcastExchange +(54) Project [codegen id : 11] +Output [2]: [customer_id#38 AS customer_id#40, year_total#39 AS year_total#41] Input [2]: [customer_id#38, year_total#39] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] -(55) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#38] +(55) BroadcastExchange +Input [2]: [customer_id#40, year_total#41] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] + +(56) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#40] Join condition: None -(56) Project [codegen id : 16] -Output [7]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39] -Input [8]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, customer_id#38, year_total#39] +(57) Project [codegen id : 16] +Output [7]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41] +Input [8]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, customer_id#40, year_total#41] -(57) Scan parquet default.customer +(58) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(58) ColumnarToRow [codegen id : 14] +(59) ColumnarToRow [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(59) Filter [codegen id : 14] +(60) Filter [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(60) ReusedExchange [Reuses operator id: 43] -Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(61) ReusedExchange [Reuses operator id: 44] +Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(61) BroadcastHashJoin [codegen id : 14] +(62) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#29] +Right keys [1]: [ws_bill_customer_sk#31] Join condition: None -(62) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(63) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(63) ReusedExchange [Reuses operator id: 29] +(64) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#9, d_year#10] -(64) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#28] +(65) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#30] Right keys [1]: [d_date_sk#9] Join condition: None -(65) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] +(66) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] -(66) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +(67) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum#41] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum#43] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] -(67) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#43] +(68) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#45] -(68) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +(69) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#44] -Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#44,17,2) AS year_total#46] - -(69) BroadcastExchange -Input [2]: [customer_id#45, year_total#46] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] - -(70) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#45] -Join condition: (CASE WHEN (year_total#39 > 0.00) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#39)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#17 > 0.00) THEN CheckOverflow((promote_precision(year_total#26) / promote_precision(year_total#17)), DecimalType(37,20), true) ELSE null END) - -(71) Project [codegen id : 16] -Output [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] -Input [9]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39, customer_id#45, year_total#46] - -(72) TakeOrderedAndProject -Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] -Arguments: 100, [customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST], [customer_id#23, customer_first_name#24, customer_last_name#25] +Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#46] +Results [2]: [c_customer_id#2 AS customer_id#47, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#46,17,2) AS year_total#48] + +(70) BroadcastExchange +Input [2]: [customer_id#47, year_total#48] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] + +(71) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#47] +Join condition: (CASE WHEN (year_total#41 > 0.00) THEN CheckOverflow((promote_precision(year_total#48) / promote_precision(year_total#41)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#28) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) + +(72) Project [codegen id : 16] +Output [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] +Input [9]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41, customer_id#47, year_total#48] + +(73) TakeOrderedAndProject +Input [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] +Arguments: 100, [customer_id#25 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST], [customer_id#25, customer_first_name#26, customer_last_name#27] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt index add2d43fc5807..38f95db3e7eda 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt @@ -5,34 +5,35 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt index 39748bdd2772b..b375b9567f9da 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt @@ -328,147 +328,149 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ 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 +Arguments: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] 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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Arguments: hashpartitioning(d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43, 5), true, [id=#44] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] 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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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] +Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (49) ColumnarToRow [codegen id : 19] -Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] (50) Filter [codegen id : 19] -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)) +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) (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] +Left keys [1]: [ws_item_sk#46] 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#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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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] (55) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#38] +Left keys [1]: [ws_sold_date_sk#45] 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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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] +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#50] (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] -Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 (59) Scan parquet default.web_returns -Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (60) ColumnarToRow [codegen id : 21] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (61) Filter [codegen id : 21] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Condition : (isnotnull(wr_order_number#45) AND isnotnull(wr_item_sk#44)) +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Condition : (isnotnull(wr_order_number#52) AND isnotnull(wr_item_sk#51)) (62) Exchange -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: hashpartitioning(wr_order_number#45, wr_item_sk#44, 5), true, [id=#48] +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: hashpartitioning(wr_order_number#52, wr_item_sk#51, 5), true, [id=#55] (63) Sort [codegen id : 22] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 (64) SortMergeJoin -Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] -Right keys [2]: [wr_order_number#45, wr_item_sk#44] +Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] +Right keys [2]: [wr_order_number#52, wr_item_sk#51] 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#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#57] +Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (66) Union +Arguments: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] 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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64, 5), true, [id=#65] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] 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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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] -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] +Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [partial_sum(cast(sales_cnt#63 as bigint)), partial_sum(UnscaledValue(sales_amt#64))] +Aggregate Attributes [2]: [sum#66, sum#67] +Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#70] (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] -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] +Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [sum(cast(sales_cnt#63 as bigint)), sum(UnscaledValue(sales_amt#64))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#63 as bigint))#71, sum(UnscaledValue(sales_amt#64))#72] +Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#63 as bigint))#71 AS sales_cnt#73, MakeDecimal(sum(UnscaledValue(sales_amt#64))#72,18,2) AS sales_amt#74] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] +Arguments: hashpartitioning(i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#75] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] +Arguments: [i_brand_id#59 ASC NULLS FIRST, i_class_id#60 ASC NULLS FIRST, i_category_id#61 ASC NULLS FIRST, i_manufact_id#62 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] @@ -485,50 +487,50 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (79) BroadcastHashJoin [codegen id : 30] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#62] +Right keys [1]: [i_item_sk#6] 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]: [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] (81) Scan parquet default.date_dim -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] 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 (82) ColumnarToRow [codegen id : 29] -Input [2]: [d_date_sk#67, d_year#68] +Input [2]: [d_date_sk#13, d_year#14] (83) Filter [codegen id : 29] -Input [2]: [d_date_sk#67, d_year#68] -Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2001)) AND isnotnull(d_date_sk#67)) +Input [2]: [d_date_sk#13, d_year#14] +Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) (84) BroadcastExchange -Input [2]: [d_date_sk#67, d_year#68] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] +Input [2]: [d_date_sk#13, d_year#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] (85) BroadcastHashJoin [codegen id : 30] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#67] +Right keys [1]: [d_date_sk#13] 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#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] (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#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=#77] (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] +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 (89) ReusedExchange [Reuses operator id: 22] @@ -544,8 +546,8 @@ 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#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] (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] @@ -562,35 +564,35 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (97) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#62] +Right keys [1]: [i_item_sk#6] Join condition: None (98) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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] (99) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] (100) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_sold_date_sk#24] -Right keys [1]: [d_date_sk#67] +Right keys [1]: [d_date_sk#13] Join condition: None (101) Project [codegen id : 37] -Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] +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] (102) Exchange -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#71] +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=#78] (103) Sort [codegen id : 38] -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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 (104) ReusedExchange [Reuses operator id: 40] @@ -606,147 +608,149 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (107) Project [codegen id : 41] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#72, 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#73] -Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, 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#79, 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#80] +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] (108) Union +Arguments: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (109) HashAggregate [codegen id : 42] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (110) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#74] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Arguments: hashpartitioning(d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87, 5), true, [id=#88] (111) HashAggregate [codegen id : 43] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (112) 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] +Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 46] -Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] (114) Filter [codegen id : 46] -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)) +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (116) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_item_sk#39] -Right keys [1]: [i_item_sk#62] +Left keys [1]: [ws_item_sk#46] +Right keys [1]: [i_item_sk#6] Join condition: None (117) Project [codegen id : 46] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (118) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] (119) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#38] -Right keys [1]: [d_date_sk#67] +Left keys [1]: [ws_sold_date_sk#45] +Right keys [1]: [d_date_sk#13] Join condition: None (120) Project [codegen id : 46] -Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] +Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (121) Exchange -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#75] +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#89] (122) Sort [codegen id : 47] -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 (123) ReusedExchange [Reuses operator id: 62] -Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (124) Sort [codegen id : 49] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 (125) SortMergeJoin -Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] -Right keys [2]: [wr_order_number#45, wr_item_sk#44] +Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] +Right keys [2]: [wr_order_number#52, wr_item_sk#51] Join condition: None (126) Project [codegen id : 50] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#76, 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#77] -Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, 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#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#90] +Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (127) Union +Arguments: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (128) HashAggregate [codegen id : 51] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (129) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#78] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97, 5), true, [id=#98] (130) HashAggregate [codegen id : 52] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (131) HashAggregate [codegen id : 52] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Functions [2]: [partial_sum(cast(sales_cnt#96 as bigint)), partial_sum(UnscaledValue(sales_amt#97))] +Aggregate Attributes [2]: [sum#99, sum#100] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] (132) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#83] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#103] (133) HashAggregate [codegen id : 53] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] -Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#84, sum(UnscaledValue(sales_amt#23))#85] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum(cast(sales_cnt#22 as bigint))#84 AS sales_cnt#86, MakeDecimal(sum(UnscaledValue(sales_amt#23))#85,18,2) AS sales_amt#87] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Functions [2]: [sum(cast(sales_cnt#96 as bigint)), sum(UnscaledValue(sales_amt#97))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#96 as bigint))#104, sum(UnscaledValue(sales_amt#97))#105] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum(cast(sales_cnt#96 as bigint))#104 AS sales_cnt#106, MakeDecimal(sum(UnscaledValue(sales_amt#97))#105,18,2) AS sales_amt#107] (134) Exchange -Input [7]: [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] -Arguments: hashpartitioning(i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#88] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +Arguments: hashpartitioning(i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#108] (135) Sort [codegen id : 54] -Input [7]: [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] -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 +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +Arguments: [i_brand_id#92 ASC NULLS FIRST, i_class_id#93 ASC NULLS FIRST, i_category_id#94 ASC NULLS FIRST, i_manufact_id#95 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] -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) +Left keys [4]: [i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Right keys [4]: [i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#73 as decimal(17,2))) / promote_precision(cast(sales_cnt#106 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#91 AS prev_year#109, d_year#58 AS year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#106 AS prev_yr_cnt#111, sales_cnt#73 AS curr_yr_cnt#112, (sales_cnt#73 - sales_cnt#106) AS sales_cnt_diff#113, CheckOverflow((promote_precision(cast(sales_amt#74 as decimal(19,2))) - promote_precision(cast(sales_amt#107 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#114] +Input [14]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74, d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] (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], [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#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] +Arguments: 100, [sales_cnt_diff#113 ASC NULLS FIRST], [prev_year#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt index d8d1a3976559d..8326127eae3dd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt @@ -19,7 +19,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (24) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (16) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -27,7 +27,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (7) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter @@ -146,7 +146,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (51) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (43) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -154,7 +154,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (42) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (34) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt index 292a44930ed3d..a3c4812097176 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt @@ -283,127 +283,129 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (38) Union +Arguments: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (39) HashAggregate [codegen id : 9] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] 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#21, sales_amt#22] +Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (40) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#35] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Arguments: hashpartitioning(d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41, 5), true, [id=#42] (41) HashAggregate [codegen id : 10] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] 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#21, sales_amt#22] +Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (42) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] 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 : 14] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] (44) Filter [codegen id : 14] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] -Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) (45) 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] (46) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#37] +Left keys [1]: [ws_item_sk#44] Right keys [1]: [i_item_sk#6] Join condition: None (47) Project [codegen id : 14] -Output [9]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (48) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#36] +Left keys [1]: [ws_sold_date_sk#43] Right keys [1]: [d_date_sk#13] Join condition: None (50) Project [codegen id : 14] -Output [9]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (51) Scan parquet default.web_returns -Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 13] -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (53) Filter [codegen id : 13] -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] -Condition : (isnotnull(wr_order_number#42) AND isnotnull(wr_item_sk#41)) +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Condition : (isnotnull(wr_order_number#49) AND isnotnull(wr_item_sk#48)) (54) BroadcastExchange -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#45] +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#52] (55) BroadcastHashJoin [codegen id : 14] -Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] -Right keys [2]: [wr_order_number#42, wr_item_sk#41] +Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] +Right keys [2]: [wr_order_number#49, wr_item_sk#48] Join condition: None (56) 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, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#46, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#47] -Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#54] +Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (57) Union +Arguments: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (58) 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#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] 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#21, sales_amt#22] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (59) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#48] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61, 5), true, [id=#62] (60) 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#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] 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#21, sales_amt#22] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (61) 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#21, sales_amt#22] -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#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum#49, sum#50] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Functions [2]: [partial_sum(cast(sales_cnt#60 as bigint)), partial_sum(UnscaledValue(sales_amt#61))] +Aggregate Attributes [2]: [sum#63, sum#64] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] (62) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#53] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, 5), true, [id=#67] (63) HashAggregate [codegen id : 34] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] -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#21 as bigint)), sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#54, sum(UnscaledValue(sales_amt#22))#55] -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#21 as bigint))#54 AS sales_cnt#56, MakeDecimal(sum(UnscaledValue(sales_amt#22))#55,18,2) AS sales_amt#57] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Functions [2]: [sum(cast(sales_cnt#60 as bigint)), sum(UnscaledValue(sales_amt#61))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#60 as bigint))#68, sum(UnscaledValue(sales_amt#61))#69] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum(cast(sales_cnt#60 as bigint))#68 AS sales_cnt#70, MakeDecimal(sum(UnscaledValue(sales_amt#61))#69,18,2) AS sales_amt#71] (64) 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] @@ -420,43 +422,43 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (67) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (68) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#58] +Right keys [1]: [i_item_sk#6] Join condition: None (69) Project [codegen id : 20] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +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] (70) Scan parquet default.date_dim -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] 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 (71) ColumnarToRow [codegen id : 18] -Input [2]: [d_date_sk#63, d_year#64] +Input [2]: [d_date_sk#13, d_year#14] (72) Filter [codegen id : 18] -Input [2]: [d_date_sk#63, d_year#64] -Condition : ((isnotnull(d_year#64) AND (d_year#64 = 2001)) AND isnotnull(d_date_sk#63)) +Input [2]: [d_date_sk#13, d_year#14] +Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) (73) BroadcastExchange -Input [2]: [d_date_sk#63, d_year#64] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#65] +Input [2]: [d_date_sk#13, d_year#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] (74) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#63] +Right keys [1]: [d_date_sk#13] Join condition: None (75) Project [codegen id : 20] -Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +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] (76) ReusedExchange [Reuses operator id: 20] Output [4]: [cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] @@ -467,8 +469,8 @@ Right keys [2]: [cr_order_number#17, cr_item_sk#16] Join condition: None (78) Project [codegen id : 20] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (cs_quantity#4 - coalesce(cr_return_quantity#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] -Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] +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#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] +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#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] (79) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27] @@ -485,28 +487,28 @@ Input [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity# Condition : (isnotnull(ss_item_sk#24) AND isnotnull(ss_sold_date_sk#23)) (82) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (83) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_item_sk#24] -Right keys [1]: [i_item_sk#58] +Right keys [1]: [i_item_sk#6] Join condition: None (84) Project [codegen id : 24] -Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (85) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] (86) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_sold_date_sk#23] -Right keys [1]: [d_date_sk#63] +Right keys [1]: [d_date_sk#13] Join condition: None (87) Project [codegen id : 24] -Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -Input [11]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (88) ReusedExchange [Reuses operator id: 35] Output [4]: [sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] @@ -517,131 +519,133 @@ Right keys [2]: [sr_ticket_number#29, sr_item_sk#28] Join condition: None (90) Project [codegen id : 24] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] -Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#73, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#74] +Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (91) Union +Arguments: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (92) HashAggregate [codegen id : 25] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (93) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#68] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Arguments: hashpartitioning(d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81, 5), true, [id=#82] (94) HashAggregate [codegen id : 26] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (95) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (96) ColumnarToRow [codegen id : 30] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] (97) Filter [codegen id : 30] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] -Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) (98) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (99) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_item_sk#37] -Right keys [1]: [i_item_sk#58] +Left keys [1]: [ws_item_sk#44] +Right keys [1]: [i_item_sk#6] Join condition: None (100) Project [codegen id : 30] -Output [9]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (101) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] (102) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_sold_date_sk#36] -Right keys [1]: [d_date_sk#63] +Left keys [1]: [ws_sold_date_sk#43] +Right keys [1]: [d_date_sk#13] Join condition: None (103) Project [codegen id : 30] -Output [9]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -Input [11]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (104) ReusedExchange [Reuses operator id: 54] -Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (105) BroadcastHashJoin [codegen id : 30] -Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] -Right keys [2]: [wr_order_number#42, wr_item_sk#41] +Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] +Right keys [2]: [wr_order_number#49, wr_item_sk#48] Join condition: None (106) Project [codegen id : 30] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#69, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#70] -Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#83] +Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (107) Union +Arguments: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (108) HashAggregate [codegen id : 31] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (109) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#71] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90, 5), true, [id=#91] (110) HashAggregate [codegen id : 32] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (111) HashAggregate [codegen id : 32] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [partial_sum(cast(sales_cnt#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum#72, sum#73] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Functions [2]: [partial_sum(cast(sales_cnt#89 as bigint)), partial_sum(UnscaledValue(sales_amt#90))] +Aggregate Attributes [2]: [sum#92, sum#93] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] (112) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#76] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, 5), true, [id=#96] (113) HashAggregate [codegen id : 33] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] -Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [sum(cast(sales_cnt#21 as bigint)), sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#77, sum(UnscaledValue(sales_amt#22))#78] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#21 as bigint))#77 AS sales_cnt#79, MakeDecimal(sum(UnscaledValue(sales_amt#22))#78,18,2) AS sales_amt#80] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Functions [2]: [sum(cast(sales_cnt#89 as bigint)), sum(UnscaledValue(sales_amt#90))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#89 as bigint))#97, sum(UnscaledValue(sales_amt#90))#98] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum(cast(sales_cnt#89 as bigint))#97 AS sales_cnt#99, MakeDecimal(sum(UnscaledValue(sales_amt#90))#98,18,2) AS sales_amt#100] (114) BroadcastExchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] -Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#81] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#101] (115) BroadcastHashJoin [codegen id : 34] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#56 as decimal(17,2))) / promote_precision(cast(sales_cnt#79 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Left keys [4]: [i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Right keys [4]: [i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#70 as decimal(17,2))) / promote_precision(cast(sales_cnt#99 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (116) Project [codegen id : 34] -Output [10]: [d_year#64 AS prev_year#82, d_year#14 AS year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#79 AS prev_yr_cnt#84, sales_cnt#56 AS curr_yr_cnt#85, (sales_cnt#56 - sales_cnt#79) AS sales_cnt_diff#86, CheckOverflow((promote_precision(cast(sales_amt#57 as decimal(19,2))) - promote_precision(cast(sales_amt#80 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#87] -Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#56, sales_amt#57, d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] +Output [10]: [d_year#84 AS prev_year#102, d_year#55 AS year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#99 AS prev_yr_cnt#104, sales_cnt#70 AS curr_yr_cnt#105, (sales_cnt#70 - sales_cnt#99) AS sales_cnt_diff#106, CheckOverflow((promote_precision(cast(sales_amt#71 as decimal(19,2))) - promote_precision(cast(sales_amt#100 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#107] +Input [14]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#70, sales_amt#71, d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] (117) TakeOrderedAndProject -Input [10]: [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] -Arguments: 100, [sales_cnt_diff#86 ASC NULLS FIRST], [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] +Input [10]: [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] +Arguments: 100, [sales_cnt_diff#106 ASC NULLS FIRST], [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt index 298a06b87762f..601547223bcfa 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (10) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -21,7 +21,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (9) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (4) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] @@ -113,7 +113,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (31) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (26) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -121,7 +121,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (25) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (20) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_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..97621bed43138 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 @@ -220,26 +220,27 @@ Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#6, 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 +Arguments: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, ext_sales_price#36] (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] -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] +Input [6]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, ext_sales_price#36] +Keys [5]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35] +Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#36))] +Aggregate Attributes [2]: [count#37, sum#38] +Results [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] (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#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] +Arguments: hashpartitioning(channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, 5), true, [id=#41] (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] -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] +Input [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] +Keys [5]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35] +Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#36))] +Aggregate Attributes [2]: [count(1)#42, sum(UnscaledValue(ext_sales_price#36))#43] +Results [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count(1)#42 AS sales_cnt#44, MakeDecimal(sum(UnscaledValue(ext_sales_price#36))#43,17,2) AS sales_amt#45] (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#31, col_name#32, d_year#33, d_qoy#34, i_category#35, sales_cnt#44, sales_amt#45] +Arguments: 100, [channel#31 ASC NULLS FIRST, col_name#32 ASC NULLS FIRST, d_year#33 ASC NULLS FIRST, d_qoy#34 ASC NULLS FIRST, i_category#35 ASC NULLS FIRST], [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, sales_cnt#44, sales_amt#45] 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..aea65ecfcb19f 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (10) HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] InputAdapter - Union + Union [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt index 917e2b028106c..aa0d38c8d197b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt @@ -184,26 +184,27 @@ Output [6]: [catalog AS channel#26, cs_ship_addr_sk#23 AS col_name#27, d_year#9, Input [7]: [cs_sold_date_sk#22, cs_ship_addr_sk#23, cs_ext_sales_price#25, i_category#6, d_date_sk#8, d_year#9, d_qoy#10] (34) Union +Arguments: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, ext_sales_price#34] (35) HashAggregate [codegen id : 10] -Input [6]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, ext_sales_price#14] -Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] -Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] -Aggregate Attributes [2]: [count#29, sum#30] -Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] +Input [6]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, ext_sales_price#34] +Keys [5]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33] +Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#34))] +Aggregate Attributes [2]: [count#35, sum#36] +Results [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] (36) Exchange -Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] -Arguments: hashpartitioning(channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, 5), true, [id=#33] +Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] +Arguments: hashpartitioning(channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, 5), true, [id=#39] (37) HashAggregate [codegen id : 11] -Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] -Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] -Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] -Aggregate Attributes [2]: [count(1)#34, sum(UnscaledValue(ext_sales_price#14))#35] -Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count(1)#34 AS sales_cnt#36, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#35,17,2) AS sales_amt#37] +Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] +Keys [5]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33] +Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#34))] +Aggregate Attributes [2]: [count(1)#40, sum(UnscaledValue(ext_sales_price#34))#41] +Results [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count(1)#40 AS sales_cnt#42, MakeDecimal(sum(UnscaledValue(ext_sales_price#34))#41,17,2) AS sales_amt#43] (38) TakeOrderedAndProject -Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#36, sales_amt#37] -Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#9 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, i_category#6 ASC NULLS FIRST], [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#36, sales_amt#37] +Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, sales_cnt#42, sales_amt#43] +Arguments: 100, [channel#29 ASC NULLS FIRST, col_name#30 ASC NULLS FIRST, d_year#31 ASC NULLS FIRST, d_qoy#32 ASC NULLS FIRST, i_category#33 ASC NULLS FIRST], [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, sales_cnt#42, sales_amt#43] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt index f01916baaac78..98674c3255845 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (10) HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] InputAdapter - Union + Union [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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..ade117b9465d1 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 @@ -491,30 +491,31 @@ Output [5]: [sales#80, coalesce(returns#94, 0.00) AS returns#97, CheckOverflow(( Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union +Arguments: [sales#101, returns#102, profit#103, channel#104, id#105] (87) Expand [codegen id : 24] -Input [5]: [sales#17, returns#34, profit#35, channel#36, id#37] -Arguments: [List(sales#17, returns#34, profit#35, channel#36, id#37, 0), List(sales#17, returns#34, profit#35, channel#36, null, 1), List(sales#17, returns#34, profit#35, null, null, 3)], [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] +Input [5]: [sales#101, returns#102, profit#103, channel#104, id#105] +Arguments: [List(sales#101, returns#102, profit#103, channel#104, id#105, 0), List(sales#101, returns#102, profit#103, channel#104, null, 1), List(sales#101, returns#102, profit#103, null, null, 3)], [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] (88) HashAggregate [codegen id : 24] -Input [6]: [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] -Keys [3]: [channel#101, id#102, spark_grouping_id#103] -Functions [3]: [partial_sum(sales#17), partial_sum(returns#34), partial_sum(profit#35)] -Aggregate Attributes [6]: [sum#104, isEmpty#105, sum#106, isEmpty#107, sum#108, isEmpty#109] -Results [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Input [6]: [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] +Keys [3]: [channel#106, id#107, spark_grouping_id#108] +Functions [3]: [partial_sum(sales#101), partial_sum(returns#102), partial_sum(profit#103)] +Aggregate Attributes [6]: [sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114] +Results [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] (89) Exchange -Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] -Arguments: hashpartitioning(channel#101, id#102, spark_grouping_id#103, 5), true, [id=#116] +Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Arguments: hashpartitioning(channel#106, id#107, spark_grouping_id#108, 5), true, [id=#121] (90) HashAggregate [codegen id : 25] -Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] -Keys [3]: [channel#101, id#102, spark_grouping_id#103] -Functions [3]: [sum(sales#17), sum(returns#34), sum(profit#35)] -Aggregate Attributes [3]: [sum(sales#17)#117, sum(returns#34)#118, sum(profit#35)#119] -Results [5]: [channel#101, id#102, sum(sales#17)#117 AS sales#120, sum(returns#34)#118 AS returns#121, sum(profit#35)#119 AS profit#122] +Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Keys [3]: [channel#106, id#107, spark_grouping_id#108] +Functions [3]: [sum(sales#101), sum(returns#102), sum(profit#103)] +Aggregate Attributes [3]: [sum(sales#101)#122, sum(returns#102)#123, sum(profit#103)#124] +Results [5]: [channel#106, id#107, sum(sales#101)#122 AS sales#125, sum(returns#102)#123 AS returns#126, sum(profit#103)#124 AS profit#127] (91) TakeOrderedAndProject -Input [5]: [channel#101, id#102, sales#120, returns#121, profit#122] -Arguments: 100, [channel#101 ASC NULLS FIRST, id#102 ASC NULLS FIRST], [channel#101, id#102, sales#120, returns#121, profit#122] +Input [5]: [channel#106, id#107, sales#125, returns#126, profit#127] +Arguments: 100, [channel#106 ASC NULLS FIRST, id#107 ASC NULLS FIRST], [channel#106, id#107, sales#125, returns#126, profit#127] 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..510b344a7db49 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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] WholeStageCodegen (8) Project [sales,returns,profit,profit_loss,s_store_sk] BroadcastHashJoin [s_store_sk,s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt index c232055ba8c34..aead42d6abb99 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt @@ -491,30 +491,31 @@ Output [5]: [sales#80, coalesce(returns#94, 0.00) AS returns#97, CheckOverflow(( Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union +Arguments: [sales#101, returns#102, profit#103, channel#104, id#105] (87) Expand [codegen id : 24] -Input [5]: [sales#17, returns#34, profit#35, channel#36, id#37] -Arguments: [List(sales#17, returns#34, profit#35, channel#36, id#37, 0), List(sales#17, returns#34, profit#35, channel#36, null, 1), List(sales#17, returns#34, profit#35, null, null, 3)], [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] +Input [5]: [sales#101, returns#102, profit#103, channel#104, id#105] +Arguments: [List(sales#101, returns#102, profit#103, channel#104, id#105, 0), List(sales#101, returns#102, profit#103, channel#104, null, 1), List(sales#101, returns#102, profit#103, null, null, 3)], [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] (88) HashAggregate [codegen id : 24] -Input [6]: [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] -Keys [3]: [channel#101, id#102, spark_grouping_id#103] -Functions [3]: [partial_sum(sales#17), partial_sum(returns#34), partial_sum(profit#35)] -Aggregate Attributes [6]: [sum#104, isEmpty#105, sum#106, isEmpty#107, sum#108, isEmpty#109] -Results [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Input [6]: [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] +Keys [3]: [channel#106, id#107, spark_grouping_id#108] +Functions [3]: [partial_sum(sales#101), partial_sum(returns#102), partial_sum(profit#103)] +Aggregate Attributes [6]: [sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114] +Results [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] (89) Exchange -Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] -Arguments: hashpartitioning(channel#101, id#102, spark_grouping_id#103, 5), true, [id=#116] +Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Arguments: hashpartitioning(channel#106, id#107, spark_grouping_id#108, 5), true, [id=#121] (90) HashAggregate [codegen id : 25] -Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] -Keys [3]: [channel#101, id#102, spark_grouping_id#103] -Functions [3]: [sum(sales#17), sum(returns#34), sum(profit#35)] -Aggregate Attributes [3]: [sum(sales#17)#117, sum(returns#34)#118, sum(profit#35)#119] -Results [5]: [channel#101, id#102, sum(sales#17)#117 AS sales#120, sum(returns#34)#118 AS returns#121, sum(profit#35)#119 AS profit#122] +Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Keys [3]: [channel#106, id#107, spark_grouping_id#108] +Functions [3]: [sum(sales#101), sum(returns#102), sum(profit#103)] +Aggregate Attributes [3]: [sum(sales#101)#122, sum(returns#102)#123, sum(profit#103)#124] +Results [5]: [channel#106, id#107, sum(sales#101)#122 AS sales#125, sum(returns#102)#123 AS returns#126, sum(profit#103)#124 AS profit#127] (91) TakeOrderedAndProject -Input [5]: [channel#101, id#102, sales#120, returns#121, profit#122] -Arguments: 100, [channel#101 ASC NULLS FIRST, id#102 ASC NULLS FIRST], [channel#101, id#102, sales#120, returns#121, profit#122] +Input [5]: [channel#106, id#107, sales#125, returns#126, profit#127] +Arguments: 100, [channel#106 ASC NULLS FIRST, id#107 ASC NULLS FIRST], [channel#106, id#107, sales#125, returns#126, profit#127] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt index bfbeff02b63be..968f37fb6eeb0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] WholeStageCodegen (8) Project [sales,returns,profit,profit_loss,s_store_sk] BroadcastHashJoin [s_store_sk,s_store_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..a8a8f5f848109 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 @@ -569,30 +569,31 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#85))#107, sum(co Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#85))#107,17,2) AS sales#110, sum(coalesce(cast(wr_return_amt#90 as decimal(12,2)), 0.00))#108 AS returns#111, sum(CheckOverflow((promote_precision(cast(ws_net_profit#86 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#91 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#109 AS profit#112, web channel AS channel#113, concat(web_site, web_site_id#94) AS id#114] (103) Union +Arguments: [sales#115, returns#116, profit#117, channel#118, id#119] (104) Expand [codegen id : 31] -Input [5]: [sales#40, returns#41, profit#42, channel#43, id#44] -Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#115, id#116, spark_grouping_id#117] +Input [5]: [sales#115, returns#116, profit#117, channel#118, id#119] +Arguments: [List(sales#115, returns#116, profit#117, channel#118, id#119, 0), List(sales#115, returns#116, profit#117, channel#118, null, 1), List(sales#115, returns#116, profit#117, null, null, 3)], [sales#115, returns#116, profit#117, channel#120, id#121, spark_grouping_id#122] (105) HashAggregate [codegen id : 31] -Input [6]: [sales#40, returns#41, profit#42, channel#115, id#116, spark_grouping_id#117] -Keys [3]: [channel#115, id#116, spark_grouping_id#117] -Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] -Aggregate Attributes [6]: [sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] -Results [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, sum#126, isEmpty#127, sum#128, isEmpty#129] +Input [6]: [sales#115, returns#116, profit#117, channel#120, id#121, spark_grouping_id#122] +Keys [3]: [channel#120, id#121, spark_grouping_id#122] +Functions [3]: [partial_sum(sales#115), partial_sum(returns#116), partial_sum(profit#117)] +Aggregate Attributes [6]: [sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] +Results [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] (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] +Input [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] +Arguments: hashpartitioning(channel#120, id#121, spark_grouping_id#122, 5), true, [id=#135] (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] -Keys [3]: [channel#115, id#116, spark_grouping_id#117] -Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] -Aggregate Attributes [3]: [sum(sales#40)#131, sum(returns#41)#132, sum(profit#42)#133] -Results [5]: [channel#115, id#116, sum(sales#40)#131 AS sales#134, sum(returns#41)#132 AS returns#135, sum(profit#42)#133 AS profit#136] +Input [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] +Keys [3]: [channel#120, id#121, spark_grouping_id#122] +Functions [3]: [sum(sales#115), sum(returns#116), sum(profit#117)] +Aggregate Attributes [3]: [sum(sales#115)#136, sum(returns#116)#137, sum(profit#117)#138] +Results [5]: [channel#120, id#121, sum(sales#115)#136 AS sales#139, sum(returns#116)#137 AS returns#140, sum(profit#117)#138 AS profit#141] (108) TakeOrderedAndProject -Input [5]: [channel#115, id#116, sales#134, returns#135, profit#136] -Arguments: 100, [channel#115 ASC NULLS FIRST, id#116 ASC NULLS FIRST], [channel#115, id#116, sales#134, returns#135, profit#136] +Input [5]: [channel#120, id#121, sales#139, returns#140, profit#141] +Arguments: 100, [channel#120 ASC NULLS FIRST, id#121 ASC NULLS FIRST], [channel#120, id#121, sales#139, returns#140, profit#141] 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..2d0b88add7b2b 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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] 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)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt index 36b045bfd9129..3457adff35a8e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt @@ -524,30 +524,31 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#83))#104, sum(co Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#83))#104,17,2) AS sales#107, sum(coalesce(cast(wr_return_amt#87 as decimal(12,2)), 0.00))#105 AS returns#108, sum(CheckOverflow((promote_precision(cast(ws_net_profit#84 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#88 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#106 AS profit#109, web channel AS channel#110, concat(web_site, web_site_id#91) AS id#111] (94) Union +Arguments: [sales#112, returns#113, profit#114, channel#115, id#116] (95) Expand [codegen id : 22] -Input [5]: [sales#39, returns#40, profit#41, channel#42, id#43] -Arguments: [List(sales#39, returns#40, profit#41, channel#42, id#43, 0), List(sales#39, returns#40, profit#41, channel#42, null, 1), List(sales#39, returns#40, profit#41, null, null, 3)], [sales#39, returns#40, profit#41, channel#112, id#113, spark_grouping_id#114] +Input [5]: [sales#112, returns#113, profit#114, channel#115, id#116] +Arguments: [List(sales#112, returns#113, profit#114, channel#115, id#116, 0), List(sales#112, returns#113, profit#114, channel#115, null, 1), List(sales#112, returns#113, profit#114, null, null, 3)], [sales#112, returns#113, profit#114, channel#117, id#118, spark_grouping_id#119] (96) HashAggregate [codegen id : 22] -Input [6]: [sales#39, returns#40, profit#41, channel#112, id#113, spark_grouping_id#114] -Keys [3]: [channel#112, id#113, spark_grouping_id#114] -Functions [3]: [partial_sum(sales#39), partial_sum(returns#40), partial_sum(profit#41)] -Aggregate Attributes [6]: [sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Results [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Input [6]: [sales#112, returns#113, profit#114, channel#117, id#118, spark_grouping_id#119] +Keys [3]: [channel#117, id#118, spark_grouping_id#119] +Functions [3]: [partial_sum(sales#112), partial_sum(returns#113), partial_sum(profit#114)] +Aggregate Attributes [6]: [sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Results [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] (97) Exchange -Input [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] -Arguments: hashpartitioning(channel#112, id#113, spark_grouping_id#114, 5), true, [id=#127] +Input [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Arguments: hashpartitioning(channel#117, id#118, spark_grouping_id#119, 5), true, [id=#132] (98) HashAggregate [codegen id : 23] -Input [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] -Keys [3]: [channel#112, id#113, spark_grouping_id#114] -Functions [3]: [sum(sales#39), sum(returns#40), sum(profit#41)] -Aggregate Attributes [3]: [sum(sales#39)#128, sum(returns#40)#129, sum(profit#41)#130] -Results [5]: [channel#112, id#113, sum(sales#39)#128 AS sales#131, sum(returns#40)#129 AS returns#132, sum(profit#41)#130 AS profit#133] +Input [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [3]: [channel#117, id#118, spark_grouping_id#119] +Functions [3]: [sum(sales#112), sum(returns#113), sum(profit#114)] +Aggregate Attributes [3]: [sum(sales#112)#133, sum(returns#113)#134, sum(profit#114)#135] +Results [5]: [channel#117, id#118, sum(sales#112)#133 AS sales#136, sum(returns#113)#134 AS returns#137, sum(profit#114)#135 AS profit#138] (99) TakeOrderedAndProject -Input [5]: [channel#112, id#113, sales#131, returns#132, profit#133] -Arguments: 100, [channel#112 ASC NULLS FIRST, id#113 ASC NULLS FIRST], [channel#112, id#113, sales#131, returns#132, profit#133] +Input [5]: [channel#117, id#118, sales#136, returns#137, profit#138] +Arguments: 100, [channel#117 ASC NULLS FIRST, id#118 ASC NULLS FIRST], [channel#117, id#118, sales#136, returns#137, profit#138] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt index 37f46f14e467b..3e79691bfc873 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union + Union [sales,returns,profit,channel,id] WholeStageCodegen (7) 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)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] InputAdapter 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/q86/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt index 20ae4d244dcd8..20beeb9d31d89 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/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-v2_7/q10a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt index 1146a80d45727..e1b217a52b521 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt @@ -1,56 +1,55 @@ == Physical Plan == -TakeOrderedAndProject (52) -+- * HashAggregate (51) - +- Exchange (50) - +- * HashAggregate (49) - +- * Project (48) - +- * BroadcastHashJoin Inner BuildLeft (47) - :- BroadcastExchange (43) - : +- * Project (42) - : +- * BroadcastHashJoin Inner BuildRight (41) - : :- * Project (35) - : : +- SortMergeJoin LeftSemi (34) - : : :- 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 (33) - : : +- Exchange (32) - : : +- Union (31) - : : :- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Project (30) - : : +- * BroadcastHashJoin Inner BuildRight (29) - : : :- * Filter (27) - : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.catalog_sales (25) - : : +- ReusedExchange (28) - : +- BroadcastExchange (40) - : +- * Project (39) - : +- * Filter (38) - : +- * ColumnarToRow (37) - : +- Scan parquet default.customer_address (36) - +- * Filter (46) - +- * ColumnarToRow (45) - +- Scan parquet default.customer_demographics (44) +TakeOrderedAndProject (51) ++- * HashAggregate (50) + +- Exchange (49) + +- * HashAggregate (48) + +- * Project (47) + +- BroadcastNestedLoopJoin LeftSemi BuildLeft (46) + :- BroadcastExchange (32) + : +- * Project (31) + : +- * BroadcastHashJoin Inner BuildLeft (30) + : :- BroadcastExchange (26) + : : +- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- 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) + : : +- BroadcastExchange (23) + : : +- * Project (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.customer_address (19) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.customer_demographics (27) + +- Union (45) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.web_sales (33) + : +- ReusedExchange (36) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Filter (41) + : +- * ColumnarToRow (40) + : +- Scan parquet default.catalog_sales (39) + +- ReusedExchange (42) (1) Scan parquet default.customer @@ -133,154 +132,148 @@ Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(19) Scan parquet default.customer_address +Output [2]: [ca_address_sk#12, ca_county#13] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +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 -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(20) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#12, ca_county#13] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -Condition : isnotnull(ws_sold_date_sk#12) +(21) Filter [codegen id : 6] +Input [2]: [ca_address_sk#12, ca_county#13] +Condition : (ca_county#13 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#12)) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(22) Project [codegen id : 6] +Output [1]: [ca_address_sk#12] +Input [2]: [ca_address_sk#12, ca_county#13] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#12] -Right keys [1]: [d_date_sk#7] +(23) BroadcastExchange +Input [1]: [ca_address_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(24) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#12] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#13 AS customer_sk#14] -Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] +(25) Project [codegen id : 7] +Output [2]: [c_customer_sk#1, c_current_cdemo_sk#2] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#12] -(25) 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 +(26) BroadcastExchange +Input [2]: [c_customer_sk#1, c_current_cdemo_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#15] -(26) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(27) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct -(27) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -Condition : isnotnull(cs_sold_date_sk#15) +(28) ColumnarToRow +Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -(28) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(29) Filter +Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Condition : isnotnull(cd_demo_sk#16) -(29) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#15] -Right keys [1]: [d_date_sk#7] +(30) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#16] Join condition: None -(30) Project [codegen id : 9] -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#7] +(31) Project [codegen id : 8] +Output [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Input [11]: [c_customer_sk#1, c_current_cdemo_sk#2, cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -(31) Union +(32) BroadcastExchange +Input [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Arguments: IdentityBroadcastMode, [id=#25] -(32) Exchange -Input [1]: [customer_sk#14] -Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#18] +(33) Scan parquet default.web_sales +Output [1]: [ws_sold_date_sk#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(33) Sort [codegen id : 10] -Input [1]: [customer_sk#14] -Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 +(34) ColumnarToRow [codegen id : 10] +Input [1]: [ws_sold_date_sk#26] -(34) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#14] +(35) Filter [codegen id : 10] +Input [1]: [ws_sold_date_sk#26] +Condition : isnotnull(ws_sold_date_sk#26) + +(36) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] + +(37) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#26] +Right keys [1]: [d_date_sk#7] 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] +(38) Project [codegen id : 10] +Output: [] +Input [2]: [ws_sold_date_sk#26, d_date_sk#7] -(36) Scan parquet default.customer_address -Output [2]: [ca_address_sk#19, ca_county#20] +(39) Scan parquet default.catalog_sales +Output [1]: [cs_sold_date_sk#27] 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#19, ca_county#20] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(38) Filter [codegen id : 11] -Input [2]: [ca_address_sk#19, ca_county#20] -Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19)) +(40) ColumnarToRow [codegen id : 12] +Input [1]: [cs_sold_date_sk#27] -(39) Project [codegen id : 11] -Output [1]: [ca_address_sk#19] -Input [2]: [ca_address_sk#19, ca_county#20] +(41) Filter [codegen id : 12] +Input [1]: [cs_sold_date_sk#27] +Condition : isnotnull(cs_sold_date_sk#27) -(40) BroadcastExchange -Input [1]: [ca_address_sk#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] +(42) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(41) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#19] +(43) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#7] 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#19] +(44) Project [codegen id : 12] +Output: [] +Input [2]: [cs_sold_date_sk#27, d_date_sk#7] -(43) BroadcastExchange -Input [1]: [c_current_cdemo_sk#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +(45) Union -(44) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(45) ColumnarToRow -Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] - -(46) Filter -Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Condition : isnotnull(cd_demo_sk#23) - -(47) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#23] -Join condition: None +(46) BroadcastNestedLoopJoin +Join condition: (c_customer_sk#1 = customer_sk#28) -(48) Project [codegen id : 13] -Output [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +(47) Project [codegen id : 13] +Output [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Input [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -(49) HashAggregate [codegen id : 13] -Input [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +(48) HashAggregate [codegen id : 13] +Input [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Keys [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#32] -Results [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] +Aggregate Attributes [1]: [count#29] +Results [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] -(50) Exchange -Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] -Arguments: hashpartitioning(cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, 5), true, [id=#34] +(49) Exchange +Input [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] +Arguments: hashpartitioning(cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, 5), true, [id=#31] -(51) HashAggregate [codegen id : 14] -Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] -Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +(50) HashAggregate [codegen id : 14] +Input [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] +Keys [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#35] -Results [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, count(1)#35 AS cnt1#36, cd_purchase_estimate#27, count(1)#35 AS cnt2#37, cd_credit_rating#28, count(1)#35 AS cnt3#38, cd_dep_count#29, count(1)#35 AS cnt4#39, cd_dep_employed_count#30, count(1)#35 AS cnt5#40, cd_dep_college_count#31, count(1)#35 AS cnt6#41] +Aggregate Attributes [1]: [count(1)#32] +Results [14]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, count(1)#32 AS cnt1#33, cd_purchase_estimate#20, count(1)#32 AS cnt2#34, cd_credit_rating#21, count(1)#32 AS cnt3#35, cd_dep_count#22, count(1)#32 AS cnt4#36, cd_dep_employed_count#23, count(1)#32 AS cnt5#37, cd_dep_college_count#24, count(1)#32 AS cnt6#38] -(52) TakeOrderedAndProject -Input [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#36, cd_purchase_estimate#27, cnt2#37, cd_credit_rating#28, cnt3#38, cd_dep_count#29, cnt4#39, cd_dep_employed_count#30, cnt5#40, cd_dep_college_count#31, cnt6#41] -Arguments: 100, [cd_gender#24 ASC NULLS FIRST, cd_marital_status#25 ASC NULLS FIRST, cd_education_status#26 ASC NULLS FIRST, cd_purchase_estimate#27 ASC NULLS FIRST, cd_credit_rating#28 ASC NULLS FIRST, cd_dep_count#29 ASC NULLS FIRST, cd_dep_employed_count#30 ASC NULLS FIRST, cd_dep_college_count#31 ASC NULLS FIRST], [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#36, cd_purchase_estimate#27, cnt2#37, cd_credit_rating#28, cnt3#38, cd_dep_count#29, cnt4#39, cd_dep_employed_count#30, cnt5#40, cd_dep_college_count#31, cnt6#41] +(51) TakeOrderedAndProject +Input [14]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cnt1#33, cd_purchase_estimate#20, cnt2#34, cd_credit_rating#21, cnt3#35, cd_dep_count#22, cnt4#36, cd_dep_employed_count#23, cnt5#37, cd_dep_college_count#24, cnt6#38] +Arguments: 100, [cd_gender#17 ASC NULLS FIRST, cd_marital_status#18 ASC NULLS FIRST, cd_education_status#19 ASC NULLS FIRST, cd_purchase_estimate#20 ASC NULLS FIRST, cd_credit_rating#21 ASC NULLS FIRST, cd_dep_count#22 ASC NULLS FIRST, cd_dep_employed_count#23 ASC NULLS FIRST, cd_dep_college_count#24 ASC NULLS FIRST], [cd_gender#17, cd_marital_status#18, cd_education_status#19, cnt1#33, cd_purchase_estimate#20, cnt2#34, cd_credit_rating#21, cnt3#35, cd_dep_count#22, cnt4#36, cd_dep_employed_count#23, cnt5#37, cd_dep_college_count#24, cnt6#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt index f9276bf1058fd..09e974f0297b1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt @@ -6,76 +6,75 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha WholeStageCodegen (13) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - InputAdapter + InputAdapter + BroadcastNestedLoopJoin [c_customer_sk,customer_sk] BroadcastExchange #2 - WholeStageCodegen (12) - Project [c_current_cdemo_sk] - 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,ss_customer_sk] - WholeStageCodegen (2) - Sort [c_customer_sk] - InputAdapter - 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 (5) - Sort [ss_customer_sk] - InputAdapter - Exchange [ss_customer_sk] #4 - WholeStageCodegen (4) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] - InputAdapter - 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 (10) - Sort [customer_sk] + WholeStageCodegen (8) + Project [c_customer_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (7) + Project [c_customer_sk,c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] InputAdapter - Exchange [customer_sk] #6 - Union - WholeStageCodegen (7) - Project [ws_bill_customer_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #5 - WholeStageCodegen (9) - Project [cs_ship_customer_sk] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] + SortMergeJoin [c_customer_sk,ss_customer_sk] + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + 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 (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] + InputAdapter + BroadcastExchange #6 + 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] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow InputAdapter - ReusedExchange [d_date_sk] #5 + Scan parquet default.customer_address [ca_address_sk,ca_county] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + Union + WholeStageCodegen (10) + Project + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (12) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk] 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 - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + ReusedExchange [d_date_sk] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt index 40d3299de4ac9..5387b0309bd45 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt @@ -4,11 +4,11 @@ TakeOrderedAndProject (48) +- Exchange (46) +- * HashAggregate (45) +- * Project (44) - +- * BroadcastHashJoin Inner BuildRight (43) - :- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Project (31) - : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + +- BroadcastNestedLoopJoin LeftSemi BuildRight (43) + :- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) : : :- * BroadcastHashJoin LeftSemi BuildRight (15) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) @@ -24,29 +24,29 @@ TakeOrderedAndProject (48) : : : +- * Filter (9) : : : +- * ColumnarToRow (8) : : : +- Scan parquet default.date_dim (7) - : : +- BroadcastExchange (29) - : : +- Union (28) - : : :- * Project (21) - : : : +- * BroadcastHashJoin Inner BuildRight (20) - : : : :- * Filter (18) - : : : : +- * ColumnarToRow (17) - : : : : +- Scan parquet default.web_sales (16) - : : : +- ReusedExchange (19) - : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildRight (26) - : : :- * Filter (24) - : : : +- * ColumnarToRow (23) - : : : +- Scan parquet default.catalog_sales (22) - : : +- ReusedExchange (25) - : +- BroadcastExchange (36) - : +- * Project (35) - : +- * Filter (34) - : +- * ColumnarToRow (33) - : +- Scan parquet default.customer_address (32) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.customer_address (16) + : +- BroadcastExchange (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.customer_demographics (23) +- BroadcastExchange (42) - +- * Filter (41) - +- * ColumnarToRow (40) - +- Scan parquet default.customer_demographics (39) + +- Union (41) + :- * Project (34) + : +- * BroadcastHashJoin Inner BuildRight (33) + : :- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.web_sales (29) + : +- ReusedExchange (32) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.catalog_sales (35) + +- ReusedExchange (38) (1) Scan parquet default.customer @@ -56,10 +56,10 @@ 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 : 9] +(2) ColumnarToRow [codegen id : 5] Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(3) Filter [codegen id : 9] +(3) Filter [codegen id : 5] 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)) @@ -112,155 +112,153 @@ Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, d_date_sk#6] Input [1]: [ss_customer_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(15) BroadcastHashJoin [codegen id : 9] +(15) BroadcastHashJoin [codegen id : 5] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#5] Join condition: None -(16) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +(16) Scan parquet default.customer_address +Output [2]: [ca_address_sk#11, ca_county#12] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +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 -(17) ColumnarToRow [codegen id : 4] -Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +(17) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#11, ca_county#12] -(18) Filter [codegen id : 4] -Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] -Condition : isnotnull(ws_sold_date_sk#11) +(18) Filter [codegen id : 3] +Input [2]: [ca_address_sk#11, ca_county#12] +Condition : (ca_county#12 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#11)) -(19) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(19) Project [codegen id : 3] +Output [1]: [ca_address_sk#11] +Input [2]: [ca_address_sk#11, ca_county#12] -(20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ws_sold_date_sk#11] -Right keys [1]: [d_date_sk#6] +(20) BroadcastExchange +Input [1]: [ca_address_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#11] Join condition: None -(21) Project [codegen id : 4] -Output [1]: [ws_bill_customer_sk#12 AS customer_sk#13] -Input [3]: [ws_sold_date_sk#11, ws_bill_customer_sk#12, d_date_sk#6] +(22) Project [codegen id : 5] +Output [2]: [c_customer_sk#1, c_current_cdemo_sk#2] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#11] -(22) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +(23) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct -(23) ColumnarToRow [codegen id : 6] -Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +(24) ColumnarToRow [codegen id : 4] +Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(24) Filter [codegen id : 6] -Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] -Condition : isnotnull(cs_sold_date_sk#14) +(25) Filter [codegen id : 4] +Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Condition : isnotnull(cd_demo_sk#14) -(25) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(26) BroadcastExchange +Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] -(26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#14] -Right keys [1]: [d_date_sk#6] +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#14] Join condition: None -(27) Project [codegen id : 6] -Output [1]: [cs_ship_customer_sk#15 AS customer_sk#16] -Input [3]: [cs_sold_date_sk#14, cs_ship_customer_sk#15, d_date_sk#6] +(28) Project [codegen id : 5] +Output [9]: [c_customer_sk#1, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Input [11]: [c_customer_sk#1, c_current_cdemo_sk#2, cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(28) Union +(29) Scan parquet default.web_sales +Output [1]: [ws_sold_date_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(29) BroadcastExchange -Input [1]: [customer_sk#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +(30) ColumnarToRow [codegen id : 7] +Input [1]: [ws_sold_date_sk#24] -(30) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#13] +(31) Filter [codegen id : 7] +Input [1]: [ws_sold_date_sk#24] +Condition : isnotnull(ws_sold_date_sk#24) + +(32) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] + +(33) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#24] +Right keys [1]: [d_date_sk#6] Join condition: None -(31) Project [codegen id : 9] -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] +(34) Project [codegen id : 7] +Output: [] +Input [2]: [ws_sold_date_sk#24, d_date_sk#6] -(32) Scan parquet default.customer_address -Output [2]: [ca_address_sk#18, ca_county#19] +(35) Scan parquet default.catalog_sales +Output [1]: [cs_sold_date_sk#25] 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 - -(33) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#18, ca_county#19] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(34) Filter [codegen id : 7] -Input [2]: [ca_address_sk#18, ca_county#19] -Condition : (ca_county#19 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#18)) +(36) ColumnarToRow [codegen id : 9] +Input [1]: [cs_sold_date_sk#25] -(35) Project [codegen id : 7] -Output [1]: [ca_address_sk#18] -Input [2]: [ca_address_sk#18, ca_county#19] +(37) Filter [codegen id : 9] +Input [1]: [cs_sold_date_sk#25] +Condition : isnotnull(cs_sold_date_sk#25) -(36) BroadcastExchange -Input [1]: [ca_address_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] +(38) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(37) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#18] +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#25] +Right keys [1]: [d_date_sk#6] Join condition: None -(38) Project [codegen id : 9] -Output [1]: [c_current_cdemo_sk#2] -Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18] - -(39) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(40) ColumnarToRow [codegen id : 8] -Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +(40) Project [codegen id : 9] +Output: [] +Input [2]: [cs_sold_date_sk#25, d_date_sk#6] -(41) Filter [codegen id : 8] -Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Condition : isnotnull(cd_demo_sk#21) +(41) Union (42) BroadcastExchange -Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] +Input: [] +Arguments: IdentityBroadcastMode, [id=#26] -(43) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#21] -Join condition: None +(43) BroadcastNestedLoopJoin +Join condition: (c_customer_sk#1 = customer_sk#27) -(44) Project [codegen id : 9] -Output [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +(44) Project [codegen id : 10] +Output [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Input [9]: [c_customer_sk#1, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(45) HashAggregate [codegen id : 9] -Input [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Keys [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +(45) HashAggregate [codegen id : 10] +Input [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Keys [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#31] -Results [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] +Aggregate Attributes [1]: [count#28] +Results [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] (46) Exchange -Input [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] -Arguments: hashpartitioning(cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, 5), true, [id=#33] +Input [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] +Arguments: hashpartitioning(cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, 5), true, [id=#30] -(47) HashAggregate [codegen id : 10] -Input [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] -Keys [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +(47) HashAggregate [codegen id : 11] +Input [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] +Keys [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#34] -Results [14]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, count(1)#34 AS cnt1#35, cd_purchase_estimate#25, count(1)#34 AS cnt2#36, cd_credit_rating#26, count(1)#34 AS cnt3#37, cd_dep_count#27, count(1)#34 AS cnt4#38, cd_dep_employed_count#28, count(1)#34 AS cnt5#39, cd_dep_college_count#29, count(1)#34 AS cnt6#40] +Aggregate Attributes [1]: [count(1)#31] +Results [14]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, count(1)#31 AS cnt1#32, cd_purchase_estimate#18, count(1)#31 AS cnt2#33, cd_credit_rating#19, count(1)#31 AS cnt3#34, cd_dep_count#20, count(1)#31 AS cnt4#35, cd_dep_employed_count#21, count(1)#31 AS cnt5#36, cd_dep_college_count#22, count(1)#31 AS cnt6#37] (48) TakeOrderedAndProject -Input [14]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#35, cd_purchase_estimate#25, cnt2#36, cd_credit_rating#26, cnt3#37, cd_dep_count#27, cnt4#38, cd_dep_employed_count#28, cnt5#39, cd_dep_college_count#29, cnt6#40] -Arguments: 100, [cd_gender#22 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_education_status#24 ASC NULLS FIRST, cd_purchase_estimate#25 ASC NULLS FIRST, cd_credit_rating#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#35, cd_purchase_estimate#25, cnt2#36, cd_credit_rating#26, cnt3#37, cd_dep_count#27, cnt4#38, cd_dep_employed_count#28, cnt5#39, cd_dep_college_count#29, cnt6#40] +Input [14]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cnt1#32, cd_purchase_estimate#18, cnt2#33, cd_credit_rating#19, cnt3#34, cd_dep_count#20, cnt4#35, cd_dep_employed_count#21, cnt5#36, cd_dep_college_count#22, cnt6#37] +Arguments: 100, [cd_gender#15 ASC NULLS FIRST, cd_marital_status#16 ASC NULLS FIRST, cd_education_status#17 ASC NULLS FIRST, cd_purchase_estimate#18 ASC NULLS FIRST, cd_credit_rating#19 ASC NULLS FIRST, cd_dep_count#20 ASC NULLS FIRST, cd_dep_employed_count#21 ASC NULLS FIRST, cd_dep_college_count#22 ASC NULLS FIRST], [cd_gender#15, cd_marital_status#16, cd_education_status#17, cnt1#32, cd_purchase_estimate#18, cnt2#33, cd_credit_rating#19, cnt3#34, cd_dep_count#20, cnt4#35, cd_dep_employed_count#21, cnt5#36, cd_dep_college_count#22, cnt6#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt index c4567e89049ac..f7382e147e6f6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt @@ -1,71 +1,72 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] - WholeStageCodegen (10) + WholeStageCodegen (11) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] InputAdapter Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (9) + WholeStageCodegen (10) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - Project [c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Project [c_current_cdemo_sk,c_current_addr_sk] - BroadcastHashJoin [c_customer_sk,customer_sk] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_current_addr_sk,c_current_cdemo_sk] - ColumnarToRow + InputAdapter + BroadcastNestedLoopJoin [c_customer_sk,customer_sk] + WholeStageCodegen (5) + Project [c_customer_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_customer_sk,c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + 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] InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (2) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_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 - BroadcastExchange #4 - Union - WholeStageCodegen (4) - Project [ws_bill_customer_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] + 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 + BroadcastExchange #4 + WholeStageCodegen (3) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - WholeStageCodegen (6) - Project [cs_ship_customer_sk] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (7) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastExchange #6 + Union + WholeStageCodegen (7) + Project + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] - InputAdapter - BroadcastExchange #6 - WholeStageCodegen (8) - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + Scan parquet default.web_sales [ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (9) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 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..7ed5cc9ab6262 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 @@ -1,90 +1,91 @@ == Physical Plan == -TakeOrderedAndProject (86) -+- * Project (85) - +- * SortMergeJoin Inner (84) - :- * Project (66) - : +- * SortMergeJoin Inner (65) - : :- * SortMergeJoin Inner (45) - : : :- * Sort (24) - : : : +- Exchange (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (44) - : : +- Exchange (43) - : : +- * HashAggregate (42) - : : +- Exchange (41) - : : +- * HashAggregate (40) - : : +- * Project (39) - : : +- * SortMergeJoin Inner (38) - : : :- * 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) - : : +- * Sort (37) - : : +- ReusedExchange (36) - : +- * Sort (64) - : +- Exchange (63) - : +- * Project (62) - : +- * Filter (61) - : +- * HashAggregate (60) - : +- Exchange (59) - : +- * HashAggregate (58) - : +- * Project (57) - : +- * SortMergeJoin Inner (56) - : :- * Sort (53) - : : +- Exchange (52) - : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (48) - : : : +- * ColumnarToRow (47) - : : : +- Scan parquet default.web_sales (46) - : : +- ReusedExchange (49) - : +- * Sort (55) - : +- ReusedExchange (54) - +- * Sort (83) - +- Exchange (82) - +- * HashAggregate (81) - +- Exchange (80) - +- * HashAggregate (79) - +- * Project (78) - +- * SortMergeJoin Inner (77) - :- * Sort (74) - : +- Exchange (73) - : +- * Project (72) - : +- * BroadcastHashJoin Inner BuildRight (71) - : :- * Filter (69) - : : +- * ColumnarToRow (68) - : : +- Scan parquet default.web_sales (67) - : +- ReusedExchange (70) - +- * Sort (76) - +- ReusedExchange (75) +TakeOrderedAndProject (87) ++- * Project (86) + +- * SortMergeJoin Inner (85) + :- * Project (67) + : +- * SortMergeJoin Inner (66) + : :- * SortMergeJoin Inner (46) + : : :- * Sort (25) + : : : +- Exchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (45) + : : +- Exchange (44) + : : +- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * SortMergeJoin Inner (39) + : : :- * Sort (36) + : : : +- Exchange (35) + : : : +- * Project (34) + : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : :- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.store_sales (26) + : : : +- BroadcastExchange (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.date_dim (29) + : : +- * Sort (38) + : : +- ReusedExchange (37) + : +- * Sort (65) + : +- Exchange (64) + : +- * Project (63) + : +- * Filter (62) + : +- * HashAggregate (61) + : +- Exchange (60) + : +- * HashAggregate (59) + : +- * Project (58) + : +- * SortMergeJoin Inner (57) + : :- * Sort (54) + : : +- Exchange (53) + : : +- * Project (52) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) + : +- * Sort (56) + : +- ReusedExchange (55) + +- * Sort (84) + +- Exchange (83) + +- * HashAggregate (82) + +- Exchange (81) + +- * HashAggregate (80) + +- * Project (79) + +- * SortMergeJoin Inner (78) + :- * Sort (75) + : +- Exchange (74) + : +- * Project (73) + : +- * BroadcastHashJoin Inner BuildRight (72) + : :- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.web_sales (68) + : +- ReusedExchange (71) + +- * Sort (77) + +- ReusedExchange (76) (1) Scan parquet default.store_sales @@ -189,289 +190,293 @@ Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue( Input [2]: [customer_id#22, year_total#23] Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) -(23) Exchange +(23) Project [codegen id : 7] +Output [2]: [customer_id#22 AS customer_id#24, year_total#23 AS year_total#25] Input [2]: [customer_id#22, year_total#23] -Arguments: hashpartitioning(customer_id#22, 5), true, [id=#24] -(24) Sort [codegen id : 8] -Input [2]: [customer_id#22, year_total#23] -Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 +(24) Exchange +Input [2]: [customer_id#24, year_total#25] +Arguments: hashpartitioning(customer_id#24, 5), true, [id=#26] + +(25) Sort [codegen id : 8] +Input [2]: [customer_id#24, year_total#25] +Arguments: [customer_id#24 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales +(26) 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 -(26) ColumnarToRow [codegen id : 10] +(27) 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] -(27) Filter [codegen id : 10] +(28) 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)) -(28) Scan parquet default.date_dim +(29) 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 -(29) ColumnarToRow [codegen id : 9] +(30) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#5, d_year#6] -(30) Filter [codegen id : 9] +(31) 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)) -(31) BroadcastExchange +(32) BroadcastExchange Input [2]: [d_date_sk#5, d_year#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] -(32) BroadcastHashJoin [codegen id : 10] +(33) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#5] Join condition: None -(33) Project [codegen id : 10] +(34) 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] -(34) Exchange +(35) 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] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#28] -(35) Sort [codegen id : 11] +(36) 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 -(36) ReusedExchange [Reuses operator id: 15] +(37) 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] -(37) Sort [codegen id : 13] +(38) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(38) SortMergeJoin [codegen id : 14] +(39) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None -(39) Project [codegen id : 14] +(40) 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] -(40) HashAggregate [codegen id : 14] +(41) 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)))] -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] +Aggregate Attributes [1]: [sum#29] +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#30] -(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] +(42) 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#30] +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=#31] -(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] +(43) 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#30] 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 [5]: [c_customer_id#10 AS customer_id#31, c_first_name#11 AS customer_first_name#32, c_last_name#12 AS customer_last_name#33, c_email_address#16 AS customer_email_address#34, 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#35] +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)))#32] +Results [5]: [c_customer_id#10 AS customer_id#33, c_first_name#11 AS customer_first_name#34, c_last_name#12 AS customer_last_name#35, c_email_address#16 AS customer_email_address#36, 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)))#32,18,2) AS year_total#37] -(43) Exchange -Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35] -Arguments: hashpartitioning(customer_id#31, 5), true, [id=#36] +(44) Exchange +Input [5]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37] +Arguments: hashpartitioning(customer_id#33, 5), true, [id=#38] -(44) Sort [codegen id : 16] -Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35] -Arguments: [customer_id#31 ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 16] +Input [5]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37] +Arguments: [customer_id#33 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#31] +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#33] Join condition: None -(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] +(47) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] 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] -Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +(48) ColumnarToRow [codegen id : 19] +Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] -(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) Filter [codegen id : 19] +Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +Condition : (isnotnull(ws_bill_customer_sk#40) AND isnotnull(ws_sold_date_sk#39)) -(49) ReusedExchange [Reuses operator id: 7] +(50) 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] +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#39] Right keys [1]: [d_date_sk#5] 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] +(52) Project [codegen id : 19] +Output [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Input [6]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_date_sk#5, d_year#6] -(52) Exchange -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) Exchange +Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Arguments: hashpartitioning(ws_bill_customer_sk#40, 5), true, [id=#43] -(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] -Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0 +(54) Sort [codegen id : 20] +Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Arguments: [ws_bill_customer_sk#40 ASC NULLS FIRST], false, 0 -(54) ReusedExchange [Reuses operator id: 15] +(55) 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] -(55) Sort [codegen id : 22] +(56) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(56) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#38] +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#40] Right keys [1]: [c_customer_sk#9] 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] +(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#41, ws_ext_list_price#42, d_year#6] +Input [12]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, 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] +(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#41, ws_ext_list_price#42, 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#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#42] -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#43] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#44] +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#45] -(59) 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#43] -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=#44] +(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#45] +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=#46] -(60) 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#43] +(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#45] 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#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45] -Results [2]: [c_customer_id#10 AS customer_id#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45,18,2) AS year_total#47] - -(61) Filter [codegen id : 24] -Input [2]: [customer_id#46, year_total#47] -Condition : (isnotnull(year_total#47) AND (year_total#47 > 0.00)) +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#47] +Results [2]: [c_customer_id#10 AS customer_id#48, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#47,18,2) AS year_total#49] -(62) Project [codegen id : 24] -Output [2]: [customer_id#46 AS customer_id#48, year_total#47 AS year_total#49] -Input [2]: [customer_id#46, year_total#47] - -(63) Exchange +(62) Filter [codegen id : 24] Input [2]: [customer_id#48, year_total#49] -Arguments: hashpartitioning(customer_id#48, 5), true, [id=#50] +Condition : (isnotnull(year_total#49) AND (year_total#49 > 0.00)) -(64) Sort [codegen id : 25] +(63) Project [codegen id : 24] +Output [2]: [customer_id#48 AS customer_id#50, year_total#49 AS year_total#51] Input [2]: [customer_id#48, year_total#49] -Arguments: [customer_id#48 ASC NULLS FIRST], false, 0 -(65) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#48] +(64) Exchange +Input [2]: [customer_id#50, year_total#51] +Arguments: hashpartitioning(customer_id#50, 5), true, [id=#52] + +(65) Sort [codegen id : 25] +Input [2]: [customer_id#50, year_total#51] +Arguments: [customer_id#50 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#50] Join condition: None -(66) Project [codegen id : 26] -Output [8]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49] -Input [9]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, customer_id#48, year_total#49] +(67) Project [codegen id : 26] +Output [8]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, year_total#51] +Input [9]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, customer_id#50, year_total#51] -(67) 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] +(68) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] 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] -Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +(69) ColumnarToRow [codegen id : 28] +Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] -(69) Filter [codegen id : 28] -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)) +(70) Filter [codegen id : 28] +Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +Condition : (isnotnull(ws_bill_customer_sk#40) AND isnotnull(ws_sold_date_sk#39)) -(70) ReusedExchange [Reuses operator id: 31] +(71) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#5, d_year#6] -(71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#37] +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#39] Right keys [1]: [d_date_sk#5] Join condition: None -(72) Project [codegen id : 28] -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] +(73) Project [codegen id : 28] +Output [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Input [6]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_date_sk#5, d_year#6] -(73) Exchange -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=#51] +(74) Exchange +Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Arguments: hashpartitioning(ws_bill_customer_sk#40, 5), true, [id=#53] -(74) Sort [codegen id : 29] -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 +(75) Sort [codegen id : 29] +Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] +Arguments: [ws_bill_customer_sk#40 ASC NULLS FIRST], false, 0 -(75) ReusedExchange [Reuses operator id: 15] +(76) 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] -(76) Sort [codegen id : 31] +(77) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(77) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#38] +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#40] Right keys [1]: [c_customer_sk#9] Join condition: None -(78) 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#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] +(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#41, ws_ext_list_price#42, d_year#6] +Input [12]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, 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] -(79) 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#39, ws_ext_list_price#40, d_year#6] +(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#41, ws_ext_list_price#42, 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#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#52] -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#53] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#54] +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#55] -(80) 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#53] -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=#54] +(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#55] +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=#56] -(81) 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#53] +(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#55] 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#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55] -Results [2]: [c_customer_id#10 AS customer_id#56, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55,18,2) AS year_total#57] - -(82) Exchange -Input [2]: [customer_id#56, year_total#57] -Arguments: hashpartitioning(customer_id#56, 5), true, [id=#58] - -(83) Sort [codegen id : 34] -Input [2]: [customer_id#56, year_total#57] -Arguments: [customer_id#56 ASC NULLS FIRST], false, 0 - -(84) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#22] -Right keys [1]: [customer_id#56] -Join condition: (CASE WHEN (year_total#49 > 0.00) THEN CheckOverflow((promote_precision(year_total#57) / promote_precision(year_total#49)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#35) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE 0E-20 END) - -(85) Project [codegen id : 35] -Output [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] -Input [10]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49, customer_id#56, year_total#57] - -(86) TakeOrderedAndProject -Input [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] -Arguments: 100, [customer_id#31 ASC NULLS FIRST, customer_first_name#32 ASC NULLS FIRST, customer_last_name#33 ASC NULLS FIRST, customer_email_address#34 ASC NULLS FIRST], [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#57] +Results [2]: [c_customer_id#10 AS customer_id#58, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#57,18,2) AS year_total#59] + +(83) Exchange +Input [2]: [customer_id#58, year_total#59] +Arguments: hashpartitioning(customer_id#58, 5), true, [id=#60] + +(84) Sort [codegen id : 34] +Input [2]: [customer_id#58, year_total#59] +Arguments: [customer_id#58 ASC NULLS FIRST], false, 0 + +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#24] +Right keys [1]: [customer_id#58] +Join condition: (CASE WHEN (year_total#51 > 0.00) THEN CheckOverflow((promote_precision(year_total#59) / promote_precision(year_total#51)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#25 > 0.00) THEN CheckOverflow((promote_precision(year_total#37) / promote_precision(year_total#25)), DecimalType(38,20), true) ELSE 0E-20 END) + +(86) Project [codegen id : 35] +Output [4]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] +Input [10]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, year_total#51, customer_id#58, year_total#59] + +(87) TakeOrderedAndProject +Input [4]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] +Arguments: 100, [customer_id#33 ASC NULLS FIRST, customer_first_name#34 ASC NULLS FIRST, customer_last_name#35 ASC NULLS FIRST, customer_email_address#36 ASC NULLS FIRST], [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] 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..2857d41125ee7 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 @@ -15,43 +15,44 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt index fc0b38368e006..4e6fee0076626 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt @@ -1,76 +1,77 @@ == Physical Plan == -TakeOrderedAndProject (72) -+- * Project (71) - +- * BroadcastHashJoin Inner BuildRight (70) - :- * Project (56) - : +- * BroadcastHashJoin Inner BuildRight (55) - : :- * BroadcastHashJoin Inner BuildRight (36) - : : :- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (35) - : : +- * HashAggregate (34) - : : +- Exchange (33) - : : +- * HashAggregate (32) - : : +- * Project (31) - : : +- * BroadcastHashJoin Inner BuildRight (30) - : : :- * Project (25) - : : : +- * BroadcastHashJoin Inner BuildRight (24) - : : : :- * Filter (22) - : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.customer (20) - : : : +- ReusedExchange (23) - : : +- BroadcastExchange (29) - : : +- * Filter (28) - : : +- * ColumnarToRow (27) - : : +- Scan parquet default.date_dim (26) - : +- BroadcastExchange (54) - : +- * Project (53) - : +- * Filter (52) - : +- * HashAggregate (51) - : +- Exchange (50) - : +- * HashAggregate (49) - : +- * Project (48) - : +- * BroadcastHashJoin Inner BuildRight (47) - : :- * Project (45) - : : +- * BroadcastHashJoin Inner BuildRight (44) - : : :- * Filter (39) - : : : +- * ColumnarToRow (38) - : : : +- Scan parquet default.customer (37) - : : +- BroadcastExchange (43) - : : +- * Filter (42) - : : +- * ColumnarToRow (41) - : : +- Scan parquet default.web_sales (40) - : +- ReusedExchange (46) - +- BroadcastExchange (69) - +- * HashAggregate (68) - +- Exchange (67) - +- * HashAggregate (66) - +- * Project (65) - +- * BroadcastHashJoin Inner BuildRight (64) - :- * Project (62) - : +- * BroadcastHashJoin Inner BuildRight (61) - : :- * Filter (59) - : : +- * ColumnarToRow (58) - : : +- Scan parquet default.customer (57) - : +- ReusedExchange (60) - +- ReusedExchange (63) +TakeOrderedAndProject (73) ++- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (57) + : +- * BroadcastHashJoin Inner BuildRight (56) + : :- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (20) + : : : +- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.customer (21) + : : : +- ReusedExchange (24) + : : +- BroadcastExchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.date_dim (27) + : +- BroadcastExchange (55) + : +- * Project (54) + : +- * Filter (53) + : +- * HashAggregate (52) + : +- Exchange (51) + : +- * HashAggregate (50) + : +- * Project (49) + : +- * BroadcastHashJoin Inner BuildRight (48) + : :- * Project (46) + : : +- * BroadcastHashJoin Inner BuildRight (45) + : : :- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.customer (38) + : : +- BroadcastExchange (44) + : : +- * Filter (43) + : : +- * ColumnarToRow (42) + : : +- Scan parquet default.web_sales (41) + : +- ReusedExchange (47) + +- BroadcastExchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Filter (60) + : : +- * ColumnarToRow (59) + : : +- Scan parquet default.customer (58) + : +- ReusedExchange (61) + +- ReusedExchange (64) (1) Scan parquet default.customer @@ -163,248 +164,252 @@ Results [2]: [c_customer_id#2 AS customer_id#21, MakeDecimal(sum(UnscaledValue(C Input [2]: [customer_id#21, year_total#22] Condition : (isnotnull(year_total#22) AND (year_total#22 > 0.00)) -(20) Scan parquet default.customer +(20) Project [codegen id : 16] +Output [2]: [customer_id#21 AS customer_id#23, year_total#22 AS year_total#24] +Input [2]: [customer_id#21, year_total#22] + +(21) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] +(22) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(22) Filter [codegen id : 6] +(23) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(23) ReusedExchange [Reuses operator id: 7] +(24) ReusedExchange [Reuses operator id: 7] Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(24) BroadcastHashJoin [codegen id : 6] +(25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(25) Project [codegen id : 6] +(26) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12] Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(26) Scan parquet default.date_dim +(27) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] 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 -(27) ColumnarToRow [codegen id : 5] +(28) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] -(28) Filter [codegen id : 5] +(29) Filter [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) -(29) BroadcastExchange +(30) BroadcastExchange Input [2]: [d_date_sk#14, d_year#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] -(30) BroadcastHashJoin [codegen id : 6] +(31) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#14] Join condition: None -(31) Project [codegen id : 6] +(32) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, d_date_sk#14, d_year#15] -(32) HashAggregate [codegen id : 6] +(33) HashAggregate [codegen id : 6] Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#24] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +Aggregate Attributes [1]: [sum#26] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] -(33) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#26] +(34) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#28] -(34) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +(35) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27] -Results [5]: [c_customer_id#2 AS customer_id#28, c_first_name#3 AS customer_first_name#29, c_last_name#4 AS customer_last_name#30, c_email_address#8 AS customer_email_address#31, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27,18,2) AS year_total#32] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29] +Results [5]: [c_customer_id#2 AS customer_id#30, c_first_name#3 AS customer_first_name#31, c_last_name#4 AS customer_last_name#32, c_email_address#8 AS customer_email_address#33, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29,18,2) AS year_total#34] -(35) BroadcastExchange -Input [5]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#33] +(36) BroadcastExchange +Input [5]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#35] -(36) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#28] +(37) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#30] Join condition: None -(37) Scan parquet default.customer +(38) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 10] +(39) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(39) Filter [codegen id : 10] +(40) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(40) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(41) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 8] -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(42) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -(42) Filter [codegen id : 8] -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -Condition : (isnotnull(ws_bill_customer_sk#35) AND isnotnull(ws_sold_date_sk#34)) +(43) Filter [codegen id : 8] +Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +Condition : (isnotnull(ws_bill_customer_sk#37) AND isnotnull(ws_sold_date_sk#36)) -(43) BroadcastExchange -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#38] +(44) BroadcastExchange +Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#40] -(44) BroadcastHashJoin [codegen id : 10] +(45) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#35] +Right keys [1]: [ws_bill_customer_sk#37] Join condition: None -(45) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(46) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -(46) ReusedExchange [Reuses operator id: 13] +(47) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#14, d_year#15] -(47) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#34] +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#36] Right keys [1]: [d_date_sk#14] Join condition: None -(48) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] +(49) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39, d_date_sk#14, d_year#15] -(49) HashAggregate [codegen id : 10] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +(50) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#39] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#41] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] -(50) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#41] +(51) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#43] -(51) HashAggregate [codegen id : 11] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +(52) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42] -Results [2]: [c_customer_id#2 AS customer_id#43, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42,18,2) AS year_total#44] - -(52) Filter [codegen id : 11] -Input [2]: [customer_id#43, year_total#44] -Condition : (isnotnull(year_total#44) AND (year_total#44 > 0.00)) +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#44] +Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#44,18,2) AS year_total#46] -(53) Project [codegen id : 11] -Output [2]: [customer_id#43 AS customer_id#45, year_total#44 AS year_total#46] -Input [2]: [customer_id#43, year_total#44] +(53) Filter [codegen id : 11] +Input [2]: [customer_id#45, year_total#46] +Condition : (isnotnull(year_total#46) AND (year_total#46 > 0.00)) -(54) BroadcastExchange +(54) Project [codegen id : 11] +Output [2]: [customer_id#45 AS customer_id#47, year_total#46 AS year_total#48] Input [2]: [customer_id#45, year_total#46] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] -(55) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#45] +(55) BroadcastExchange +Input [2]: [customer_id#47, year_total#48] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] + +(56) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#47] Join condition: None -(56) Project [codegen id : 16] -Output [8]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, year_total#46] -Input [9]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, customer_id#45, year_total#46] +(57) Project [codegen id : 16] +Output [8]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, year_total#48] +Input [9]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, customer_id#47, year_total#48] -(57) Scan parquet default.customer +(58) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(58) ColumnarToRow [codegen id : 14] +(59) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(59) Filter [codegen id : 14] +(60) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(60) ReusedExchange [Reuses operator id: 43] -Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(61) ReusedExchange [Reuses operator id: 44] +Output [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -(61) BroadcastHashJoin [codegen id : 14] +(62) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#35] +Right keys [1]: [ws_bill_customer_sk#37] Join condition: None -(62) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(63) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -(63) ReusedExchange [Reuses operator id: 29] +(64) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#14, d_year#15] -(64) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#34] +(65) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#36] Right keys [1]: [d_date_sk#14] Join condition: None -(65) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] +(66) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39, d_date_sk#14, d_year#15] -(66) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +(67) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#48] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#50] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] -(67) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#50] +(68) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#52] -(68) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +(69) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51] -Results [2]: [c_customer_id#2 AS customer_id#52, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51,18,2) AS year_total#53] - -(69) BroadcastExchange -Input [2]: [customer_id#52, year_total#53] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#54] - -(70) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#21] -Right keys [1]: [customer_id#52] -Join condition: (CASE WHEN (year_total#46 > 0.00) THEN CheckOverflow((promote_precision(year_total#53) / promote_precision(year_total#46)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#22 > 0.00) THEN CheckOverflow((promote_precision(year_total#32) / promote_precision(year_total#22)), DecimalType(38,20), true) ELSE 0E-20 END) - -(71) Project [codegen id : 16] -Output [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] -Input [10]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, year_total#46, customer_id#52, year_total#53] - -(72) TakeOrderedAndProject -Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] -Arguments: 100, [customer_id#28 ASC NULLS FIRST, customer_first_name#29 ASC NULLS FIRST, customer_last_name#30 ASC NULLS FIRST, customer_email_address#31 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#53] +Results [2]: [c_customer_id#2 AS customer_id#54, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#53,18,2) AS year_total#55] + +(70) BroadcastExchange +Input [2]: [customer_id#54, year_total#55] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#56] + +(71) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#54] +Join condition: (CASE WHEN (year_total#48 > 0.00) THEN CheckOverflow((promote_precision(year_total#55) / promote_precision(year_total#48)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#34) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE 0E-20 END) + +(72) Project [codegen id : 16] +Output [4]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] +Input [10]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, year_total#48, customer_id#54, year_total#55] + +(73) TakeOrderedAndProject +Input [4]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] +Arguments: 100, [customer_id#30 ASC NULLS FIRST, customer_first_name#31 ASC NULLS FIRST, customer_last_name#32 ASC NULLS FIRST, customer_email_address#33 ASC NULLS FIRST], [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt index ab72d5041eeea..0ac7ba7fb2b31 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt @@ -5,34 +5,35 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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..9bd0b32a591d5 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 @@ -736,24 +736,25 @@ 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] (133) Union +Arguments: [quantity#82, list_price#83] (134) HashAggregate [codegen id : 7] -Input [2]: [quantity#72, list_price#73] +Input [2]: [quantity#82, list_price#83] Keys: [] -Functions [1]: [partial_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))] -Aggregate Attributes [2]: [sum#82, count#83] -Results [2]: [sum#84, count#85] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#84, count#85] +Results [2]: [sum#86, count#87] (135) Exchange -Input [2]: [sum#84, count#85] -Arguments: SinglePartition, true, [id=#86] +Input [2]: [sum#86, count#87] +Arguments: SinglePartition, true, [id=#88] (136) HashAggregate [codegen id : 8] -Input [2]: [sum#84, count#85] +Input [2]: [sum#86, count#87] Keys: [] -Functions [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))] -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] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89 AS average_sales#90] Subquery:2 Hosting operator id = 67 Hosting Expression = Subquery scalar-subquery#30, [id=#31] * Project (140) @@ -763,22 +764,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#29, d_year#11, d_moy#91, d_dom#92] 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,16)] 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#29, d_year#11, d_moy#91, d_dom#92] (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 = 1999)) AND (d_moy#89 = 12)) AND (d_dom#90 = 16)) +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1999)) AND (d_moy#91 = 12)) AND (d_dom#92 = 16)) (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] +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] Subquery:3 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#47, [id=#48] @@ -790,21 +791,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#29, d_year#11, d_moy#91, d_dom#92] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] 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#29, d_year#11, d_moy#91, d_dom#92] (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 = 1998)) AND (d_moy#89 = 12)) AND (d_dom#90 = 16)) +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1998)) AND (d_moy#91 = 12)) AND (d_dom#92 = 16)) (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] +Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] 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..911c66b997afd 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 @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt index 1af2e69d57338..1b54d866203e6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt @@ -689,24 +689,25 @@ Output [2]: [ws_quantity#75 AS quantity#77, ws_list_price#76 AS list_price#78] Input [4]: [ws_sold_date_sk#20, ws_quantity#75, ws_list_price#76, d_date_sk#10] (123) Union +Arguments: [quantity#79, list_price#80] (124) HashAggregate [codegen id : 7] -Input [2]: [quantity#69, list_price#70] +Input [2]: [quantity#79, list_price#80] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#79, count#80] -Results [2]: [sum#81, count#82] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#81, count#82] +Results [2]: [sum#83, count#84] (125) Exchange -Input [2]: [sum#81, count#82] -Arguments: SinglePartition, true, [id=#83] +Input [2]: [sum#83, count#84] +Arguments: SinglePartition, true, [id=#85] (126) HashAggregate [codegen id : 8] -Input [2]: [sum#81, count#82] +Input [2]: [sum#83, count#84] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84 AS average_sales#85] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86 AS average_sales#87] Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#29, [id=#30] * Project (130) @@ -716,22 +717,22 @@ Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquer (127) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] 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,16)] ReadSchema: struct (128) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] (129) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1999)) AND (d_moy#86 = 12)) AND (d_dom#87 = 16)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1999)) AND (d_moy#88 = 12)) AND (d_dom#89 = 16)) (130) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] Subquery:3 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#44, [id=#45] @@ -743,21 +744,21 @@ Subquery:4 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] ReadSchema: struct (132) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] (133) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1998)) AND (d_moy#86 = 12)) AND (d_dom#87 = 16)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1998)) AND (d_moy#88 = 12)) AND (d_dom#89 = 16)) (134) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt index 7bbf83e3de707..c3079dd2643bb 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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..2172be69af68c 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 @@ -787,476 +787,485 @@ Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sal 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 +Arguments: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sales#84, number_sales#85] (127) HashAggregate [codegen id : 118] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#80, isEmpty#81, sum#82] -Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] +Input [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sales#84, number_sales#85] +Keys [4]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [partial_sum(sales#84), partial_sum(number_sales#85)] +Aggregate Attributes [3]: [sum#86, isEmpty#87, sum#88] +Results [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] (128) Exchange -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#86] +Input [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] +Arguments: hashpartitioning(channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, 5), true, [id=#92] (129) HashAggregate [codegen id : 119] -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#87, sum(number_sales#43)#88] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum(sales#42)#87 AS sum_sales#89, sum(number_sales#43)#88 AS number_sales#90] +Input [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] +Keys [4]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [sum(sales#84), sum(number_sales#85)] +Aggregate Attributes [2]: [sum(sales#84)#93, sum(number_sales#85)#94] +Results [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales#84)#93 AS sum_sales#95, sum(number_sales#85)#94 AS number_sales#96] (130) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#91, isEmpty#92, count#93] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] (131) HashAggregate [codegen id : 158] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#91, isEmpty#92, count#93] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] 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))#94, count(1)#95] -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))#94 AS sales#42, count(1)#95 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))#94 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))#96] +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))#100, count(1)#101] +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))#100 AS sales#42, count(1)#101 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))#100 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))#102] (132) Filter [codegen id : 158] -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))#96] -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))#96) 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))#96 as decimal(32,6)) > cast(ReusedSubquery 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))#102] +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))#102) 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))#102 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (133) Project [codegen id : 158] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#96] +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))#102] (134) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#103, isEmpty#104, count#105] (135) HashAggregate [codegen id : 197] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#103, isEmpty#104, count#105] 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))#100, count(1)#101] -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))#100 AS sales#60, count(1)#101 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))#100 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))#102] +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))#106, count(1)#107] +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))#106 AS sales#60, count(1)#107 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))#106 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))#108] (136) Filter [codegen id : 197] -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))#102] -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))#102) 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))#102 as decimal(32,6)) > cast(ReusedSubquery 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#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))#108] +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))#108) 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))#108 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (137) Project [codegen id : 197] -Output [6]: [catalog AS channel#103, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#102] +Output [6]: [catalog AS channel#109, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#108] (138) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#104, isEmpty#105, count#106] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#110, isEmpty#111, count#112] (139) HashAggregate [codegen id : 236] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#104, isEmpty#105, count#106] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#110, isEmpty#111, count#112] 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))#107, count(1)#108] -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))#107 AS sales#76, count(1)#108 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))#107 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))#109] +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))#113, count(1)#114] +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))#113 AS sales#76, count(1)#114 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))#113 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))#115] (140) Filter [codegen id : 236] -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))#109] -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))#109) 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))#109 as decimal(32,6)) > cast(ReusedSubquery 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#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))#115] +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))#115) 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))#115 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (141) Project [codegen id : 236] -Output [6]: [web AS channel#110, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#109] +Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#115] (142) Union +Arguments: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sales#120, number_sales#121] (143) HashAggregate [codegen id : 237] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#111, isEmpty#112, sum#113] -Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] +Input [6]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sales#120, number_sales#121] +Keys [4]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119] +Functions [2]: [partial_sum(sales#120), partial_sum(number_sales#121)] +Aggregate Attributes [3]: [sum#122, isEmpty#123, sum#124] +Results [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] (144) Exchange -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#117] +Input [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] +Arguments: hashpartitioning(channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, 5), true, [id=#128] (145) HashAggregate [codegen id : 238] -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#118, sum(number_sales#43)#119] -Results [5]: [channel#47, i_brand_id#7, i_class_id#8, sum(sales#42)#118 AS sum_sales#89, sum(number_sales#43)#119 AS number_sales#90] +Input [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] +Keys [4]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119] +Functions [2]: [sum(sales#120), sum(number_sales#121)] +Aggregate Attributes [2]: [sum(sales#120)#129, sum(number_sales#121)#130] +Results [5]: [channel#116, i_brand_id#117, i_class_id#118, sum(sales#120)#129 AS sum_sales#95, sum(number_sales#121)#130 AS number_sales#96] (146) HashAggregate [codegen id : 238] -Input [5]: [channel#47, i_brand_id#7, i_class_id#8, sum_sales#89, number_sales#90] -Keys [3]: [channel#47, i_brand_id#7, i_class_id#8] -Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] -Aggregate Attributes [3]: [sum#120, isEmpty#121, sum#122] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] +Input [5]: [channel#116, i_brand_id#117, i_class_id#118, sum_sales#95, number_sales#96] +Keys [3]: [channel#116, i_brand_id#117, i_class_id#118] +Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] +Aggregate Attributes [3]: [sum#131, isEmpty#132, sum#133] +Results [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] (147) Exchange -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, 5), true, [id=#126] +Input [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] +Arguments: hashpartitioning(channel#116, i_brand_id#117, i_class_id#118, 5), true, [id=#137] (148) HashAggregate [codegen id : 239] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] -Keys [3]: [channel#47, i_brand_id#7, i_class_id#8] -Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] -Aggregate Attributes [2]: [sum(sum_sales#89)#127, sum(number_sales#90)#128] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, null AS i_category_id#129, sum(sum_sales#89)#127 AS sum(sum_sales)#130, sum(number_sales#90)#128 AS sum(number_sales)#131] +Input [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] +Keys [3]: [channel#116, i_brand_id#117, i_class_id#118] +Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] +Aggregate Attributes [2]: [sum(sum_sales#95)#138, sum(number_sales#96)#139] +Results [6]: [channel#116, i_brand_id#117, i_class_id#118, null AS i_category_id#140, sum(sum_sales#95)#138 AS sum(sum_sales)#141, sum(number_sales#96)#139 AS sum(number_sales)#142] (149) Union +Arguments: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] (150) HashAggregate [codegen id : 240] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Keys [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] (151) Exchange -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#132] +Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Arguments: hashpartitioning(channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148, 5), true, [id=#149] (152) HashAggregate [codegen id : 241] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Keys [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] (153) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#133, isEmpty#134, count#135] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#150, isEmpty#151, count#152] (154) HashAggregate [codegen id : 280] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#133, isEmpty#134, count#135] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#150, isEmpty#151, count#152] 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))#136, count(1)#137] -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))#136 AS sales#42, count(1)#137 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))#136 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))#138] +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))#153, count(1)#154] +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))#153 AS sales#42, count(1)#154 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))#153 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))#155] (155) Filter [codegen id : 280] -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))#138] -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))#138) 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))#138 as decimal(32,6)) > cast(ReusedSubquery 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))#155] +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))#155) 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))#155 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (156) Project [codegen id : 280] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#138] +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))#155] (157) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#139, isEmpty#140, count#141] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, count#158] (158) HashAggregate [codegen id : 319] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#139, isEmpty#140, count#141] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, count#158] 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))#142, count(1)#143] -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))#142 AS sales#60, count(1)#143 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))#142 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))#144] +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))#159, count(1)#160] +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))#159 AS sales#60, count(1)#160 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))#159 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))#161] (159) Filter [codegen id : 319] -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))#144] -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))#144) 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))#144 as decimal(32,6)) > cast(ReusedSubquery 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#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))#161] +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))#161) 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))#161 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (160) Project [codegen id : 319] -Output [6]: [catalog AS channel#145, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#144] +Output [6]: [catalog AS channel#162, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#161] (161) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#146, isEmpty#147, count#148] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#163, isEmpty#164, count#165] (162) HashAggregate [codegen id : 358] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#146, isEmpty#147, count#148] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#163, isEmpty#164, count#165] 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))#149, count(1)#150] -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))#149 AS sales#76, count(1)#150 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))#149 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))#151] +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))#166, count(1)#167] +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))#166 AS sales#76, count(1)#167 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))#166 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))#168] (163) Filter [codegen id : 358] -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))#151] -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))#151) 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))#151 as decimal(32,6)) > cast(ReusedSubquery 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#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))#168] +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))#168) 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))#168 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (164) Project [codegen id : 358] -Output [6]: [web AS channel#152, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#151] +Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#168] (165) Union +Arguments: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sales#173, number_sales#174] (166) HashAggregate [codegen id : 359] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#153, isEmpty#154, sum#155] -Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] +Input [6]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sales#173, number_sales#174] +Keys [4]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172] +Functions [2]: [partial_sum(sales#173), partial_sum(number_sales#174)] +Aggregate Attributes [3]: [sum#175, isEmpty#176, sum#177] +Results [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] (167) Exchange -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#159] +Input [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] +Arguments: hashpartitioning(channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, 5), true, [id=#181] (168) HashAggregate [codegen id : 360] -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#160, sum(number_sales#43)#161] -Results [4]: [channel#47, i_brand_id#7, sum(sales#42)#160 AS sum_sales#89, sum(number_sales#43)#161 AS number_sales#90] +Input [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] +Keys [4]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172] +Functions [2]: [sum(sales#173), sum(number_sales#174)] +Aggregate Attributes [2]: [sum(sales#173)#182, sum(number_sales#174)#183] +Results [4]: [channel#169, i_brand_id#170, sum(sales#173)#182 AS sum_sales#95, sum(number_sales#174)#183 AS number_sales#96] (169) HashAggregate [codegen id : 360] -Input [4]: [channel#47, i_brand_id#7, sum_sales#89, number_sales#90] -Keys [2]: [channel#47, i_brand_id#7] -Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] -Aggregate Attributes [3]: [sum#162, isEmpty#163, sum#164] -Results [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] +Input [4]: [channel#169, i_brand_id#170, sum_sales#95, number_sales#96] +Keys [2]: [channel#169, i_brand_id#170] +Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] +Aggregate Attributes [3]: [sum#184, isEmpty#185, sum#186] +Results [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] (170) Exchange -Input [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] -Arguments: hashpartitioning(channel#47, i_brand_id#7, 5), true, [id=#168] +Input [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] +Arguments: hashpartitioning(channel#169, i_brand_id#170, 5), true, [id=#190] (171) HashAggregate [codegen id : 361] -Input [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] -Keys [2]: [channel#47, i_brand_id#7] -Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] -Aggregate Attributes [2]: [sum(sum_sales#89)#169, sum(number_sales#90)#170] -Results [6]: [channel#47, i_brand_id#7, null AS i_class_id#171, null AS i_category_id#172, sum(sum_sales#89)#169 AS sum(sum_sales)#173, sum(number_sales#90)#170 AS sum(number_sales)#174] +Input [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] +Keys [2]: [channel#169, i_brand_id#170] +Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] +Aggregate Attributes [2]: [sum(sum_sales#95)#191, sum(number_sales#96)#192] +Results [6]: [channel#169, i_brand_id#170, null AS i_class_id#193, null AS i_category_id#194, sum(sum_sales#95)#191 AS sum(sum_sales)#195, sum(number_sales#96)#192 AS sum(number_sales)#196] (172) Union +Arguments: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] (173) HashAggregate [codegen id : 362] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Keys [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] (174) Exchange -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#175] +Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Arguments: hashpartitioning(channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202, 5), true, [id=#203] (175) HashAggregate [codegen id : 363] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Keys [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] (176) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#176, isEmpty#177, count#178] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#204, isEmpty#205, count#206] (177) HashAggregate [codegen id : 402] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#176, isEmpty#177, count#178] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#204, isEmpty#205, count#206] 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))#179, count(1)#180] -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))#179 AS sales#42, count(1)#180 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))#179 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))#181] +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))#207, count(1)#208] +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))#207 AS sales#42, count(1)#208 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))#207 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))#209] (178) Filter [codegen id : 402] -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))#181] -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))#181) 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))#181 as decimal(32,6)) > cast(ReusedSubquery 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))#209] +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))#209) 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))#209 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (179) Project [codegen id : 402] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#181] +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))#209] (180) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#182, isEmpty#183, count#184] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#210, isEmpty#211, count#212] (181) HashAggregate [codegen id : 441] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#182, isEmpty#183, count#184] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#210, isEmpty#211, count#212] 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))#185, count(1)#186] -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))#185 AS sales#60, count(1)#186 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))#185 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))#187] +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))#213, count(1)#214] +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))#213 AS sales#60, count(1)#214 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))#213 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))#215] (182) Filter [codegen id : 441] -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))#187] -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))#187) 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))#187 as decimal(32,6)) > cast(ReusedSubquery 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#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))#215] +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))#215) 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))#215 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (183) Project [codegen id : 441] -Output [6]: [catalog AS channel#188, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#187] +Output [6]: [catalog AS channel#216, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#215] (184) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#189, isEmpty#190, count#191] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#217, isEmpty#218, count#219] (185) HashAggregate [codegen id : 480] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#189, isEmpty#190, count#191] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#217, isEmpty#218, count#219] 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))#192, count(1)#193] -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))#192 AS sales#76, count(1)#193 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))#192 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))#194] +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))#220, count(1)#221] +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))#220 AS sales#76, count(1)#221 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))#220 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))#222] (186) Filter [codegen id : 480] -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))#194] -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))#194) 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))#194 as decimal(32,6)) > cast(ReusedSubquery 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#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))#222] +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))#222) 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))#222 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (187) Project [codegen id : 480] -Output [6]: [web AS channel#195, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#194] +Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#222] (188) Union +Arguments: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sales#227, number_sales#228] (189) HashAggregate [codegen id : 481] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#196, isEmpty#197, sum#198] -Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] +Input [6]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sales#227, number_sales#228] +Keys [4]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226] +Functions [2]: [partial_sum(sales#227), partial_sum(number_sales#228)] +Aggregate Attributes [3]: [sum#229, isEmpty#230, sum#231] +Results [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] (190) Exchange -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#202] +Input [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] +Arguments: hashpartitioning(channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, 5), true, [id=#235] (191) HashAggregate [codegen id : 482] -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#203, sum(number_sales#43)#204] -Results [3]: [channel#47, sum(sales#42)#203 AS sum_sales#89, sum(number_sales#43)#204 AS number_sales#90] +Input [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] +Keys [4]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226] +Functions [2]: [sum(sales#227), sum(number_sales#228)] +Aggregate Attributes [2]: [sum(sales#227)#236, sum(number_sales#228)#237] +Results [3]: [channel#223, sum(sales#227)#236 AS sum_sales#95, sum(number_sales#228)#237 AS number_sales#96] (192) HashAggregate [codegen id : 482] -Input [3]: [channel#47, sum_sales#89, number_sales#90] -Keys [1]: [channel#47] -Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] -Aggregate Attributes [3]: [sum#205, isEmpty#206, sum#207] -Results [4]: [channel#47, sum#208, isEmpty#209, sum#210] +Input [3]: [channel#223, sum_sales#95, number_sales#96] +Keys [1]: [channel#223] +Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] +Aggregate Attributes [3]: [sum#238, isEmpty#239, sum#240] +Results [4]: [channel#223, sum#241, isEmpty#242, sum#243] (193) Exchange -Input [4]: [channel#47, sum#208, isEmpty#209, sum#210] -Arguments: hashpartitioning(channel#47, 5), true, [id=#211] +Input [4]: [channel#223, sum#241, isEmpty#242, sum#243] +Arguments: hashpartitioning(channel#223, 5), true, [id=#244] (194) HashAggregate [codegen id : 483] -Input [4]: [channel#47, sum#208, isEmpty#209, sum#210] -Keys [1]: [channel#47] -Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] -Aggregate Attributes [2]: [sum(sum_sales#89)#212, sum(number_sales#90)#213] -Results [6]: [channel#47, null AS i_brand_id#214, null AS i_class_id#215, null AS i_category_id#216, sum(sum_sales#89)#212 AS sum(sum_sales)#217, sum(number_sales#90)#213 AS sum(number_sales)#218] +Input [4]: [channel#223, sum#241, isEmpty#242, sum#243] +Keys [1]: [channel#223] +Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] +Aggregate Attributes [2]: [sum(sum_sales#95)#245, sum(number_sales#96)#246] +Results [6]: [channel#223, null AS i_brand_id#247, null AS i_class_id#248, null AS i_category_id#249, sum(sum_sales#95)#245 AS sum(sum_sales)#250, sum(number_sales#96)#246 AS sum(number_sales)#251] (195) Union +Arguments: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] (196) HashAggregate [codegen id : 484] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Keys [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] (197) Exchange -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#219] +Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Arguments: hashpartitioning(channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257, 5), true, [id=#258] (198) HashAggregate [codegen id : 485] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Keys [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] (199) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#220, isEmpty#221, count#222] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#259, isEmpty#260, count#261] (200) HashAggregate [codegen id : 524] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#220, isEmpty#221, count#222] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#259, isEmpty#260, count#261] 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))#223, count(1)#224] -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))#223 AS sales#42, count(1)#224 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))#223 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))#225] +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))#262, count(1)#263] +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))#262 AS sales#42, count(1)#263 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))#262 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))#264] (201) Filter [codegen id : 524] -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))#225] -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))#225) 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))#225 as decimal(32,6)) > cast(ReusedSubquery 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))#264] +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))#264) 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))#264 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (202) Project [codegen id : 524] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#225] +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))#264] (203) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#226, isEmpty#227, count#228] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#265, isEmpty#266, count#267] (204) HashAggregate [codegen id : 563] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#226, isEmpty#227, count#228] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#265, isEmpty#266, count#267] 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))#229, count(1)#230] -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))#229 AS sales#60, count(1)#230 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))#229 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))#231] +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))#268, count(1)#269] +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))#268 AS sales#60, count(1)#269 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))#268 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))#270] (205) Filter [codegen id : 563] -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))#231] -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))#231) 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))#231 as decimal(32,6)) > cast(ReusedSubquery 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#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))#270] +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))#270) 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))#270 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (206) Project [codegen id : 563] -Output [6]: [catalog AS channel#232, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#231] +Output [6]: [catalog AS channel#271, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#270] (207) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#233, isEmpty#234, count#235] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#272, isEmpty#273, count#274] (208) HashAggregate [codegen id : 602] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#233, isEmpty#234, count#235] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#272, isEmpty#273, count#274] 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))#236, count(1)#237] -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))#236 AS sales#76, count(1)#237 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))#236 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))#238] +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))#275, count(1)#276] +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))#275 AS sales#76, count(1)#276 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))#275 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))#277] (209) Filter [codegen id : 602] -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))#238] -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))#238) 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))#238 as decimal(32,6)) > cast(ReusedSubquery 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#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))#277] +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))#277) 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))#277 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (210) Project [codegen id : 602] -Output [6]: [web AS channel#239, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#238] +Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#277] (211) Union +Arguments: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sales#282, number_sales#283] (212) HashAggregate [codegen id : 603] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] -Aggregate Attributes [3]: [sum#240, isEmpty#241, sum#242] -Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] +Input [6]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sales#282, number_sales#283] +Keys [4]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281] +Functions [2]: [partial_sum(sales#282), partial_sum(number_sales#283)] +Aggregate Attributes [3]: [sum#284, isEmpty#285, sum#286] +Results [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] (213) Exchange -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#246] +Input [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] +Arguments: hashpartitioning(channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, 5), true, [id=#290] (214) HashAggregate [codegen id : 604] -Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] -Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] -Functions [2]: [sum(sales#42), sum(number_sales#43)] -Aggregate Attributes [2]: [sum(sales#42)#247, sum(number_sales#43)#248] -Results [2]: [sum(sales#42)#247 AS sum_sales#89, sum(number_sales#43)#248 AS number_sales#90] +Input [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] +Keys [4]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281] +Functions [2]: [sum(sales#282), sum(number_sales#283)] +Aggregate Attributes [2]: [sum(sales#282)#291, sum(number_sales#283)#292] +Results [2]: [sum(sales#282)#291 AS sum_sales#95, sum(number_sales#283)#292 AS number_sales#96] (215) HashAggregate [codegen id : 604] -Input [2]: [sum_sales#89, number_sales#90] +Input [2]: [sum_sales#95, number_sales#96] Keys: [] -Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] -Aggregate Attributes [3]: [sum#249, isEmpty#250, sum#251] -Results [3]: [sum#252, isEmpty#253, sum#254] +Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] +Aggregate Attributes [3]: [sum#293, isEmpty#294, sum#295] +Results [3]: [sum#296, isEmpty#297, sum#298] (216) Exchange -Input [3]: [sum#252, isEmpty#253, sum#254] -Arguments: SinglePartition, true, [id=#255] +Input [3]: [sum#296, isEmpty#297, sum#298] +Arguments: SinglePartition, true, [id=#299] (217) HashAggregate [codegen id : 605] -Input [3]: [sum#252, isEmpty#253, sum#254] +Input [3]: [sum#296, isEmpty#297, sum#298] Keys: [] -Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] -Aggregate Attributes [2]: [sum(sum_sales#89)#256, sum(number_sales#90)#257] -Results [6]: [null AS channel#258, null AS i_brand_id#259, null AS i_class_id#260, null AS i_category_id#261, sum(sum_sales#89)#256 AS sum(sum_sales)#262, sum(number_sales#90)#257 AS sum(number_sales)#263] +Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] +Aggregate Attributes [2]: [sum(sum_sales#95)#300, sum(number_sales#96)#301] +Results [6]: [null AS channel#302, null AS i_brand_id#303, null AS i_class_id#304, null AS i_category_id#305, sum(sum_sales#95)#300 AS sum(sum_sales)#306, sum(number_sales#96)#301 AS sum(number_sales)#307] (218) Union +Arguments: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] (219) HashAggregate [codegen id : 606] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Keys [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] (220) Exchange -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#264] +Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Arguments: hashpartitioning(channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313, 5), true, [id=#314] (221) HashAggregate [codegen id : 607] -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Keys [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Results [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] (222) TakeOrderedAndProject -Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] -Arguments: 100, [channel#47 ASC NULLS FIRST, i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST], [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Arguments: 100, [channel#308 ASC NULLS FIRST, i_brand_id#309 ASC NULLS FIRST, i_class_id#310 ASC NULLS FIRST, i_category_id#311 ASC NULLS FIRST], [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] ===== Subqueries ===== @@ -1327,7 +1336,7 @@ Input [2]: [d_date_sk#10, d_year#11] (230) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#265] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#315] (231) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -1335,7 +1344,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (232) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#266, ss_list_price#4 AS list_price#267] +Output [2]: [ss_quantity#3 AS quantity#316, ss_list_price#4 AS list_price#317] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (233) Scan parquet default.catalog_sales @@ -1372,7 +1381,7 @@ Input [2]: [d_date_sk#10, d_year#11] (240) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#268] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#318] (241) BroadcastHashJoin [codegen id : 4] Left keys [1]: [cs_sold_date_sk#18] @@ -1380,7 +1389,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (242) Project [codegen id : 4] -Output [2]: [cs_quantity#48 AS quantity#269, cs_list_price#49 AS list_price#270] +Output [2]: [cs_quantity#48 AS quantity#319, cs_list_price#49 AS list_price#320] Input [4]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49, d_date_sk#10] (243) Scan parquet default.web_sales @@ -1406,28 +1415,29 @@ Right keys [1]: [d_date_sk#10] Join condition: None (248) Project [codegen id : 6] -Output [2]: [ws_quantity#64 AS quantity#271, ws_list_price#65 AS list_price#272] +Output [2]: [ws_quantity#64 AS quantity#321, ws_list_price#65 AS list_price#322] Input [4]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65, d_date_sk#10] (249) Union +Arguments: [quantity#323, list_price#324] (250) HashAggregate [codegen id : 7] -Input [2]: [quantity#266, list_price#267] +Input [2]: [quantity#323, list_price#324] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#273, count#274] -Results [2]: [sum#275, count#276] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#325, count#326] +Results [2]: [sum#327, count#328] (251) Exchange -Input [2]: [sum#275, count#276] -Arguments: SinglePartition, true, [id=#277] +Input [2]: [sum#327, count#328] +Arguments: SinglePartition, true, [id=#329] (252) HashAggregate [codegen id : 8] -Input [2]: [sum#275, count#276] +Input [2]: [sum#327, count#328] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))#278] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))#278 AS average_sales#279] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))#330] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))#330 AS average_sales#331] Subquery:2 Hosting operator id = 105 Hosting Expression = ReusedSubquery Subquery scalar-subquery#45, [id=#46] 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..a382362b32235 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (606) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (485) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (484) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (363) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (362) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (241) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -30,7 +30,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (240) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (119) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] InputAdapter @@ -38,7 +38,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (118) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (39) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -50,7 +50,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -301,7 +301,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (237) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (158) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -335,7 +335,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (359) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (280) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -369,7 +369,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (481) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (402) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -403,7 +403,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (603) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (524) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt index 238053a3428e3..b1f1fca12cc0c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt @@ -707,476 +707,485 @@ Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sal Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#73] (110) Union +Arguments: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sales#79, number_sales#80] (111) HashAggregate [codegen id : 79] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#75, isEmpty#76, sum#77] -Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] +Input [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sales#79, number_sales#80] +Keys [4]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [partial_sum(sales#79), partial_sum(number_sales#80)] +Aggregate Attributes [3]: [sum#81, isEmpty#82, sum#83] +Results [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] (112) Exchange -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#81] +Input [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] +Arguments: hashpartitioning(channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, 5), true, [id=#87] (113) HashAggregate [codegen id : 80] -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#82, sum(number_sales#40)#83] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum(sales#39)#82 AS sum_sales#84, sum(number_sales#40)#83 AS number_sales#85] +Input [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] +Keys [4]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [sum(sales#79), sum(number_sales#80)] +Aggregate Attributes [2]: [sum(sales#79)#88, sum(number_sales#80)#89] +Results [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales#79)#88 AS sum_sales#90, sum(number_sales#80)#89 AS number_sales#91] (114) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#86, isEmpty#87, count#88] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] (115) HashAggregate [codegen id : 106] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#86, isEmpty#87, count#88] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#89, count(1)#90] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#89 AS sales#39, count(1)#90 AS number_sales#40, 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))#89 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))#91] +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))#95, count(1)#96] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#95 AS sales#39, count(1)#96 AS number_sales#40, 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))#95 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))#97] (116) Filter [codegen id : 106] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#91] -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))#91) 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))#91 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#97] +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))#97) 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))#97 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (117) Project [codegen id : 106] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#91] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#97] (118) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#98, isEmpty#99, count#100] (119) HashAggregate [codegen id : 132] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#98, isEmpty#99, count#100] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95, count(1)#96] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95 AS sales#56, count(1)#96 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101, count(1)#102] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101 AS sales#56, count(1)#102 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] (120) Filter [codegen id : 132] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (121) Project [codegen id : 132] -Output [6]: [catalog AS channel#98, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] +Output [6]: [catalog AS channel#104, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] (122) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#99, isEmpty#100, count#101] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#105, isEmpty#106, count#107] (123) HashAggregate [codegen id : 158] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#99, isEmpty#100, count#101] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#105, isEmpty#106, count#107] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102, count(1)#103] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102 AS sales#71, count(1)#103 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108, count(1)#109] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108 AS sales#71, count(1)#109 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] (124) Filter [codegen id : 158] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (125) Project [codegen id : 158] -Output [6]: [web AS channel#105, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] +Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] (126) Union +Arguments: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sales#115, number_sales#116] (127) HashAggregate [codegen id : 159] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#106, isEmpty#107, sum#108] -Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] +Input [6]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sales#115, number_sales#116] +Keys [4]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114] +Functions [2]: [partial_sum(sales#115), partial_sum(number_sales#116)] +Aggregate Attributes [3]: [sum#117, isEmpty#118, sum#119] +Results [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] (128) Exchange -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#112] +Input [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] +Arguments: hashpartitioning(channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, 5), true, [id=#123] (129) HashAggregate [codegen id : 160] -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#113, sum(number_sales#40)#114] -Results [5]: [channel#44, i_brand_id#6, i_class_id#7, sum(sales#39)#113 AS sum_sales#84, sum(number_sales#40)#114 AS number_sales#85] +Input [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] +Keys [4]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114] +Functions [2]: [sum(sales#115), sum(number_sales#116)] +Aggregate Attributes [2]: [sum(sales#115)#124, sum(number_sales#116)#125] +Results [5]: [channel#111, i_brand_id#112, i_class_id#113, sum(sales#115)#124 AS sum_sales#90, sum(number_sales#116)#125 AS number_sales#91] (130) HashAggregate [codegen id : 160] -Input [5]: [channel#44, i_brand_id#6, i_class_id#7, sum_sales#84, number_sales#85] -Keys [3]: [channel#44, i_brand_id#6, i_class_id#7] -Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] -Aggregate Attributes [3]: [sum#115, isEmpty#116, sum#117] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] +Input [5]: [channel#111, i_brand_id#112, i_class_id#113, sum_sales#90, number_sales#91] +Keys [3]: [channel#111, i_brand_id#112, i_class_id#113] +Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] +Aggregate Attributes [3]: [sum#126, isEmpty#127, sum#128] +Results [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] (131) Exchange -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, 5), true, [id=#121] +Input [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] +Arguments: hashpartitioning(channel#111, i_brand_id#112, i_class_id#113, 5), true, [id=#132] (132) HashAggregate [codegen id : 161] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] -Keys [3]: [channel#44, i_brand_id#6, i_class_id#7] -Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] -Aggregate Attributes [2]: [sum(sum_sales#84)#122, sum(number_sales#85)#123] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, null AS i_category_id#124, sum(sum_sales#84)#122 AS sum(sum_sales)#125, sum(number_sales#85)#123 AS sum(number_sales)#126] +Input [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] +Keys [3]: [channel#111, i_brand_id#112, i_class_id#113] +Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] +Aggregate Attributes [2]: [sum(sum_sales#90)#133, sum(number_sales#91)#134] +Results [6]: [channel#111, i_brand_id#112, i_class_id#113, null AS i_category_id#135, sum(sum_sales#90)#133 AS sum(sum_sales)#136, sum(number_sales#91)#134 AS sum(number_sales)#137] (133) Union +Arguments: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] (134) HashAggregate [codegen id : 162] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Keys [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] (135) Exchange -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#127] +Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Arguments: hashpartitioning(channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143, 5), true, [id=#144] (136) HashAggregate [codegen id : 163] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Keys [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] (137) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#128, isEmpty#129, count#130] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#145, isEmpty#146, count#147] (138) HashAggregate [codegen id : 189] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#128, isEmpty#129, count#130] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#145, isEmpty#146, count#147] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#131, count(1)#132] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#131 AS sales#39, count(1)#132 AS number_sales#40, 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))#131 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))#133] +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))#148, count(1)#149] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#148 AS sales#39, count(1)#149 AS number_sales#40, 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))#148 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))#150] (139) Filter [codegen id : 189] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#133] -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))#133) 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))#133 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#150] +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))#150) 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))#150 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (140) Project [codegen id : 189] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#133] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#150] (141) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#134, isEmpty#135, count#136] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, count#153] (142) HashAggregate [codegen id : 215] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#134, isEmpty#135, count#136] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, count#153] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137, count(1)#138] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137 AS sales#56, count(1)#138 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154, count(1)#155] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sales#56, count(1)#155 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] (143) Filter [codegen id : 215] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (144) Project [codegen id : 215] -Output [6]: [catalog AS channel#140, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] +Output [6]: [catalog AS channel#157, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] (145) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#141, isEmpty#142, count#143] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#158, isEmpty#159, count#160] (146) HashAggregate [codegen id : 241] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#141, isEmpty#142, count#143] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#158, isEmpty#159, count#160] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144, count(1)#145] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144 AS sales#71, count(1)#145 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161, count(1)#162] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sales#71, count(1)#162 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] (147) Filter [codegen id : 241] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (148) Project [codegen id : 241] -Output [6]: [web AS channel#147, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] +Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] (149) Union +Arguments: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sales#168, number_sales#169] (150) HashAggregate [codegen id : 242] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#148, isEmpty#149, sum#150] -Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] +Input [6]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sales#168, number_sales#169] +Keys [4]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167] +Functions [2]: [partial_sum(sales#168), partial_sum(number_sales#169)] +Aggregate Attributes [3]: [sum#170, isEmpty#171, sum#172] +Results [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] (151) Exchange -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#154] +Input [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] +Arguments: hashpartitioning(channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, 5), true, [id=#176] (152) HashAggregate [codegen id : 243] -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#155, sum(number_sales#40)#156] -Results [4]: [channel#44, i_brand_id#6, sum(sales#39)#155 AS sum_sales#84, sum(number_sales#40)#156 AS number_sales#85] +Input [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] +Keys [4]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167] +Functions [2]: [sum(sales#168), sum(number_sales#169)] +Aggregate Attributes [2]: [sum(sales#168)#177, sum(number_sales#169)#178] +Results [4]: [channel#164, i_brand_id#165, sum(sales#168)#177 AS sum_sales#90, sum(number_sales#169)#178 AS number_sales#91] (153) HashAggregate [codegen id : 243] -Input [4]: [channel#44, i_brand_id#6, sum_sales#84, number_sales#85] -Keys [2]: [channel#44, i_brand_id#6] -Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] -Aggregate Attributes [3]: [sum#157, isEmpty#158, sum#159] -Results [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] +Input [4]: [channel#164, i_brand_id#165, sum_sales#90, number_sales#91] +Keys [2]: [channel#164, i_brand_id#165] +Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] +Aggregate Attributes [3]: [sum#179, isEmpty#180, sum#181] +Results [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] (154) Exchange -Input [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] -Arguments: hashpartitioning(channel#44, i_brand_id#6, 5), true, [id=#163] +Input [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] +Arguments: hashpartitioning(channel#164, i_brand_id#165, 5), true, [id=#185] (155) HashAggregate [codegen id : 244] -Input [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] -Keys [2]: [channel#44, i_brand_id#6] -Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] -Aggregate Attributes [2]: [sum(sum_sales#84)#164, sum(number_sales#85)#165] -Results [6]: [channel#44, i_brand_id#6, null AS i_class_id#166, null AS i_category_id#167, sum(sum_sales#84)#164 AS sum(sum_sales)#168, sum(number_sales#85)#165 AS sum(number_sales)#169] +Input [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] +Keys [2]: [channel#164, i_brand_id#165] +Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] +Aggregate Attributes [2]: [sum(sum_sales#90)#186, sum(number_sales#91)#187] +Results [6]: [channel#164, i_brand_id#165, null AS i_class_id#188, null AS i_category_id#189, sum(sum_sales#90)#186 AS sum(sum_sales)#190, sum(number_sales#91)#187 AS sum(number_sales)#191] (156) Union +Arguments: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] (157) HashAggregate [codegen id : 245] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Keys [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] (158) Exchange -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#170] +Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Arguments: hashpartitioning(channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197, 5), true, [id=#198] (159) HashAggregate [codegen id : 246] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Keys [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] (160) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#171, isEmpty#172, count#173] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#199, isEmpty#200, count#201] (161) HashAggregate [codegen id : 272] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#171, isEmpty#172, count#173] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#199, isEmpty#200, count#201] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#174, count(1)#175] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#174 AS sales#39, count(1)#175 AS number_sales#40, 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))#174 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))#176] +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))#202, count(1)#203] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#202 AS sales#39, count(1)#203 AS number_sales#40, 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))#202 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))#204] (162) Filter [codegen id : 272] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#176] -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))#176) 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))#176 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#204] +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))#204) 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))#204 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (163) Project [codegen id : 272] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#176] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#204] (164) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#177, isEmpty#178, count#179] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#205, isEmpty#206, count#207] (165) HashAggregate [codegen id : 298] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#177, isEmpty#178, count#179] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#205, isEmpty#206, count#207] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180, count(1)#181] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180 AS sales#56, count(1)#181 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208, count(1)#209] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sales#56, count(1)#209 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] (166) Filter [codegen id : 298] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (167) Project [codegen id : 298] -Output [6]: [catalog AS channel#183, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] +Output [6]: [catalog AS channel#211, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] (168) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#184, isEmpty#185, count#186] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#212, isEmpty#213, count#214] (169) HashAggregate [codegen id : 324] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#184, isEmpty#185, count#186] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#212, isEmpty#213, count#214] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187, count(1)#188] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187 AS sales#71, count(1)#188 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215, count(1)#216] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sales#71, count(1)#216 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] (170) Filter [codegen id : 324] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (171) Project [codegen id : 324] -Output [6]: [web AS channel#190, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] +Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] (172) Union +Arguments: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sales#222, number_sales#223] (173) HashAggregate [codegen id : 325] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#191, isEmpty#192, sum#193] -Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] +Input [6]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sales#222, number_sales#223] +Keys [4]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221] +Functions [2]: [partial_sum(sales#222), partial_sum(number_sales#223)] +Aggregate Attributes [3]: [sum#224, isEmpty#225, sum#226] +Results [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] (174) Exchange -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#197] +Input [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] +Arguments: hashpartitioning(channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, 5), true, [id=#230] (175) HashAggregate [codegen id : 326] -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#198, sum(number_sales#40)#199] -Results [3]: [channel#44, sum(sales#39)#198 AS sum_sales#84, sum(number_sales#40)#199 AS number_sales#85] +Input [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] +Keys [4]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221] +Functions [2]: [sum(sales#222), sum(number_sales#223)] +Aggregate Attributes [2]: [sum(sales#222)#231, sum(number_sales#223)#232] +Results [3]: [channel#218, sum(sales#222)#231 AS sum_sales#90, sum(number_sales#223)#232 AS number_sales#91] (176) HashAggregate [codegen id : 326] -Input [3]: [channel#44, sum_sales#84, number_sales#85] -Keys [1]: [channel#44] -Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] -Aggregate Attributes [3]: [sum#200, isEmpty#201, sum#202] -Results [4]: [channel#44, sum#203, isEmpty#204, sum#205] +Input [3]: [channel#218, sum_sales#90, number_sales#91] +Keys [1]: [channel#218] +Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] +Aggregate Attributes [3]: [sum#233, isEmpty#234, sum#235] +Results [4]: [channel#218, sum#236, isEmpty#237, sum#238] (177) Exchange -Input [4]: [channel#44, sum#203, isEmpty#204, sum#205] -Arguments: hashpartitioning(channel#44, 5), true, [id=#206] +Input [4]: [channel#218, sum#236, isEmpty#237, sum#238] +Arguments: hashpartitioning(channel#218, 5), true, [id=#239] (178) HashAggregate [codegen id : 327] -Input [4]: [channel#44, sum#203, isEmpty#204, sum#205] -Keys [1]: [channel#44] -Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] -Aggregate Attributes [2]: [sum(sum_sales#84)#207, sum(number_sales#85)#208] -Results [6]: [channel#44, null AS i_brand_id#209, null AS i_class_id#210, null AS i_category_id#211, sum(sum_sales#84)#207 AS sum(sum_sales)#212, sum(number_sales#85)#208 AS sum(number_sales)#213] +Input [4]: [channel#218, sum#236, isEmpty#237, sum#238] +Keys [1]: [channel#218] +Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] +Aggregate Attributes [2]: [sum(sum_sales#90)#240, sum(number_sales#91)#241] +Results [6]: [channel#218, null AS i_brand_id#242, null AS i_class_id#243, null AS i_category_id#244, sum(sum_sales#90)#240 AS sum(sum_sales)#245, sum(number_sales#91)#241 AS sum(number_sales)#246] (179) Union +Arguments: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] (180) HashAggregate [codegen id : 328] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Keys [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] (181) Exchange -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#214] +Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Arguments: hashpartitioning(channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252, 5), true, [id=#253] (182) HashAggregate [codegen id : 329] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Keys [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] (183) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#215, isEmpty#216, count#217] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#254, isEmpty#255, count#256] (184) HashAggregate [codegen id : 355] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#215, isEmpty#216, count#217] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#254, isEmpty#255, count#256] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#218, count(1)#219] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#218 AS sales#39, count(1)#219 AS number_sales#40, 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))#218 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))#220] +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))#257, count(1)#258] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#257 AS sales#39, count(1)#258 AS number_sales#40, 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))#257 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))#259] (185) Filter [codegen id : 355] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#220] -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))#220) 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))#220 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#259] +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))#259) 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))#259 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (186) Project [codegen id : 355] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#220] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#259] (187) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#221, isEmpty#222, count#223] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#260, isEmpty#261, count#262] (188) HashAggregate [codegen id : 381] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#221, isEmpty#222, count#223] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#260, isEmpty#261, count#262] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224, count(1)#225] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224 AS sales#56, count(1)#225 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263, count(1)#264] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sales#56, count(1)#264 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] (189) Filter [codegen id : 381] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (190) Project [codegen id : 381] -Output [6]: [catalog AS channel#227, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] +Output [6]: [catalog AS channel#266, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] (191) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#228, isEmpty#229, count#230] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#267, isEmpty#268, count#269] (192) HashAggregate [codegen id : 407] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#228, isEmpty#229, count#230] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#267, isEmpty#268, count#269] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231, count(1)#232] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231 AS sales#71, count(1)#232 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270, count(1)#271] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sales#71, count(1)#271 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] (193) Filter [codegen id : 407] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (194) Project [codegen id : 407] -Output [6]: [web AS channel#234, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] +Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] (195) Union +Arguments: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sales#277, number_sales#278] (196) HashAggregate [codegen id : 408] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] -Aggregate Attributes [3]: [sum#235, isEmpty#236, sum#237] -Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] +Input [6]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sales#277, number_sales#278] +Keys [4]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276] +Functions [2]: [partial_sum(sales#277), partial_sum(number_sales#278)] +Aggregate Attributes [3]: [sum#279, isEmpty#280, sum#281] +Results [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] (197) Exchange -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#241] +Input [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] +Arguments: hashpartitioning(channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, 5), true, [id=#285] (198) HashAggregate [codegen id : 409] -Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] -Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] -Functions [2]: [sum(sales#39), sum(number_sales#40)] -Aggregate Attributes [2]: [sum(sales#39)#242, sum(number_sales#40)#243] -Results [2]: [sum(sales#39)#242 AS sum_sales#84, sum(number_sales#40)#243 AS number_sales#85] +Input [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] +Keys [4]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276] +Functions [2]: [sum(sales#277), sum(number_sales#278)] +Aggregate Attributes [2]: [sum(sales#277)#286, sum(number_sales#278)#287] +Results [2]: [sum(sales#277)#286 AS sum_sales#90, sum(number_sales#278)#287 AS number_sales#91] (199) HashAggregate [codegen id : 409] -Input [2]: [sum_sales#84, number_sales#85] +Input [2]: [sum_sales#90, number_sales#91] Keys: [] -Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] -Aggregate Attributes [3]: [sum#244, isEmpty#245, sum#246] -Results [3]: [sum#247, isEmpty#248, sum#249] +Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] +Aggregate Attributes [3]: [sum#288, isEmpty#289, sum#290] +Results [3]: [sum#291, isEmpty#292, sum#293] (200) Exchange -Input [3]: [sum#247, isEmpty#248, sum#249] -Arguments: SinglePartition, true, [id=#250] +Input [3]: [sum#291, isEmpty#292, sum#293] +Arguments: SinglePartition, true, [id=#294] (201) HashAggregate [codegen id : 410] -Input [3]: [sum#247, isEmpty#248, sum#249] +Input [3]: [sum#291, isEmpty#292, sum#293] Keys: [] -Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] -Aggregate Attributes [2]: [sum(sum_sales#84)#251, sum(number_sales#85)#252] -Results [6]: [null AS channel#253, null AS i_brand_id#254, null AS i_class_id#255, null AS i_category_id#256, sum(sum_sales#84)#251 AS sum(sum_sales)#257, sum(number_sales#85)#252 AS sum(number_sales)#258] +Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] +Aggregate Attributes [2]: [sum(sum_sales#90)#295, sum(number_sales#91)#296] +Results [6]: [null AS channel#297, null AS i_brand_id#298, null AS i_class_id#299, null AS i_category_id#300, sum(sum_sales#90)#295 AS sum(sum_sales)#301, sum(number_sales#91)#296 AS sum(number_sales)#302] (202) Union +Arguments: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] (203) HashAggregate [codegen id : 411] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Keys [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] (204) Exchange -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#259] +Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Arguments: hashpartitioning(channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308, 5), true, [id=#309] (205) HashAggregate [codegen id : 412] -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Keys [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Results [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] (206) TakeOrderedAndProject -Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] -Arguments: 100, [channel#44 ASC NULLS FIRST, i_brand_id#6 ASC NULLS FIRST, i_class_id#7 ASC NULLS FIRST, i_category_id#8 ASC NULLS FIRST], [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Arguments: 100, [channel#303 ASC NULLS FIRST, i_brand_id#304 ASC NULLS FIRST, i_class_id#305 ASC NULLS FIRST, i_category_id#306 ASC NULLS FIRST], [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] ===== Subqueries ===== @@ -1247,7 +1256,7 @@ Input [2]: [d_date_sk#10, d_year#11] (214) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#260] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#310] (215) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -1255,7 +1264,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (216) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#261, ss_list_price#4 AS list_price#262] +Output [2]: [ss_quantity#3 AS quantity#311, ss_list_price#4 AS list_price#312] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (217) Scan parquet default.catalog_sales @@ -1292,7 +1301,7 @@ Input [2]: [d_date_sk#10, d_year#11] (224) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#263] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#313] (225) BroadcastHashJoin [codegen id : 4] Left keys [1]: [cs_sold_date_sk#16] @@ -1300,7 +1309,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (226) Project [codegen id : 4] -Output [2]: [cs_quantity#45 AS quantity#264, cs_list_price#46 AS list_price#265] +Output [2]: [cs_quantity#45 AS quantity#314, cs_list_price#46 AS list_price#315] Input [4]: [cs_sold_date_sk#16, cs_quantity#45, cs_list_price#46, d_date_sk#10] (227) Scan parquet default.web_sales @@ -1326,28 +1335,29 @@ Right keys [1]: [d_date_sk#10] Join condition: None (232) Project [codegen id : 6] -Output [2]: [ws_quantity#60 AS quantity#266, ws_list_price#61 AS list_price#267] +Output [2]: [ws_quantity#60 AS quantity#316, ws_list_price#61 AS list_price#317] Input [4]: [ws_sold_date_sk#20, ws_quantity#60, ws_list_price#61, d_date_sk#10] (233) Union +Arguments: [quantity#318, list_price#319] (234) HashAggregate [codegen id : 7] -Input [2]: [quantity#261, list_price#262] +Input [2]: [quantity#318, list_price#319] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#268, count#269] -Results [2]: [sum#270, count#271] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#320, count#321] +Results [2]: [sum#322, count#323] (235) Exchange -Input [2]: [sum#270, count#271] -Arguments: SinglePartition, true, [id=#272] +Input [2]: [sum#322, count#323] +Arguments: SinglePartition, true, [id=#324] (236) HashAggregate [codegen id : 8] -Input [2]: [sum#270, count#271] +Input [2]: [sum#322, count#323] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#273] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#273 AS average_sales#274] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))#325] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))#325 AS average_sales#326] Subquery:2 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#42, [id=#43] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt index e96f1d6fed14f..a71be4f6b1253 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (411) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (329) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (328) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (246) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (245) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (163) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -30,7 +30,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (162) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] WholeStageCodegen (80) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] InputAdapter @@ -38,7 +38,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (79) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (26) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -50,7 +50,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union + Union [quantity,list_price] WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -261,7 +261,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (159) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (106) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -295,7 +295,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (242) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (189) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -329,7 +329,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (325) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (272) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -363,7 +363,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (408) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union + Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] WholeStageCodegen (355) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] 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..dc352b2382fc4 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 @@ -870,8 +870,9 @@ Aggregate Attributes [7]: [avg(agg1#36)#263, avg(agg2#37)#264, avg(agg3#38)#265, Results [11]: [null AS i_item_id#270, null AS ca_country#271, null AS ca_state#272, null AS county#273, avg(agg1#36)#263 AS agg1#274, avg(agg2#37)#264 AS agg2#275, avg(agg3#38)#265 AS agg3#276, avg(agg4#39)#266 AS agg4#277, avg(agg5#40)#267 AS agg5#278, avg(agg6#41)#268 AS agg6#279, avg(agg7#42)#269 AS agg7#280] (159) Union +Arguments: [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] (160) TakeOrderedAndProject -Input [11]: [i_item_id#19, ca_country#30, ca_state#29, ca_county#28, agg1#79, agg2#80, agg3#81, agg4#82, agg5#83, agg6#84, agg7#85] -Arguments: 100, [ca_country#30 ASC NULLS FIRST, ca_state#29 ASC NULLS FIRST, ca_county#28 ASC NULLS FIRST, i_item_id#19 ASC NULLS FIRST], [i_item_id#19, ca_country#30, ca_state#29, ca_county#28, agg1#79, agg2#80, agg3#81, agg4#82, agg5#83, agg6#84, agg7#85] +Input [11]: [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] +Arguments: 100, [ca_country#282 ASC NULLS FIRST, ca_state#283 ASC NULLS FIRST, ca_county#284 ASC NULLS FIRST, i_item_id#281 ASC NULLS FIRST], [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] 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..8990f555b7622 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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] - Union + Union [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] WholeStageCodegen (14) HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt index b9a00214c3a1b..97c1bbb37fc3b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt @@ -849,8 +849,9 @@ Aggregate Attributes [7]: [avg(agg1#34)#256, avg(agg2#35)#257, avg(agg3#36)#258, Results [11]: [null AS i_item_id#263, null AS ca_country#264, null AS ca_state#265, null AS county#266, avg(agg1#34)#256 AS agg1#267, avg(agg2#35)#257 AS agg2#268, avg(agg3#36)#258 AS agg3#269, avg(agg4#37)#259 AS agg4#270, avg(agg5#38)#260 AS agg5#271, avg(agg6#39)#261 AS agg6#272, avg(agg7#40)#262 AS agg7#273] (156) Union +Arguments: [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] (157) TakeOrderedAndProject -Input [11]: [i_item_id#32, ca_country#26, ca_state#25, ca_county#24, agg1#77, agg2#78, agg3#79, agg4#80, agg5#81, agg6#82, agg7#83] -Arguments: 100, [ca_country#26 ASC NULLS FIRST, ca_state#25 ASC NULLS FIRST, ca_county#24 ASC NULLS FIRST, i_item_id#32 ASC NULLS FIRST], [i_item_id#32, ca_country#26, ca_state#25, ca_county#24, agg1#77, agg2#78, agg3#79, agg4#80, agg5#81, agg6#82, agg7#83] +Input [11]: [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] +Arguments: 100, [ca_country#275 ASC NULLS FIRST, ca_state#276 ASC NULLS FIRST, ca_county#277 ASC NULLS FIRST, i_item_id#274 ASC NULLS FIRST], [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt index 49d50714a0940..e1adf35adee9e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] - Union + Union [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] WholeStageCodegen (8) HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] InputAdapter 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..508eea8b8a80c 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 @@ -309,8 +309,9 @@ Aggregate Attributes [1]: [avg(qoh#23)#74] Results [5]: [null AS i_product_name#75, null AS i_brand#76, null AS i_class#77, null AS i_category#78, avg(qoh#23)#74 AS qoh#79] (51) Union +Arguments: [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] (52) TakeOrderedAndProject -Input [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#29] -Arguments: 100, [qoh#29 ASC NULLS FIRST, i_product_name#15 ASC NULLS FIRST, i_brand#12 ASC NULLS FIRST, i_class#13 ASC NULLS FIRST, i_category#14 ASC NULLS FIRST], [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#29] +Input [5]: [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] +Arguments: 100, [qoh#84 ASC NULLS FIRST, i_product_name#80 ASC NULLS FIRST, i_brand#81 ASC NULLS FIRST, i_class#82 ASC NULLS FIRST, i_category#83 ASC NULLS FIRST], [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] 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..7bdedef069bcb 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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] - Union + Union [i_product_name,i_brand,i_class,i_category,qoh] WholeStageCodegen (8) HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt index 2a1ca82e1f263..acae5d4362e96 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt @@ -294,8 +294,9 @@ Aggregate Attributes [1]: [avg(qoh#22)#73] Results [5]: [null AS i_product_name#74, null AS i_brand#75, null AS i_class#76, null AS i_category#77, avg(qoh#22)#73 AS qoh#78] (48) Union +Arguments: [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] (49) TakeOrderedAndProject -Input [5]: [i_product_name#12, i_brand#9, i_class#10, i_category#11, qoh#28] -Arguments: 100, [qoh#28 ASC NULLS FIRST, i_product_name#12 ASC NULLS FIRST, i_brand#9 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_category#11 ASC NULLS FIRST], [i_product_name#12, i_brand#9, i_class#10, i_category#11, qoh#28] +Input [5]: [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] +Arguments: 100, [qoh#83 ASC NULLS FIRST, i_product_name#79 ASC NULLS FIRST, i_brand#80 ASC NULLS FIRST, i_class#81 ASC NULLS FIRST, i_category#82 ASC NULLS FIRST], [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt index 616bfc89c0023..4742a7562b08b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] - Union + Union [i_product_name,i_brand,i_class,i_category,qoh] WholeStageCodegen (5) HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] 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..d27de4225c845 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 @@ -421,8 +421,9 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union +Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] -Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] 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..70ffd62771d8e 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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union + Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt index 75e07ce8cd680..bb164f7d94b7d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt @@ -421,8 +421,9 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union +Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] -Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt index 995ed4b432be6..fac01f15c9f13 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union + Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt index b08d2174e5974..edf2ea6b68e99 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt @@ -1,61 +1,60 @@ == Physical Plan == -TakeOrderedAndProject (57) -+- * HashAggregate (56) - +- Exchange (55) - +- * HashAggregate (54) - +- * Project (53) - +- * SortMergeJoin Inner (52) - :- * Sort (46) - : +- Exchange (45) - : +- * Project (44) - : +- * SortMergeJoin Inner (43) - : :- * Sort (37) - : : +- Exchange (36) - : : +- * Project (35) - : : +- SortMergeJoin LeftSemi (34) - : : :- 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 (33) - : : +- Exchange (32) - : : +- Union (31) - : : :- * Project (24) - : : : +- * BroadcastHashJoin Inner BuildRight (23) - : : : :- * Filter (21) - : : : : +- * ColumnarToRow (20) - : : : : +- Scan parquet default.web_sales (19) - : : : +- ReusedExchange (22) - : : +- * Project (30) - : : +- * BroadcastHashJoin Inner BuildRight (29) - : : :- * Filter (27) - : : : +- * ColumnarToRow (26) - : : : +- Scan parquet default.catalog_sales (25) - : : +- ReusedExchange (28) - : +- * Sort (42) - : +- Exchange (41) - : +- * Filter (40) - : +- * ColumnarToRow (39) - : +- Scan parquet default.customer_address (38) - +- * Sort (51) - +- Exchange (50) - +- * Filter (49) - +- * ColumnarToRow (48) - +- Scan parquet default.customer_demographics (47) +TakeOrderedAndProject (56) ++- * HashAggregate (55) + +- Exchange (54) + +- * HashAggregate (53) + +- * Project (52) + +- BroadcastNestedLoopJoin LeftSemi BuildRight (51) + :- * Project (36) + : +- * SortMergeJoin Inner (35) + : :- * Sort (29) + : : +- Exchange (28) + : : +- * Project (27) + : : +- * SortMergeJoin Inner (26) + : : :- * Sort (20) + : : : +- Exchange (19) + : : : +- 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 (25) + : : +- Exchange (24) + : : +- * Filter (23) + : : +- * ColumnarToRow (22) + : : +- Scan parquet default.customer_address (21) + : +- * Sort (34) + : +- Exchange (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.customer_demographics (30) + +- BroadcastExchange (50) + +- Union (49) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Filter (39) + : : +- * ColumnarToRow (38) + : : +- Scan parquet default.web_sales (37) + : +- ReusedExchange (40) + +- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Filter (45) + : +- * ColumnarToRow (44) + : +- Scan parquet default.catalog_sales (43) + +- ReusedExchange (46) (1) Scan parquet default.customer @@ -138,174 +137,168 @@ Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(19) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(19) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_current_addr_sk#3, 5), true, [id=#12] + +(20) Sort [codegen id : 6] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_current_addr_sk#3 ASC NULLS FIRST], false, 0 + +(21) Scan parquet default.customer_address +Output [2]: [ca_address_sk#13, ca_state#14] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(20) ColumnarToRow [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +(22) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#13, ca_state#14] -(21) Filter [codegen id : 7] -Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -Condition : isnotnull(ws_sold_date_sk#12) +(23) Filter [codegen id : 7] +Input [2]: [ca_address_sk#13, ca_state#14] +Condition : isnotnull(ca_address_sk#13) -(22) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(24) Exchange +Input [2]: [ca_address_sk#13, ca_state#14] +Arguments: hashpartitioning(ca_address_sk#13, 5), true, [id=#15] -(23) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#12] -Right keys [1]: [d_date_sk#7] +(25) Sort [codegen id : 8] +Input [2]: [ca_address_sk#13, ca_state#14] +Arguments: [ca_address_sk#13 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#13] Join condition: None -(24) Project [codegen id : 7] -Output [1]: [ws_bill_customer_sk#13 AS customsk#14] -Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] +(27) Project [codegen id : 9] +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] +Input [5]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#13, ca_state#14] -(25) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(28) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] +Arguments: hashpartitioning(c_current_cdemo_sk#2, 5), true, [id=#16] + +(29) Sort [codegen id : 10] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] +Arguments: [c_current_cdemo_sk#2 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct -(26) ColumnarToRow [codegen id : 9] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +(31) ColumnarToRow [codegen id : 11] +Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(27) Filter [codegen id : 9] -Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -Condition : isnotnull(cs_sold_date_sk#15) +(32) Filter [codegen id : 11] +Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Condition : isnotnull(cd_demo_sk#17) -(28) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(33) Exchange +Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Arguments: hashpartitioning(cd_demo_sk#17, 5), true, [id=#23] -(29) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#15] -Right keys [1]: [d_date_sk#7] -Join condition: None +(34) Sort [codegen id : 12] +Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Arguments: [cd_demo_sk#17 ASC NULLS FIRST], false, 0 -(30) Project [codegen id : 9] -Output [1]: [cs_ship_customer_sk#16 AS customsk#17] -Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#7] +(35) SortMergeJoin [codegen id : 13] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#17] +Join condition: None -(31) Union +(36) Project [codegen id : 13] +Output [7]: [c_customer_sk#1, ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Input [9]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14, cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(32) Exchange -Input [1]: [customsk#14] -Arguments: hashpartitioning(customsk#14, 5), true, [id=#18] +(37) Scan parquet default.web_sales +Output [1]: [ws_sold_date_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(33) Sort [codegen id : 10] -Input [1]: [customsk#14] -Arguments: [customsk#14 ASC NULLS FIRST], false, 0 +(38) ColumnarToRow [codegen id : 15] +Input [1]: [ws_sold_date_sk#24] -(34) SortMergeJoin -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customsk#14] -Join condition: None +(39) Filter [codegen id : 15] +Input [1]: [ws_sold_date_sk#24] +Condition : isnotnull(ws_sold_date_sk#24) -(35) Project [codegen id : 11] -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] +(40) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(36) Exchange -Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: hashpartitioning(c_current_addr_sk#3, 5), true, [id=#19] +(41) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [ws_sold_date_sk#24] +Right keys [1]: [d_date_sk#7] +Join condition: None -(37) Sort [codegen id : 12] -Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: [c_current_addr_sk#3 ASC NULLS FIRST], false, 0 +(42) Project [codegen id : 15] +Output: [] +Input [2]: [ws_sold_date_sk#24, d_date_sk#7] -(38) Scan parquet default.customer_address -Output [2]: [ca_address_sk#20, ca_state#21] +(43) Scan parquet default.catalog_sales +Output [1]: [cs_sold_date_sk#25] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct - -(39) ColumnarToRow [codegen id : 13] -Input [2]: [ca_address_sk#20, ca_state#21] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(40) Filter [codegen id : 13] -Input [2]: [ca_address_sk#20, ca_state#21] -Condition : isnotnull(ca_address_sk#20) +(44) ColumnarToRow [codegen id : 17] +Input [1]: [cs_sold_date_sk#25] -(41) Exchange -Input [2]: [ca_address_sk#20, ca_state#21] -Arguments: hashpartitioning(ca_address_sk#20, 5), true, [id=#22] +(45) Filter [codegen id : 17] +Input [1]: [cs_sold_date_sk#25] +Condition : isnotnull(cs_sold_date_sk#25) -(42) Sort [codegen id : 14] -Input [2]: [ca_address_sk#20, ca_state#21] -Arguments: [ca_address_sk#20 ASC NULLS FIRST], false, 0 +(46) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(43) SortMergeJoin [codegen id : 15] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#20] +(47) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [cs_sold_date_sk#25] +Right keys [1]: [d_date_sk#7] Join condition: None -(44) Project [codegen id : 15] -Output [2]: [c_current_cdemo_sk#2, ca_state#21] -Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20, ca_state#21] +(48) Project [codegen id : 17] +Output: [] +Input [2]: [cs_sold_date_sk#25, d_date_sk#7] -(45) Exchange -Input [2]: [c_current_cdemo_sk#2, ca_state#21] -Arguments: hashpartitioning(c_current_cdemo_sk#2, 5), true, [id=#23] +(49) Union -(46) Sort [codegen id : 16] -Input [2]: [c_current_cdemo_sk#2, ca_state#21] -Arguments: [c_current_cdemo_sk#2 ASC NULLS FIRST], false, 0 +(50) BroadcastExchange +Input: [] +Arguments: IdentityBroadcastMode, [id=#26] -(47) Scan parquet default.customer_demographics -Output [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct +(51) BroadcastNestedLoopJoin +Join condition: (customsk#27 = c_customer_sk#1) -(48) ColumnarToRow [codegen id : 17] -Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +(52) Project [codegen id : 18] +Output [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Input [7]: [c_customer_sk#1, ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -(49) Filter [codegen id : 17] -Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Condition : isnotnull(cd_demo_sk#24) +(53) HashAggregate [codegen id : 18] +Input [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Keys [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#20 as bigint)), partial_max(cd_dep_count#20), partial_sum(cast(cd_dep_count#20 as bigint)), partial_avg(cast(cd_dep_employed_count#21 as bigint)), partial_max(cd_dep_employed_count#21), partial_sum(cast(cd_dep_employed_count#21 as bigint)), partial_avg(cast(cd_dep_college_count#22 as bigint)), partial_max(cd_dep_college_count#22), partial_sum(cast(cd_dep_college_count#22 as bigint))] +Aggregate Attributes [13]: [count#28, sum#29, count#30, max#31, sum#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40] +Results [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] -(50) Exchange -Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Arguments: hashpartitioning(cd_demo_sk#24, 5), true, [id=#30] +(54) Exchange +Input [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +Arguments: hashpartitioning(ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, 5), true, [id=#54] -(51) Sort [codegen id : 18] -Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Arguments: [cd_demo_sk#24 ASC NULLS FIRST], false, 0 - -(52) SortMergeJoin [codegen id : 19] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#24] -Join condition: None +(55) HashAggregate [codegen id : 19] +Input [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +Keys [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Functions [10]: [count(1), avg(cast(cd_dep_count#20 as bigint)), max(cd_dep_count#20), sum(cast(cd_dep_count#20 as bigint)), avg(cast(cd_dep_employed_count#21 as bigint)), max(cd_dep_employed_count#21), sum(cast(cd_dep_employed_count#21 as bigint)), avg(cast(cd_dep_college_count#22 as bigint)), max(cd_dep_college_count#22), sum(cast(cd_dep_college_count#22 as bigint))] +Aggregate Attributes [10]: [count(1)#55, avg(cast(cd_dep_count#20 as bigint))#56, max(cd_dep_count#20)#57, sum(cast(cd_dep_count#20 as bigint))#58, avg(cast(cd_dep_employed_count#21 as bigint))#59, max(cd_dep_employed_count#21)#60, sum(cast(cd_dep_employed_count#21 as bigint))#61, avg(cast(cd_dep_college_count#22 as bigint))#62, max(cd_dep_college_count#22)#63, sum(cast(cd_dep_college_count#22 as bigint))#64] +Results [18]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, count(1)#55 AS cnt1#65, avg(cast(cd_dep_count#20 as bigint))#56 AS avg(cd_dep_count)#66, max(cd_dep_count#20)#57 AS max(cd_dep_count)#67, sum(cast(cd_dep_count#20 as bigint))#58 AS sum(cd_dep_count)#68, cd_dep_employed_count#21, count(1)#55 AS cnt2#69, avg(cast(cd_dep_employed_count#21 as bigint))#59 AS avg(cd_dep_employed_count)#70, max(cd_dep_employed_count#21)#60 AS max(cd_dep_employed_count)#71, sum(cast(cd_dep_employed_count#21 as bigint))#61 AS sum(cd_dep_employed_count)#72, cd_dep_college_count#22, count(1)#55 AS cnt3#73, avg(cast(cd_dep_college_count#22 as bigint))#62 AS avg(cd_dep_college_count)#74, max(cd_dep_college_count#22)#63 AS max(cd_dep_college_count)#75, sum(cast(cd_dep_college_count#22 as bigint))#64 AS sum(cd_dep_college_count)#76] -(53) Project [codegen id : 19] -Output [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Input [8]: [c_current_cdemo_sk#2, ca_state#21, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] - -(54) HashAggregate [codegen id : 19] -Input [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Keys [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#27 as bigint)), partial_max(cd_dep_count#27), partial_sum(cast(cd_dep_count#27 as bigint)), partial_avg(cast(cd_dep_employed_count#28 as bigint)), partial_max(cd_dep_employed_count#28), partial_sum(cast(cd_dep_employed_count#28 as bigint)), partial_avg(cast(cd_dep_college_count#29 as bigint)), partial_max(cd_dep_college_count#29), partial_sum(cast(cd_dep_college_count#29 as bigint))] -Aggregate Attributes [13]: [count#31, sum#32, count#33, max#34, sum#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43] -Results [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] - -(55) Exchange -Input [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] -Arguments: hashpartitioning(ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, 5), true, [id=#57] - -(56) HashAggregate [codegen id : 20] -Input [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] -Keys [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -Functions [10]: [count(1), avg(cast(cd_dep_count#27 as bigint)), max(cd_dep_count#27), sum(cast(cd_dep_count#27 as bigint)), avg(cast(cd_dep_employed_count#28 as bigint)), max(cd_dep_employed_count#28), sum(cast(cd_dep_employed_count#28 as bigint)), avg(cast(cd_dep_college_count#29 as bigint)), max(cd_dep_college_count#29), sum(cast(cd_dep_college_count#29 as bigint))] -Aggregate Attributes [10]: [count(1)#58, avg(cast(cd_dep_count#27 as bigint))#59, max(cd_dep_count#27)#60, sum(cast(cd_dep_count#27 as bigint))#61, avg(cast(cd_dep_employed_count#28 as bigint))#62, max(cd_dep_employed_count#28)#63, sum(cast(cd_dep_employed_count#28 as bigint))#64, avg(cast(cd_dep_college_count#29 as bigint))#65, max(cd_dep_college_count#29)#66, sum(cast(cd_dep_college_count#29 as bigint))#67] -Results [18]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, count(1)#58 AS cnt1#68, avg(cast(cd_dep_count#27 as bigint))#59 AS avg(cd_dep_count)#69, max(cd_dep_count#27)#60 AS max(cd_dep_count)#70, sum(cast(cd_dep_count#27 as bigint))#61 AS sum(cd_dep_count)#71, cd_dep_employed_count#28, count(1)#58 AS cnt2#72, avg(cast(cd_dep_employed_count#28 as bigint))#62 AS avg(cd_dep_employed_count)#73, max(cd_dep_employed_count#28)#63 AS max(cd_dep_employed_count)#74, sum(cast(cd_dep_employed_count#28 as bigint))#64 AS sum(cd_dep_employed_count)#75, cd_dep_college_count#29, count(1)#58 AS cnt3#76, avg(cast(cd_dep_college_count#29 as bigint))#65 AS avg(cd_dep_college_count)#77, max(cd_dep_college_count#29)#66 AS max(cd_dep_college_count)#78, sum(cast(cd_dep_college_count#29 as bigint))#67 AS sum(cd_dep_college_count)#79] - -(57) TakeOrderedAndProject -Input [18]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] -Arguments: 100, [ca_state#21 ASC NULLS FIRST, cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] +(56) TakeOrderedAndProject +Input [18]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#21, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#22, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] +Arguments: 100, [ca_state#14 ASC NULLS FIRST, cd_gender#18 ASC NULLS FIRST, cd_marital_status#19 ASC NULLS FIRST, cd_dep_count#20 ASC NULLS FIRST, cd_dep_employed_count#21 ASC NULLS FIRST, cd_dep_college_count#22 ASC NULLS FIRST], [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#21, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#22, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt index b38eeeb527eb4..62f940df1331b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt @@ -1,29 +1,29 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] - WholeStageCodegen (20) + WholeStageCodegen (19) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cast(cd_dep_count as bigint)),max(cd_dep_count),sum(cast(cd_dep_count as bigint)),avg(cast(cd_dep_employed_count as bigint)),max(cd_dep_employed_count),sum(cast(cd_dep_employed_count as bigint)),avg(cast(cd_dep_college_count as bigint)),max(cd_dep_college_count),sum(cast(cd_dep_college_count as bigint)),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] InputAdapter Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (19) + WholeStageCodegen (18) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] - InputAdapter - WholeStageCodegen (16) - Sort [c_current_cdemo_sk] - InputAdapter - Exchange [c_current_cdemo_sk] #2 - WholeStageCodegen (15) - Project [c_current_cdemo_sk,ca_state] - SortMergeJoin [c_current_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (12) - Sort [c_current_addr_sk] - InputAdapter - Exchange [c_current_addr_sk] #3 - WholeStageCodegen (11) - Project [c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastNestedLoopJoin [customsk,c_customer_sk] + WholeStageCodegen (13) + Project [c_customer_sk,ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (10) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (9) + Project [c_customer_sk,c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (6) + Sort [c_current_addr_sk] InputAdapter - SortMergeJoin [c_customer_sk,customsk] + Exchange [c_current_addr_sk] #3 SortMergeJoin [c_customer_sk,ss_customer_sk] WholeStageCodegen (2) Sort [c_customer_sk] @@ -53,46 +53,43 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - WholeStageCodegen (10) - Sort [customsk] - InputAdapter - Exchange [customsk] #7 - Union - WholeStageCodegen (7) - Project [ws_bill_customer_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (9) - Project [cs_ship_customer_sk] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (8) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #7 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (12) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #8 + WholeStageCodegen (11) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastExchange #9 + Union + WholeStageCodegen (15) + Project + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow InputAdapter - WholeStageCodegen (14) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #8 - WholeStageCodegen (13) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - WholeStageCodegen (18) - Sort [cd_demo_sk] - InputAdapter - Exchange [cd_demo_sk] #9 - WholeStageCodegen (17) - Filter [cd_demo_sk] + Scan parquet default.web_sales [ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (17) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + Scan parquet default.catalog_sales [cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt index 847b5cf66c3e0..3cd406676347e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt @@ -4,11 +4,11 @@ TakeOrderedAndProject (47) +- Exchange (45) +- * HashAggregate (44) +- * Project (43) - +- * BroadcastHashJoin Inner BuildRight (42) - :- * Project (37) - : +- * BroadcastHashJoin Inner BuildRight (36) - : :- * Project (31) - : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + +- BroadcastNestedLoopJoin LeftSemi BuildRight (42) + :- * Project (27) + : +- * BroadcastHashJoin Inner BuildRight (26) + : :- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) : : :- * BroadcastHashJoin LeftSemi BuildRight (15) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) @@ -24,28 +24,28 @@ TakeOrderedAndProject (47) : : : +- * Filter (9) : : : +- * ColumnarToRow (8) : : : +- Scan parquet default.date_dim (7) - : : +- BroadcastExchange (29) - : : +- Union (28) - : : :- * Project (21) - : : : +- * BroadcastHashJoin Inner BuildRight (20) - : : : :- * Filter (18) - : : : : +- * ColumnarToRow (17) - : : : : +- Scan parquet default.web_sales (16) - : : : +- ReusedExchange (19) - : : +- * Project (27) - : : +- * BroadcastHashJoin Inner BuildRight (26) - : : :- * Filter (24) - : : : +- * ColumnarToRow (23) - : : : +- Scan parquet default.catalog_sales (22) - : : +- ReusedExchange (25) - : +- BroadcastExchange (35) - : +- * Filter (34) - : +- * ColumnarToRow (33) - : +- Scan parquet default.customer_address (32) + : : +- BroadcastExchange (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.customer_address (16) + : +- BroadcastExchange (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.customer_demographics (22) +- BroadcastExchange (41) - +- * Filter (40) - +- * ColumnarToRow (39) - +- Scan parquet default.customer_demographics (38) + +- Union (40) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.web_sales (28) + : +- ReusedExchange (31) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildRight (38) + :- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.catalog_sales (34) + +- ReusedExchange (37) (1) Scan parquet default.customer @@ -55,10 +55,10 @@ 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 : 9] +(2) ColumnarToRow [codegen id : 5] Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(3) Filter [codegen id : 9] +(3) Filter [codegen id : 5] 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)) @@ -111,151 +111,149 @@ Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, d_date_sk#6] Input [1]: [ss_customer_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(15) BroadcastHashJoin [codegen id : 9] +(15) BroadcastHashJoin [codegen id : 5] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#5] Join condition: None -(16) Scan parquet default.web_sales -Output [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +(16) Scan parquet default.customer_address +Output [2]: [ca_address_sk#11, ca_state#12] Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(17) ColumnarToRow [codegen id : 4] -Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +(17) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#11, ca_state#12] -(18) Filter [codegen id : 4] -Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] -Condition : isnotnull(ws_sold_date_sk#11) +(18) Filter [codegen id : 3] +Input [2]: [ca_address_sk#11, ca_state#12] +Condition : isnotnull(ca_address_sk#11) -(19) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(19) BroadcastExchange +Input [2]: [ca_address_sk#11, ca_state#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] -(20) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [ws_sold_date_sk#11] -Right keys [1]: [d_date_sk#6] +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#11] Join condition: None -(21) Project [codegen id : 4] -Output [1]: [ws_bill_customer_sk#12 AS customsk#13] -Input [3]: [ws_sold_date_sk#11, ws_bill_customer_sk#12, d_date_sk#6] +(21) Project [codegen id : 5] +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#12] +Input [5]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#11, ca_state#12] -(22) Scan parquet default.catalog_sales -Output [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +(22) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct -(23) ColumnarToRow [codegen id : 6] -Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +(23) ColumnarToRow [codegen id : 4] +Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -(24) Filter [codegen id : 6] -Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] -Condition : isnotnull(cs_sold_date_sk#14) +(24) Filter [codegen id : 4] +Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Condition : isnotnull(cd_demo_sk#14) -(25) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(25) BroadcastExchange +Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(26) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [cs_sold_date_sk#14] -Right keys [1]: [d_date_sk#6] +(26) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#14] Join condition: None -(27) Project [codegen id : 6] -Output [1]: [cs_ship_customer_sk#15 AS customsk#16] -Input [3]: [cs_sold_date_sk#14, cs_ship_customer_sk#15, d_date_sk#6] +(27) Project [codegen id : 5] +Output [7]: [c_customer_sk#1, ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Input [9]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#12, cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -(28) Union +(28) Scan parquet default.web_sales +Output [1]: [ws_sold_date_sk#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(29) BroadcastExchange -Input [1]: [customsk#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] +(29) ColumnarToRow [codegen id : 7] +Input [1]: [ws_sold_date_sk#21] -(30) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customsk#13] +(30) Filter [codegen id : 7] +Input [1]: [ws_sold_date_sk#21] +Condition : isnotnull(ws_sold_date_sk#21) + +(31) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] + +(32) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#21] +Right keys [1]: [d_date_sk#6] Join condition: None -(31) Project [codegen id : 9] -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] +(33) Project [codegen id : 7] +Output: [] +Input [2]: [ws_sold_date_sk#21, d_date_sk#6] -(32) Scan parquet default.customer_address -Output [2]: [ca_address_sk#18, ca_state#19] +(34) Scan parquet default.catalog_sales +Output [1]: [cs_sold_date_sk#22] 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}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(33) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#18, ca_state#19] +(35) ColumnarToRow [codegen id : 9] +Input [1]: [cs_sold_date_sk#22] -(34) Filter [codegen id : 7] -Input [2]: [ca_address_sk#18, ca_state#19] -Condition : isnotnull(ca_address_sk#18) +(36) Filter [codegen id : 9] +Input [1]: [cs_sold_date_sk#22] +Condition : isnotnull(cs_sold_date_sk#22) -(35) BroadcastExchange -Input [2]: [ca_address_sk#18, ca_state#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(37) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#18] +(38) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#22] +Right keys [1]: [d_date_sk#6] Join condition: None -(37) Project [codegen id : 9] -Output [2]: [c_current_cdemo_sk#2, ca_state#19] -Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18, ca_state#19] - -(38) Scan parquet default.customer_demographics -Output [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(39) ColumnarToRow [codegen id : 8] -Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +(39) Project [codegen id : 9] +Output: [] +Input [2]: [cs_sold_date_sk#22, d_date_sk#6] -(40) Filter [codegen id : 8] -Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Condition : isnotnull(cd_demo_sk#21) +(40) Union (41) BroadcastExchange -Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] +Input: [] +Arguments: IdentityBroadcastMode, [id=#23] -(42) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#21] -Join condition: None +(42) BroadcastNestedLoopJoin +Join condition: (customsk#24 = c_customer_sk#1) -(43) Project [codegen id : 9] -Output [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Input [8]: [c_current_cdemo_sk#2, ca_state#19, cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +(43) Project [codegen id : 10] +Output [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Input [7]: [c_customer_sk#1, ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -(44) HashAggregate [codegen id : 9] -Input [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Keys [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#24 as bigint)), partial_max(cd_dep_count#24), partial_sum(cast(cd_dep_count#24 as bigint)), partial_avg(cast(cd_dep_employed_count#25 as bigint)), partial_max(cd_dep_employed_count#25), partial_sum(cast(cd_dep_employed_count#25 as bigint)), partial_avg(cast(cd_dep_college_count#26 as bigint)), partial_max(cd_dep_college_count#26), partial_sum(cast(cd_dep_college_count#26 as bigint))] -Aggregate Attributes [13]: [count#28, sum#29, count#30, max#31, sum#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40] -Results [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +(44) HashAggregate [codegen id : 10] +Input [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Keys [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#17 as bigint)), partial_max(cd_dep_count#17), partial_sum(cast(cd_dep_count#17 as bigint)), partial_avg(cast(cd_dep_employed_count#18 as bigint)), partial_max(cd_dep_employed_count#18), partial_sum(cast(cd_dep_employed_count#18 as bigint)), partial_avg(cast(cd_dep_college_count#19 as bigint)), partial_max(cd_dep_college_count#19), partial_sum(cast(cd_dep_college_count#19 as bigint))] +Aggregate Attributes [13]: [count#25, sum#26, count#27, max#28, sum#29, sum#30, count#31, max#32, sum#33, sum#34, count#35, max#36, sum#37] +Results [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] (45) Exchange -Input [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] -Arguments: hashpartitioning(ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, 5), true, [id=#54] +Input [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] +Arguments: hashpartitioning(ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, 5), true, [id=#51] -(46) HashAggregate [codegen id : 10] -Input [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] -Keys [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -Functions [10]: [count(1), avg(cast(cd_dep_count#24 as bigint)), max(cd_dep_count#24), sum(cast(cd_dep_count#24 as bigint)), avg(cast(cd_dep_employed_count#25 as bigint)), max(cd_dep_employed_count#25), sum(cast(cd_dep_employed_count#25 as bigint)), avg(cast(cd_dep_college_count#26 as bigint)), max(cd_dep_college_count#26), sum(cast(cd_dep_college_count#26 as bigint))] -Aggregate Attributes [10]: [count(1)#55, avg(cast(cd_dep_count#24 as bigint))#56, max(cd_dep_count#24)#57, sum(cast(cd_dep_count#24 as bigint))#58, avg(cast(cd_dep_employed_count#25 as bigint))#59, max(cd_dep_employed_count#25)#60, sum(cast(cd_dep_employed_count#25 as bigint))#61, avg(cast(cd_dep_college_count#26 as bigint))#62, max(cd_dep_college_count#26)#63, sum(cast(cd_dep_college_count#26 as bigint))#64] -Results [18]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, count(1)#55 AS cnt1#65, avg(cast(cd_dep_count#24 as bigint))#56 AS avg(cd_dep_count)#66, max(cd_dep_count#24)#57 AS max(cd_dep_count)#67, sum(cast(cd_dep_count#24 as bigint))#58 AS sum(cd_dep_count)#68, cd_dep_employed_count#25, count(1)#55 AS cnt2#69, avg(cast(cd_dep_employed_count#25 as bigint))#59 AS avg(cd_dep_employed_count)#70, max(cd_dep_employed_count#25)#60 AS max(cd_dep_employed_count)#71, sum(cast(cd_dep_employed_count#25 as bigint))#61 AS sum(cd_dep_employed_count)#72, cd_dep_college_count#26, count(1)#55 AS cnt3#73, avg(cast(cd_dep_college_count#26 as bigint))#62 AS avg(cd_dep_college_count)#74, max(cd_dep_college_count#26)#63 AS max(cd_dep_college_count)#75, sum(cast(cd_dep_college_count#26 as bigint))#64 AS sum(cd_dep_college_count)#76] +(46) HashAggregate [codegen id : 11] +Input [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] +Keys [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +Functions [10]: [count(1), avg(cast(cd_dep_count#17 as bigint)), max(cd_dep_count#17), sum(cast(cd_dep_count#17 as bigint)), avg(cast(cd_dep_employed_count#18 as bigint)), max(cd_dep_employed_count#18), sum(cast(cd_dep_employed_count#18 as bigint)), avg(cast(cd_dep_college_count#19 as bigint)), max(cd_dep_college_count#19), sum(cast(cd_dep_college_count#19 as bigint))] +Aggregate Attributes [10]: [count(1)#52, avg(cast(cd_dep_count#17 as bigint))#53, max(cd_dep_count#17)#54, sum(cast(cd_dep_count#17 as bigint))#55, avg(cast(cd_dep_employed_count#18 as bigint))#56, max(cd_dep_employed_count#18)#57, sum(cast(cd_dep_employed_count#18 as bigint))#58, avg(cast(cd_dep_college_count#19 as bigint))#59, max(cd_dep_college_count#19)#60, sum(cast(cd_dep_college_count#19 as bigint))#61] +Results [18]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, count(1)#52 AS cnt1#62, avg(cast(cd_dep_count#17 as bigint))#53 AS avg(cd_dep_count)#63, max(cd_dep_count#17)#54 AS max(cd_dep_count)#64, sum(cast(cd_dep_count#17 as bigint))#55 AS sum(cd_dep_count)#65, cd_dep_employed_count#18, count(1)#52 AS cnt2#66, avg(cast(cd_dep_employed_count#18 as bigint))#56 AS avg(cd_dep_employed_count)#67, max(cd_dep_employed_count#18)#57 AS max(cd_dep_employed_count)#68, sum(cast(cd_dep_employed_count#18 as bigint))#58 AS sum(cd_dep_employed_count)#69, cd_dep_college_count#19, count(1)#52 AS cnt3#70, avg(cast(cd_dep_college_count#19 as bigint))#59 AS avg(cd_dep_college_count)#71, max(cd_dep_college_count#19)#60 AS max(cd_dep_college_count)#72, sum(cast(cd_dep_college_count#19 as bigint))#61 AS sum(cd_dep_college_count)#73] (47) TakeOrderedAndProject -Input [18]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#25, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#26, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] -Arguments: 100, [ca_state#19 ASC NULLS FIRST, cd_gender#22 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_dep_count#24 ASC NULLS FIRST, cd_dep_employed_count#25 ASC NULLS FIRST, cd_dep_college_count#26 ASC NULLS FIRST], [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#25, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#26, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] +Input [18]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cnt1#62, avg(cd_dep_count)#63, max(cd_dep_count)#64, sum(cd_dep_count)#65, cd_dep_employed_count#18, cnt2#66, avg(cd_dep_employed_count)#67, max(cd_dep_employed_count)#68, sum(cd_dep_employed_count)#69, cd_dep_college_count#19, cnt3#70, avg(cd_dep_college_count)#71, max(cd_dep_college_count)#72, sum(cd_dep_college_count)#73] +Arguments: 100, [ca_state#12 ASC NULLS FIRST, cd_gender#15 ASC NULLS FIRST, cd_marital_status#16 ASC NULLS FIRST, cd_dep_count#17 ASC NULLS FIRST, cd_dep_employed_count#18 ASC NULLS FIRST, cd_dep_college_count#19 ASC NULLS FIRST], [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cnt1#62, avg(cd_dep_count)#63, max(cd_dep_count)#64, sum(cd_dep_count)#65, cd_dep_employed_count#18, cnt2#66, avg(cd_dep_employed_count)#67, max(cd_dep_employed_count)#68, sum(cd_dep_employed_count)#69, cd_dep_college_count#19, cnt3#70, avg(cd_dep_college_count)#71, max(cd_dep_college_count)#72, sum(cd_dep_college_count)#73] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt index 85198feb8e903..b3afbfb65d272 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt @@ -1,70 +1,71 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] - WholeStageCodegen (10) + WholeStageCodegen (11) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cast(cd_dep_count as bigint)),max(cd_dep_count),sum(cast(cd_dep_count as bigint)),avg(cast(cd_dep_employed_count as bigint)),max(cd_dep_employed_count),sum(cast(cd_dep_employed_count as bigint)),avg(cast(cd_dep_college_count as bigint)),max(cd_dep_college_count),sum(cast(cd_dep_college_count as bigint)),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] InputAdapter Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (9) + WholeStageCodegen (10) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - Project [c_current_cdemo_sk,ca_state] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - Project [c_current_cdemo_sk,c_current_addr_sk] - BroadcastHashJoin [c_customer_sk,customsk] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_current_addr_sk,c_current_cdemo_sk] - ColumnarToRow + InputAdapter + BroadcastNestedLoopJoin [customsk,c_customer_sk] + WholeStageCodegen (5) + Project [c_customer_sk,ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_customer_sk,c_current_cdemo_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + 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] InputAdapter - Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (2) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - 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] + BroadcastExchange #3 + WholeStageCodegen (1) + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] InputAdapter - BroadcastExchange #4 - Union - WholeStageCodegen (4) - Project [ws_bill_customer_sk] - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - WholeStageCodegen (6) - Project [cs_ship_customer_sk] - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - InputAdapter - BroadcastExchange #5 - WholeStageCodegen (7) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] BroadcastExchange #6 - WholeStageCodegen (8) - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + Union + WholeStageCodegen (7) + Project + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (9) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 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..5a4ba4b4db71f 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 @@ -200,90 +200,92 @@ Aggregate Attributes [2]: [sum(ss_net_profit#31)#42, sum(ss_ext_sales_price#32)# Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#42) / promote_precision(sum(ss_ext_sales_price#32)#43)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#44, i_category#14, null AS i_class#45, 0 AS t_category#46, 1 AS t_class#47, 1 AS lochierarchy#48] (32) Union +Arguments: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (33) HashAggregate [codegen id : 12] -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (34) Exchange -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Arguments: hashpartitioning(gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#49] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Arguments: hashpartitioning(gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54, 5), true, [id=#55] (35) HashAggregate [codegen id : 13] -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (36) ReusedExchange [Reuses operator id: 25] -Output [4]: [i_category#14, i_class#13, sum#50, sum#51] +Output [4]: [i_category#14, i_class#13, sum#56, sum#57] (37) HashAggregate [codegen id : 18] -Input [4]: [i_category#14, i_class#13, sum#50, sum#51] +Input [4]: [i_category#14, i_class#13, sum#56, sum#57] 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] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#58, sum(UnscaledValue(ss_ext_sales_price#4))#59] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#58,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#59,17,2) AS ss_ext_sales_price#32] (38) HashAggregate [codegen id : 18] Input [2]: [ss_net_profit#31, ss_ext_sales_price#32] Keys: [] Functions [2]: [partial_sum(ss_net_profit#31), partial_sum(ss_ext_sales_price#32)] -Aggregate Attributes [4]: [sum#54, isEmpty#55, sum#56, isEmpty#57] -Results [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Aggregate Attributes [4]: [sum#60, isEmpty#61, sum#62, isEmpty#63] +Results [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] (39) Exchange -Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] -Arguments: SinglePartition, true, [id=#62] +Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Arguments: SinglePartition, true, [id=#68] (40) HashAggregate [codegen id : 19] -Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] Keys: [] Functions [2]: [sum(ss_net_profit#31), sum(ss_ext_sales_price#32)] -Aggregate Attributes [2]: [sum(ss_net_profit#31)#63, sum(ss_ext_sales_price#32)#64] -Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#63) / promote_precision(sum(ss_ext_sales_price#32)#64)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#65, null AS i_category#66, null AS i_class#67, 1 AS t_category#68, 1 AS t_class#69, 2 AS lochierarchy#70] +Aggregate Attributes [2]: [sum(ss_net_profit#31)#69, sum(ss_ext_sales_price#32)#70] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#69) / promote_precision(sum(ss_ext_sales_price#32)#70)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#71, null AS i_category#72, null AS i_class#73, 1 AS t_category#74, 1 AS t_class#75, 2 AS lochierarchy#76] (41) Union +Arguments: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (42) HashAggregate [codegen id : 20] -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (43) Exchange -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Arguments: hashpartitioning(gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#71] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Arguments: hashpartitioning(gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82, 5), true, [id=#83] (44) HashAggregate [codegen id : 21] -Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] Functions: [] Aggregate Attributes: [] -Results [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, CASE WHEN (t_class#25 = 0) THEN i_category#14 END AS _w0#72] +Results [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, CASE WHEN (t_class#81 = 0) THEN i_category#78 END AS _w0#84] (45) Exchange -Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] -Arguments: hashpartitioning(lochierarchy#26, _w0#72, 5), true, [id=#73] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: hashpartitioning(lochierarchy#82, _w0#84, 5), true, [id=#85] (46) Sort [codegen id : 22] -Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] -Arguments: [lochierarchy#26 ASC NULLS FIRST, _w0#72 ASC NULLS FIRST, gross_margin#23 ASC NULLS FIRST], false, 0 +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: [lochierarchy#82 ASC NULLS FIRST, _w0#84 ASC NULLS FIRST, gross_margin#77 ASC NULLS FIRST], false, 0 (47) Window -Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] -Arguments: [rank(gross_margin#23) windowspecdefinition(lochierarchy#26, _w0#72, gross_margin#23 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#74], [lochierarchy#26, _w0#72], [gross_margin#23 ASC NULLS FIRST] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: [rank(gross_margin#77) windowspecdefinition(lochierarchy#82, _w0#84, gross_margin#77 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#86], [lochierarchy#82, _w0#84], [gross_margin#77 ASC NULLS FIRST] (48) Project [codegen id : 23] -Output [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] -Input [6]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72, rank_within_parent#74] +Output [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Input [6]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84, rank_within_parent#86] (49) TakeOrderedAndProject -Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] -Arguments: 100, [lochierarchy#26 DESC NULLS LAST, CASE WHEN (lochierarchy#26 = 0) THEN i_category#14 END ASC NULLS FIRST, rank_within_parent#74 ASC NULLS FIRST], [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Arguments: 100, [lochierarchy#82 DESC NULLS LAST, CASE WHEN (lochierarchy#82 = 0) THEN i_category#78 END ASC NULLS FIRST, rank_within_parent#86 ASC NULLS FIRST], [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] 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..74bdd4785e115 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 @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (20) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union + Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] WholeStageCodegen (13) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (12) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union + Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] WholeStageCodegen (5) HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt index 0d6dfa6f90a86..a26fea82c6b4c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt @@ -200,90 +200,92 @@ Aggregate Attributes [2]: [sum(ss_net_profit#31)#42, sum(ss_ext_sales_price#32)# Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#42) / promote_precision(sum(ss_ext_sales_price#32)#43)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#44, i_category#11, null AS i_class#45, 0 AS t_category#46, 1 AS t_class#47, 1 AS lochierarchy#48] (32) Union +Arguments: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (33) HashAggregate [codegen id : 12] -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (34) Exchange -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Arguments: hashpartitioning(gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#49] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Arguments: hashpartitioning(gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54, 5), true, [id=#55] (35) HashAggregate [codegen id : 13] -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (36) ReusedExchange [Reuses operator id: 25] -Output [4]: [i_category#11, i_class#10, sum#50, sum#51] +Output [4]: [i_category#11, i_class#10, sum#56, sum#57] (37) HashAggregate [codegen id : 18] -Input [4]: [i_category#11, i_class#10, sum#50, sum#51] +Input [4]: [i_category#11, i_class#10, sum#56, sum#57] Keys [2]: [i_category#11, i_class#10] 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] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#58, sum(UnscaledValue(ss_ext_sales_price#4))#59] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#58,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#59,17,2) AS ss_ext_sales_price#32] (38) HashAggregate [codegen id : 18] Input [2]: [ss_net_profit#31, ss_ext_sales_price#32] Keys: [] Functions [2]: [partial_sum(ss_net_profit#31), partial_sum(ss_ext_sales_price#32)] -Aggregate Attributes [4]: [sum#54, isEmpty#55, sum#56, isEmpty#57] -Results [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Aggregate Attributes [4]: [sum#60, isEmpty#61, sum#62, isEmpty#63] +Results [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] (39) Exchange -Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] -Arguments: SinglePartition, true, [id=#62] +Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Arguments: SinglePartition, true, [id=#68] (40) HashAggregate [codegen id : 19] -Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] Keys: [] Functions [2]: [sum(ss_net_profit#31), sum(ss_ext_sales_price#32)] -Aggregate Attributes [2]: [sum(ss_net_profit#31)#63, sum(ss_ext_sales_price#32)#64] -Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#63) / promote_precision(sum(ss_ext_sales_price#32)#64)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#65, null AS i_category#66, null AS i_class#67, 1 AS t_category#68, 1 AS t_class#69, 2 AS lochierarchy#70] +Aggregate Attributes [2]: [sum(ss_net_profit#31)#69, sum(ss_ext_sales_price#32)#70] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#69) / promote_precision(sum(ss_ext_sales_price#32)#70)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#71, null AS i_category#72, null AS i_class#73, 1 AS t_category#74, 1 AS t_class#75, 2 AS lochierarchy#76] (41) Union +Arguments: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (42) HashAggregate [codegen id : 20] -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Results [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (43) Exchange -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Arguments: hashpartitioning(gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#71] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Arguments: hashpartitioning(gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82, 5), true, [id=#83] (44) HashAggregate [codegen id : 21] -Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] -Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] Functions: [] Aggregate Attributes: [] -Results [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, CASE WHEN (t_class#25 = 0) THEN i_category#11 END AS _w0#72] +Results [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, CASE WHEN (t_class#81 = 0) THEN i_category#78 END AS _w0#84] (45) Exchange -Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] -Arguments: hashpartitioning(lochierarchy#26, _w0#72, 5), true, [id=#73] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: hashpartitioning(lochierarchy#82, _w0#84, 5), true, [id=#85] (46) Sort [codegen id : 22] -Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] -Arguments: [lochierarchy#26 ASC NULLS FIRST, _w0#72 ASC NULLS FIRST, gross_margin#23 ASC NULLS FIRST], false, 0 +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: [lochierarchy#82 ASC NULLS FIRST, _w0#84 ASC NULLS FIRST, gross_margin#77 ASC NULLS FIRST], false, 0 (47) Window -Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] -Arguments: [rank(gross_margin#23) windowspecdefinition(lochierarchy#26, _w0#72, gross_margin#23 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#74], [lochierarchy#26, _w0#72], [gross_margin#23 ASC NULLS FIRST] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] +Arguments: [rank(gross_margin#77) windowspecdefinition(lochierarchy#82, _w0#84, gross_margin#77 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#86], [lochierarchy#82, _w0#84], [gross_margin#77 ASC NULLS FIRST] (48) Project [codegen id : 23] -Output [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] -Input [6]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72, rank_within_parent#74] +Output [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Input [6]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84, rank_within_parent#86] (49) TakeOrderedAndProject -Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] -Arguments: 100, [lochierarchy#26 DESC NULLS LAST, CASE WHEN (lochierarchy#26 = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#74 ASC NULLS FIRST], [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] +Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Arguments: 100, [lochierarchy#82 DESC NULLS LAST, CASE WHEN (lochierarchy#82 = 0) THEN i_category#78 END ASC NULLS FIRST, rank_within_parent#86 ASC NULLS FIRST], [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt index a72781e1da0ed..ced101be7262a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (20) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union + Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] WholeStageCodegen (13) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (12) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union + Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] WholeStageCodegen (5) HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] InputAdapter 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..f4cc2b287f92d 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 @@ -453,26 +453,27 @@ Output [5]: [store AS channel#112, item#106, return_ratio#107, return_rank#110, Input [5]: [item#106, return_ratio#107, currency_ratio#108, return_rank#110, currency_rank#111] (83) Union +Arguments: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (84) HashAggregate [codegen id : 31] -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (85) Exchange -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Arguments: hashpartitioning(channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39, 5), true, [id=#113] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Arguments: hashpartitioning(channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117, 5), true, [id=#118] (86) HashAggregate [codegen id : 32] -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (87) TakeOrderedAndProject -Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] -Arguments: 100, [channel#40 ASC NULLS FIRST, return_rank#38 ASC NULLS FIRST, currency_rank#39 ASC NULLS FIRST, item#34 ASC NULLS FIRST], [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Arguments: 100, [channel#113 ASC NULLS FIRST, return_rank#116 ASC NULLS FIRST, currency_rank#117 ASC NULLS FIRST, item#114 ASC NULLS FIRST], [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] 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..d8c5e9679b1cf 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (31) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union + Union [channel,item,return_ratio,return_rank,currency_rank] WholeStageCodegen (10) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt index 01dc1047953e3..8a6a3942cefed 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt @@ -408,26 +408,27 @@ Output [5]: [store AS channel#109, item#103, return_ratio#104, return_rank#107, Input [5]: [item#103, return_ratio#104, currency_ratio#105, return_rank#107, currency_rank#108] (74) Union +Arguments: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (75) HashAggregate [codegen id : 22] -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (76) Exchange -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Arguments: hashpartitioning(channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38, 5), true, [id=#110] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Arguments: hashpartitioning(channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114, 5), true, [id=#115] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (78) TakeOrderedAndProject -Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] -Arguments: 100, [channel#39 ASC NULLS FIRST, return_rank#37 ASC NULLS FIRST, currency_rank#38 ASC NULLS FIRST, item#33 ASC NULLS FIRST], [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Arguments: 100, [channel#110 ASC NULLS FIRST, return_rank#113 ASC NULLS FIRST, currency_rank#114 ASC NULLS FIRST, item#111 ASC NULLS FIRST], [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt index c15f2394e1a44..e156919a29dd1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (22) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union + Union [channel,item,return_ratio,return_rank,currency_rank] WholeStageCodegen (7) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt index 471d38c89e601..c50ef03d3b8b8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt @@ -135,425 +135,431 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union +Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +Output [2]: [d_date_sk#27, d_date#28] 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-08-18), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [d_date_sk#27, d_date#28] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10442)) AND (d_date#22 <= 10456)) AND isnotnull(d_date_sk#21)) +Input [2]: [d_date_sk#27, d_date#28] +Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 10442)) AND (d_date#28 <= 10456)) AND isnotnull(d_date_sk#27)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [d_date_sk#27] +Input [2]: [d_date_sk#27, d_date#28] (14) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#6] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#22] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] -Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] +Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] +Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] (17) Scan parquet default.store -Output [2]: [s_store_sk#24, s_store_id#25] +Output [2]: [s_store_sk#30, s_store_id#31] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] +Input [2]: [s_store_sk#30, s_store_id#31] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] -Condition : isnotnull(s_store_sk#24) +Input [2]: [s_store_sk#30, s_store_id#31] +Condition : isnotnull(s_store_sk#30) (20) BroadcastExchange -Input [2]: [s_store_sk#24, s_store_id#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] +Input [2]: [s_store_sk#30, s_store_id#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#5] -Right keys [1]: [cast(s_store_sk#24 as bigint)] +Left keys [1]: [store_sk#21] +Right keys [1]: [cast(s_store_sk#30 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] +Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Keys [1]: [s_store_id#25] -Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] -Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Keys [1]: [s_store_id#31] +Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] +Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] (24) Exchange -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Keys [1]: [s_store_id#25] -Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] -Results [5]: [store channel AS channel#40, concat(store, s_store_id#25) AS id#41, MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#42, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS returns#43, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#44] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Keys [1]: [s_store_id#31] +Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] +Results [5]: [store channel AS channel#46, concat(store, s_store_id#31) AS id#47, MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#48, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS returns#49, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#50] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] -Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] -Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (34) Union +Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#50] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [date_sk#72] +Right keys [1]: [d_date_sk#27] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] -Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] +Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] +Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Condition : isnotnull(cp_catalog_page_sk#65) +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Condition : isnotnull(cp_catalog_page_sk#77) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#49] -Right keys [1]: [cp_catalog_page_sk#65] +Left keys [1]: [page_sk#71] +Right keys [1]: [cp_catalog_page_sk#77] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] -Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] +Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] (45) Exchange -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] -Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#66) AS id#82, MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS returns#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] +Results [5]: [catalog channel AS channel#93, concat(catalog_page, cp_catalog_page_id#78) AS id#94, MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#95, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS returns#96, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#97] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] -Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] (53) Filter [codegen id : 14] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Condition : isnotnull(wr_returned_date_sk#96) +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Condition : isnotnull(wr_returned_date_sk#108) (54) Exchange -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Arguments: hashpartitioning(wr_item_sk#97, wr_order_number#98, 5), true, [id=#101] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Arguments: hashpartitioning(wr_item_sk#109, wr_order_number#110, 5), true, [id=#113] (55) Sort [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Arguments: [wr_item_sk#97 ASC NULLS FIRST, wr_order_number#98 ASC NULLS FIRST], false, 0 +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Arguments: [wr_item_sk#109 ASC NULLS FIRST, wr_order_number#110 ASC NULLS FIRST], false, 0 (56) Scan parquet default.web_sales -Output [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Output [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (57) ColumnarToRow [codegen id : 16] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] (58) Filter [codegen id : 16] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Condition : ((isnotnull(ws_item_sk#102) AND isnotnull(ws_order_number#103)) AND isnotnull(ws_web_site_sk#87)) +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Condition : ((isnotnull(ws_item_sk#114) AND isnotnull(ws_order_number#115)) AND isnotnull(ws_web_site_sk#99)) (59) Exchange -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Arguments: hashpartitioning(cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint), 5), true, [id=#104] +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Arguments: hashpartitioning(cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint), 5), true, [id=#116] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] -Arguments: [cast(ws_item_sk#102 as bigint) ASC NULLS FIRST, cast(ws_order_number#103 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Arguments: [cast(ws_item_sk#114 as bigint) ASC NULLS FIRST, cast(ws_order_number#115 as bigint) ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#97, wr_order_number#98] -Right keys [2]: [cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint)] +Left keys [2]: [wr_item_sk#109, wr_order_number#110] +Right keys [2]: [cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint)] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#105, wr_returned_date_sk#96 AS date_sk#106, 0.00 AS sales_price#107, 0.00 AS profit#108, wr_return_amt#99 AS return_amt#109, wr_net_loss#100 AS net_loss#110] -Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#117, wr_returned_date_sk#108 AS date_sk#118, 0.00 AS sales_price#119, 0.00 AS profit#120, wr_return_amt#111 AS return_amt#121, wr_net_loss#112 AS net_loss#122] +Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] (63) Union +Arguments: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128] (64) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (65) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#91] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#124] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (66) Project [codegen id : 21] -Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] -Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] +Output [5]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128] +Input [7]: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128, d_date_sk#27] (67) Scan parquet default.web_site -Output [2]: [web_site_sk#111, web_site_id#112] +Output [2]: [web_site_sk#129, web_site_id#130] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (68) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#111, web_site_id#112] +Input [2]: [web_site_sk#129, web_site_id#130] (69) Filter [codegen id : 20] -Input [2]: [web_site_sk#111, web_site_id#112] -Condition : isnotnull(web_site_sk#111) +Input [2]: [web_site_sk#129, web_site_id#130] +Condition : isnotnull(web_site_sk#129) (70) BroadcastExchange -Input [2]: [web_site_sk#111, web_site_id#112] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#113] +Input [2]: [web_site_sk#129, web_site_id#130] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#131] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#90] -Right keys [1]: [web_site_sk#111] +Left keys [1]: [wsr_web_site_sk#123] +Right keys [1]: [web_site_sk#129] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] -Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#111, web_site_id#112] +Output [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] +Input [7]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_sk#129, web_site_id#130] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] -Keys [1]: [web_site_id#112] -Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum#114, sum#115, sum#116, sum#117] -Results [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Input [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] +Keys [1]: [web_site_id#130] +Functions [4]: [partial_sum(UnscaledValue(sales_price#125)), partial_sum(UnscaledValue(return_amt#127)), partial_sum(UnscaledValue(profit#126)), partial_sum(UnscaledValue(net_loss#128))] +Aggregate Attributes [4]: [sum#132, sum#133, sum#134, sum#135] +Results [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] (74) Exchange -Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] -Arguments: hashpartitioning(web_site_id#112, 5), true, [id=#122] +Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Arguments: hashpartitioning(web_site_id#130, 5), true, [id=#140] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] -Keys [1]: [web_site_id#112] -Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#123, sum(UnscaledValue(return_amt#94))#124, sum(UnscaledValue(profit#93))#125, sum(UnscaledValue(net_loss#95))#126] -Results [5]: [web channel AS channel#127, concat(web_site, web_site_id#112) AS id#128, MakeDecimal(sum(UnscaledValue(sales_price#92))#123,17,2) AS sales#129, MakeDecimal(sum(UnscaledValue(return_amt#94))#124,17,2) AS returns#130, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#125,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#126,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#131] +Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Keys [1]: [web_site_id#130] +Functions [4]: [sum(UnscaledValue(sales_price#125)), sum(UnscaledValue(return_amt#127)), sum(UnscaledValue(profit#126)), sum(UnscaledValue(net_loss#128))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#125))#141, sum(UnscaledValue(return_amt#127))#142, sum(UnscaledValue(profit#126))#143, sum(UnscaledValue(net_loss#128))#144] +Results [5]: [web channel AS channel#145, concat(web_site, web_site_id#130) AS id#146, MakeDecimal(sum(UnscaledValue(sales_price#125))#141,17,2) AS sales#147, MakeDecimal(sum(UnscaledValue(return_amt#127))#142,17,2) AS returns#148, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#126))#143,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#128))#144,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#149] (76) Union +Arguments: [channel#150, id#151, sales#152, returns#153, profit#154] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] -Keys [2]: [channel#40, id#41] -Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] -Aggregate Attributes [6]: [sum#132, isEmpty#133, sum#134, isEmpty#135, sum#136, isEmpty#137] -Results [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Input [5]: [channel#150, id#151, sales#152, returns#153, profit#154] +Keys [2]: [channel#150, id#151] +Functions [3]: [partial_sum(sales#152), partial_sum(returns#153), partial_sum(profit#154)] +Aggregate Attributes [6]: [sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] +Results [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] (78) Exchange -Input [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] -Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#144] +Input [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] +Arguments: hashpartitioning(channel#150, id#151, 5), true, [id=#167] (79) HashAggregate [codegen id : 24] -Input [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] -Aggregate Attributes [3]: [sum(sales#42)#145, sum(returns#43)#146, sum(profit#44)#147] -Results [5]: [channel#40, id#41, cast(sum(sales#42)#145 as decimal(37,2)) AS sales#148, cast(sum(returns#43)#146 as decimal(37,2)) AS returns#149, cast(sum(profit#44)#147 as decimal(38,2)) AS profit#150] +Input [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] +Keys [2]: [channel#150, id#151] +Functions [3]: [sum(sales#152), sum(returns#153), sum(profit#154)] +Aggregate Attributes [3]: [sum(sales#152)#168, sum(returns#153)#169, sum(profit#154)#170] +Results [5]: [channel#150, id#151, cast(sum(sales#152)#168 as decimal(37,2)) AS sales#171, cast(sum(returns#153)#169 as decimal(37,2)) AS returns#172, cast(sum(profit#154)#170 as decimal(38,2)) AS profit#173] (80) ReusedExchange [Reuses operator id: 78] -Output [8]: [channel#40, id#41, sum#151, isEmpty#152, sum#153, isEmpty#154, sum#155, isEmpty#156] +Output [8]: [channel#174, id#175, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] (81) HashAggregate [codegen id : 48] -Input [8]: [channel#40, id#41, sum#151, isEmpty#152, sum#153, isEmpty#154, sum#155, isEmpty#156] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#157)] -Aggregate Attributes [3]: [sum(sales#42)#158, sum(returns#43)#159, sum(profit#157)#160] -Results [4]: [channel#40, sum(sales#42)#158 AS sales#161, sum(returns#43)#159 AS returns#162, sum(profit#157)#160 AS profit#163] +Input [8]: [channel#174, id#175, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Keys [2]: [channel#174, id#175] +Functions [3]: [sum(sales#182), sum(returns#183), sum(profit#184)] +Aggregate Attributes [3]: [sum(sales#182)#185, sum(returns#183)#186, sum(profit#184)#187] +Results [4]: [channel#174, sum(sales#182)#185 AS sales#188, sum(returns#183)#186 AS returns#189, sum(profit#184)#187 AS profit#190] (82) HashAggregate [codegen id : 48] -Input [4]: [channel#40, sales#161, returns#162, profit#163] -Keys [1]: [channel#40] -Functions [3]: [partial_sum(sales#161), partial_sum(returns#162), partial_sum(profit#163)] -Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Results [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Input [4]: [channel#174, sales#188, returns#189, profit#190] +Keys [1]: [channel#174] +Functions [3]: [partial_sum(sales#188), partial_sum(returns#189), partial_sum(profit#190)] +Aggregate Attributes [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] +Results [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] (83) Exchange -Input [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Arguments: hashpartitioning(channel#40, 5), true, [id=#176] +Input [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] +Arguments: hashpartitioning(channel#174, 5), true, [id=#203] (84) HashAggregate [codegen id : 49] -Input [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Keys [1]: [channel#40] -Functions [3]: [sum(sales#161), sum(returns#162), sum(profit#163)] -Aggregate Attributes [3]: [sum(sales#161)#177, sum(returns#162)#178, sum(profit#163)#179] -Results [5]: [channel#40, null AS id#180, sum(sales#161)#177 AS sum(sales)#181, sum(returns#162)#178 AS sum(returns)#182, sum(profit#163)#179 AS sum(profit)#183] +Input [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] +Keys [1]: [channel#174] +Functions [3]: [sum(sales#188), sum(returns#189), sum(profit#190)] +Aggregate Attributes [3]: [sum(sales#188)#204, sum(returns#189)#205, sum(profit#190)#206] +Results [5]: [channel#174, null AS id#207, sum(sales#188)#204 AS sum(sales)#208, sum(returns#189)#205 AS sum(returns)#209, sum(profit#190)#206 AS sum(profit)#210] (85) Union +Arguments: [channel#211, id#212, sales#213, returns#214, profit#215] (86) HashAggregate [codegen id : 50] -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Keys [5]: [channel#211, id#212, sales#213, returns#214, profit#215] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Results [5]: [channel#211, id#212, sales#213, returns#214, profit#215] (87) Exchange -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Arguments: hashpartitioning(channel#40, id#41, sales#148, returns#149, profit#150, 5), true, [id=#184] +Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Arguments: hashpartitioning(channel#211, id#212, sales#213, returns#214, profit#215, 5), true, [id=#216] (88) HashAggregate [codegen id : 51] -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Keys [5]: [channel#211, id#212, sales#213, returns#214, profit#215] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Results [5]: [channel#211, id#212, sales#213, returns#214, profit#215] (89) ReusedExchange [Reuses operator id: 78] -Output [8]: [channel#40, id#41, sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] +Output [8]: [channel#217, id#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224] (90) HashAggregate [codegen id : 75] -Input [8]: [channel#40, id#41, sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#191)] -Aggregate Attributes [3]: [sum(sales#42)#192, sum(returns#43)#193, sum(profit#191)#194] -Results [3]: [sum(sales#42)#192 AS sales#161, sum(returns#43)#193 AS returns#162, sum(profit#191)#194 AS profit#163] +Input [8]: [channel#217, id#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224] +Keys [2]: [channel#217, id#218] +Functions [3]: [sum(sales#225), sum(returns#226), sum(profit#227)] +Aggregate Attributes [3]: [sum(sales#225)#228, sum(returns#226)#229, sum(profit#227)#230] +Results [3]: [sum(sales#225)#228 AS sales#188, sum(returns#226)#229 AS returns#189, sum(profit#227)#230 AS profit#190] (91) HashAggregate [codegen id : 75] -Input [3]: [sales#161, returns#162, profit#163] +Input [3]: [sales#188, returns#189, profit#190] Keys: [] -Functions [3]: [partial_sum(sales#161), partial_sum(returns#162), partial_sum(profit#163)] -Aggregate Attributes [6]: [sum#195, isEmpty#196, sum#197, isEmpty#198, sum#199, isEmpty#200] -Results [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] +Functions [3]: [partial_sum(sales#188), partial_sum(returns#189), partial_sum(profit#190)] +Aggregate Attributes [6]: [sum#231, isEmpty#232, sum#233, isEmpty#234, sum#235, isEmpty#236] +Results [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] (92) Exchange -Input [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] -Arguments: SinglePartition, true, [id=#207] +Input [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] +Arguments: SinglePartition, true, [id=#243] (93) HashAggregate [codegen id : 76] -Input [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] +Input [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] Keys: [] -Functions [3]: [sum(sales#161), sum(returns#162), sum(profit#163)] -Aggregate Attributes [3]: [sum(sales#161)#208, sum(returns#162)#209, sum(profit#163)#210] -Results [5]: [null AS channel#211, null AS id#212, sum(sales#161)#208 AS sum(sales)#213, sum(returns#162)#209 AS sum(returns)#214, sum(profit#163)#210 AS sum(profit)#215] +Functions [3]: [sum(sales#188), sum(returns#189), sum(profit#190)] +Aggregate Attributes [3]: [sum(sales#188)#244, sum(returns#189)#245, sum(profit#190)#246] +Results [5]: [null AS channel#247, null AS id#248, sum(sales#188)#244 AS sum(sales)#249, sum(returns#189)#245 AS sum(returns)#250, sum(profit#190)#246 AS sum(profit)#251] (94) Union +Arguments: [channel#252, id#253, sales#254, returns#255, profit#256] (95) HashAggregate [codegen id : 77] -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Keys [5]: [channel#252, id#253, sales#254, returns#255, profit#256] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Results [5]: [channel#252, id#253, sales#254, returns#255, profit#256] (96) Exchange -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Arguments: hashpartitioning(channel#40, id#41, sales#148, returns#149, profit#150, 5), true, [id=#216] +Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Arguments: hashpartitioning(channel#252, id#253, sales#254, returns#255, profit#256, 5), true, [id=#257] (97) HashAggregate [codegen id : 78] -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Keys [5]: [channel#252, id#253, sales#254, returns#255, profit#256] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Results [5]: [channel#252, id#253, sales#254, returns#255, profit#256] (98) TakeOrderedAndProject -Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] -Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#148, returns#149, profit#150] +Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Arguments: 100, [channel#252 ASC NULLS FIRST, id#253 ASC NULLS FIRST], [channel#252, id#253, sales#254, returns#255, profit#256] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt index 81b4178b7a9ca..ccdf442569fb0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (77) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (51) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (50) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (24) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (23) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] InputAdapter @@ -34,7 +34,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -73,7 +73,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -106,7 +106,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt index fa2435de73e02..2c5c5212e2004 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt @@ -132,413 +132,419 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union +Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#21, d_date#22] +Output [2]: [d_date_sk#27, d_date#28] 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-08-18), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] +Input [2]: [d_date_sk#27, d_date#28] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#21, d_date#22] -Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10442)) AND (d_date#22 <= 10456)) AND isnotnull(d_date_sk#21)) +Input [2]: [d_date_sk#27, d_date#28] +Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 10442)) AND (d_date#28 <= 10456)) AND isnotnull(d_date_sk#27)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#21] -Input [2]: [d_date_sk#21, d_date#22] +Output [1]: [d_date_sk#27] +Input [2]: [d_date_sk#27, d_date#28] (14) BroadcastExchange -Input [1]: [d_date_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#6] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#22] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] -Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] +Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] +Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] (17) Scan parquet default.store -Output [2]: [s_store_sk#24, s_store_id#25] +Output [2]: [s_store_sk#30, s_store_id#31] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] +Input [2]: [s_store_sk#30, s_store_id#31] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#24, s_store_id#25] -Condition : isnotnull(s_store_sk#24) +Input [2]: [s_store_sk#30, s_store_id#31] +Condition : isnotnull(s_store_sk#30) (20) BroadcastExchange -Input [2]: [s_store_sk#24, s_store_id#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] +Input [2]: [s_store_sk#30, s_store_id#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#5] -Right keys [1]: [cast(s_store_sk#24 as bigint)] +Left keys [1]: [store_sk#21] +Right keys [1]: [cast(s_store_sk#30 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] +Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] -Keys [1]: [s_store_id#25] -Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] -Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] +Keys [1]: [s_store_id#31] +Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] +Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] (24) Exchange -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] -Keys [1]: [s_store_id#25] -Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] -Results [5]: [store channel AS channel#40, concat(store, s_store_id#25) AS id#41, MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#42, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS returns#43, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#44] +Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Keys [1]: [s_store_id#31] +Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] +Results [5]: [store channel AS channel#46, concat(store, s_store_id#31) AS id#47, MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#48, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS returns#49, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#50] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] -Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] -Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] +Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] -Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] -Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] +Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] (34) Union +Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#50] -Right keys [1]: [d_date_sk#21] +Left keys [1]: [date_sk#72] +Right keys [1]: [d_date_sk#27] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] -Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] +Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] +Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Condition : isnotnull(cp_catalog_page_sk#65) +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Condition : isnotnull(cp_catalog_page_sk#77) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] +Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#49] -Right keys [1]: [cp_catalog_page_sk#65] +Left keys [1]: [page_sk#71] +Right keys [1]: [cp_catalog_page_sk#77] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] +Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] -Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] +Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] (45) Exchange -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] -Keys [1]: [cp_catalog_page_id#66] -Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] -Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#66) AS id#82, MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS returns#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85] +Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Keys [1]: [cp_catalog_page_id#78] +Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] +Results [5]: [catalog channel AS channel#93, concat(catalog_page, cp_catalog_page_id#78) AS id#94, MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#95, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS returns#96, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#97] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] -Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] -Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] +Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] (53) Filter [codegen id : 15] -Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] -Condition : isnotnull(wr_returned_date_sk#96) +Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Condition : isnotnull(wr_returned_date_sk#108) (54) Scan parquet default.web_sales -Output [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Output [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 14] -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] (56) Filter [codegen id : 14] -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] -Condition : ((isnotnull(ws_item_sk#101) AND isnotnull(ws_order_number#102)) AND isnotnull(ws_web_site_sk#87)) +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Condition : ((isnotnull(ws_item_sk#113) AND isnotnull(ws_order_number#114)) AND isnotnull(ws_web_site_sk#99)) (57) BroadcastExchange -Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#103] +Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#115] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#97, wr_order_number#98] -Right keys [2]: [cast(ws_item_sk#101 as bigint), cast(ws_order_number#102 as bigint)] +Left keys [2]: [wr_item_sk#109, wr_order_number#110] +Right keys [2]: [cast(ws_item_sk#113 as bigint), cast(ws_order_number#114 as bigint)] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#104, wr_returned_date_sk#96 AS date_sk#105, 0.00 AS sales_price#106, 0.00 AS profit#107, wr_return_amt#99 AS return_amt#108, wr_net_loss#100 AS net_loss#109] -Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#116, wr_returned_date_sk#108 AS date_sk#117, 0.00 AS sales_price#118, 0.00 AS profit#119, wr_return_amt#111 AS return_amt#120, wr_net_loss#112 AS net_loss#121] +Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] (60) Union +Arguments: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127] (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#21] +Output [1]: [d_date_sk#27] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#91] -Right keys [1]: [cast(d_date_sk#21 as bigint)] +Left keys [1]: [date_sk#123] +Right keys [1]: [cast(d_date_sk#27 as bigint)] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] -Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] +Output [5]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127] +Input [7]: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127, d_date_sk#27] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#110, web_site_id#111] +Output [2]: [web_site_sk#128, web_site_id#129] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#110, web_site_id#111] +Input [2]: [web_site_sk#128, web_site_id#129] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#110, web_site_id#111] -Condition : isnotnull(web_site_sk#110) +Input [2]: [web_site_sk#128, web_site_id#129] +Condition : isnotnull(web_site_sk#128) (67) BroadcastExchange -Input [2]: [web_site_sk#110, web_site_id#111] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#112] +Input [2]: [web_site_sk#128, web_site_id#129] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#130] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#90] -Right keys [1]: [web_site_sk#110] +Left keys [1]: [wsr_web_site_sk#122] +Right keys [1]: [web_site_sk#128] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] -Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#110, web_site_id#111] +Output [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] +Input [7]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_sk#128, web_site_id#129] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] -Keys [1]: [web_site_id#111] -Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum#113, sum#114, sum#115, sum#116] -Results [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Input [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] +Keys [1]: [web_site_id#129] +Functions [4]: [partial_sum(UnscaledValue(sales_price#124)), partial_sum(UnscaledValue(return_amt#126)), partial_sum(UnscaledValue(profit#125)), partial_sum(UnscaledValue(net_loss#127))] +Aggregate Attributes [4]: [sum#131, sum#132, sum#133, sum#134] +Results [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] (71) Exchange -Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] -Arguments: hashpartitioning(web_site_id#111, 5), true, [id=#121] +Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Arguments: hashpartitioning(web_site_id#129, 5), true, [id=#139] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] -Keys [1]: [web_site_id#111] -Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#122, sum(UnscaledValue(return_amt#94))#123, sum(UnscaledValue(profit#93))#124, sum(UnscaledValue(net_loss#95))#125] -Results [5]: [web channel AS channel#126, concat(web_site, web_site_id#111) AS id#127, MakeDecimal(sum(UnscaledValue(sales_price#92))#122,17,2) AS sales#128, MakeDecimal(sum(UnscaledValue(return_amt#94))#123,17,2) AS returns#129, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#124,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#125,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#130] +Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Keys [1]: [web_site_id#129] +Functions [4]: [sum(UnscaledValue(sales_price#124)), sum(UnscaledValue(return_amt#126)), sum(UnscaledValue(profit#125)), sum(UnscaledValue(net_loss#127))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#124))#140, sum(UnscaledValue(return_amt#126))#141, sum(UnscaledValue(profit#125))#142, sum(UnscaledValue(net_loss#127))#143] +Results [5]: [web channel AS channel#144, concat(web_site, web_site_id#129) AS id#145, MakeDecimal(sum(UnscaledValue(sales_price#124))#140,17,2) AS sales#146, MakeDecimal(sum(UnscaledValue(return_amt#126))#141,17,2) AS returns#147, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#125))#142,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#127))#143,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#148] (73) Union +Arguments: [channel#149, id#150, sales#151, returns#152, profit#153] (74) HashAggregate [codegen id : 20] -Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] -Keys [2]: [channel#40, id#41] -Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] -Aggregate Attributes [6]: [sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] -Results [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] +Input [5]: [channel#149, id#150, sales#151, returns#152, profit#153] +Keys [2]: [channel#149, id#150] +Functions [3]: [partial_sum(sales#151), partial_sum(returns#152), partial_sum(profit#153)] +Aggregate Attributes [6]: [sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] +Results [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] (75) Exchange -Input [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] -Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#143] +Input [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] +Arguments: hashpartitioning(channel#149, id#150, 5), true, [id=#166] (76) HashAggregate [codegen id : 21] -Input [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] -Aggregate Attributes [3]: [sum(sales#42)#144, sum(returns#43)#145, sum(profit#44)#146] -Results [5]: [channel#40, id#41, cast(sum(sales#42)#144 as decimal(37,2)) AS sales#147, cast(sum(returns#43)#145 as decimal(37,2)) AS returns#148, cast(sum(profit#44)#146 as decimal(38,2)) AS profit#149] +Input [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] +Keys [2]: [channel#149, id#150] +Functions [3]: [sum(sales#151), sum(returns#152), sum(profit#153)] +Aggregate Attributes [3]: [sum(sales#151)#167, sum(returns#152)#168, sum(profit#153)#169] +Results [5]: [channel#149, id#150, cast(sum(sales#151)#167 as decimal(37,2)) AS sales#170, cast(sum(returns#152)#168 as decimal(37,2)) AS returns#171, cast(sum(profit#153)#169 as decimal(38,2)) AS profit#172] (77) ReusedExchange [Reuses operator id: 75] -Output [8]: [channel#40, id#41, sum#150, isEmpty#151, sum#152, isEmpty#153, sum#154, isEmpty#155] +Output [8]: [channel#173, id#174, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] (78) HashAggregate [codegen id : 42] -Input [8]: [channel#40, id#41, sum#150, isEmpty#151, sum#152, isEmpty#153, sum#154, isEmpty#155] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#156)] -Aggregate Attributes [3]: [sum(sales#42)#157, sum(returns#43)#158, sum(profit#156)#159] -Results [4]: [channel#40, sum(sales#42)#157 AS sales#160, sum(returns#43)#158 AS returns#161, sum(profit#156)#159 AS profit#162] +Input [8]: [channel#173, id#174, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Keys [2]: [channel#173, id#174] +Functions [3]: [sum(sales#181), sum(returns#182), sum(profit#183)] +Aggregate Attributes [3]: [sum(sales#181)#184, sum(returns#182)#185, sum(profit#183)#186] +Results [4]: [channel#173, sum(sales#181)#184 AS sales#187, sum(returns#182)#185 AS returns#188, sum(profit#183)#186 AS profit#189] (79) HashAggregate [codegen id : 42] -Input [4]: [channel#40, sales#160, returns#161, profit#162] -Keys [1]: [channel#40] -Functions [3]: [partial_sum(sales#160), partial_sum(returns#161), partial_sum(profit#162)] -Aggregate Attributes [6]: [sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] -Results [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] +Input [4]: [channel#173, sales#187, returns#188, profit#189] +Keys [1]: [channel#173] +Functions [3]: [partial_sum(sales#187), partial_sum(returns#188), partial_sum(profit#189)] +Aggregate Attributes [6]: [sum#190, isEmpty#191, sum#192, isEmpty#193, sum#194, isEmpty#195] +Results [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] (80) Exchange -Input [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] -Arguments: hashpartitioning(channel#40, 5), true, [id=#175] +Input [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Arguments: hashpartitioning(channel#173, 5), true, [id=#202] (81) HashAggregate [codegen id : 43] -Input [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] -Keys [1]: [channel#40] -Functions [3]: [sum(sales#160), sum(returns#161), sum(profit#162)] -Aggregate Attributes [3]: [sum(sales#160)#176, sum(returns#161)#177, sum(profit#162)#178] -Results [5]: [channel#40, null AS id#179, sum(sales#160)#176 AS sum(sales)#180, sum(returns#161)#177 AS sum(returns)#181, sum(profit#162)#178 AS sum(profit)#182] +Input [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Keys [1]: [channel#173] +Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] +Aggregate Attributes [3]: [sum(sales#187)#203, sum(returns#188)#204, sum(profit#189)#205] +Results [5]: [channel#173, null AS id#206, sum(sales#187)#203 AS sum(sales)#207, sum(returns#188)#204 AS sum(returns)#208, sum(profit#189)#205 AS sum(profit)#209] (82) Union +Arguments: [channel#210, id#211, sales#212, returns#213, profit#214] (83) HashAggregate [codegen id : 44] -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Keys [5]: [channel#210, id#211, sales#212, returns#213, profit#214] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Results [5]: [channel#210, id#211, sales#212, returns#213, profit#214] (84) Exchange -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Arguments: hashpartitioning(channel#40, id#41, sales#147, returns#148, profit#149, 5), true, [id=#183] +Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Arguments: hashpartitioning(channel#210, id#211, sales#212, returns#213, profit#214, 5), true, [id=#215] (85) HashAggregate [codegen id : 45] -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Keys [5]: [channel#210, id#211, sales#212, returns#213, profit#214] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Results [5]: [channel#210, id#211, sales#212, returns#213, profit#214] (86) ReusedExchange [Reuses operator id: 75] -Output [8]: [channel#40, id#41, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] +Output [8]: [channel#216, id#217, sum#218, isEmpty#219, sum#220, isEmpty#221, sum#222, isEmpty#223] (87) HashAggregate [codegen id : 66] -Input [8]: [channel#40, id#41, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#190)] -Aggregate Attributes [3]: [sum(sales#42)#191, sum(returns#43)#192, sum(profit#190)#193] -Results [3]: [sum(sales#42)#191 AS sales#160, sum(returns#43)#192 AS returns#161, sum(profit#190)#193 AS profit#162] +Input [8]: [channel#216, id#217, sum#218, isEmpty#219, sum#220, isEmpty#221, sum#222, isEmpty#223] +Keys [2]: [channel#216, id#217] +Functions [3]: [sum(sales#224), sum(returns#225), sum(profit#226)] +Aggregate Attributes [3]: [sum(sales#224)#227, sum(returns#225)#228, sum(profit#226)#229] +Results [3]: [sum(sales#224)#227 AS sales#187, sum(returns#225)#228 AS returns#188, sum(profit#226)#229 AS profit#189] (88) HashAggregate [codegen id : 66] -Input [3]: [sales#160, returns#161, profit#162] +Input [3]: [sales#187, returns#188, profit#189] Keys: [] -Functions [3]: [partial_sum(sales#160), partial_sum(returns#161), partial_sum(profit#162)] -Aggregate Attributes [6]: [sum#194, isEmpty#195, sum#196, isEmpty#197, sum#198, isEmpty#199] -Results [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] +Functions [3]: [partial_sum(sales#187), partial_sum(returns#188), partial_sum(profit#189)] +Aggregate Attributes [6]: [sum#230, isEmpty#231, sum#232, isEmpty#233, sum#234, isEmpty#235] +Results [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] (89) Exchange -Input [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] -Arguments: SinglePartition, true, [id=#206] +Input [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] +Arguments: SinglePartition, true, [id=#242] (90) HashAggregate [codegen id : 67] -Input [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] +Input [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] Keys: [] -Functions [3]: [sum(sales#160), sum(returns#161), sum(profit#162)] -Aggregate Attributes [3]: [sum(sales#160)#207, sum(returns#161)#208, sum(profit#162)#209] -Results [5]: [null AS channel#210, null AS id#211, sum(sales#160)#207 AS sum(sales)#212, sum(returns#161)#208 AS sum(returns)#213, sum(profit#162)#209 AS sum(profit)#214] +Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] +Aggregate Attributes [3]: [sum(sales#187)#243, sum(returns#188)#244, sum(profit#189)#245] +Results [5]: [null AS channel#246, null AS id#247, sum(sales#187)#243 AS sum(sales)#248, sum(returns#188)#244 AS sum(returns)#249, sum(profit#189)#245 AS sum(profit)#250] (91) Union +Arguments: [channel#251, id#252, sales#253, returns#254, profit#255] (92) HashAggregate [codegen id : 68] -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Keys [5]: [channel#251, id#252, sales#253, returns#254, profit#255] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Results [5]: [channel#251, id#252, sales#253, returns#254, profit#255] (93) Exchange -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Arguments: hashpartitioning(channel#40, id#41, sales#147, returns#148, profit#149, 5), true, [id=#215] +Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Arguments: hashpartitioning(channel#251, id#252, sales#253, returns#254, profit#255, 5), true, [id=#256] (94) HashAggregate [codegen id : 69] -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Keys [5]: [channel#251, id#252, sales#253, returns#254, profit#255] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Results [5]: [channel#251, id#252, sales#253, returns#254, profit#255] (95) TakeOrderedAndProject -Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] -Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#147, returns#148, profit#149] +Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Arguments: 100, [channel#251 ASC NULLS FIRST, id#252 ASC NULLS FIRST], [channel#251, id#252, sales#253, returns#254, profit#255] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt index 6bb223e2f4488..12be2a8321f1f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (68) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (45) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (44) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (21) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (20) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] InputAdapter @@ -34,7 +34,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -73,7 +73,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -106,7 +106,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union + Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt index 3d0d49fff876a..3437a41143c3e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt @@ -429,24 +429,25 @@ Aggregate Attributes [1]: [sum(sumsales#32)#136] Results [9]: [null AS i_category#137, null AS i_class#138, null AS i_brand#139, null AS i_product_name#140, null AS d_year#141, null AS d_qoy#142, null AS d_moy#143, null AS s_store_id#144, sum(sumsales#32)#136 AS sumsales#145] (69) Union +Arguments: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] (70) Exchange -Input [9]: [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, sumsales#28] -Arguments: hashpartitioning(i_category#19, 5), true, [id=#146] +Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] +Arguments: hashpartitioning(i_category#146, 5), true, [id=#155] (71) Sort [codegen id : 81] -Input [9]: [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, sumsales#28] -Arguments: [i_category#19 ASC NULLS FIRST, sumsales#28 DESC NULLS LAST], false, 0 +Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] +Arguments: [i_category#146 ASC NULLS FIRST, sumsales#154 DESC NULLS LAST], false, 0 (72) Window -Input [9]: [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, sumsales#28] -Arguments: [rank(sumsales#28) windowspecdefinition(i_category#19, sumsales#28 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#147], [i_category#19], [sumsales#28 DESC NULLS LAST] +Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] +Arguments: [rank(sumsales#154) windowspecdefinition(i_category#146, sumsales#154 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#156], [i_category#146], [sumsales#154 DESC NULLS LAST] (73) Filter [codegen id : 82] -Input [10]: [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, sumsales#28, rk#147] -Condition : (isnotnull(rk#147) AND (rk#147 <= 100)) +Input [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] +Condition : (isnotnull(rk#156) AND (rk#156 <= 100)) (74) TakeOrderedAndProject -Input [10]: [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, sumsales#28, rk#147] -Arguments: 100, [i_category#19 ASC NULLS FIRST, i_class#18 ASC NULLS FIRST, i_brand#17 ASC NULLS FIRST, i_product_name#20 ASC NULLS FIRST, d_year#8 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, d_moy#9 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, sumsales#28 ASC NULLS FIRST, rk#147 ASC NULLS FIRST], [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, sumsales#28, rk#147] +Input [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] +Arguments: 100, [i_category#146 ASC NULLS FIRST, i_class#147 ASC NULLS FIRST, i_brand#148 ASC NULLS FIRST, i_product_name#149 ASC NULLS FIRST, d_year#150 ASC NULLS FIRST, d_qoy#151 ASC NULLS FIRST, d_moy#152 ASC NULLS FIRST, s_store_id#153 ASC NULLS FIRST, sumsales#154 ASC NULLS FIRST, rk#156 ASC NULLS FIRST], [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt index 277f3a8edd022..0944d22b3b200 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ Sort [i_category,sumsales] InputAdapter Exchange [i_category] #1 - Union + Union [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales] WholeStageCodegen (8) HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt index 38a768bd3dec0..3b61e47d69e27 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt @@ -414,24 +414,25 @@ Aggregate Attributes [1]: [sum(sumsales#31)#135] Results [9]: [null AS i_category#136, null AS i_class#137, null AS i_brand#138, null AS i_product_name#139, null AS d_year#140, null AS d_qoy#141, null AS d_moy#142, null AS s_store_id#143, sum(sumsales#31)#135 AS sumsales#144] (66) Union +Arguments: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] (67) Exchange -Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] -Arguments: hashpartitioning(i_category#18, 5), true, [id=#145] +Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] +Arguments: hashpartitioning(i_category#145, 5), true, [id=#154] (68) Sort [codegen id : 54] -Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] -Arguments: [i_category#18 ASC NULLS FIRST, sumsales#27 DESC NULLS LAST], false, 0 +Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] +Arguments: [i_category#145 ASC NULLS FIRST, sumsales#153 DESC NULLS LAST], false, 0 (69) Window -Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] -Arguments: [rank(sumsales#27) windowspecdefinition(i_category#18, sumsales#27 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#146], [i_category#18], [sumsales#27 DESC NULLS LAST] +Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] +Arguments: [rank(sumsales#153) windowspecdefinition(i_category#145, sumsales#153 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#155], [i_category#145], [sumsales#153 DESC NULLS LAST] (70) Filter [codegen id : 55] -Input [10]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] -Condition : (isnotnull(rk#146) AND (rk#146 <= 100)) +Input [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] +Condition : (isnotnull(rk#155) AND (rk#155 <= 100)) (71) TakeOrderedAndProject -Input [10]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] -Arguments: 100, [i_category#18 ASC NULLS FIRST, i_class#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, i_product_name#19 ASC NULLS FIRST, d_year#8 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, d_moy#9 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, sumsales#27 ASC NULLS FIRST, rk#146 ASC NULLS FIRST], [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] +Input [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] +Arguments: 100, [i_category#145 ASC NULLS FIRST, i_class#146 ASC NULLS FIRST, i_brand#147 ASC NULLS FIRST, i_product_name#148 ASC NULLS FIRST, d_year#149 ASC NULLS FIRST, d_qoy#150 ASC NULLS FIRST, d_moy#151 ASC NULLS FIRST, s_store_id#152 ASC NULLS FIRST, sumsales#153 ASC NULLS FIRST, rk#155 ASC NULLS FIRST], [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt index 3581b5b7b436c..7804a43808ab6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ Sort [i_category,sumsales] InputAdapter Exchange [i_category] #1 - Union + Union [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales] WholeStageCodegen (5) HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt index 628ca0ad4711c..6a963a354ee3c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt @@ -284,90 +284,92 @@ Aggregate Attributes [1]: [sum(total_sum#31)#37] Results [6]: [sum(total_sum#31)#37 AS total_sum#38, s_state#9, null AS s_county#39, 0 AS g_state#40, 1 AS g_county#41, 1 AS lochierarchy#42] (47) Union +Arguments: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (48) HashAggregate [codegen id : 22] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (49) Exchange -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#43] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Arguments: hashpartitioning(total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48, 5), true, [id=#49] (50) HashAggregate [codegen id : 23] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (51) ReusedExchange [Reuses operator id: 40] -Output [3]: [s_state#9, s_county#8, sum#44] +Output [3]: [s_state#9, s_county#8, sum#50] (52) HashAggregate [codegen id : 33] -Input [3]: [s_state#9, s_county#8, sum#44] +Input [3]: [s_state#9, s_county#8, sum#50] Keys [2]: [s_state#9, s_county#8] Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#45] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#45,17,2) AS total_sum#31] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#51] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#51,17,2) AS total_sum#31] (53) HashAggregate [codegen id : 33] Input [1]: [total_sum#31] Keys: [] Functions [1]: [partial_sum(total_sum#31)] -Aggregate Attributes [2]: [sum#46, isEmpty#47] -Results [2]: [sum#48, isEmpty#49] +Aggregate Attributes [2]: [sum#52, isEmpty#53] +Results [2]: [sum#54, isEmpty#55] (54) Exchange -Input [2]: [sum#48, isEmpty#49] -Arguments: SinglePartition, true, [id=#50] +Input [2]: [sum#54, isEmpty#55] +Arguments: SinglePartition, true, [id=#56] (55) HashAggregate [codegen id : 34] -Input [2]: [sum#48, isEmpty#49] +Input [2]: [sum#54, isEmpty#55] Keys: [] Functions [1]: [sum(total_sum#31)] -Aggregate Attributes [1]: [sum(total_sum#31)#51] -Results [6]: [sum(total_sum#31)#51 AS total_sum#52, null AS s_state#53, null AS s_county#54, 1 AS g_state#55, 1 AS g_county#56, 2 AS lochierarchy#57] +Aggregate Attributes [1]: [sum(total_sum#31)#57] +Results [6]: [sum(total_sum#31)#57 AS total_sum#58, null AS s_state#59, null AS s_county#60, 1 AS g_state#61, 1 AS g_county#62, 2 AS lochierarchy#63] (56) Union +Arguments: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (57) HashAggregate [codegen id : 35] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (58) Exchange -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#58] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Arguments: hashpartitioning(total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69, 5), true, [id=#70] (59) HashAggregate [codegen id : 36] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, CASE WHEN (g_county#27 = 0) THEN s_state#9 END AS _w0#59] +Results [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, CASE WHEN (g_county#68 = 0) THEN s_state#65 END AS _w0#71] (60) Exchange -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: hashpartitioning(lochierarchy#28, _w0#59, 5), true, [id=#60] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: hashpartitioning(lochierarchy#69, _w0#71, 5), true, [id=#72] (61) Sort [codegen id : 37] -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: [lochierarchy#28 ASC NULLS FIRST, _w0#59 ASC NULLS FIRST, total_sum#25 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: [lochierarchy#69 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#64 DESC NULLS LAST], false, 0 (62) Window -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: [rank(total_sum#25) windowspecdefinition(lochierarchy#28, _w0#59, total_sum#25 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#61], [lochierarchy#28, _w0#59], [total_sum#25 DESC NULLS LAST] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: [rank(total_sum#64) windowspecdefinition(lochierarchy#69, _w0#71, total_sum#64 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#69, _w0#71], [total_sum#64 DESC NULLS LAST] (63) Project [codegen id : 38] -Output [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] -Input [6]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59, rank_within_parent#61] +Output [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Input [6]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71, rank_within_parent#73] (64) TakeOrderedAndProject -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] -Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN s_state#9 END ASC NULLS FIRST, rank_within_parent#61 ASC NULLS FIRST], [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Arguments: 100, [lochierarchy#69 DESC NULLS LAST, CASE WHEN (lochierarchy#69 = 0) THEN s_state#65 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt index b3dbc1612539a..a6f021f3acb45 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (35) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union + Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] WholeStageCodegen (23) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (22) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union + Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] WholeStageCodegen (10) HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt index 705d1b3f91342..36e80e405d3a3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt @@ -284,90 +284,92 @@ Aggregate Attributes [1]: [sum(total_sum#31)#37] Results [6]: [sum(total_sum#31)#37 AS total_sum#38, s_state#9, null AS s_county#39, 0 AS g_state#40, 1 AS g_county#41, 1 AS lochierarchy#42] (47) Union +Arguments: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (48) HashAggregate [codegen id : 22] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (49) Exchange -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#43] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Arguments: hashpartitioning(total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48, 5), true, [id=#49] (50) HashAggregate [codegen id : 23] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (51) ReusedExchange [Reuses operator id: 40] -Output [3]: [s_state#9, s_county#8, sum#44] +Output [3]: [s_state#9, s_county#8, sum#50] (52) HashAggregate [codegen id : 33] -Input [3]: [s_state#9, s_county#8, sum#44] +Input [3]: [s_state#9, s_county#8, sum#50] Keys [2]: [s_state#9, s_county#8] Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#45] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#45,17,2) AS total_sum#31] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#51] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#51,17,2) AS total_sum#31] (53) HashAggregate [codegen id : 33] Input [1]: [total_sum#31] Keys: [] Functions [1]: [partial_sum(total_sum#31)] -Aggregate Attributes [2]: [sum#46, isEmpty#47] -Results [2]: [sum#48, isEmpty#49] +Aggregate Attributes [2]: [sum#52, isEmpty#53] +Results [2]: [sum#54, isEmpty#55] (54) Exchange -Input [2]: [sum#48, isEmpty#49] -Arguments: SinglePartition, true, [id=#50] +Input [2]: [sum#54, isEmpty#55] +Arguments: SinglePartition, true, [id=#56] (55) HashAggregate [codegen id : 34] -Input [2]: [sum#48, isEmpty#49] +Input [2]: [sum#54, isEmpty#55] Keys: [] Functions [1]: [sum(total_sum#31)] -Aggregate Attributes [1]: [sum(total_sum#31)#51] -Results [6]: [sum(total_sum#31)#51 AS total_sum#52, null AS s_state#53, null AS s_county#54, 1 AS g_state#55, 1 AS g_county#56, 2 AS lochierarchy#57] +Aggregate Attributes [1]: [sum(total_sum#31)#57] +Results [6]: [sum(total_sum#31)#57 AS total_sum#58, null AS s_state#59, null AS s_county#60, 1 AS g_state#61, 1 AS g_county#62, 2 AS lochierarchy#63] (56) Union +Arguments: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (57) HashAggregate [codegen id : 35] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Results [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (58) Exchange -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#58] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Arguments: hashpartitioning(total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69, 5), true, [id=#70] (59) HashAggregate [codegen id : 36] -Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] -Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, CASE WHEN (g_county#27 = 0) THEN s_state#9 END AS _w0#59] +Results [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, CASE WHEN (g_county#68 = 0) THEN s_state#65 END AS _w0#71] (60) Exchange -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: hashpartitioning(lochierarchy#28, _w0#59, 5), true, [id=#60] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: hashpartitioning(lochierarchy#69, _w0#71, 5), true, [id=#72] (61) Sort [codegen id : 37] -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: [lochierarchy#28 ASC NULLS FIRST, _w0#59 ASC NULLS FIRST, total_sum#25 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: [lochierarchy#69 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#64 DESC NULLS LAST], false, 0 (62) Window -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] -Arguments: [rank(total_sum#25) windowspecdefinition(lochierarchy#28, _w0#59, total_sum#25 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#61], [lochierarchy#28, _w0#59], [total_sum#25 DESC NULLS LAST] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] +Arguments: [rank(total_sum#64) windowspecdefinition(lochierarchy#69, _w0#71, total_sum#64 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#69, _w0#71], [total_sum#64 DESC NULLS LAST] (63) Project [codegen id : 38] -Output [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] -Input [6]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59, rank_within_parent#61] +Output [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Input [6]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71, rank_within_parent#73] (64) TakeOrderedAndProject -Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] -Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN s_state#9 END ASC NULLS FIRST, rank_within_parent#61 ASC NULLS FIRST], [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Arguments: 100, [lochierarchy#69 DESC NULLS LAST, CASE WHEN (lochierarchy#69 = 0) THEN s_state#65 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt index bd0bd7e87251f..371b63dd4368a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (35) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union + Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] WholeStageCodegen (23) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (22) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union + Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] WholeStageCodegen (10) HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] InputAdapter 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..1b9373773d3b8 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 @@ -1,90 +1,91 @@ == Physical Plan == -TakeOrderedAndProject (86) -+- * Project (85) - +- * SortMergeJoin Inner (84) - :- * Project (66) - : +- * SortMergeJoin Inner (65) - : :- * SortMergeJoin Inner (45) - : : :- * Sort (24) - : : : +- Exchange (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (44) - : : +- Exchange (43) - : : +- * HashAggregate (42) - : : +- Exchange (41) - : : +- * HashAggregate (40) - : : +- * Project (39) - : : +- * SortMergeJoin Inner (38) - : : :- * 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) - : : +- * Sort (37) - : : +- ReusedExchange (36) - : +- * Sort (64) - : +- Exchange (63) - : +- * Project (62) - : +- * Filter (61) - : +- * HashAggregate (60) - : +- Exchange (59) - : +- * HashAggregate (58) - : +- * Project (57) - : +- * SortMergeJoin Inner (56) - : :- * Sort (53) - : : +- Exchange (52) - : : +- * Project (51) - : : +- * BroadcastHashJoin Inner BuildRight (50) - : : :- * Filter (48) - : : : +- * ColumnarToRow (47) - : : : +- Scan parquet default.web_sales (46) - : : +- ReusedExchange (49) - : +- * Sort (55) - : +- ReusedExchange (54) - +- * Sort (83) - +- Exchange (82) - +- * HashAggregate (81) - +- Exchange (80) - +- * HashAggregate (79) - +- * Project (78) - +- * SortMergeJoin Inner (77) - :- * Sort (74) - : +- Exchange (73) - : +- * Project (72) - : +- * BroadcastHashJoin Inner BuildRight (71) - : :- * Filter (69) - : : +- * ColumnarToRow (68) - : : +- Scan parquet default.web_sales (67) - : +- ReusedExchange (70) - +- * Sort (76) - +- ReusedExchange (75) +TakeOrderedAndProject (87) ++- * Project (86) + +- * SortMergeJoin Inner (85) + :- * Project (67) + : +- * SortMergeJoin Inner (66) + : :- * SortMergeJoin Inner (46) + : : :- * Sort (25) + : : : +- Exchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (45) + : : +- Exchange (44) + : : +- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * SortMergeJoin Inner (39) + : : :- * Sort (36) + : : : +- Exchange (35) + : : : +- * Project (34) + : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : :- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.store_sales (26) + : : : +- BroadcastExchange (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.date_dim (29) + : : +- * Sort (38) + : : +- ReusedExchange (37) + : +- * Sort (65) + : +- Exchange (64) + : +- * Project (63) + : +- * Filter (62) + : +- * HashAggregate (61) + : +- Exchange (60) + : +- * HashAggregate (59) + : +- * Project (58) + : +- * SortMergeJoin Inner (57) + : :- * Sort (54) + : : +- Exchange (53) + : : +- * Project (52) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) + : +- * Sort (56) + : +- ReusedExchange (55) + +- * Sort (84) + +- Exchange (83) + +- * HashAggregate (82) + +- Exchange (81) + +- * HashAggregate (80) + +- * Project (79) + +- * SortMergeJoin Inner (78) + :- * Sort (75) + : +- Exchange (74) + : +- * Project (73) + : +- * BroadcastHashJoin Inner BuildRight (72) + : :- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.web_sales (68) + : +- ReusedExchange (71) + +- * Sort (77) + +- ReusedExchange (76) (1) Scan parquet default.store_sales @@ -189,289 +190,293 @@ Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#17, year_total#18] Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) -(23) Exchange +(23) Project [codegen id : 7] +Output [2]: [customer_id#17 AS customer_id#19, year_total#18 AS year_total#20] Input [2]: [customer_id#17, year_total#18] -Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] -(24) Sort [codegen id : 8] -Input [2]: [customer_id#17, year_total#18] -Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 +(24) Exchange +Input [2]: [customer_id#19, year_total#20] +Arguments: hashpartitioning(customer_id#19, 5), true, [id=#21] + +(25) Sort [codegen id : 8] +Input [2]: [customer_id#19, year_total#20] +Arguments: [customer_id#19 ASC NULLS FIRST], false, 0 -(25) Scan parquet default.store_sales +(26) 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] +(27) ColumnarToRow [codegen id : 10] Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -(27) Filter [codegen id : 10] +(28) 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 +(29) 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 -(29) ColumnarToRow [codegen id : 9] +(30) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#4, d_year#5] -(30) Filter [codegen id : 9] +(31) 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)) -(31) BroadcastExchange +(32) BroadcastExchange Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] -(32) BroadcastHashJoin [codegen id : 10] +(33) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None -(33) Project [codegen id : 10] +(34) 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] -(34) Exchange +(35) Exchange Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] -(35) Sort [codegen id : 11] +(36) 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 -(36) ReusedExchange [Reuses operator id: 15] +(37) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(37) Sort [codegen id : 13] +(38) Sort [codegen id : 13] 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] +(39) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None -(39) Project [codegen id : 14] +(40) 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] -(40) HashAggregate [codegen id : 14] +(41) 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))] -Aggregate Attributes [1]: [sum#22] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +Aggregate Attributes [1]: [sum#24] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] -(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] +(42) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#26] -(42) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] +(43) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] 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] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#3))#27] +Results [4]: [c_customer_id#9 AS customer_id#28, c_first_name#10 AS customer_first_name#29, c_last_name#11 AS customer_last_name#30, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#27,17,2) AS year_total#31] -(43) Exchange -Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] -Arguments: hashpartitioning(customer_id#26, 5), true, [id=#30] +(44) Exchange +Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] +Arguments: hashpartitioning(customer_id#28, 5), true, [id=#32] -(44) Sort [codegen id : 16] -Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] -Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 +(45) Sort [codegen id : 16] +Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] +Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 -(45) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#26] +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#28] Join condition: None -(46) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(47) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] 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] -Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(48) ColumnarToRow [codegen id : 19] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -(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) Filter [codegen id : 19] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) -(49) ReusedExchange [Reuses operator id: 7] +(50) 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] +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#33] 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#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) Project [codegen id : 19] +Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] -(52) Exchange -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) Exchange +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#36] -(53) Sort [codegen id : 20] -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) Sort [codegen id : 20] +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 -(54) ReusedExchange [Reuses operator id: 15] +(55) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(55) Sort [codegen id : 22] +(56) Sort [codegen id : 22] 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 -(56) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#32] +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#34] 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] +(58) Project [codegen id : 23] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, 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] +(59) HashAggregate [codegen id : 23] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, 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#5, sum#36] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum#37] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] -(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] +(60) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#39] -(60) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#36] +(61) HashAggregate [codegen id : 24] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] 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] - -(61) Filter [codegen id : 24] -Input [2]: [customer_id#39, year_total#40] -Condition : (isnotnull(year_total#40) AND (year_total#40 > 0.00)) +Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#40] +Results [2]: [c_customer_id#9 AS customer_id#41, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#40,17,2) AS year_total#42] -(62) Project [codegen id : 24] -Output [2]: [customer_id#39 AS customer_id#41, year_total#40 AS year_total#42] -Input [2]: [customer_id#39, year_total#40] - -(63) Exchange +(62) Filter [codegen id : 24] Input [2]: [customer_id#41, year_total#42] -Arguments: hashpartitioning(customer_id#41, 5), true, [id=#43] +Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) -(64) Sort [codegen id : 25] +(63) Project [codegen id : 24] +Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] Input [2]: [customer_id#41, year_total#42] -Arguments: [customer_id#41 ASC NULLS FIRST], false, 0 -(65) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#41] +(64) Exchange +Input [2]: [customer_id#43, year_total#44] +Arguments: hashpartitioning(customer_id#43, 5), true, [id=#45] + +(65) Sort [codegen id : 25] +Input [2]: [customer_id#43, year_total#44] +Arguments: [customer_id#43 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#43] Join condition: None -(66) Project [codegen id : 26] -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) Project [codegen id : 26] +Output [7]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44] +Input [8]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, customer_id#43, year_total#44] -(67) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(68) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] 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] -Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] +(69) ColumnarToRow [codegen id : 28] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -(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) Filter [codegen id : 28] +Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) -(70) ReusedExchange [Reuses operator id: 31] +(71) ReusedExchange [Reuses operator id: 32] Output [2]: [d_date_sk#4, d_year#5] -(71) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#31] +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#33] 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#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) Project [codegen id : 28] +Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] -(73) Exchange -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) Exchange +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#46] -(74) Sort [codegen id : 29] -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) Sort [codegen id : 29] +Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] +Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 -(75) ReusedExchange [Reuses operator id: 15] +(76) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(76) Sort [codegen id : 31] +(77) Sort [codegen id : 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 -(77) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#32] +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#34] 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] +(79) Project [codegen id : 32] +Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, 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] +(80) HashAggregate [codegen id : 32] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, 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#5, sum#46] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum#47] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] -(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] +(81) Exchange +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#49] -(81) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#46] +(82) HashAggregate [codegen id : 33] +Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] 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] - -(82) Exchange -Input [2]: [customer_id#49, year_total#50] -Arguments: hashpartitioning(customer_id#49, 5), true, [id=#51] - -(83) Sort [codegen id : 34] -Input [2]: [customer_id#49, year_total#50] -Arguments: [customer_id#49 ASC NULLS FIRST], false, 0 - -(84) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#17] -Right keys [1]: [customer_id#49] -Join condition: (CASE WHEN (year_total#42 > 0.00) THEN CheckOverflow((promote_precision(year_total#50) / promote_precision(year_total#42)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#29) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) - -(85) Project [codegen id : 35] -Output [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] -Input [9]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42, customer_id#49, year_total#50] - -(86) TakeOrderedAndProject -Input [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] -Arguments: 100, [customer_first_name#27 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST, customer_last_name#28 ASC NULLS FIRST], [customer_id#26, customer_first_name#27, customer_last_name#28] +Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#50] +Results [2]: [c_customer_id#9 AS customer_id#51, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#50,17,2) AS year_total#52] + +(83) Exchange +Input [2]: [customer_id#51, year_total#52] +Arguments: hashpartitioning(customer_id#51, 5), true, [id=#53] + +(84) Sort [codegen id : 34] +Input [2]: [customer_id#51, year_total#52] +Arguments: [customer_id#51 ASC NULLS FIRST], false, 0 + +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#19] +Right keys [1]: [customer_id#51] +Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#52) / promote_precision(year_total#44)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#20 > 0.00) THEN CheckOverflow((promote_precision(year_total#31) / promote_precision(year_total#20)), DecimalType(37,20), true) ELSE null END) + +(86) Project [codegen id : 35] +Output [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] +Input [9]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44, customer_id#51, year_total#52] + +(87) TakeOrderedAndProject +Input [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] +Arguments: 100, [customer_first_name#29 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST, customer_last_name#30 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30] 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..7fd17c0e67a49 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 @@ -15,43 +15,44 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt index f58fb1343a186..da00998242ef1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt @@ -1,76 +1,77 @@ == Physical Plan == -TakeOrderedAndProject (72) -+- * Project (71) - +- * BroadcastHashJoin Inner BuildRight (70) - :- * Project (56) - : +- * BroadcastHashJoin Inner BuildRight (55) - : :- * BroadcastHashJoin Inner BuildRight (36) - : : :- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (35) - : : +- * HashAggregate (34) - : : +- Exchange (33) - : : +- * HashAggregate (32) - : : +- * Project (31) - : : +- * BroadcastHashJoin Inner BuildRight (30) - : : :- * Project (25) - : : : +- * BroadcastHashJoin Inner BuildRight (24) - : : : :- * Filter (22) - : : : : +- * ColumnarToRow (21) - : : : : +- Scan parquet default.customer (20) - : : : +- ReusedExchange (23) - : : +- BroadcastExchange (29) - : : +- * Filter (28) - : : +- * ColumnarToRow (27) - : : +- Scan parquet default.date_dim (26) - : +- BroadcastExchange (54) - : +- * Project (53) - : +- * Filter (52) - : +- * HashAggregate (51) - : +- Exchange (50) - : +- * HashAggregate (49) - : +- * Project (48) - : +- * BroadcastHashJoin Inner BuildRight (47) - : :- * Project (45) - : : +- * BroadcastHashJoin Inner BuildRight (44) - : : :- * Filter (39) - : : : +- * ColumnarToRow (38) - : : : +- Scan parquet default.customer (37) - : : +- BroadcastExchange (43) - : : +- * Filter (42) - : : +- * ColumnarToRow (41) - : : +- Scan parquet default.web_sales (40) - : +- ReusedExchange (46) - +- BroadcastExchange (69) - +- * HashAggregate (68) - +- Exchange (67) - +- * HashAggregate (66) - +- * Project (65) - +- * BroadcastHashJoin Inner BuildRight (64) - :- * Project (62) - : +- * BroadcastHashJoin Inner BuildRight (61) - : :- * Filter (59) - : : +- * ColumnarToRow (58) - : : +- Scan parquet default.customer (57) - : +- ReusedExchange (60) - +- ReusedExchange (63) +TakeOrderedAndProject (73) ++- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (57) + : +- * BroadcastHashJoin Inner BuildRight (56) + : :- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (20) + : : : +- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.customer (21) + : : : +- ReusedExchange (24) + : : +- BroadcastExchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.date_dim (27) + : +- BroadcastExchange (55) + : +- * Project (54) + : +- * Filter (53) + : +- * HashAggregate (52) + : +- Exchange (51) + : +- * HashAggregate (50) + : +- * Project (49) + : +- * BroadcastHashJoin Inner BuildRight (48) + : :- * Project (46) + : : +- * BroadcastHashJoin Inner BuildRight (45) + : : :- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.customer (38) + : : +- BroadcastExchange (44) + : : +- * Filter (43) + : : +- * ColumnarToRow (42) + : : +- Scan parquet default.web_sales (41) + : +- ReusedExchange (47) + +- BroadcastExchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Filter (60) + : : +- * ColumnarToRow (59) + : : +- Scan parquet default.customer (58) + : +- ReusedExchange (61) + +- ReusedExchange (64) (1) Scan parquet default.customer @@ -163,248 +164,252 @@ Results [2]: [c_customer_id#2 AS customer_id#16, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#16, year_total#17] Condition : (isnotnull(year_total#17) AND (year_total#17 > 0.00)) -(20) Scan parquet default.customer +(20) Project [codegen id : 16] +Output [2]: [customer_id#16 AS customer_id#18, year_total#17 AS year_total#19] +Input [2]: [customer_id#16, year_total#17] + +(21) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(21) ColumnarToRow [codegen id : 6] +(22) ColumnarToRow [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(22) Filter [codegen id : 6] +(23) Filter [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(23) ReusedExchange [Reuses operator id: 7] +(24) ReusedExchange [Reuses operator id: 7] Output [3]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(24) BroadcastHashJoin [codegen id : 6] +(25) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(25) Project [codegen id : 6] +(26) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7] Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(26) Scan parquet default.date_dim +(27) 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,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(27) ColumnarToRow [codegen id : 5] +(28) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] -(28) Filter [codegen id : 5] +(29) Filter [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] Condition : (((isnotnull(d_year#10) AND (d_year#10 = 2002)) AND d_year#10 IN (2001,2002)) AND isnotnull(d_date_sk#9)) -(29) BroadcastExchange +(30) BroadcastExchange Input [2]: [d_date_sk#9, d_year#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(30) BroadcastHashJoin [codegen id : 6] +(31) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#5] Right keys [1]: [d_date_sk#9] Join condition: None -(31) Project [codegen id : 6] +(32) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7, d_date_sk#9, d_year#10] -(32) HashAggregate [codegen id : 6] +(33) HashAggregate [codegen id : 6] Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum#19] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +Aggregate Attributes [1]: [sum#21] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] -(33) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#21] +(34) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#23] -(34) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +(35) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#22] -Results [4]: [c_customer_id#2 AS customer_id#23, c_first_name#3 AS customer_first_name#24, c_last_name#4 AS customer_last_name#25, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#22,17,2) AS year_total#26] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#24] +Results [4]: [c_customer_id#2 AS customer_id#25, c_first_name#3 AS customer_first_name#26, c_last_name#4 AS customer_last_name#27, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#24,17,2) AS year_total#28] -(35) BroadcastExchange -Input [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#27] +(36) BroadcastExchange +Input [4]: [customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] -(36) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#23] +(37) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#25] Join condition: None -(37) Scan parquet default.customer +(38) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(38) ColumnarToRow [codegen id : 10] +(39) ColumnarToRow [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(39) Filter [codegen id : 10] +(40) Filter [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(40) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(41) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(41) ColumnarToRow [codegen id : 8] -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(42) ColumnarToRow [codegen id : 8] +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(42) Filter [codegen id : 8] -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -Condition : (isnotnull(ws_bill_customer_sk#29) AND isnotnull(ws_sold_date_sk#28)) +(43) Filter [codegen id : 8] +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +Condition : (isnotnull(ws_bill_customer_sk#31) AND isnotnull(ws_sold_date_sk#30)) -(43) BroadcastExchange -Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] +(44) BroadcastExchange +Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#33] -(44) BroadcastHashJoin [codegen id : 10] +(45) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#29] +Right keys [1]: [ws_bill_customer_sk#31] Join condition: None -(45) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(46) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(46) ReusedExchange [Reuses operator id: 13] +(47) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#9, d_year#10] -(47) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#28] +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#30] Right keys [1]: [d_date_sk#9] Join condition: None -(48) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] +(49) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] -(49) HashAggregate [codegen id : 10] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +(50) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum#32] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum#34] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] -(50) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#34] +(51) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#36] -(51) HashAggregate [codegen id : 11] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +(52) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#35] -Results [2]: [c_customer_id#2 AS customer_id#36, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#35,17,2) AS year_total#37] - -(52) Filter [codegen id : 11] -Input [2]: [customer_id#36, year_total#37] -Condition : (isnotnull(year_total#37) AND (year_total#37 > 0.00)) +Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#37] +Results [2]: [c_customer_id#2 AS customer_id#38, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#37,17,2) AS year_total#39] -(53) Project [codegen id : 11] -Output [2]: [customer_id#36 AS customer_id#38, year_total#37 AS year_total#39] -Input [2]: [customer_id#36, year_total#37] +(53) Filter [codegen id : 11] +Input [2]: [customer_id#38, year_total#39] +Condition : (isnotnull(year_total#39) AND (year_total#39 > 0.00)) -(54) BroadcastExchange +(54) Project [codegen id : 11] +Output [2]: [customer_id#38 AS customer_id#40, year_total#39 AS year_total#41] Input [2]: [customer_id#38, year_total#39] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] -(55) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#38] +(55) BroadcastExchange +Input [2]: [customer_id#40, year_total#41] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] + +(56) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#40] Join condition: None -(56) Project [codegen id : 16] -Output [7]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39] -Input [8]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, customer_id#38, year_total#39] +(57) Project [codegen id : 16] +Output [7]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41] +Input [8]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, customer_id#40, year_total#41] -(57) Scan parquet default.customer +(58) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(58) ColumnarToRow [codegen id : 14] +(59) ColumnarToRow [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(59) Filter [codegen id : 14] +(60) Filter [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(60) ReusedExchange [Reuses operator id: 43] -Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(61) ReusedExchange [Reuses operator id: 44] +Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(61) BroadcastHashJoin [codegen id : 14] +(62) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#29] +Right keys [1]: [ws_bill_customer_sk#31] Join condition: None -(62) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +(63) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -(63) ReusedExchange [Reuses operator id: 29] +(64) ReusedExchange [Reuses operator id: 30] Output [2]: [d_date_sk#9, d_year#10] -(64) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#28] +(65) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#30] Right keys [1]: [d_date_sk#9] Join condition: None -(65) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] +(66) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] -(66) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +(67) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum#41] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum#43] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] -(67) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#43] +(68) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#45] -(68) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +(69) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#44] -Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#44,17,2) AS year_total#46] - -(69) BroadcastExchange -Input [2]: [customer_id#45, year_total#46] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] - -(70) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#16] -Right keys [1]: [customer_id#45] -Join condition: (CASE WHEN (year_total#39 > 0.00) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#39)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#17 > 0.00) THEN CheckOverflow((promote_precision(year_total#26) / promote_precision(year_total#17)), DecimalType(37,20), true) ELSE null END) - -(71) Project [codegen id : 16] -Output [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] -Input [9]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39, customer_id#45, year_total#46] - -(72) TakeOrderedAndProject -Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] -Arguments: 100, [customer_first_name#24 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST, customer_last_name#25 ASC NULLS FIRST], [customer_id#23, customer_first_name#24, customer_last_name#25] +Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#46] +Results [2]: [c_customer_id#2 AS customer_id#47, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#46,17,2) AS year_total#48] + +(70) BroadcastExchange +Input [2]: [customer_id#47, year_total#48] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] + +(71) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#47] +Join condition: (CASE WHEN (year_total#41 > 0.00) THEN CheckOverflow((promote_precision(year_total#48) / promote_precision(year_total#41)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#28) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) + +(72) Project [codegen id : 16] +Output [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] +Input [9]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41, customer_id#47, year_total#48] + +(73) TakeOrderedAndProject +Input [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] +Arguments: 100, [customer_first_name#26 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST, customer_last_name#27 ASC NULLS FIRST], [customer_id#25, customer_first_name#26, customer_last_name#27] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt index 205fb6ac974a2..10cef74f6f82c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt @@ -5,34 +5,35 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] ColumnarToRow InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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..052ecd661288c 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 @@ -328,147 +328,149 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ 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 +Arguments: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] 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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Arguments: hashpartitioning(d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43, 5), true, [id=#44] (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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] 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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (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] +Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (49) ColumnarToRow [codegen id : 19] -Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] (50) Filter [codegen id : 19] -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)) +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) (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] +Left keys [1]: [ws_item_sk#46] 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#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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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] (55) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#38] +Left keys [1]: [ws_sold_date_sk#45] 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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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] +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#50] (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] -Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 (59) Scan parquet default.web_returns -Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (60) ColumnarToRow [codegen id : 21] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (61) Filter [codegen id : 21] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Condition : (isnotnull(wr_order_number#45) AND isnotnull(wr_item_sk#44)) +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Condition : (isnotnull(wr_order_number#52) AND isnotnull(wr_item_sk#51)) (62) Exchange -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: hashpartitioning(wr_order_number#45, wr_item_sk#44, 5), true, [id=#48] +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: hashpartitioning(wr_order_number#52, wr_item_sk#51, 5), true, [id=#55] (63) Sort [codegen id : 22] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 (64) SortMergeJoin -Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] -Right keys [2]: [wr_order_number#45, wr_item_sk#44] +Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] +Right keys [2]: [wr_order_number#52, wr_item_sk#51] 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#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#57] +Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (66) Union +Arguments: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] 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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64, 5), true, [id=#65] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] 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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (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] -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] +Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [partial_sum(cast(sales_cnt#63 as bigint)), partial_sum(UnscaledValue(sales_amt#64))] +Aggregate Attributes [2]: [sum#66, sum#67] +Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#70] (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] -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] +Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [sum(cast(sales_cnt#63 as bigint)), sum(UnscaledValue(sales_amt#64))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#63 as bigint))#71, sum(UnscaledValue(sales_amt#64))#72] +Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#63 as bigint))#71 AS sales_cnt#73, MakeDecimal(sum(UnscaledValue(sales_amt#64))#72,18,2) AS sales_amt#74] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] +Arguments: hashpartitioning(i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#75] (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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] +Arguments: [i_brand_id#59 ASC NULLS FIRST, i_class_id#60 ASC NULLS FIRST, i_category_id#61 ASC NULLS FIRST, i_manufact_id#62 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] @@ -485,50 +487,50 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (79) BroadcastHashJoin [codegen id : 30] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#62] +Right keys [1]: [i_item_sk#6] 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]: [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] (81) Scan parquet default.date_dim -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] 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 (82) ColumnarToRow [codegen id : 29] -Input [2]: [d_date_sk#67, d_year#68] +Input [2]: [d_date_sk#13, d_year#14] (83) Filter [codegen id : 29] -Input [2]: [d_date_sk#67, d_year#68] -Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2001)) AND isnotnull(d_date_sk#67)) +Input [2]: [d_date_sk#13, d_year#14] +Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) (84) BroadcastExchange -Input [2]: [d_date_sk#67, d_year#68] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] +Input [2]: [d_date_sk#13, d_year#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] (85) BroadcastHashJoin [codegen id : 30] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#67] +Right keys [1]: [d_date_sk#13] 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#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] (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#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=#77] (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] +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 (89) ReusedExchange [Reuses operator id: 22] @@ -544,8 +546,8 @@ 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#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] (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] @@ -562,35 +564,35 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (97) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#62] +Right keys [1]: [i_item_sk#6] Join condition: None (98) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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] (99) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] (100) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_sold_date_sk#24] -Right keys [1]: [d_date_sk#67] +Right keys [1]: [d_date_sk#13] Join condition: None (101) Project [codegen id : 37] -Output [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] +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] (102) Exchange -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#71] +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=#78] (103) Sort [codegen id : 38] -Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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 (104) ReusedExchange [Reuses operator id: 40] @@ -606,147 +608,149 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (107) Project [codegen id : 41] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#72, 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#73] -Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, 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#79, 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#80] +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] (108) Union +Arguments: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (109) HashAggregate [codegen id : 42] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (110) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#74] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Arguments: hashpartitioning(d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87, 5), true, [id=#88] (111) HashAggregate [codegen id : 43] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (112) 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] +Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 46] -Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] (114) Filter [codegen id : 46] -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)) +Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) (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] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (116) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_item_sk#39] -Right keys [1]: [i_item_sk#62] +Left keys [1]: [ws_item_sk#46] +Right keys [1]: [i_item_sk#6] Join condition: None (117) Project [codegen id : 46] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (118) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#67, d_year#68] +Output [2]: [d_date_sk#13, d_year#14] (119) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#38] -Right keys [1]: [d_date_sk#67] +Left keys [1]: [ws_sold_date_sk#45] +Right keys [1]: [d_date_sk#13] Join condition: None (120) Project [codegen id : 46] -Output [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] +Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (121) Exchange -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#75] +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#89] (122) Sort [codegen id : 47] -Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] -Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] +Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 (123) ReusedExchange [Reuses operator id: 62] -Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (124) Sort [codegen id : 49] -Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] -Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 (125) SortMergeJoin -Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] -Right keys [2]: [wr_order_number#45, wr_item_sk#44] +Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] +Right keys [2]: [wr_order_number#52, wr_item_sk#51] Join condition: None (126) Project [codegen id : 50] -Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#76, 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#77] -Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, 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#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#90] +Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] (127) Union +Arguments: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (128) HashAggregate [codegen id : 51] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (129) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#78] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97, 5), true, [id=#98] (130) HashAggregate [codegen id : 52] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (131) HashAggregate [codegen id : 52] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] -Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] -Aggregate Attributes [2]: [sum#79, sum#80] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Functions [2]: [partial_sum(cast(sales_cnt#96 as bigint)), partial_sum(UnscaledValue(sales_amt#97))] +Aggregate Attributes [2]: [sum#99, sum#100] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] (132) Exchange -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] -Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#83] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#103] (133) HashAggregate [codegen id : 53] -Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] -Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] -Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#84, sum(UnscaledValue(sales_amt#23))#85] -Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum(cast(sales_cnt#22 as bigint))#84 AS sales_cnt#86, MakeDecimal(sum(UnscaledValue(sales_amt#23))#85,18,2) AS sales_amt#87] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Functions [2]: [sum(cast(sales_cnt#96 as bigint)), sum(UnscaledValue(sales_amt#97))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#96 as bigint))#104, sum(UnscaledValue(sales_amt#97))#105] +Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum(cast(sales_cnt#96 as bigint))#104 AS sales_cnt#106, MakeDecimal(sum(UnscaledValue(sales_amt#97))#105,18,2) AS sales_amt#107] (134) Exchange -Input [7]: [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] -Arguments: hashpartitioning(i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#88] +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +Arguments: hashpartitioning(i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#108] (135) Sort [codegen id : 54] -Input [7]: [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] -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 +Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +Arguments: [i_brand_id#92 ASC NULLS FIRST, i_class_id#93 ASC NULLS FIRST, i_category_id#94 ASC NULLS FIRST, i_manufact_id#95 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] -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) +Left keys [4]: [i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Right keys [4]: [i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#73 as decimal(17,2))) / promote_precision(cast(sales_cnt#106 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#91 AS prev_year#109, d_year#58 AS year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#106 AS prev_yr_cnt#111, sales_cnt#73 AS curr_yr_cnt#112, (sales_cnt#73 - sales_cnt#106) AS sales_cnt_diff#113, CheckOverflow((promote_precision(cast(sales_amt#74 as decimal(19,2))) - promote_precision(cast(sales_amt#107 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#114] +Input [14]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74, d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] (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#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] +Arguments: 100, [sales_cnt_diff#113 ASC NULLS FIRST, sales_amt_diff#114 ASC NULLS FIRST], [prev_year#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] 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..16a1a49c8da9f 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 @@ -19,7 +19,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (24) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (16) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -27,7 +27,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (7) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter @@ -146,7 +146,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (51) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (43) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -154,7 +154,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (42) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (34) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt index 1d8aab417f188..38fb3c61543ac 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt @@ -283,127 +283,129 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (38) Union +Arguments: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (39) HashAggregate [codegen id : 9] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] 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#21, sales_amt#22] +Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (40) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#35] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Arguments: hashpartitioning(d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41, 5), true, [id=#42] (41) HashAggregate [codegen id : 10] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] 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#21, sales_amt#22] +Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (42) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] 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 : 14] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] (44) Filter [codegen id : 14] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] -Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) (45) 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] (46) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#37] +Left keys [1]: [ws_item_sk#44] Right keys [1]: [i_item_sk#6] Join condition: None (47) Project [codegen id : 14] -Output [9]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (48) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#36] +Left keys [1]: [ws_sold_date_sk#43] Right keys [1]: [d_date_sk#13] Join condition: None (50) Project [codegen id : 14] -Output [9]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (51) Scan parquet default.web_returns -Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 13] -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (53) Filter [codegen id : 13] -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] -Condition : (isnotnull(wr_order_number#42) AND isnotnull(wr_item_sk#41)) +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Condition : (isnotnull(wr_order_number#49) AND isnotnull(wr_item_sk#48)) (54) BroadcastExchange -Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#45] +Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#52] (55) BroadcastHashJoin [codegen id : 14] -Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] -Right keys [2]: [wr_order_number#42, wr_item_sk#41] +Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] +Right keys [2]: [wr_order_number#49, wr_item_sk#48] Join condition: None (56) 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, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#46, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#47] -Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#54] +Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (57) Union +Arguments: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (58) 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#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] 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#21, sales_amt#22] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (59) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#48] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61, 5), true, [id=#62] (60) 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#21, sales_amt#22] -Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] 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#21, sales_amt#22] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (61) 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#21, sales_amt#22] -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#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum#49, sum#50] -Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Functions [2]: [partial_sum(cast(sales_cnt#60 as bigint)), partial_sum(UnscaledValue(sales_amt#61))] +Aggregate Attributes [2]: [sum#63, sum#64] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] (62) Exchange -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] -Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#53] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, 5), true, [id=#67] (63) HashAggregate [codegen id : 34] -Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] -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#21 as bigint)), sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#54, sum(UnscaledValue(sales_amt#22))#55] -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#21 as bigint))#54 AS sales_cnt#56, MakeDecimal(sum(UnscaledValue(sales_amt#22))#55,18,2) AS sales_amt#57] +Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Functions [2]: [sum(cast(sales_cnt#60 as bigint)), sum(UnscaledValue(sales_amt#61))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#60 as bigint))#68, sum(UnscaledValue(sales_amt#61))#69] +Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum(cast(sales_cnt#60 as bigint))#68 AS sales_cnt#70, MakeDecimal(sum(UnscaledValue(sales_amt#61))#69,18,2) AS sales_amt#71] (64) 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] @@ -420,43 +422,43 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (67) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (68) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#58] +Right keys [1]: [i_item_sk#6] Join condition: None (69) Project [codegen id : 20] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +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] (70) Scan parquet default.date_dim -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] 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 (71) ColumnarToRow [codegen id : 18] -Input [2]: [d_date_sk#63, d_year#64] +Input [2]: [d_date_sk#13, d_year#14] (72) Filter [codegen id : 18] -Input [2]: [d_date_sk#63, d_year#64] -Condition : ((isnotnull(d_year#64) AND (d_year#64 = 2001)) AND isnotnull(d_date_sk#63)) +Input [2]: [d_date_sk#13, d_year#14] +Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) (73) BroadcastExchange -Input [2]: [d_date_sk#63, d_year#64] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#65] +Input [2]: [d_date_sk#13, d_year#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] (74) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#63] +Right keys [1]: [d_date_sk#13] Join condition: None (75) Project [codegen id : 20] -Output [9]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +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] (76) ReusedExchange [Reuses operator id: 20] Output [4]: [cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] @@ -467,8 +469,8 @@ Right keys [2]: [cr_order_number#17, cr_item_sk#16] Join condition: None (78) Project [codegen id : 20] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (cs_quantity#4 - coalesce(cr_return_quantity#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] -Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] +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#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] +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#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] (79) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27] @@ -485,28 +487,28 @@ Input [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity# Condition : (isnotnull(ss_item_sk#24) AND isnotnull(ss_sold_date_sk#23)) (82) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (83) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_item_sk#24] -Right keys [1]: [i_item_sk#58] +Right keys [1]: [i_item_sk#6] Join condition: None (84) Project [codegen id : 24] -Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (85) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] (86) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_sold_date_sk#23] -Right keys [1]: [d_date_sk#63] +Right keys [1]: [d_date_sk#13] Join condition: None (87) Project [codegen id : 24] -Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -Input [11]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (88) ReusedExchange [Reuses operator id: 35] Output [4]: [sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] @@ -517,131 +519,133 @@ Right keys [2]: [sr_ticket_number#29, sr_item_sk#28] Join condition: None (90) Project [codegen id : 24] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] -Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#73, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#74] +Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (91) Union +Arguments: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (92) HashAggregate [codegen id : 25] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (93) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#68] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Arguments: hashpartitioning(d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81, 5), true, [id=#82] (94) HashAggregate [codegen id : 26] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (95) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (96) ColumnarToRow [codegen id : 30] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] (97) Filter [codegen id : 30] -Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] -Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) +Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) (98) ReusedExchange [Reuses operator id: 8] -Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (99) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_item_sk#37] -Right keys [1]: [i_item_sk#58] +Left keys [1]: [ws_item_sk#44] +Right keys [1]: [i_item_sk#6] Join condition: None (100) Project [codegen id : 30] -Output [9]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (101) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#63, d_year#64] +Output [2]: [d_date_sk#13, d_year#14] (102) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_sold_date_sk#36] -Right keys [1]: [d_date_sk#63] +Left keys [1]: [ws_sold_date_sk#43] +Right keys [1]: [d_date_sk#13] Join condition: None (103) Project [codegen id : 30] -Output [9]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] -Input [11]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] +Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (104) ReusedExchange [Reuses operator id: 54] -Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (105) BroadcastHashJoin [codegen id : 30] -Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] -Right keys [2]: [wr_order_number#42, wr_item_sk#41] +Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] +Right keys [2]: [wr_order_number#49, wr_item_sk#48] Join condition: None (106) Project [codegen id : 30] -Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#69, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#70] -Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#83] +Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] (107) Union +Arguments: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (108) HashAggregate [codegen id : 31] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (109) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#71] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90, 5), true, [id=#91] (110) HashAggregate [codegen id : 32] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (111) HashAggregate [codegen id : 32] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] -Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [partial_sum(cast(sales_cnt#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum#72, sum#73] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Functions [2]: [partial_sum(cast(sales_cnt#89 as bigint)), partial_sum(UnscaledValue(sales_amt#90))] +Aggregate Attributes [2]: [sum#92, sum#93] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] (112) Exchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] -Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#76] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, 5), true, [id=#96] (113) HashAggregate [codegen id : 33] -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] -Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [sum(cast(sales_cnt#21 as bigint)), sum(UnscaledValue(sales_amt#22))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#77, sum(UnscaledValue(sales_amt#22))#78] -Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#21 as bigint))#77 AS sales_cnt#79, MakeDecimal(sum(UnscaledValue(sales_amt#22))#78,18,2) AS sales_amt#80] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Functions [2]: [sum(cast(sales_cnt#89 as bigint)), sum(UnscaledValue(sales_amt#90))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#89 as bigint))#97, sum(UnscaledValue(sales_amt#90))#98] +Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum(cast(sales_cnt#89 as bigint))#97 AS sales_cnt#99, MakeDecimal(sum(UnscaledValue(sales_amt#90))#98,18,2) AS sales_amt#100] (114) BroadcastExchange -Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] -Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#81] +Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#101] (115) BroadcastHashJoin [codegen id : 34] -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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#56 as decimal(17,2))) / promote_precision(cast(sales_cnt#79 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +Left keys [4]: [i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] +Right keys [4]: [i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#70 as decimal(17,2))) / promote_precision(cast(sales_cnt#99 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (116) Project [codegen id : 34] -Output [10]: [d_year#64 AS prev_year#82, d_year#14 AS year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#79 AS prev_yr_cnt#84, sales_cnt#56 AS curr_yr_cnt#85, (sales_cnt#56 - sales_cnt#79) AS sales_cnt_diff#86, CheckOverflow((promote_precision(cast(sales_amt#57 as decimal(19,2))) - promote_precision(cast(sales_amt#80 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#87] -Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#56, sales_amt#57, d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] +Output [10]: [d_year#84 AS prev_year#102, d_year#55 AS year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#99 AS prev_yr_cnt#104, sales_cnt#70 AS curr_yr_cnt#105, (sales_cnt#70 - sales_cnt#99) AS sales_cnt_diff#106, CheckOverflow((promote_precision(cast(sales_amt#71 as decimal(19,2))) - promote_precision(cast(sales_amt#100 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#107] +Input [14]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#70, sales_amt#71, d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] (117) TakeOrderedAndProject -Input [10]: [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] -Arguments: 100, [sales_cnt_diff#86 ASC NULLS FIRST, sales_amt_diff#87 ASC NULLS FIRST], [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] +Input [10]: [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] +Arguments: 100, [sales_cnt_diff#106 ASC NULLS FIRST, sales_amt_diff#107 ASC NULLS FIRST], [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt index d1c20801ec5fd..8f1d4a5ceae58 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (10) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -21,7 +21,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (9) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (4) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] @@ -113,7 +113,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (31) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (26) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -121,7 +121,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (25) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union + Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] WholeStageCodegen (20) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt index ac49cc0548c08..0231877c04994 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt @@ -508,122 +508,125 @@ Output [5]: [web channel AS channel#97, wp_web_page_sk#71 AS id#98, sales#80, co Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union +Arguments: [channel#101, id#102, sales#103, returns#104, profit#105] (87) HashAggregate [codegen id : 24] -Input [5]: [channel#34, id#35, sales#17, returns#36, profit#37] -Keys [2]: [channel#34, id#35] -Functions [3]: [partial_sum(sales#17), partial_sum(returns#36), partial_sum(profit#37)] -Aggregate Attributes [6]: [sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106] -Results [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Input [5]: [channel#101, id#102, sales#103, returns#104, profit#105] +Keys [2]: [channel#101, id#102] +Functions [3]: [partial_sum(sales#103), partial_sum(returns#104), partial_sum(profit#105)] +Aggregate Attributes [6]: [sum#106, isEmpty#107, sum#108, isEmpty#109, sum#110, isEmpty#111] +Results [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] (88) Exchange -Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] -Arguments: hashpartitioning(channel#34, id#35, 5), true, [id=#113] +Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Arguments: hashpartitioning(channel#101, id#102, 5), true, [id=#118] (89) HashAggregate [codegen id : 25] -Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#37)] -Aggregate Attributes [3]: [sum(sales#17)#114, sum(returns#36)#115, sum(profit#37)#116] -Results [5]: [channel#34, id#35, cast(sum(sales#17)#114 as decimal(37,2)) AS sales#117, cast(sum(returns#36)#115 as decimal(37,2)) AS returns#118, cast(sum(profit#37)#116 as decimal(38,2)) AS profit#119] +Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Keys [2]: [channel#101, id#102] +Functions [3]: [sum(sales#103), sum(returns#104), sum(profit#105)] +Aggregate Attributes [3]: [sum(sales#103)#119, sum(returns#104)#120, sum(profit#105)#121] +Results [5]: [channel#101, id#102, cast(sum(sales#103)#119 as decimal(37,2)) AS sales#122, cast(sum(returns#104)#120 as decimal(37,2)) AS returns#123, cast(sum(profit#105)#121 as decimal(38,2)) AS profit#124] (90) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Output [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] (91) HashAggregate [codegen id : 50] -Input [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#126)] -Aggregate Attributes [3]: [sum(sales#17)#127, sum(returns#36)#128, sum(profit#126)#129] -Results [4]: [channel#34, sum(sales#17)#127 AS sales#130, sum(returns#36)#128 AS returns#131, sum(profit#126)#129 AS profit#132] +Input [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Keys [2]: [channel#125, id#126] +Functions [3]: [sum(sales#133), sum(returns#134), sum(profit#135)] +Aggregate Attributes [3]: [sum(sales#133)#136, sum(returns#134)#137, sum(profit#135)#138] +Results [4]: [channel#125, sum(sales#133)#136 AS sales#139, sum(returns#134)#137 AS returns#140, sum(profit#135)#138 AS profit#141] (92) HashAggregate [codegen id : 50] -Input [4]: [channel#34, sales#130, returns#131, profit#132] -Keys [1]: [channel#34] -Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] -Aggregate Attributes [6]: [sum#133, isEmpty#134, sum#135, isEmpty#136, sum#137, isEmpty#138] -Results [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Input [4]: [channel#125, sales#139, returns#140, profit#141] +Keys [1]: [channel#125] +Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] +Aggregate Attributes [6]: [sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] +Results [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] (93) Exchange -Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] -Arguments: hashpartitioning(channel#34, 5), true, [id=#145] +Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Arguments: hashpartitioning(channel#125, 5), true, [id=#154] (94) HashAggregate [codegen id : 51] -Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] -Keys [1]: [channel#34] -Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] -Aggregate Attributes [3]: [sum(sales#130)#146, sum(returns#131)#147, sum(profit#132)#148] -Results [5]: [channel#34, null AS id#149, sum(sales#130)#146 AS sales#150, sum(returns#131)#147 AS returns#151, sum(profit#132)#148 AS profit#152] +Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Keys [1]: [channel#125] +Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] +Aggregate Attributes [3]: [sum(sales#139)#155, sum(returns#140)#156, sum(profit#141)#157] +Results [5]: [channel#125, null AS id#158, sum(sales#139)#155 AS sales#159, sum(returns#140)#156 AS returns#160, sum(profit#141)#157 AS profit#161] (95) Union +Arguments: [channel#162, id#163, sales#164, returns#165, profit#166] (96) HashAggregate [codegen id : 52] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] (97) Exchange -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#153] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Arguments: hashpartitioning(channel#162, id#163, sales#164, returns#165, profit#166, 5), true, [id=#167] (98) HashAggregate [codegen id : 53] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] (99) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] +Output [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] (100) HashAggregate [codegen id : 78] -Input [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#160)] -Aggregate Attributes [3]: [sum(sales#17)#161, sum(returns#36)#162, sum(profit#160)#163] -Results [3]: [sum(sales#17)#161 AS sales#130, sum(returns#36)#162 AS returns#131, sum(profit#160)#163 AS profit#132] +Input [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Keys [2]: [channel#168, id#169] +Functions [3]: [sum(sales#176), sum(returns#177), sum(profit#178)] +Aggregate Attributes [3]: [sum(sales#176)#179, sum(returns#177)#180, sum(profit#178)#181] +Results [3]: [sum(sales#176)#179 AS sales#139, sum(returns#177)#180 AS returns#140, sum(profit#178)#181 AS profit#141] (101) HashAggregate [codegen id : 78] -Input [3]: [sales#130, returns#131, profit#132] +Input [3]: [sales#139, returns#140, profit#141] Keys: [] -Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] -Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Results [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] +Aggregate Attributes [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] +Results [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] (102) Exchange -Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Arguments: SinglePartition, true, [id=#176] +Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Arguments: SinglePartition, true, [id=#194] (103) HashAggregate [codegen id : 79] -Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] Keys: [] -Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] -Aggregate Attributes [3]: [sum(sales#130)#177, sum(returns#131)#178, sum(profit#132)#179] -Results [5]: [null AS channel#180, null AS id#181, sum(sales#130)#177 AS sales#182, sum(returns#131)#178 AS returns#183, sum(profit#132)#179 AS profit#184] +Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] +Aggregate Attributes [3]: [sum(sales#139)#195, sum(returns#140)#196, sum(profit#141)#197] +Results [5]: [null AS channel#198, null AS id#199, sum(sales#139)#195 AS sales#200, sum(returns#140)#196 AS returns#201, sum(profit#141)#197 AS profit#202] (104) Union +Arguments: [channel#203, id#204, sales#205, returns#206, profit#207] (105) HashAggregate [codegen id : 80] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] (106) Exchange -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#185] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Arguments: hashpartitioning(channel#203, id#204, sales#205, returns#206, profit#207, 5), true, [id=#208] (107) HashAggregate [codegen id : 81] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] (108) TakeOrderedAndProject -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: 100, [channel#34 ASC NULLS FIRST, id#35 ASC NULLS FIRST], [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Arguments: 100, [channel#203 ASC NULLS FIRST, id#204 ASC NULLS FIRST], [channel#203, id#204, sales#205, returns#206, profit#207] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt index 92c25891f940e..1dd163c1d9c57 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (80) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (53) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (52) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (25) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (24) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (8) Project [s_store_sk,sales,returns,profit,profit_loss] BroadcastHashJoin [s_store_sk,s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt index c18698ebc5b45..4d5e17399bdcc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt @@ -508,122 +508,125 @@ Output [5]: [web channel AS channel#97, wp_web_page_sk#71 AS id#98, sales#80, co Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union +Arguments: [channel#101, id#102, sales#103, returns#104, profit#105] (87) HashAggregate [codegen id : 24] -Input [5]: [channel#34, id#35, sales#17, returns#36, profit#37] -Keys [2]: [channel#34, id#35] -Functions [3]: [partial_sum(sales#17), partial_sum(returns#36), partial_sum(profit#37)] -Aggregate Attributes [6]: [sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106] -Results [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Input [5]: [channel#101, id#102, sales#103, returns#104, profit#105] +Keys [2]: [channel#101, id#102] +Functions [3]: [partial_sum(sales#103), partial_sum(returns#104), partial_sum(profit#105)] +Aggregate Attributes [6]: [sum#106, isEmpty#107, sum#108, isEmpty#109, sum#110, isEmpty#111] +Results [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] (88) Exchange -Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] -Arguments: hashpartitioning(channel#34, id#35, 5), true, [id=#113] +Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Arguments: hashpartitioning(channel#101, id#102, 5), true, [id=#118] (89) HashAggregate [codegen id : 25] -Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#37)] -Aggregate Attributes [3]: [sum(sales#17)#114, sum(returns#36)#115, sum(profit#37)#116] -Results [5]: [channel#34, id#35, cast(sum(sales#17)#114 as decimal(37,2)) AS sales#117, cast(sum(returns#36)#115 as decimal(37,2)) AS returns#118, cast(sum(profit#37)#116 as decimal(38,2)) AS profit#119] +Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Keys [2]: [channel#101, id#102] +Functions [3]: [sum(sales#103), sum(returns#104), sum(profit#105)] +Aggregate Attributes [3]: [sum(sales#103)#119, sum(returns#104)#120, sum(profit#105)#121] +Results [5]: [channel#101, id#102, cast(sum(sales#103)#119 as decimal(37,2)) AS sales#122, cast(sum(returns#104)#120 as decimal(37,2)) AS returns#123, cast(sum(profit#105)#121 as decimal(38,2)) AS profit#124] (90) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Output [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] (91) HashAggregate [codegen id : 50] -Input [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#126)] -Aggregate Attributes [3]: [sum(sales#17)#127, sum(returns#36)#128, sum(profit#126)#129] -Results [4]: [channel#34, sum(sales#17)#127 AS sales#130, sum(returns#36)#128 AS returns#131, sum(profit#126)#129 AS profit#132] +Input [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Keys [2]: [channel#125, id#126] +Functions [3]: [sum(sales#133), sum(returns#134), sum(profit#135)] +Aggregate Attributes [3]: [sum(sales#133)#136, sum(returns#134)#137, sum(profit#135)#138] +Results [4]: [channel#125, sum(sales#133)#136 AS sales#139, sum(returns#134)#137 AS returns#140, sum(profit#135)#138 AS profit#141] (92) HashAggregate [codegen id : 50] -Input [4]: [channel#34, sales#130, returns#131, profit#132] -Keys [1]: [channel#34] -Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] -Aggregate Attributes [6]: [sum#133, isEmpty#134, sum#135, isEmpty#136, sum#137, isEmpty#138] -Results [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Input [4]: [channel#125, sales#139, returns#140, profit#141] +Keys [1]: [channel#125] +Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] +Aggregate Attributes [6]: [sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] +Results [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] (93) Exchange -Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] -Arguments: hashpartitioning(channel#34, 5), true, [id=#145] +Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Arguments: hashpartitioning(channel#125, 5), true, [id=#154] (94) HashAggregate [codegen id : 51] -Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] -Keys [1]: [channel#34] -Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] -Aggregate Attributes [3]: [sum(sales#130)#146, sum(returns#131)#147, sum(profit#132)#148] -Results [5]: [channel#34, null AS id#149, sum(sales#130)#146 AS sales#150, sum(returns#131)#147 AS returns#151, sum(profit#132)#148 AS profit#152] +Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Keys [1]: [channel#125] +Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] +Aggregate Attributes [3]: [sum(sales#139)#155, sum(returns#140)#156, sum(profit#141)#157] +Results [5]: [channel#125, null AS id#158, sum(sales#139)#155 AS sales#159, sum(returns#140)#156 AS returns#160, sum(profit#141)#157 AS profit#161] (95) Union +Arguments: [channel#162, id#163, sales#164, returns#165, profit#166] (96) HashAggregate [codegen id : 52] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] (97) Exchange -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#153] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Arguments: hashpartitioning(channel#162, id#163, sales#164, returns#165, profit#166, 5), true, [id=#167] (98) HashAggregate [codegen id : 53] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] (99) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] +Output [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] (100) HashAggregate [codegen id : 78] -Input [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] -Keys [2]: [channel#34, id#35] -Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#160)] -Aggregate Attributes [3]: [sum(sales#17)#161, sum(returns#36)#162, sum(profit#160)#163] -Results [3]: [sum(sales#17)#161 AS sales#130, sum(returns#36)#162 AS returns#131, sum(profit#160)#163 AS profit#132] +Input [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Keys [2]: [channel#168, id#169] +Functions [3]: [sum(sales#176), sum(returns#177), sum(profit#178)] +Aggregate Attributes [3]: [sum(sales#176)#179, sum(returns#177)#180, sum(profit#178)#181] +Results [3]: [sum(sales#176)#179 AS sales#139, sum(returns#177)#180 AS returns#140, sum(profit#178)#181 AS profit#141] (101) HashAggregate [codegen id : 78] -Input [3]: [sales#130, returns#131, profit#132] +Input [3]: [sales#139, returns#140, profit#141] Keys: [] -Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] -Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Results [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] +Aggregate Attributes [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] +Results [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] (102) Exchange -Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Arguments: SinglePartition, true, [id=#176] +Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Arguments: SinglePartition, true, [id=#194] (103) HashAggregate [codegen id : 79] -Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] Keys: [] -Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] -Aggregate Attributes [3]: [sum(sales#130)#177, sum(returns#131)#178, sum(profit#132)#179] -Results [5]: [null AS channel#180, null AS id#181, sum(sales#130)#177 AS sales#182, sum(returns#131)#178 AS returns#183, sum(profit#132)#179 AS profit#184] +Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] +Aggregate Attributes [3]: [sum(sales#139)#195, sum(returns#140)#196, sum(profit#141)#197] +Results [5]: [null AS channel#198, null AS id#199, sum(sales#139)#195 AS sales#200, sum(returns#140)#196 AS returns#201, sum(profit#141)#197 AS profit#202] (104) Union +Arguments: [channel#203, id#204, sales#205, returns#206, profit#207] (105) HashAggregate [codegen id : 80] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] (106) Exchange -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#185] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Arguments: hashpartitioning(channel#203, id#204, sales#205, returns#206, profit#207, 5), true, [id=#208] (107) HashAggregate [codegen id : 81] -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] (108) TakeOrderedAndProject -Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] -Arguments: 100, [channel#34 ASC NULLS FIRST, id#35 ASC NULLS FIRST], [channel#34, id#35, sales#117, returns#118, profit#119] +Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Arguments: 100, [channel#203 ASC NULLS FIRST, id#204 ASC NULLS FIRST], [channel#203, id#204, sales#205, returns#206, profit#207] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt index 864039e512231..7d9082dce4b6c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (80) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (53) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (52) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (25) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (24) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (8) Project [s_store_sk,sales,returns,profit,profit_loss] BroadcastHashJoin [s_store_sk,s_store_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..156e82828a56a 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 @@ -586,122 +586,125 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#85))#107, sum(co Results [5]: [web channel AS channel#110, concat(web_site, web_site_id#94) AS id#111, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#85))#107,17,2) AS sales#112, sum(coalesce(cast(wr_return_amt#90 as decimal(12,2)), 0.00))#108 AS returns#113, sum(CheckOverflow((promote_precision(cast(ws_net_profit#86 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#91 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#109 AS profit#114] (103) Union +Arguments: [channel#115, id#116, sales#117, returns#118, profit#119] (104) HashAggregate [codegen id : 31] -Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] -Keys [2]: [channel#40, id#41] -Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] -Aggregate Attributes [6]: [sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Results [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Input [5]: [channel#115, id#116, sales#117, returns#118, profit#119] +Keys [2]: [channel#115, id#116] +Functions [3]: [partial_sum(sales#117), partial_sum(returns#118), partial_sum(profit#119)] +Aggregate Attributes [6]: [sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Results [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] (105) Exchange -Input [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] -Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#127] +Input [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Arguments: hashpartitioning(channel#115, id#116, 5), true, [id=#132] (106) HashAggregate [codegen id : 32] -Input [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] -Aggregate Attributes [3]: [sum(sales#42)#128, sum(returns#43)#129, sum(profit#44)#130] -Results [5]: [channel#40, id#41, cast(sum(sales#42)#128 as decimal(37,2)) AS sales#131, cast(sum(returns#43)#129 as decimal(38,2)) AS returns#132, cast(sum(profit#44)#130 as decimal(38,2)) AS profit#133] +Input [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [2]: [channel#115, id#116] +Functions [3]: [sum(sales#117), sum(returns#118), sum(profit#119)] +Aggregate Attributes [3]: [sum(sales#117)#133, sum(returns#118)#134, sum(profit#119)#135] +Results [5]: [channel#115, id#116, cast(sum(sales#117)#133 as decimal(37,2)) AS sales#136, cast(sum(returns#118)#134 as decimal(38,2)) AS returns#137, cast(sum(profit#119)#135 as decimal(38,2)) AS profit#138] (107) ReusedExchange [Reuses operator id: 105] -Output [8]: [channel#40, id#41, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Output [8]: [channel#139, id#140, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] (108) HashAggregate [codegen id : 64] -Input [8]: [channel#40, id#41, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] -Aggregate Attributes [3]: [sum(sales#42)#140, sum(returns#43)#141, sum(profit#44)#142] -Results [4]: [channel#40, sum(sales#42)#140 AS sales#143, sum(returns#43)#141 AS returns#144, sum(profit#44)#142 AS profit#145] +Input [8]: [channel#139, id#140, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] +Keys [2]: [channel#139, id#140] +Functions [3]: [sum(sales#147), sum(returns#148), sum(profit#149)] +Aggregate Attributes [3]: [sum(sales#147)#150, sum(returns#148)#151, sum(profit#149)#152] +Results [4]: [channel#139, sum(sales#147)#150 AS sales#153, sum(returns#148)#151 AS returns#154, sum(profit#149)#152 AS profit#155] (109) HashAggregate [codegen id : 64] -Input [4]: [channel#40, sales#143, returns#144, profit#145] -Keys [1]: [channel#40] -Functions [3]: [partial_sum(sales#143), partial_sum(returns#144), partial_sum(profit#145)] -Aggregate Attributes [6]: [sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] -Results [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] +Input [4]: [channel#139, sales#153, returns#154, profit#155] +Keys [1]: [channel#139] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Results [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] (110) Exchange -Input [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] -Arguments: hashpartitioning(channel#40, 5), true, [id=#158] +Input [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Arguments: hashpartitioning(channel#139, 5), true, [id=#168] (111) HashAggregate [codegen id : 65] -Input [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] -Keys [1]: [channel#40] -Functions [3]: [sum(sales#143), sum(returns#144), sum(profit#145)] -Aggregate Attributes [3]: [sum(sales#143)#159, sum(returns#144)#160, sum(profit#145)#161] -Results [5]: [channel#40, null AS id#162, sum(sales#143)#159 AS sales#163, sum(returns#144)#160 AS returns#164, sum(profit#145)#161 AS profit#165] +Input [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Keys [1]: [channel#139] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#169, sum(returns#154)#170, sum(profit#155)#171] +Results [5]: [channel#139, null AS id#172, sum(sales#153)#169 AS sales#173, sum(returns#154)#170 AS returns#174, sum(profit#155)#171 AS profit#175] (112) Union +Arguments: [channel#176, id#177, sales#178, returns#179, profit#180] (113) HashAggregate [codegen id : 66] -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Keys [5]: [channel#176, id#177, sales#178, returns#179, profit#180] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Results [5]: [channel#176, id#177, sales#178, returns#179, profit#180] (114) Exchange -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Arguments: hashpartitioning(channel#40, id#41, sales#131, returns#132, profit#133, 5), true, [id=#166] +Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Arguments: hashpartitioning(channel#176, id#177, sales#178, returns#179, profit#180, 5), true, [id=#181] (115) HashAggregate [codegen id : 67] -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Keys [5]: [channel#176, id#177, sales#178, returns#179, profit#180] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Results [5]: [channel#176, id#177, sales#178, returns#179, profit#180] (116) ReusedExchange [Reuses operator id: 105] -Output [8]: [channel#40, id#41, sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Output [8]: [channel#182, id#183, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] (117) HashAggregate [codegen id : 99] -Input [8]: [channel#40, id#41, sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] -Keys [2]: [channel#40, id#41] -Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] -Aggregate Attributes [3]: [sum(sales#42)#173, sum(returns#43)#174, sum(profit#44)#175] -Results [3]: [sum(sales#42)#173 AS sales#143, sum(returns#43)#174 AS returns#144, sum(profit#44)#175 AS profit#145] +Input [8]: [channel#182, id#183, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] +Keys [2]: [channel#182, id#183] +Functions [3]: [sum(sales#190), sum(returns#191), sum(profit#192)] +Aggregate Attributes [3]: [sum(sales#190)#193, sum(returns#191)#194, sum(profit#192)#195] +Results [3]: [sum(sales#190)#193 AS sales#153, sum(returns#191)#194 AS returns#154, sum(profit#192)#195 AS profit#155] (118) HashAggregate [codegen id : 99] -Input [3]: [sales#143, returns#144, profit#145] +Input [3]: [sales#153, returns#154, profit#155] Keys: [] -Functions [3]: [partial_sum(sales#143), partial_sum(returns#144), partial_sum(profit#145)] -Aggregate Attributes [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] -Results [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Results [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] (119) Exchange -Input [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] -Arguments: SinglePartition, true, [id=#188] +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Arguments: SinglePartition, true, [id=#208] (120) HashAggregate [codegen id : 100] -Input [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] Keys: [] -Functions [3]: [sum(sales#143), sum(returns#144), sum(profit#145)] -Aggregate Attributes [3]: [sum(sales#143)#189, sum(returns#144)#190, sum(profit#145)#191] -Results [5]: [null AS channel#192, null AS id#193, sum(sales#143)#189 AS sales#194, sum(returns#144)#190 AS returns#195, sum(profit#145)#191 AS profit#196] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#209, sum(returns#154)#210, sum(profit#155)#211] +Results [5]: [null AS channel#212, null AS id#213, sum(sales#153)#209 AS sales#214, sum(returns#154)#210 AS returns#215, sum(profit#155)#211 AS profit#216] (121) Union +Arguments: [channel#217, id#218, sales#219, returns#220, profit#221] (122) HashAggregate [codegen id : 101] -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Keys [5]: [channel#217, id#218, sales#219, returns#220, profit#221] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Results [5]: [channel#217, id#218, sales#219, returns#220, profit#221] (123) Exchange -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Arguments: hashpartitioning(channel#40, id#41, sales#131, returns#132, profit#133, 5), true, [id=#197] +Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Arguments: hashpartitioning(channel#217, id#218, sales#219, returns#220, profit#221, 5), true, [id=#222] (124) HashAggregate [codegen id : 102] -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Keys [5]: [channel#217, id#218, sales#219, returns#220, profit#221] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Results [5]: [channel#217, id#218, sales#219, returns#220, profit#221] (125) TakeOrderedAndProject -Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] -Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#131, returns#132, profit#133] +Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Arguments: 100, [channel#217 ASC NULLS FIRST, id#218 ASC NULLS FIRST], [channel#217, id#218, sales#219, returns#220, profit#221] 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..999f36d7d0284 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (101) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (67) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (66) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (32) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (31) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [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 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt index ddfdeadcf8eb3..987fa90dbcddf 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt @@ -541,122 +541,125 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#83))#104, sum(co Results [5]: [web channel AS channel#107, concat(web_site, web_site_id#91) AS id#108, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#83))#104,17,2) AS sales#109, sum(coalesce(cast(wr_return_amt#87 as decimal(12,2)), 0.00))#105 AS returns#110, sum(CheckOverflow((promote_precision(cast(ws_net_profit#84 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#88 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#106 AS profit#111] (94) Union +Arguments: [channel#112, id#113, sales#114, returns#115, profit#116] (95) HashAggregate [codegen id : 22] -Input [5]: [channel#39, id#40, sales#41, returns#42, profit#43] -Keys [2]: [channel#39, id#40] -Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] -Aggregate Attributes [6]: [sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] -Results [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] +Input [5]: [channel#112, id#113, sales#114, returns#115, profit#116] +Keys [2]: [channel#112, id#113] +Functions [3]: [partial_sum(sales#114), partial_sum(returns#115), partial_sum(profit#116)] +Aggregate Attributes [6]: [sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Results [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] (96) Exchange -Input [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] -Arguments: hashpartitioning(channel#39, id#40, 5), true, [id=#124] +Input [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] +Arguments: hashpartitioning(channel#112, id#113, 5), true, [id=#129] (97) HashAggregate [codegen id : 23] -Input [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] -Keys [2]: [channel#39, id#40] -Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] -Aggregate Attributes [3]: [sum(sales#41)#125, sum(returns#42)#126, sum(profit#43)#127] -Results [5]: [channel#39, id#40, cast(sum(sales#41)#125 as decimal(37,2)) AS sales#128, cast(sum(returns#42)#126 as decimal(38,2)) AS returns#129, cast(sum(profit#43)#127 as decimal(38,2)) AS profit#130] +Input [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] +Keys [2]: [channel#112, id#113] +Functions [3]: [sum(sales#114), sum(returns#115), sum(profit#116)] +Aggregate Attributes [3]: [sum(sales#114)#130, sum(returns#115)#131, sum(profit#116)#132] +Results [5]: [channel#112, id#113, cast(sum(sales#114)#130 as decimal(37,2)) AS sales#133, cast(sum(returns#115)#131 as decimal(38,2)) AS returns#134, cast(sum(profit#116)#132 as decimal(38,2)) AS profit#135] (98) ReusedExchange [Reuses operator id: 96] -Output [8]: [channel#39, id#40, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Output [8]: [channel#136, id#137, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] (99) HashAggregate [codegen id : 46] -Input [8]: [channel#39, id#40, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] -Keys [2]: [channel#39, id#40] -Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] -Aggregate Attributes [3]: [sum(sales#41)#137, sum(returns#42)#138, sum(profit#43)#139] -Results [4]: [channel#39, sum(sales#41)#137 AS sales#140, sum(returns#42)#138 AS returns#141, sum(profit#43)#139 AS profit#142] +Input [8]: [channel#136, id#137, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Keys [2]: [channel#136, id#137] +Functions [3]: [sum(sales#144), sum(returns#145), sum(profit#146)] +Aggregate Attributes [3]: [sum(sales#144)#147, sum(returns#145)#148, sum(profit#146)#149] +Results [4]: [channel#136, sum(sales#144)#147 AS sales#150, sum(returns#145)#148 AS returns#151, sum(profit#146)#149 AS profit#152] (100) HashAggregate [codegen id : 46] -Input [4]: [channel#39, sales#140, returns#141, profit#142] -Keys [1]: [channel#39] -Functions [3]: [partial_sum(sales#140), partial_sum(returns#141), partial_sum(profit#142)] -Aggregate Attributes [6]: [sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] -Results [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] +Input [4]: [channel#136, sales#150, returns#151, profit#152] +Keys [1]: [channel#136] +Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] +Aggregate Attributes [6]: [sum#153, isEmpty#154, sum#155, isEmpty#156, sum#157, isEmpty#158] +Results [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] (101) Exchange -Input [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] -Arguments: hashpartitioning(channel#39, 5), true, [id=#155] +Input [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] +Arguments: hashpartitioning(channel#136, 5), true, [id=#165] (102) HashAggregate [codegen id : 47] -Input [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] -Keys [1]: [channel#39] -Functions [3]: [sum(sales#140), sum(returns#141), sum(profit#142)] -Aggregate Attributes [3]: [sum(sales#140)#156, sum(returns#141)#157, sum(profit#142)#158] -Results [5]: [channel#39, null AS id#159, sum(sales#140)#156 AS sales#160, sum(returns#141)#157 AS returns#161, sum(profit#142)#158 AS profit#162] +Input [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] +Keys [1]: [channel#136] +Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] +Aggregate Attributes [3]: [sum(sales#150)#166, sum(returns#151)#167, sum(profit#152)#168] +Results [5]: [channel#136, null AS id#169, sum(sales#150)#166 AS sales#170, sum(returns#151)#167 AS returns#171, sum(profit#152)#168 AS profit#172] (103) Union +Arguments: [channel#173, id#174, sales#175, returns#176, profit#177] (104) HashAggregate [codegen id : 48] -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Keys [5]: [channel#173, id#174, sales#175, returns#176, profit#177] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Results [5]: [channel#173, id#174, sales#175, returns#176, profit#177] (105) Exchange -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Arguments: hashpartitioning(channel#39, id#40, sales#128, returns#129, profit#130, 5), true, [id=#163] +Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Arguments: hashpartitioning(channel#173, id#174, sales#175, returns#176, profit#177, 5), true, [id=#178] (106) HashAggregate [codegen id : 49] -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Keys [5]: [channel#173, id#174, sales#175, returns#176, profit#177] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Results [5]: [channel#173, id#174, sales#175, returns#176, profit#177] (107) ReusedExchange [Reuses operator id: 96] -Output [8]: [channel#39, id#40, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Output [8]: [channel#179, id#180, sum#181, isEmpty#182, sum#183, isEmpty#184, sum#185, isEmpty#186] (108) HashAggregate [codegen id : 72] -Input [8]: [channel#39, id#40, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Keys [2]: [channel#39, id#40] -Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] -Aggregate Attributes [3]: [sum(sales#41)#170, sum(returns#42)#171, sum(profit#43)#172] -Results [3]: [sum(sales#41)#170 AS sales#140, sum(returns#42)#171 AS returns#141, sum(profit#43)#172 AS profit#142] +Input [8]: [channel#179, id#180, sum#181, isEmpty#182, sum#183, isEmpty#184, sum#185, isEmpty#186] +Keys [2]: [channel#179, id#180] +Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] +Aggregate Attributes [3]: [sum(sales#187)#190, sum(returns#188)#191, sum(profit#189)#192] +Results [3]: [sum(sales#187)#190 AS sales#150, sum(returns#188)#191 AS returns#151, sum(profit#189)#192 AS profit#152] (109) HashAggregate [codegen id : 72] -Input [3]: [sales#140, returns#141, profit#142] +Input [3]: [sales#150, returns#151, profit#152] Keys: [] -Functions [3]: [partial_sum(sales#140), partial_sum(returns#141), partial_sum(profit#142)] -Aggregate Attributes [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] -Results [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] +Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] +Aggregate Attributes [6]: [sum#193, isEmpty#194, sum#195, isEmpty#196, sum#197, isEmpty#198] +Results [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] (110) Exchange -Input [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] -Arguments: SinglePartition, true, [id=#185] +Input [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] +Arguments: SinglePartition, true, [id=#205] (111) HashAggregate [codegen id : 73] -Input [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] +Input [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] Keys: [] -Functions [3]: [sum(sales#140), sum(returns#141), sum(profit#142)] -Aggregate Attributes [3]: [sum(sales#140)#186, sum(returns#141)#187, sum(profit#142)#188] -Results [5]: [null AS channel#189, null AS id#190, sum(sales#140)#186 AS sales#191, sum(returns#141)#187 AS returns#192, sum(profit#142)#188 AS profit#193] +Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] +Aggregate Attributes [3]: [sum(sales#150)#206, sum(returns#151)#207, sum(profit#152)#208] +Results [5]: [null AS channel#209, null AS id#210, sum(sales#150)#206 AS sales#211, sum(returns#151)#207 AS returns#212, sum(profit#152)#208 AS profit#213] (112) Union +Arguments: [channel#214, id#215, sales#216, returns#217, profit#218] (113) HashAggregate [codegen id : 74] -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Keys [5]: [channel#214, id#215, sales#216, returns#217, profit#218] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Results [5]: [channel#214, id#215, sales#216, returns#217, profit#218] (114) Exchange -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Arguments: hashpartitioning(channel#39, id#40, sales#128, returns#129, profit#130, 5), true, [id=#194] +Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Arguments: hashpartitioning(channel#214, id#215, sales#216, returns#217, profit#218, 5), true, [id=#219] (115) HashAggregate [codegen id : 75] -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Keys [5]: [channel#214, id#215, sales#216, returns#217, profit#218] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Results [5]: [channel#214, id#215, sales#216, returns#217, profit#218] (116) TakeOrderedAndProject -Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] -Arguments: 100, [channel#39 ASC NULLS FIRST, id#40 ASC NULLS FIRST], [channel#39, id#40, sales#128, returns#129, profit#130] +Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Arguments: 100, [channel#214 ASC NULLS FIRST, id#215 ASC NULLS FIRST], [channel#214, id#215, sales#216, returns#217, profit#218] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt index 602a670a49116..3142f75ea2698 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (74) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (49) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (48) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (23) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (22) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union + Union [channel,id,sales,returns,profit] WholeStageCodegen (7) 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 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt index f61c214640e33..e5b049f6d33b2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt @@ -162,90 +162,92 @@ Aggregate Attributes [1]: [sum(total_sum#21)#27] Results [6]: [sum(total_sum#21)#27 AS total_sum#28, i_category#9, null AS i_class#29, 0 AS g_category#30, 1 AS g_class#31, 1 AS lochierarchy#32] (25) Union +Arguments: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (26) HashAggregate [codegen id : 10] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (27) Exchange -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#33] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Arguments: hashpartitioning(total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38, 5), true, [id=#39] (28) HashAggregate [codegen id : 11] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (29) ReusedExchange [Reuses operator id: 18] -Output [3]: [i_category#9, i_class#8, sum#34] +Output [3]: [i_category#9, i_class#8, sum#40] (30) HashAggregate [codegen id : 15] -Input [3]: [i_category#9, i_class#8, sum#34] +Input [3]: [i_category#9, i_class#8, sum#40] Keys [2]: [i_category#9, i_class#8] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#35] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#35,17,2) AS total_sum#21] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#41] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#41,17,2) AS total_sum#21] (31) HashAggregate [codegen id : 15] Input [1]: [total_sum#21] Keys: [] Functions [1]: [partial_sum(total_sum#21)] -Aggregate Attributes [2]: [sum#36, isEmpty#37] -Results [2]: [sum#38, isEmpty#39] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [2]: [sum#44, isEmpty#45] (32) Exchange -Input [2]: [sum#38, isEmpty#39] -Arguments: SinglePartition, true, [id=#40] +Input [2]: [sum#44, isEmpty#45] +Arguments: SinglePartition, true, [id=#46] (33) HashAggregate [codegen id : 16] -Input [2]: [sum#38, isEmpty#39] +Input [2]: [sum#44, isEmpty#45] Keys: [] Functions [1]: [sum(total_sum#21)] -Aggregate Attributes [1]: [sum(total_sum#21)#41] -Results [6]: [sum(total_sum#21)#41 AS total_sum#42, null AS i_category#43, null AS i_class#44, 1 AS g_category#45, 1 AS g_class#46, 2 AS lochierarchy#47] +Aggregate Attributes [1]: [sum(total_sum#21)#47] +Results [6]: [sum(total_sum#21)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] (34) Union +Arguments: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (35) HashAggregate [codegen id : 17] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (36) Exchange -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#48] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Arguments: hashpartitioning(total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59, 5), true, [id=#60] (37) HashAggregate [codegen id : 18] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, CASE WHEN (g_class#17 = 0) THEN i_category#9 END AS _w0#49] +Results [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, CASE WHEN (g_class#58 = 0) THEN i_category#55 END AS _w0#61] (38) Exchange -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: hashpartitioning(lochierarchy#18, _w0#49, 5), true, [id=#50] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: hashpartitioning(lochierarchy#59, _w0#61, 5), true, [id=#62] (39) Sort [codegen id : 19] -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: [lochierarchy#18 ASC NULLS FIRST, _w0#49 ASC NULLS FIRST, total_sum#15 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: [lochierarchy#59 ASC NULLS FIRST, _w0#61 ASC NULLS FIRST, total_sum#54 DESC NULLS LAST], false, 0 (40) Window -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: [rank(total_sum#15) windowspecdefinition(lochierarchy#18, _w0#49, total_sum#15 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#51], [lochierarchy#18, _w0#49], [total_sum#15 DESC NULLS LAST] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: [rank(total_sum#54) windowspecdefinition(lochierarchy#59, _w0#61, total_sum#54 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#63], [lochierarchy#59, _w0#61], [total_sum#54 DESC NULLS LAST] (41) Project [codegen id : 20] -Output [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] -Input [6]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49, rank_within_parent#51] +Output [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Input [6]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61, rank_within_parent#63] (42) TakeOrderedAndProject -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] -Arguments: 100, [lochierarchy#18 DESC NULLS LAST, CASE WHEN (lochierarchy#18 = 0) THEN i_category#9 END ASC NULLS FIRST, rank_within_parent#51 ASC NULLS FIRST], [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Arguments: 100, [lochierarchy#59 DESC NULLS LAST, CASE WHEN (lochierarchy#59 = 0) THEN i_category#55 END ASC NULLS FIRST, rank_within_parent#63 ASC NULLS FIRST], [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt index 2bd128100f527..ad22a0b734e73 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (17) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union + Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] WholeStageCodegen (11) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (10) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union + Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] WholeStageCodegen (4) HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt index f61c214640e33..e5b049f6d33b2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt @@ -162,90 +162,92 @@ Aggregate Attributes [1]: [sum(total_sum#21)#27] Results [6]: [sum(total_sum#21)#27 AS total_sum#28, i_category#9, null AS i_class#29, 0 AS g_category#30, 1 AS g_class#31, 1 AS lochierarchy#32] (25) Union +Arguments: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (26) HashAggregate [codegen id : 10] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (27) Exchange -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#33] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Arguments: hashpartitioning(total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38, 5), true, [id=#39] (28) HashAggregate [codegen id : 11] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (29) ReusedExchange [Reuses operator id: 18] -Output [3]: [i_category#9, i_class#8, sum#34] +Output [3]: [i_category#9, i_class#8, sum#40] (30) HashAggregate [codegen id : 15] -Input [3]: [i_category#9, i_class#8, sum#34] +Input [3]: [i_category#9, i_class#8, sum#40] Keys [2]: [i_category#9, i_class#8] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#35] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#35,17,2) AS total_sum#21] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#41] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#41,17,2) AS total_sum#21] (31) HashAggregate [codegen id : 15] Input [1]: [total_sum#21] Keys: [] Functions [1]: [partial_sum(total_sum#21)] -Aggregate Attributes [2]: [sum#36, isEmpty#37] -Results [2]: [sum#38, isEmpty#39] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [2]: [sum#44, isEmpty#45] (32) Exchange -Input [2]: [sum#38, isEmpty#39] -Arguments: SinglePartition, true, [id=#40] +Input [2]: [sum#44, isEmpty#45] +Arguments: SinglePartition, true, [id=#46] (33) HashAggregate [codegen id : 16] -Input [2]: [sum#38, isEmpty#39] +Input [2]: [sum#44, isEmpty#45] Keys: [] Functions [1]: [sum(total_sum#21)] -Aggregate Attributes [1]: [sum(total_sum#21)#41] -Results [6]: [sum(total_sum#21)#41 AS total_sum#42, null AS i_category#43, null AS i_class#44, 1 AS g_category#45, 1 AS g_class#46, 2 AS lochierarchy#47] +Aggregate Attributes [1]: [sum(total_sum#21)#47] +Results [6]: [sum(total_sum#21)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] (34) Union +Arguments: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (35) HashAggregate [codegen id : 17] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Results [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (36) Exchange -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#48] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Arguments: hashpartitioning(total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59, 5), true, [id=#60] (37) HashAggregate [codegen id : 18] -Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] -Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, CASE WHEN (g_class#17 = 0) THEN i_category#9 END AS _w0#49] +Results [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, CASE WHEN (g_class#58 = 0) THEN i_category#55 END AS _w0#61] (38) Exchange -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: hashpartitioning(lochierarchy#18, _w0#49, 5), true, [id=#50] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: hashpartitioning(lochierarchy#59, _w0#61, 5), true, [id=#62] (39) Sort [codegen id : 19] -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: [lochierarchy#18 ASC NULLS FIRST, _w0#49 ASC NULLS FIRST, total_sum#15 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: [lochierarchy#59 ASC NULLS FIRST, _w0#61 ASC NULLS FIRST, total_sum#54 DESC NULLS LAST], false, 0 (40) Window -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] -Arguments: [rank(total_sum#15) windowspecdefinition(lochierarchy#18, _w0#49, total_sum#15 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#51], [lochierarchy#18, _w0#49], [total_sum#15 DESC NULLS LAST] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] +Arguments: [rank(total_sum#54) windowspecdefinition(lochierarchy#59, _w0#61, total_sum#54 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#63], [lochierarchy#59, _w0#61], [total_sum#54 DESC NULLS LAST] (41) Project [codegen id : 20] -Output [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] -Input [6]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49, rank_within_parent#51] +Output [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Input [6]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61, rank_within_parent#63] (42) TakeOrderedAndProject -Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] -Arguments: 100, [lochierarchy#18 DESC NULLS LAST, CASE WHEN (lochierarchy#18 = 0) THEN i_category#9 END ASC NULLS FIRST, rank_within_parent#51 ASC NULLS FIRST], [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Arguments: 100, [lochierarchy#59 DESC NULLS LAST, CASE WHEN (lochierarchy#59 = 0) THEN i_category#55 END ASC NULLS FIRST, rank_within_parent#63 ASC NULLS FIRST], [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt index 2bd128100f527..ad22a0b734e73 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (17) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union + Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] WholeStageCodegen (11) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (10) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union + Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] WholeStageCodegen (4) HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala index ca52e51c87ea7..2f0d7bebed200 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala @@ -20,6 +20,7 @@ package org.apache.spark.sql.execution import org.apache.spark.rdd.RDD import org.apache.spark.sql.{execution, DataFrame, Row} import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.analysis.ResolveUnion import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans._ import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Range, Repartition, Sort, Union} @@ -816,8 +817,10 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { test("SPARK-26812: wrong nullability for complex datatypes in union") { def testUnionOutputType(input1: DataType, input2: DataType, output: DataType): Unit = { - val query = Union( - LocalRelation(StructField("a", input1)), LocalRelation(StructField("a", input2))) + val left = LocalRelation(StructField("a", input1)) + val right = LocalRelation(StructField("a", input2)) + val unionOutput = ResolveUnion.makeUnionOutput(Seq(left, right)) + val query = Union(left, right, unionOutput) assert(query.output.head.dataType == output) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala index 4ba25db374147..09c9c5f94ba9f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala @@ -39,7 +39,7 @@ class SparkPlannerSuite extends SharedSparkSession { planLater(child) :: planLater(NeverPlanned) :: Nil case u: Union => planned += 1 - UnionExec(u.children.map(planLater), u.unionOutput) :: planLater(NeverPlanned) :: Nil + UnionExec(u.children.map(planLater), u.unionOutput.get) :: planLater(NeverPlanned) :: Nil case LocalRelation(output, data, _) => planned += 1 LocalTableScanExec(output, data) :: planLater(NeverPlanned) :: Nil From 454821a00ffbffa52c5b2a7ab44e6fb07b7e1e3a Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 17:24:41 +0900 Subject: [PATCH 11/16] remove unused imports --- .../apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala index 9d80779b59817..20534838e96a3 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala @@ -24,7 +24,6 @@ import org.apache.spark.sql.catalyst.expressions.{And, GreaterThan, GreaterThanO import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules._ -import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.BooleanType class SetOperationSuite extends PlanTest { From fe44f6fe76ffea26d9b494b5c7930d5e88223e4d Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 20:57:31 +0900 Subject: [PATCH 12/16] Revert "remove unused imports" This reverts commit 454821a00ffbffa52c5b2a7ab44e6fb07b7e1e3a. --- .../apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala index 20534838e96a3..9d80779b59817 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala @@ -24,6 +24,7 @@ import org.apache.spark.sql.catalyst.expressions.{And, GreaterThan, GreaterThanO import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules._ +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.BooleanType class SetOperationSuite extends PlanTest { From 241d697f20a70ab25965222257a1bf2afae1c106 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 20:57:41 +0900 Subject: [PATCH 13/16] Revert "Bugfix" This reverts commit 4c8a81e3b291a5f0d0506f731596ca2dff1b6f34. --- R/pkg/tests/fulltests/test_sparkSQL.R | 14 +- .../sql/catalyst/analysis/Analyzer.scala | 5 - .../sql/catalyst/analysis/ResolveUnion.scala | 22 +- .../sql/catalyst/analysis/TypeCoercion.scala | 25 +- .../sql/catalyst/optimizer/Optimizer.scala | 8 +- .../optimizer/PropagateEmptyRelation.scala | 14 +- .../sql/catalyst/parser/AstBuilder.scala | 2 +- .../spark/sql/catalyst/plans/QueryPlan.scala | 17 +- .../plans/logical/basicLogicalOperators.scala | 15 +- .../sql/catalyst/analysis/AnalysisSuite.scala | 2 +- .../sql/catalyst/analysis/AnalysisTest.scala | 33 +- .../analysis/DataSourceV2AnalysisSuite.scala | 7 +- .../catalyst/analysis/ResolveUnionSuite.scala | 8 +- .../catalyst/analysis/TypeCoercionSuite.scala | 7 +- .../PropagateEmptyRelationSuite.scala | 11 +- .../RemoveRedundantAliasAndProjectSuite.scala | 2 +- .../optimizer/SetOperationSuite.scala | 12 +- .../joinReorder/JoinReorderSuite.scala | 16 +- .../sql/catalyst/parser/PlanParserSuite.scala | 11 +- .../plans/ConstraintPropagationSuite.scala | 30 +- .../spark/sql/execution/SparkStrategies.scala | 2 +- .../execution/basicPhysicalOperators.scala | 2 + .../sql-tests/results/explain-aqe.sql.out | 1 - .../sql-tests/results/explain.sql.out | 1 - .../q10.sf100/explain.txt | 95 ++- .../q10.sf100/simplified.txt | 2 +- .../approved-plans-modified/q10/explain.txt | 89 +- .../q10/simplified.txt | 2 +- .../q27.sf100/explain.txt | 5 +- .../q27.sf100/simplified.txt | 2 +- .../approved-plans-modified/q27/explain.txt | 5 +- .../q27/simplified.txt | 2 +- .../approved-plans-v1_4/q11.sf100/explain.txt | 501 ++++++----- .../q11.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q11/explain.txt | 411 +++++---- .../approved-plans-v1_4/q11/simplified.txt | 53 +- .../q14a.sf100/explain.txt | 62 +- .../q14a.sf100/simplified.txt | 4 +- .../approved-plans-v1_4/q14a/explain.txt | 62 +- .../approved-plans-v1_4/q14a/simplified.txt | 4 +- .../q14b.sf100/explain.txt | 41 +- .../q14b.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q14b/explain.txt | 41 +- .../approved-plans-v1_4/q14b/simplified.txt | 2 +- .../approved-plans-v1_4/q2.sf100/explain.txt | 137 ++- .../q2.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q2/explain.txt | 125 ++- .../approved-plans-v1_4/q2/simplified.txt | 2 +- .../q23a.sf100/explain.txt | 59 +- .../q23a.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q23a/explain.txt | 61 +- .../approved-plans-v1_4/q23a/simplified.txt | 2 +- .../q23b.sf100/explain.txt | 41 +- .../q23b.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q23b/explain.txt | 43 +- .../approved-plans-v1_4/q23b/simplified.txt | 2 +- .../approved-plans-v1_4/q33.sf100/explain.txt | 29 +- .../q33.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q33/explain.txt | 29 +- .../approved-plans-v1_4/q33/simplified.txt | 2 +- .../approved-plans-v1_4/q36.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q36/explain.txt | 4 +- .../approved-plans-v1_4/q4.sf100/explain.txt | 791 +++++++++--------- .../q4.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q4/explain.txt | 655 +++++++-------- .../approved-plans-v1_4/q4/simplified.txt | 53 +- .../approved-plans-v1_4/q49.sf100/explain.txt | 21 +- .../q49.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q49/explain.txt | 21 +- .../approved-plans-v1_4/q49/simplified.txt | 2 +- .../approved-plans-v1_4/q5.sf100/explain.txt | 288 ++++--- .../q5.sf100/simplified.txt | 8 +- .../approved-plans-v1_4/q5/explain.txt | 276 +++--- .../approved-plans-v1_4/q5/simplified.txt | 8 +- .../approved-plans-v1_4/q54.sf100/explain.txt | 305 ++++--- .../q54.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q54/explain.txt | 277 +++--- .../approved-plans-v1_4/q54/simplified.txt | 2 +- .../approved-plans-v1_4/q56.sf100/explain.txt | 29 +- .../q56.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q56/explain.txt | 29 +- .../approved-plans-v1_4/q56/simplified.txt | 2 +- .../approved-plans-v1_4/q60.sf100/explain.txt | 29 +- .../q60.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q60/explain.txt | 29 +- .../approved-plans-v1_4/q60/simplified.txt | 2 +- .../approved-plans-v1_4/q66.sf100/explain.txt | 29 +- .../q66.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q66/explain.txt | 29 +- .../approved-plans-v1_4/q66/simplified.txt | 2 +- .../approved-plans-v1_4/q70.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q70/explain.txt | 4 +- .../approved-plans-v1_4/q71.sf100/explain.txt | 63 +- .../q71.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q71/explain.txt | 63 +- .../approved-plans-v1_4/q71/simplified.txt | 2 +- .../approved-plans-v1_4/q74.sf100/explain.txt | 493 ++++++----- .../q74.sf100/simplified.txt | 75 +- .../approved-plans-v1_4/q74/explain.txt | 403 +++++---- .../approved-plans-v1_4/q74/simplified.txt | 53 +- .../approved-plans-v1_4/q75.sf100/explain.txt | 310 ++++--- .../q75.sf100/simplified.txt | 8 +- .../approved-plans-v1_4/q75/explain.txt | 262 +++--- .../approved-plans-v1_4/q75/simplified.txt | 8 +- .../approved-plans-v1_4/q76.sf100/explain.txt | 29 +- .../q76.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q76/explain.txt | 29 +- .../approved-plans-v1_4/q76/simplified.txt | 2 +- .../approved-plans-v1_4/q77.sf100/explain.txt | 33 +- .../q77.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q77/explain.txt | 33 +- .../approved-plans-v1_4/q77/simplified.txt | 2 +- .../approved-plans-v1_4/q80.sf100/explain.txt | 33 +- .../q80.sf100/simplified.txt | 2 +- .../approved-plans-v1_4/q80/explain.txt | 33 +- .../approved-plans-v1_4/q80/simplified.txt | 2 +- .../approved-plans-v1_4/q86.sf100/explain.txt | 4 +- .../approved-plans-v1_4/q86/explain.txt | 4 +- .../q10a.sf100/explain.txt | 323 +++---- .../q10a.sf100/simplified.txt | 137 +-- .../approved-plans-v2_7/q10a/explain.txt | 268 +++--- .../approved-plans-v2_7/q10a/simplified.txt | 119 ++- .../approved-plans-v2_7/q11.sf100/explain.txt | 493 ++++++----- .../q11.sf100/simplified.txt | 75 +- .../approved-plans-v2_7/q11/explain.txt | 403 +++++---- .../approved-plans-v2_7/q11/simplified.txt | 53 +- .../approved-plans-v2_7/q14.sf100/explain.txt | 41 +- .../q14.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q14/explain.txt | 41 +- .../approved-plans-v2_7/q14/simplified.txt | 2 +- .../q14a.sf100/explain.txt | 504 ++++++----- .../q14a.sf100/simplified.txt | 20 +- .../approved-plans-v2_7/q14a/explain.txt | 504 ++++++----- .../approved-plans-v2_7/q14a/simplified.txt | 20 +- .../q18a.sf100/explain.txt | 5 +- .../q18a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q18a/explain.txt | 5 +- .../approved-plans-v2_7/q18a/simplified.txt | 2 +- .../q22a.sf100/explain.txt | 5 +- .../q22a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q22a/explain.txt | 5 +- .../approved-plans-v2_7/q22a/simplified.txt | 2 +- .../q27a.sf100/explain.txt | 5 +- .../q27a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q27a/explain.txt | 5 +- .../approved-plans-v2_7/q27a/simplified.txt | 2 +- .../q35a.sf100/explain.txt | 373 +++++---- .../q35a.sf100/simplified.txt | 115 +-- .../approved-plans-v2_7/q35a/explain.txt | 262 +++--- .../approved-plans-v2_7/q35a/simplified.txt | 121 ++- .../q36a.sf100/explain.txt | 76 +- .../q36a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q36a/explain.txt | 76 +- .../approved-plans-v2_7/q36a/simplified.txt | 4 +- .../approved-plans-v2_7/q49.sf100/explain.txt | 21 +- .../q49.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q49/explain.txt | 21 +- .../approved-plans-v2_7/q49/simplified.txt | 2 +- .../approved-plans-v2_7/q5a.sf100/explain.txt | 386 +++++---- .../q5a.sf100/simplified.txt | 12 +- .../approved-plans-v2_7/q5a/explain.txt | 374 ++++----- .../approved-plans-v2_7/q5a/simplified.txt | 12 +- .../q67a.sf100/explain.txt | 21 +- .../q67a.sf100/simplified.txt | 2 +- .../approved-plans-v2_7/q67a/explain.txt | 21 +- .../approved-plans-v2_7/q67a/simplified.txt | 2 +- .../q70a.sf100/explain.txt | 76 +- .../q70a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q70a/explain.txt | 76 +- .../approved-plans-v2_7/q70a/simplified.txt | 4 +- .../approved-plans-v2_7/q74.sf100/explain.txt | 493 ++++++----- .../q74.sf100/simplified.txt | 75 +- .../approved-plans-v2_7/q74/explain.txt | 403 +++++---- .../approved-plans-v2_7/q74/simplified.txt | 53 +- .../approved-plans-v2_7/q75.sf100/explain.txt | 310 ++++--- .../q75.sf100/simplified.txt | 8 +- .../approved-plans-v2_7/q75/explain.txt | 262 +++--- .../approved-plans-v2_7/q75/simplified.txt | 8 +- .../q77a.sf100/explain.txt | 131 ++- .../q77a.sf100/simplified.txt | 6 +- .../approved-plans-v2_7/q77a/explain.txt | 131 ++- .../approved-plans-v2_7/q77a/simplified.txt | 6 +- .../q80a.sf100/explain.txt | 131 ++- .../q80a.sf100/simplified.txt | 6 +- .../approved-plans-v2_7/q80a/explain.txt | 131 ++- .../approved-plans-v2_7/q80a/simplified.txt | 6 +- .../q86a.sf100/explain.txt | 76 +- .../q86a.sf100/simplified.txt | 4 +- .../approved-plans-v2_7/q86a/explain.txt | 76 +- .../approved-plans-v2_7/q86a/simplified.txt | 4 +- .../spark/sql/execution/PlannerSuite.scala | 7 +- .../sql/execution/SparkPlannerSuite.scala | 2 +- 192 files changed, 7201 insertions(+), 7449 deletions(-) diff --git a/R/pkg/tests/fulltests/test_sparkSQL.R b/R/pkg/tests/fulltests/test_sparkSQL.R index 1d234130acb58..1c65dabaf6656 100644 --- a/R/pkg/tests/fulltests/test_sparkSQL.R +++ b/R/pkg/tests/fulltests/test_sparkSQL.R @@ -2684,21 +2684,21 @@ test_that("union(), unionByName(), rbind(), except(), and intersect() on a DataF writeLines(lines, jsonPath2) df2 <- read.df(jsonPath2, "json") - unioned <- arrange(union(df, df2), "age") + unioned <- arrange(union(df, df2), df$age) expect_is(unioned, "SparkDataFrame") expect_equal(count(unioned), 6) expect_equal(first(unioned)$name, "Michael") - expect_equal(count(arrange(suppressWarnings(union(df, df2)), "age")), 6) - expect_equal(count(arrange(suppressWarnings(unionAll(df, df2)), "age")), 6) + expect_equal(count(arrange(suppressWarnings(union(df, df2)), df$age)), 6) + expect_equal(count(arrange(suppressWarnings(unionAll(df, df2)), df$age)), 6) df1 <- select(df2, "age", "name") - unioned1 <- arrange(unionByName(df1, df), "age") + unioned1 <- arrange(unionByName(df1, df), df1$age) expect_is(unioned, "SparkDataFrame") expect_equal(count(unioned), 6) # Here, we test if 'Michael' in df is correctly mapped to the same name. expect_equal(first(unioned)$name, "Michael") - unioned2 <- arrange(rbind(unioned, df, df2), "age") + unioned2 <- arrange(rbind(unioned, df, df2), df$age) expect_is(unioned2, "SparkDataFrame") expect_equal(count(unioned2), 12) expect_equal(first(unioned2)$name, "Michael") @@ -2723,12 +2723,12 @@ test_that("union(), unionByName(), rbind(), except(), and intersect() on a DataF testthat::expect_error(unionByName(df2, select(df2, "age"), FALSE)) testthat::expect_error(unionByName(df2, select(df2, "age"))) - excepted <- arrange(except(df, df2), desc(column("age"))) + excepted <- arrange(except(df, df2), desc(df$age)) expect_is(unioned, "SparkDataFrame") expect_equal(count(excepted), 2) expect_equal(first(excepted)$name, "Justin") - intersected <- arrange(intersect(df, df2), "age") + intersected <- arrange(intersect(df, df2), df$age) expect_is(unioned, "SparkDataFrame") expect_equal(count(intersected), 1) expect_equal(first(intersected)$name, "Andy") diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index b072ad2b0b227..77a6631b250e8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -1272,11 +1272,6 @@ class Analyzer( val newOutput = oldVersion.generatorOutput.map(_.newInstance()) Seq((oldVersion, oldVersion.copy(generatorOutput = newOutput))) - case oldVersion: Union - if oldVersion.producedAttributes.intersect(conflictingAttributes).nonEmpty => - val newOutput = oldVersion.unionOutput.get.map(_.newInstance()) - Seq((oldVersion, oldVersion.copy(unionOutput = Some(newOutput)))) - case oldVersion: Expand if oldVersion.producedAttributes.intersect(conflictingAttributes).nonEmpty => val producedAttributes = oldVersion.producedAttributes diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index f64ef87b866cd..afd27b6e26a82 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -17,10 +17,8 @@ package org.apache.spark.sql.catalyst.analysis -import scala.collection.mutable - import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, ExprId, Literal, NamedExpression} +import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, Literal, NamedExpression} import org.apache.spark.sql.catalyst.optimizer.CombineUnions import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, Union} import org.apache.spark.sql.catalyst.rules.Rule @@ -33,15 +31,12 @@ import org.apache.spark.sql.util.SchemaUtils */ object ResolveUnion extends Rule[LogicalPlan] { - def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { - val seenExprIdSet = mutable.Map[ExprId, ExprId]() + private[catalyst] def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { children.map(_.output).transpose.map { attrs => val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) val newDt = attrs.map(_.dataType).reduce(StructType.merge) - // If child's output has attributes having the same `exprId`, we needs to - // assign a unique `exprId` for them. - val newExprId = seenExprIdSet.getOrElseUpdate(firstAttr.exprId, NamedExpression.newExprId) + val newExprId = NamedExpression.newExprId if (firstAttr.dataType == newDt) { firstAttr.withExprId(newExprId).withNullability(nullable) } else { @@ -90,13 +85,8 @@ object ResolveUnion extends Rule[LogicalPlan] { } else { left } - val newUnion = Union(leftChild, rightChild) - if (newUnion.allChildrenCompatible) { - val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) - newUnion.copy(unionOutput = Some(unionOutput)) - } else { - newUnion - } + val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) + Union(leftChild, rightChild, unionOutput) } // Check column name duplication @@ -127,6 +117,6 @@ object ResolveUnion extends Rule[LogicalPlan] { case u @ Union(children, _, _, unionOutput) if u.allChildrenCompatible && unionOutput.isEmpty => - u.copy(unionOutput = Some(makeUnionOutput(children))) + u.copy(unionOutput = makeUnionOutput(children)) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index 4b71c7284d003..f71e2c5a3c505 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -360,14 +360,13 @@ object TypeCoercion { } else { val attrMapping = s.children.head.output.zip(newChildren.head.output) val newOutput = ResolveUnion.makeUnionOutput(newChildren) - s.copy(children = newChildren, unionOutput = Some(newOutput)) -> attrMapping + s.copy(children = newChildren, unionOutput = newOutput) -> attrMapping } } } /** Build new children with the widest types for each attribute among all the children */ - private[analysis] def buildNewChildrenWithWiderTypes(children: Seq[LogicalPlan]) - : Seq[LogicalPlan] = { + private def buildNewChildrenWithWiderTypes(children: Seq[LogicalPlan]): Seq[LogicalPlan] = { require(children.forall(_.output.length == children.head.output.length)) // Get a sequence of data types, each of which is the widest type of this specific attribute @@ -1121,8 +1120,6 @@ object TypeCoercion { } trait TypeCoercionRule extends Rule[LogicalPlan] with Logging { - import TypeCoercion.WidenSetOperationTypes - /** * Applies any changes to [[AttributeReference]] data types that are made by the transform method * to instances higher in the query tree. @@ -1145,24 +1142,6 @@ trait TypeCoercionRule extends Rule[LogicalPlan] with Logging { // Don't propagate types from unresolved children. case q: LogicalPlan if !q.childrenResolved => q - case u: Union => - if (u.unionOutput.isDefined) { - // If this type coercion rule changes the input types of `Union`, we need to - // update data types in `unionOutput` accordingly. - val newChildren = WidenSetOperationTypes.buildNewChildrenWithWiderTypes(u.children) - val newOutputTypes = newChildren.head.output.map(_.dataType) - if (!u.output.zip(newOutputTypes).forall { case (a, dt) => a.dataType.sameType(dt)}) { - val newOutput = u.output.map(_.asInstanceOf[AttributeReference]).zip(newOutputTypes).map { - case (a, dt) => a.copy(dataType = dt)(exprId = a.exprId, qualifier = a.qualifier) - } - u.copy(children = newChildren, unionOutput = Some(newOutput)) - } else { - u - } - } else { - u - } - case q: LogicalPlan => val inputMap = q.inputSet.toSeq.map(a => (a.exprId, a)).toMap q transformExpressions { 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 48512e47123fc..e43799645a8e9 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 @@ -595,7 +595,7 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper } val newChildren = newFirstChild +: newOtherChildren val newOutput = ResolveUnion.makeUnionOutput(newChildren) - val newPlan = u.copy(children = newChildren, unionOutput = Some(newOutput)) + val newPlan = u.copy(children = newChildren, unionOutput = newOutput) val attrMapping = p.output.zip(newPlan.output).filter { case (a1, a2) => a1.exprId != a2.exprId } @@ -683,7 +683,7 @@ object ColumnPruning extends Rule[LogicalPlan] { Project(selected, p) } val prunedUnionOutput = u.output.filter(p.references.contains) - p.copy(child = u.copy(children = newChildren, unionOutput = Some(prunedUnionOutput))) + p.copy(child = u.copy(children = newChildren, unionOutput = prunedUnionOutput)) } else { p } @@ -1804,7 +1804,9 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { projectMinPlan ) val newPlan = Project(newLeftOutput, genRowPlan) - val attrMapping = i.output.zip(newPlan.output) + val attrMapping = i.output.zip(newPlan.output).filter { + case (a1, a2) => a1.exprId != a2.exprId + } newPlan -> attrMapping } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala index 9ff54cc8df1c5..2627202c09c45 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala @@ -55,15 +55,17 @@ object PropagateEmptyRelation extends Rule[LogicalPlan] with PredicateHelper wit if (newChildren.isEmpty) { empty(p) } else { - if (newChildren.size > 1) { - p.copy(children = newChildren) + val newPlan = if (newChildren.size > 1) Union(newChildren) else newChildren.head + val outputs = newPlan.output.zip(p.output) + // the original Union may produce different output attributes than the new one so we alias + // them if needed + if (outputs.forall { case (newAttr, oldAttr) => newAttr.exprId == oldAttr.exprId }) { + newPlan } else { - val newPlan = newChildren.head - val outputAliases = p.output.zip(newPlan.output).map { case (oldAttr, newAttr) => + val outputAliases = outputs.map { case (newAttr, oldAttr) => val newExplicitMetadata = if (oldAttr.metadata != newAttr.metadata) Some(oldAttr.metadata) else None - Alias(newAttr, oldAttr.name)( - exprId = oldAttr.exprId, explicitMetadata = newExplicitMetadata) + Alias(newAttr, oldAttr.name)(oldAttr.exprId, explicitMetadata = newExplicitMetadata) } Project(outputAliases, newPlan) } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala index 27f655ed9be12..f133235a2636e 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala @@ -229,7 +229,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging if (inserts.length == 1) { inserts.head } else { - Union(inserts.toSeq, unionOutput = Some(Nil)) + Union(inserts.toSeq) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala index 5ed6fea4cc51a..b08e8fabb9c6a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala @@ -220,23 +220,12 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) } + newPlan = planAfterRule - val newValidAttrMapping = newAttrMapping.filter { + attrMapping ++= newAttrMapping.filter { case (a1, a2) => a1.exprId != a2.exprId } - // Updates the `attrMapping` entries that are obsoleted by generated entries in `rule`. - // For example, `attrMapping` has a mapping entry 'id#1 -> id#2' and `rule` - // generates a new entry 'id#2 -> id#3'. In this case, we need to update - // the corresponding old entry from 'id#1 -> id#2' to '#id#1 -> #id#3'. - val updatedAttrMap = AttributeMap(newValidAttrMapping) - val transferAttrMapping = attrMapping.map { - case (a1, a2) => (a1, updatedAttrMap.getOrElse(a2, a2)) - } - val newOtherAttrMapping = { - val existingAttrMappingSet = transferAttrMapping.map(_._2).toSet - newValidAttrMapping.filterNot { case (_, a) => existingAttrMappingSet.contains(a) } - } - planAfterRule -> (transferAttrMapping ++ newOtherAttrMapping).toSeq + newPlan -> attrMapping.toSeq } } rewrite(this)._1 diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index 0701ececb92f8..d7cb86e6b8042 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -215,7 +215,7 @@ case class Except( object Union { def apply(left: LogicalPlan, right: LogicalPlan, output: Seq[Attribute]): Union = { - Union(left :: right :: Nil, unionOutput = Some(output)) + Union(left :: right :: Nil, unionOutput = output) } def apply(left: LogicalPlan, right: LogicalPlan): Union = { @@ -235,7 +235,7 @@ case class Union( children: Seq[LogicalPlan], byName: Boolean = false, allowMissingCol: Boolean = false, - unionOutput: Option[Seq[Attribute]] = None) extends LogicalPlan { + unionOutput: Seq[Attribute] = Seq.empty) extends LogicalPlan { assert(!allowMissingCol || byName, "`allowMissingCol` can be true only if `byName` is true.") override def maxRows: Option[Long] = { @@ -262,13 +262,12 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - override def producedAttributes: AttributeSet = - if (unionOutput.isDefined) AttributeSet(unionOutput.get) else AttributeSet.empty + override def producedAttributes: AttributeSet = AttributeSet(unionOutput) // updating nullability to make all the children consistent override def output: Seq[Attribute] = { - assert(unionOutput.isDefined, "Union should have at least a single column") - unionOutput.get + assert(unionOutput.nonEmpty, "Union should have at least a single column") + unionOutput } lazy val allChildrenCompatible: Boolean = { @@ -285,7 +284,7 @@ case class Union( override lazy val resolved: Boolean = { children.length > 1 && !(byName || allowMissingCol) && allChildrenCompatible && - unionOutput.isDefined + unionOutput.nonEmpty } /** @@ -320,7 +319,7 @@ case class Union( override protected lazy val validConstraints: ExpressionSet = { children - .map(child => rewriteConstraints(output, child.output, child.constraints)) + .map(child => rewriteConstraints(children.head.output, child.output, child.constraints)) .reduce(merge(_, _)) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala index cb4e4a5aec5a4..3a5c4b9769685 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala @@ -62,7 +62,7 @@ class AnalysisSuite extends AnalysisTest with Matchers { a.select(UnresolvedStar(None)).select($"a").union(b.select(UnresolvedStar(None))) } - assertAnalysisSuccess(plan, maxIterations = Some(150)) + assertAnalysisSuccess(plan) } test("check project's resolved") { diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala index 5189d3a42ca94..4473c20b2cca6 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisTest.scala @@ -36,14 +36,8 @@ trait AnalysisTest extends PlanTest { protected def extendedAnalysisRules: Seq[Rule[LogicalPlan]] = Nil - private def makeAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None): Analyzer = { - val conf = { - val sqlConf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) - if (maxIterations.isDefined) { - sqlConf.setConf(SQLConf.ANALYZER_MAX_ITERATIONS, maxIterations.get) - } - sqlConf - } + private def makeAnalyzer(caseSensitive: Boolean): Analyzer = { + val conf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) val catalog = new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf) catalog.createDatabase( CatalogDatabase("default", "", new URI("loc"), Map.empty), @@ -58,20 +52,15 @@ trait AnalysisTest extends PlanTest { } } - protected def getAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None) = { - if (maxIterations.isEmpty) { - if (caseSensitive) caseSensitiveAnalyzer else caseInsensitiveAnalyzer - } else { - makeAnalyzer(caseSensitive, maxIterations) - } + protected def getAnalyzer(caseSensitive: Boolean) = { + if (caseSensitive) caseSensitiveAnalyzer else caseInsensitiveAnalyzer } protected def checkAnalysis( inputPlan: LogicalPlan, expectedPlan: LogicalPlan, - caseSensitive: Boolean = true, - maxIterations: Option[Int] = None): Unit = { - val analyzer = getAnalyzer(caseSensitive, maxIterations) + caseSensitive: Boolean = true): Unit = { + val analyzer = getAnalyzer(caseSensitive) val actualPlan = analyzer.executeAndCheck(inputPlan, new QueryPlanningTracker) comparePlans(actualPlan, expectedPlan) } @@ -86,9 +75,8 @@ trait AnalysisTest extends PlanTest { protected def assertAnalysisSuccess( inputPlan: LogicalPlan, - caseSensitive: Boolean = true, - maxIterations: Option[Int] = None): Unit = { - val analyzer = getAnalyzer(caseSensitive, maxIterations) + caseSensitive: Boolean = true): Unit = { + val analyzer = getAnalyzer(caseSensitive) val analysisAttempt = analyzer.execute(inputPlan) try analyzer.checkAnalysis(analysisAttempt) catch { case a: AnalysisException => @@ -106,9 +94,8 @@ trait AnalysisTest extends PlanTest { protected def assertAnalysisError( inputPlan: LogicalPlan, expectedErrors: Seq[String], - caseSensitive: Boolean = true, - maxIterations: Option[Int] = None): Unit = { - val analyzer = getAnalyzer(caseSensitive, maxIterations) + caseSensitive: Boolean = true): Unit = { + val analyzer = getAnalyzer(caseSensitive) val e = intercept[AnalysisException] { analyzer.checkAnalysis(analyzer.execute(inputPlan)) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala index 3d9b13a1ebdf6..e466d558db1ef 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala @@ -123,13 +123,12 @@ abstract class DataSourceV2ANSIAnalysisSuite extends DataSourceV2AnalysisBaseSui override def checkAnalysis( inputPlan: LogicalPlan, expectedPlan: LogicalPlan, - caseSensitive: Boolean, - maxIterations: Option[Int] = None): Unit = { + caseSensitive: Boolean): Unit = { val expectedPlanWithAnsiCast = expectedPlan transformAllExpressions { case c: Cast => AnsiCast(c.child, c.dataType, c.timeZoneId) case other => other } - super.checkAnalysis(inputPlan, expectedPlanWithAnsiCast, caseSensitive, maxIterations) + super.checkAnalysis(inputPlan, expectedPlanWithAnsiCast, caseSensitive) } } @@ -204,7 +203,7 @@ abstract class DataSourceV2AnalysisBaseSuite extends AnalysisTest { protected def getSQLConf(caseSensitive: Boolean): SQLConf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) - override def getAnalyzer(caseSensitive: Boolean, maxIterations: Option[Int] = None): Analyzer = { + override def getAnalyzer(caseSensitive: Boolean): Analyzer = { val conf = getSQLConf(caseSensitive) val catalog = new SessionCatalog(new InMemoryCatalog, FunctionRegistry.builtin, conf) catalog.createDatabase( diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala index dff222e668e69..42bd4012b0a63 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala @@ -17,6 +17,7 @@ package org.apache.spark.sql.catalyst.analysis import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules.RuleExecutor @@ -53,7 +54,7 @@ class ResolveUnionSuite extends AnalysisTest { val projected1 = Project(Seq(table2.output(3), table2.output(0), table2.output(1), table2.output(2)), table2) val expectedOutput = Seq('i.int, 'u.decimal, 'b.byte, 'd.double) - val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = Some(expectedOutput)) + val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed1, expected1) // Allow missing column @@ -62,7 +63,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr1 = Alias(Literal(null, ByteType), "b")() val projected2 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, table2.output(2)), table3) - val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = Some(expectedOutput)) + val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed2, expected2) // Allow missing column + Allow missing column @@ -71,8 +72,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr2 = Alias(Literal(null, DoubleType), "d")() val projected3 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, nullAttr2), table4) - val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, - unionOutput = Some(expectedOutput)) + val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, unionOutput = expectedOutput) comparePlans(analyzed3, expected3) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala index 39eec899bc0eb..7b80de908fa08 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala @@ -1417,19 +1417,16 @@ class TypeCoercionSuite extends AnalysisTest { } test("SPARK-32638: corrects references when adding aliases in WidenSetOperationTypes") { - def resolve(p: LogicalPlan): LogicalPlan = { - getAnalyzer(false).ResolveReferences(ResolveUnion(widenSetOperationTypes(p))) - } val t1 = LocalRelation(AttributeReference("v", DecimalType(10, 0))()) val t2 = LocalRelation(AttributeReference("v", DecimalType(11, 0))()) val p1 = t1.select(t1.output.head).as("p1") val p2 = t2.select(t2.output.head).as("p2") val union = p1.union(p2) - val wp1 = resolve(union.select(p1.output.head, $"p2.v")) + val wp1 = widenSetOperationTypes(union.select(p1.output.head, $"p2.v")) assert(wp1.isInstanceOf[Project]) // The attribute `p1.output.head` should be replaced in the root `Project`. assert(wp1.expressions.forall(_.find(_ == p1.output.head).isEmpty)) - val wp2 = resolve(Aggregate(Nil, sum($"v").as("v") :: Nil, union)) + val wp2 = widenSetOperationTypes(Aggregate(Nil, sum(p1.output.head).as("v") :: Nil, union)) assert(wp2.isInstanceOf[Aggregate]) assert(wp2.missingInput.isEmpty) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala index e225d4ffe0ab7..5c980abdd8f53 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala @@ -23,7 +23,7 @@ import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions.Literal import org.apache.spark.sql.catalyst.plans._ -import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Project, Union} +import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Project} import org.apache.spark.sql.catalyst.rules.RuleExecutor import org.apache.spark.sql.types.{IntegerType, MetadataBuilder, StructType} @@ -73,8 +73,7 @@ class PropagateEmptyRelationSuite extends PlanTest { test("SPARK-32241: remove empty relation children from Union") { val query = testRelation1.union(testRelation2.where(false)) val optimized = Optimize.execute(query.analyze) - val a = testRelation1.output.head - val correctAnswer = testRelation1.select(a.as(a.name)) + val correctAnswer = testRelation1 comparePlans(optimized, correctAnswer) val query2 = testRelation1.where(false).union(testRelation2) @@ -84,16 +83,16 @@ class PropagateEmptyRelationSuite extends PlanTest { val query3 = testRelation1.union(testRelation2.where(false)).union(testRelation3) val optimized3 = Optimize.execute(query3.analyze) - val correctAnswer3 = testRelation1.union(testRelation3).analyze + val correctAnswer3 = testRelation1.union(testRelation3) comparePlans(optimized3, correctAnswer3) val query4 = testRelation1.where(false).union(testRelation2).union(testRelation3) val optimized4 = Optimize.execute(query4.analyze) - val correctAnswer4 = Union(testRelation2, testRelation3, testRelation1.output.head :: Nil) + val correctAnswer4 = testRelation2.union(testRelation3).select('b.as('a)).analyze comparePlans(optimized4, correctAnswer4) // Nullability can change from nullable to non-nullable - val query5 = testRelation1.where(false).union(testRelation3).analyze + val query5 = testRelation1.where(false).union(testRelation3) val optimized5 = Optimize.execute(query5.analyze) assert(query5.output.head.nullable, "Original output should be nullable") assert(!optimized5.output.head.nullable, "New output should be non-nullable") diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala index 68a3c1851a3a3..2e0ab7f64f4d6 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala @@ -97,7 +97,7 @@ class RemoveRedundantAliasAndProjectSuite extends PlanTest with PredicateHelper val r2 = LocalRelation('b.int) val query = r1.select('a as 'a).union(r2.select('b as 'b)).select('a).analyze val optimized = Optimize.execute(query) - val expected = r1.union(r2).analyze + val expected = r1.union(r2) comparePlans(optimized, expected) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala index 9d80779b59817..2eea840e21a31 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SetOperationSuite.scala @@ -17,14 +17,13 @@ package org.apache.spark.sql.catalyst.optimizer -import org.apache.spark.sql.catalyst.analysis.{EliminateSubqueryAliases, ResolveUnion} +import org.apache.spark.sql.catalyst.analysis.EliminateSubqueryAliases import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions.{And, GreaterThan, GreaterThanOrEqual, If, Literal, Rand, ReplicateRows} import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules._ -import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.BooleanType class SetOperationSuite extends PlanTest { @@ -93,10 +92,8 @@ class SetOperationSuite extends PlanTest { // query3 query2 val unionQuery1 = Distinct(Union(Distinct(Union(query1, query2)), query3)).analyze val optimized1 = Optimize.execute(unionQuery1) - val children1 = query1 :: query2 :: query3 :: Nil - val unionOutput1 = ResolveUnion.makeUnionOutput(children1) val distinctUnionCorrectAnswer1 = - Distinct(Union(query1 :: query2 :: query3 :: Nil, unionOutput = Some(unionOutput1))) + Distinct(Union(query1 :: query2 :: query3 :: Nil)) comparePlans(distinctUnionCorrectAnswer1, optimized1) // query1 @@ -109,9 +106,8 @@ class SetOperationSuite extends PlanTest { val unionQuery2 = Distinct(Union(Union(query1, query2), Distinct(Union(query2, query3)))).analyze val optimized2 = Optimize.execute(unionQuery2) - val children2 = query1 :: query2 :: query2 :: query3 :: Nil - val unionOutput2 = ResolveUnion.makeUnionOutput(children2) - val distinctUnionCorrectAnswer2 = Distinct(Union(children2, unionOutput = Some(unionOutput2))) + val distinctUnionCorrectAnswer2 = + Distinct(Union(query1 :: query2 :: query2 :: query3 :: Nil)) comparePlans(distinctUnionCorrectAnswer2, optimized2) } 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 ba2429ca502c5..b84207397e5cc 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 @@ -259,11 +259,9 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB (nameToAttr("t1.v-1-10") === nameToAttr("t3.v-1-100"))) .select(nameToAttr("t1.v-1-10")) - val originalPlan = { - val p = bottomJoins.union(t4.select(nameToAttr("t4.v-1-10"))).analyze - val leftKey = p.output.head // t1.v-1-10 - p.join(t5, Inner, Some(leftKey === nameToAttr("t5.v-1-5"))) - } + val originalPlan = bottomJoins + .union(t4.select(nameToAttr("t4.v-1-10"))) + .join(t5, Inner, Some(nameToAttr("t1.v-1-10") === nameToAttr("t5.v-1-5"))) // Should be able to reorder the bottom part. // Best order: @@ -282,11 +280,9 @@ class JoinReorderSuite extends JoinReorderPlanTestBase with StatsEstimationTestB .join(t2, Inner, Some(nameToAttr("t1.k-1-2") === nameToAttr("t2.k-1-5"))) .select(nameToAttr("t1.v-1-10")) - val bestPlan = { - val p = bestBottomPlan.union(t4.select(nameToAttr("t4.v-1-10"))).analyze - val leftKey = p.output.head // t1.v-1-10 - p.join(t5, Inner, Some(leftKey === nameToAttr("t5.v-1-5"))) - } + val bestPlan = bestBottomPlan + .union(t4.select(nameToAttr("t4.v-1-10"))) + .join(t5, Inner, Some(nameToAttr("t1.v-1-10") === nameToAttr("t5.v-1-5"))) assertEqualJoinPlans(Optimize, originalPlan, bestPlan) } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala index e3570300e0b8c..88afcb10d9c20 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala @@ -243,9 +243,8 @@ class PlanParserSuite extends AnalysisTest { "mismatched input 'from' expecting") assertEqual( "from a insert into tbl1 select * insert into tbl2 select * where s < 10", - Union( - table("a").select(star()).insertInto("tbl1"), - table("a").where('s < 10).select(star()).insertInto("tbl2"), Nil)) + table("a").select(star()).insertInto("tbl1").union( + table("a").where('s < 10).select(star()).insertInto("tbl2"))) assertEqual( "select * from (from a select * select *)", table("a").select(star()) @@ -311,9 +310,7 @@ class PlanParserSuite extends AnalysisTest { // Multi insert val plan2 = table("t").where('x > 5).select(star()) assertEqual("from t insert into s select * limit 1 insert into u select * where x > 5", - Union( - plan.limit(1).insertInto("s"), - plan2.insertInto("u"), Nil)) + plan.limit(1).insertInto("s").union(plan2.insertInto("u"))) } test("aggregation") { @@ -416,7 +413,7 @@ class PlanParserSuite extends AnalysisTest { .generate(jsonTuple, alias = Some("jtup"), outputNames = Seq("q", "z")) .select(star()) .insertInto("t2"), - from.where('s < 10).select(star()).insertInto("t3"), Nil)) + from.where('s < 10).select(star()).insertInto("t3"))) // Unresolved generator. val expected = table("t") diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala index 5edd74e5cc1ba..5ad748b6113d6 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/ConstraintPropagationSuite.scala @@ -157,32 +157,28 @@ class ConstraintPropagationSuite extends SparkFunSuite with PlanTest { .union(tr2.where('e.attr > 10) .union(tr3.where('i.attr > 10))) .analyze.constraints.isEmpty) - val query1 = tr1 + + verifyConstraints(tr1 .where('a.attr > 10) .union(tr2.where('d.attr > 10) .union(tr3.where('g.attr > 10))) - .analyze - verifyConstraints(query1.constraints, - ExpressionSet(Seq(resolveColumn(query1, "a") > 10, - IsNotNull(resolveColumn(query1, "a"))))) + .analyze.constraints, + ExpressionSet(Seq(resolveColumn(tr1, "a") > 10, + IsNotNull(resolveColumn(tr1, "a"))))) - val query2 = tr1 + val a = resolveColumn(tr1, "a") + verifyConstraints(tr1 .where('a.attr > 10) .union(tr2.where('d.attr > 11)) - .analyze - verifyConstraints(query2.constraints, - ExpressionSet(Seq(resolveColumn(query2, "a") > 10 || resolveColumn(query2, "a") > 11, - IsNotNull(resolveColumn(query2, "a"))))) - + .analyze.constraints, + ExpressionSet(Seq(a > 10 || a > 11, IsNotNull(a)))) - val query3 = tr1 + val b = resolveColumn(tr1, "b") + verifyConstraints(tr1 .where('a.attr > 10 && 'b.attr < 10) .union(tr2.where('d.attr > 11 && 'e.attr < 11)) - .analyze - verifyConstraints(query3.constraints, - ExpressionSet(Seq(resolveColumn(query3, "a") > 10 || resolveColumn(query3, "a") > 11, - resolveColumn(query3, "b") < 10 || resolveColumn(query3, "b") < 11, - IsNotNull(resolveColumn(query3, "a")), IsNotNull(resolveColumn(query3, "b"))))) + .analyze.constraints, + ExpressionSet(Seq(a > 10 || a > 11, b < 10 || b < 11, IsNotNull(a), IsNotNull(b)))) } test("propagating constraints in intersect") { diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala index 40acf2298c880..abea4a7a8eaff 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala @@ -692,7 +692,7 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { case logical.GlobalLimit(IntegerLiteral(limit), child) => execution.GlobalLimitExec(limit, planLater(child)) :: Nil case union: logical.Union => - execution.UnionExec(union.children.map(planLater), union.unionOutput.get) :: Nil + execution.UnionExec(union.children.map(planLater), union.unionOutput) :: Nil case g @ logical.Generate(generator, _, outer, _, _, child) => execution.GenerateExec( generator, g.requiredChildOutput, outer, diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 9fdcaa9e2be8c..6bc775cf26b81 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -636,6 +636,8 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) */ case class UnionExec(children: Seq[SparkPlan], output: Seq[Attribute]) extends SparkPlan { + assert(output.nonEmpty, "Union should have at least a single column") + override def producedAttributes: AttributeSet = AttributeSet(output) protected override def doExecute(): RDD[InternalRow] = diff --git a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out index 22603ad0b1228..3a850160b43e0 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out @@ -239,7 +239,6 @@ Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) (5) Union -Arguments: [key#x, val#x] (6) HashAggregate Input [2]: [key#x, val#x] diff --git a/sql/core/src/test/resources/sql-tests/results/explain.sql.out b/sql/core/src/test/resources/sql-tests/results/explain.sql.out index 9bb97decea60a..6b3b71f85ced2 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain.sql.out @@ -216,7 +216,6 @@ Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) (7) Union -Arguments: [key#x, val#x] (8) HashAggregate [codegen id : 3] Input [2]: [key#x, val#x] 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 ad9442139da10..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 @@ -147,58 +147,57 @@ 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] (22) Union -Arguments: [customer_sk#15] (23) Exchange -Input [1]: [customer_sk#15] -Arguments: hashpartitioning(customer_sk#15, 5), true, [id=#16] +Input [1]: [customer_sk#11] +Arguments: hashpartitioning(customer_sk#11, 5), true, [id=#15] (24) Sort [codegen id : 7] -Input [1]: [customer_sk#15] -Arguments: [customer_sk#15 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#11] +Arguments: [customer_sk#11 ASC NULLS FIRST], false, 0 (25) SortMergeJoin Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#15] +Right keys [1]: [customer_sk#11] Join condition: None (26) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#17, ss_customer_sk#18] +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 (27) ColumnarToRow [codegen id : 9] -Input [2]: [ss_sold_date_sk#17, ss_customer_sk#18] +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] (28) Filter [codegen id : 9] -Input [2]: [ss_sold_date_sk#17, ss_customer_sk#18] -Condition : (isnotnull(ss_sold_date_sk#17) AND isnotnull(ss_customer_sk#18)) +Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Condition : (isnotnull(ss_sold_date_sk#16) AND isnotnull(ss_customer_sk#17)) (29) ReusedExchange [Reuses operator id: 13] Output [1]: [d_date_sk#7] (30) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [ss_sold_date_sk#17] +Left keys [1]: [ss_sold_date_sk#16] Right keys [1]: [d_date_sk#7] Join condition: None (31) Project [codegen id : 9] -Output [1]: [ss_customer_sk#18 AS customer_sk#19] -Input [3]: [ss_sold_date_sk#17, ss_customer_sk#18, d_date_sk#7] +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] (32) Exchange -Input [1]: [customer_sk#19] -Arguments: hashpartitioning(customer_sk#19, 5), true, [id=#20] +Input [1]: [customer_sk#18] +Arguments: hashpartitioning(customer_sk#18, 5), true, [id=#19] (33) Sort [codegen id : 10] -Input [1]: [customer_sk#19] -Arguments: [customer_sk#19 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#18] +Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0 (34) SortMergeJoin Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#19] +Right keys [1]: [customer_sk#18] Join condition: None (35) Project [codegen id : 12] @@ -206,82 +205,82 @@ 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#21, ca_county#22] +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#21, ca_county#22] +Input [2]: [ca_address_sk#20, ca_county#21] (38) Filter [codegen id : 11] -Input [2]: [ca_address_sk#21, ca_county#22] -Condition : (ca_county#22 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#21)) +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#21] -Input [2]: [ca_address_sk#21, ca_county#22] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_county#21] (40) BroadcastExchange -Input [1]: [ca_address_sk#21] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +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]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#21] +Right keys [1]: [ca_address_sk#20] 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#21] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] (43) BroadcastExchange Input [1]: [c_current_cdemo_sk#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (44) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +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] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct (45) ColumnarToRow -Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [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] (46) Filter -Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] -Condition : isnotnull(cd_demo_sk#25) +Input [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] +Condition : isnotnull(cd_demo_sk#24) (47) BroadcastHashJoin [codegen id : 13] Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#25] +Right keys [1]: [cd_demo_sk#24] Join condition: None (48) Project [codegen id : 13] -Output [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] -Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +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] (49) HashAggregate [codegen id : 13] -Input [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] -Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +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] +Keys [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] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#34] -Results [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] +Aggregate Attributes [1]: [count#33] +Results [9]: [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, count#34] (50) Exchange -Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] -Arguments: hashpartitioning(cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), true, [id=#36] +Input [9]: [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, count#34] +Arguments: hashpartitioning(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, 5), true, [id=#35] (51) HashAggregate [codegen id : 14] -Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#35] -Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [9]: [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, count#34] +Keys [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] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#37] -Results [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, count(1)#37 AS cnt1#38, cd_purchase_estimate#29, count(1)#37 AS cnt2#39, cd_credit_rating#30, count(1)#37 AS cnt3#40, cd_dep_count#31, count(1)#37 AS cnt4#41, cd_dep_employed_count#32, count(1)#37 AS cnt5#42, cd_dep_college_count#33, count(1)#37 AS cnt6#43] +Aggregate Attributes [1]: [count(1)#36] +Results [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, count(1)#36 AS cnt1#37, cd_purchase_estimate#28, count(1)#36 AS cnt2#38, cd_credit_rating#29, count(1)#36 AS cnt3#39, cd_dep_count#30, count(1)#36 AS cnt4#40, cd_dep_employed_count#31, count(1)#36 AS cnt5#41, cd_dep_college_count#32, count(1)#36 AS cnt6#42] (52) TakeOrderedAndProject -Input [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#38, cd_purchase_estimate#29, cnt2#39, cd_credit_rating#30, cnt3#40, cd_dep_count#31, cnt4#41, cd_dep_employed_count#32, cnt5#42, cd_dep_college_count#33, cnt6#43] -Arguments: 100, [cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_education_status#28 ASC NULLS FIRST, cd_purchase_estimate#29 ASC NULLS FIRST, cd_credit_rating#30 ASC NULLS FIRST, cd_dep_count#31 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#38, cd_purchase_estimate#29, cnt2#39, cd_credit_rating#30, cnt3#40, cd_dep_count#31, cnt4#41, cd_dep_employed_count#32, cnt5#42, cd_dep_college_count#33, cnt6#43] +Input [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_employed_count#31, cnt5#41, cd_dep_college_count#32, cnt6#42] +Arguments: 100, [cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_education_status#27 ASC NULLS FIRST, cd_purchase_estimate#28 ASC NULLS FIRST, cd_credit_rating#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_employed_count#31, cnt5#41, cd_dep_college_count#32, cnt6#42] 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 8b6129b024b7f..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 @@ -29,7 +29,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Sort [customer_sk] InputAdapter Exchange [customer_sk] #4 - Union [customer_sk] + Union WholeStageCodegen (4) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt index dbd55e486a555..20f60b396c78e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt @@ -135,50 +135,49 @@ Output [1]: [cs_ship_customer_sk#12 AS customer_sk#13] Input [3]: [cs_sold_date_sk#11, cs_ship_customer_sk#12, d_date_sk#6] (20) Union -Arguments: [customer_sk#14] (21) BroadcastExchange -Input [1]: [customer_sk#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] +Input [1]: [customer_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] (22) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#14] +Right keys [1]: [customer_sk#10] Join condition: None (23) Scan parquet default.store_sales -Output [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Output [2]: [ss_sold_date_sk#15, ss_customer_sk#16] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_customer_sk)] ReadSchema: struct (24) ColumnarToRow [codegen id : 6] -Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] +Input [2]: [ss_sold_date_sk#15, ss_customer_sk#16] (25) Filter [codegen id : 6] -Input [2]: [ss_sold_date_sk#16, ss_customer_sk#17] -Condition : (isnotnull(ss_sold_date_sk#16) AND isnotnull(ss_customer_sk#17)) +Input [2]: [ss_sold_date_sk#15, ss_customer_sk#16] +Condition : (isnotnull(ss_sold_date_sk#15) AND isnotnull(ss_customer_sk#16)) (26) ReusedExchange [Reuses operator id: 11] Output [1]: [d_date_sk#6] (27) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [ss_sold_date_sk#16] +Left keys [1]: [ss_sold_date_sk#15] Right keys [1]: [d_date_sk#6] Join condition: None (28) Project [codegen id : 6] -Output [1]: [ss_customer_sk#17 AS customer_sk#18] -Input [3]: [ss_sold_date_sk#16, ss_customer_sk#17, d_date_sk#6] +Output [1]: [ss_customer_sk#16 AS customer_sk#17] +Input [3]: [ss_sold_date_sk#15, ss_customer_sk#16, d_date_sk#6] (29) BroadcastExchange -Input [1]: [customer_sk#18] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] +Input [1]: [customer_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] (30) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [customer_sk#18] +Right keys [1]: [customer_sk#17] Join condition: None (31) Project [codegen id : 9] @@ -186,82 +185,82 @@ 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] (32) Scan parquet default.customer_address -Output [2]: [ca_address_sk#20, ca_county#21] +Output [2]: [ca_address_sk#19, ca_county#20] 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 (33) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#20, ca_county#21] +Input [2]: [ca_address_sk#19, ca_county#20] (34) Filter [codegen id : 7] -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)) +Input [2]: [ca_address_sk#19, ca_county#20] +Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19)) (35) Project [codegen id : 7] -Output [1]: [ca_address_sk#20] -Input [2]: [ca_address_sk#20, ca_county#21] +Output [1]: [ca_address_sk#19] +Input [2]: [ca_address_sk#19, ca_county#20] (36) BroadcastExchange -Input [1]: [ca_address_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] +Input [1]: [ca_address_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] (37) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#20] +Right keys [1]: [ca_address_sk#19] Join condition: None (38) Project [codegen id : 9] Output [1]: [c_current_cdemo_sk#2] -Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#19] (39) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Output [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_demographics] PushedFilters: [IsNotNull(cd_demo_sk)] ReadSchema: struct (40) ColumnarToRow [codegen id : 8] -Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (41) Filter [codegen id : 8] -Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Condition : isnotnull(cd_demo_sk#23) +Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Condition : isnotnull(cd_demo_sk#22) (42) BroadcastExchange -Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] (43) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#23] +Right keys [1]: [cd_demo_sk#22] Join condition: None (44) Project [codegen id : 9] -Output [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Output [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [10]: [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, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] (45) HashAggregate [codegen id : 9] -Input [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Input [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#33] -Results [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] +Aggregate Attributes [1]: [count#32] +Results [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] (46) Exchange -Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] -Arguments: hashpartitioning(cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, 5), true, [id=#35] +Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] +Arguments: hashpartitioning(cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), true, [id=#34] (47) HashAggregate [codegen id : 10] -Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#34] -Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33] +Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#36] -Results [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, count(1)#36 AS cnt1#37, cd_purchase_estimate#27, count(1)#36 AS cnt2#38, cd_credit_rating#28, count(1)#36 AS cnt3#39, cd_dep_count#29, count(1)#36 AS cnt4#40, cd_dep_employed_count#30, count(1)#36 AS cnt5#41, cd_dep_college_count#31, count(1)#36 AS cnt6#42] +Aggregate Attributes [1]: [count(1)#35] +Results [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, count(1)#35 AS cnt1#36, cd_purchase_estimate#26, count(1)#35 AS cnt2#37, cd_credit_rating#27, count(1)#35 AS cnt3#38, cd_dep_count#28, count(1)#35 AS cnt4#39, cd_dep_employed_count#29, count(1)#35 AS cnt5#40, cd_dep_college_count#30, count(1)#35 AS cnt6#41] (48) TakeOrderedAndProject -Input [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#37, cd_purchase_estimate#27, cnt2#38, cd_credit_rating#28, cnt3#39, cd_dep_count#29, cnt4#40, cd_dep_employed_count#30, cnt5#41, cd_dep_college_count#31, cnt6#42] -Arguments: 100, [cd_gender#24 ASC NULLS FIRST, cd_marital_status#25 ASC NULLS FIRST, cd_education_status#26 ASC NULLS FIRST, cd_purchase_estimate#27 ASC NULLS FIRST, cd_credit_rating#28 ASC NULLS FIRST, cd_dep_count#29 ASC NULLS FIRST, cd_dep_employed_count#30 ASC NULLS FIRST, cd_dep_college_count#31 ASC NULLS FIRST], [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#37, cd_purchase_estimate#27, cnt2#38, cd_credit_rating#28, cnt3#39, cd_dep_count#29, cnt4#40, cd_dep_employed_count#30, cnt5#41, cd_dep_college_count#31, cnt6#42] +Input [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41] +Arguments: 100, [cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_education_status#25 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#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], [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt index 5df74f059c414..af1d5a891165b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt @@ -18,7 +18,7 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] InputAdapter BroadcastExchange #2 - Union [customer_sk] + Union WholeStageCodegen (2) Project [ws_bill_customer_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] 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 ebb713b4de0e5..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 @@ -421,9 +421,8 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union -Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] -Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] 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 1a1a7eb200ba5..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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt index 954d62987ca8f..c9724bed3e593 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt @@ -421,9 +421,8 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union -Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] -Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt index 6db3a0becf658..7f4d66577e9c0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter 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 62443718c2308..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 @@ -1,92 +1,91 @@ == Physical Plan == -TakeOrderedAndProject (88) -+- * Project (87) - +- * SortMergeJoin Inner (86) - :- * Project (68) - : +- * SortMergeJoin Inner (67) - : :- * Project (47) - : : +- * SortMergeJoin Inner (46) - : : :- * Sort (25) - : : : +- Exchange (24) - : : : +- * Project (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (45) - : : +- Exchange (44) - : : +- * HashAggregate (43) - : : +- Exchange (42) - : : +- * HashAggregate (41) - : : +- * Project (40) - : : +- * SortMergeJoin Inner (39) - : : :- * Sort (36) - : : : +- Exchange (35) - : : : +- * Project (34) - : : : +- * BroadcastHashJoin Inner BuildRight (33) - : : : :- * Filter (28) - : : : : +- * ColumnarToRow (27) - : : : : +- Scan parquet default.store_sales (26) - : : : +- BroadcastExchange (32) - : : : +- * Filter (31) - : : : +- * ColumnarToRow (30) - : : : +- Scan parquet default.date_dim (29) - : : +- * Sort (38) - : : +- ReusedExchange (37) - : +- * Sort (66) - : +- Exchange (65) - : +- * Project (64) - : +- * Filter (63) - : +- * HashAggregate (62) - : +- Exchange (61) - : +- * HashAggregate (60) - : +- * Project (59) - : +- * SortMergeJoin Inner (58) - : :- * Sort (55) - : : +- Exchange (54) - : : +- * Project (53) - : : +- * BroadcastHashJoin Inner BuildRight (52) - : : :- * Filter (50) - : : : +- * ColumnarToRow (49) - : : : +- Scan parquet default.web_sales (48) - : : +- ReusedExchange (51) - : +- * Sort (57) - : +- ReusedExchange (56) - +- * Sort (85) - +- Exchange (84) - +- * HashAggregate (83) - +- Exchange (82) - +- * HashAggregate (81) - +- * Project (80) - +- * SortMergeJoin Inner (79) - :- * Sort (76) - : +- Exchange (75) - : +- * Project (74) - : +- * BroadcastHashJoin Inner BuildRight (73) - : :- * Filter (71) - : : +- * ColumnarToRow (70) - : : +- Scan parquet default.web_sales (69) - : +- ReusedExchange (72) - +- * Sort (78) - +- ReusedExchange (77) +TakeOrderedAndProject (87) ++- * Project (86) + +- * SortMergeJoin Inner (85) + :- * Project (67) + : +- * SortMergeJoin Inner (66) + : :- * Project (46) + : : +- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * 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) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (65) + : +- Exchange (64) + : +- * Project (63) + : +- * Filter (62) + : +- * HashAggregate (61) + : +- Exchange (60) + : +- * HashAggregate (59) + : +- * Project (58) + : +- * SortMergeJoin Inner (57) + : :- * Sort (54) + : : +- Exchange (53) + : : +- * Project (52) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) + : +- * Sort (56) + : +- ReusedExchange (55) + +- * Sort (84) + +- Exchange (83) + +- * HashAggregate (82) + +- Exchange (81) + +- * HashAggregate (80) + +- * Project (79) + +- * SortMergeJoin Inner (78) + :- * Sort (75) + : +- Exchange (74) + : +- * Project (73) + : +- * BroadcastHashJoin Inner BuildRight (72) + : :- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.web_sales (68) + : +- ReusedExchange (71) + +- * Sort (77) + +- ReusedExchange (76) (1) Scan parquet default.store_sales @@ -191,297 +190,293 @@ Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue( Input [2]: [customer_id#22, year_total#23] Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) -(23) Project [codegen id : 7] -Output [2]: [customer_id#22 AS customer_id#24, year_total#23 AS year_total#25] +(23) Exchange Input [2]: [customer_id#22, year_total#23] +Arguments: hashpartitioning(customer_id#22, 5), true, [id=#24] -(24) Exchange -Input [2]: [customer_id#24, year_total#25] -Arguments: hashpartitioning(customer_id#24, 5), true, [id=#26] - -(25) Sort [codegen id : 8] -Input [2]: [customer_id#24, year_total#25] -Arguments: [customer_id#24 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 8] +Input [2]: [customer_id#22, year_total#23] +Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 -(26) Scan parquet default.store_sales +(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] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(27) ColumnarToRow [codegen id : 10] +(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] -(28) Filter [codegen id : 10] +(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)) -(29) Scan parquet default.date_dim +(28) 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 -(30) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#5, d_year#6] -(31) Filter [codegen id : 9] +(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)) -(32) BroadcastExchange +(31) BroadcastExchange Input [2]: [d_date_sk#5, d_year#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] -(33) BroadcastHashJoin [codegen id : 10] +(32) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#5] Join condition: None -(34) Project [codegen id : 10] +(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] -(35) Exchange +(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=#28] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#26] -(36) Sort [codegen id : 11] +(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 -(37) ReusedExchange [Reuses operator id: 15] +(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] -(38) Sort [codegen id : 13] +(37) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(39) SortMergeJoin [codegen id : 14] +(38) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None -(40) Project [codegen id : 14] +(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] -(41) HashAggregate [codegen id : 14] +(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)))] -Aggregate Attributes [1]: [sum#29] -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#30] +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] -(42) 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#30] -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=#31] +(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] -(43) 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#30] +(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)))#32] -Results [3]: [c_customer_id#10 AS customer_id#33, c_preferred_cust_flag#13 AS customer_preferred_cust_flag#34, 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)))#32,18,2) AS year_total#35] +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] -(44) Exchange -Input [3]: [customer_id#33, customer_preferred_cust_flag#34, year_total#35] -Arguments: hashpartitioning(customer_id#33, 5), true, [id=#36] +(43) Exchange +Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] +Arguments: hashpartitioning(customer_id#31, 5), true, [id=#34] -(45) Sort [codegen id : 16] -Input [3]: [customer_id#33, customer_preferred_cust_flag#34, year_total#35] -Arguments: [customer_id#33 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 16] +Input [3]: [customer_id#31, customer_preferred_cust_flag#32, year_total#33] +Arguments: [customer_id#31 ASC NULLS FIRST], false, 0 -(46) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#33] +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#31] Join condition: None -(47) Project [codegen id : 17] -Output [4]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35] -Input [5]: [customer_id#24, year_total#25, customer_id#33, customer_preferred_cust_flag#34, year_total#35] +(46) Project [codegen id : 17] +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] -(48) 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] +(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 [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] +(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 [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) 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)) -(51) ReusedExchange [Reuses operator id: 7] +(50) ReusedExchange [Reuses operator id: 7] Output [2]: [d_date_sk#5, d_year#6] -(52) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#37] +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#35] Right keys [1]: [d_date_sk#5] Join condition: None -(53) 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] +(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] -(54) Exchange -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) Exchange +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] -(55) Sort [codegen id : 20] -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) Sort [codegen id : 20] +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 -(56) ReusedExchange [Reuses operator id: 15] +(55) 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] -(57) Sort [codegen id : 22] +(56) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(58) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#38] +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#36] Right keys [1]: [c_customer_sk#9] Join condition: None -(59) 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] +(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] -(60) 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] +(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] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#42] -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#43] +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] -(61) 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#43] -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=#44] +(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] -(62) 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#43] +(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] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45] -Results [2]: [c_customer_id#10 AS customer_id#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45,18,2) AS year_total#47] +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] -(63) Filter [codegen id : 24] -Input [2]: [customer_id#46, year_total#47] -Condition : (isnotnull(year_total#47) AND (year_total#47 > 0.00)) +(62) Filter [codegen id : 24] +Input [2]: [customer_id#44, year_total#45] +Condition : (isnotnull(year_total#45) AND (year_total#45 > 0.00)) -(64) Project [codegen id : 24] -Output [2]: [customer_id#46 AS customer_id#48, year_total#47 AS year_total#49] -Input [2]: [customer_id#46, year_total#47] +(63) Project [codegen id : 24] +Output [2]: [customer_id#44 AS customer_id#46, year_total#45 AS year_total#47] +Input [2]: [customer_id#44, year_total#45] -(65) Exchange -Input [2]: [customer_id#48, year_total#49] -Arguments: hashpartitioning(customer_id#48, 5), true, [id=#50] +(64) Exchange +Input [2]: [customer_id#46, year_total#47] +Arguments: hashpartitioning(customer_id#46, 5), true, [id=#48] -(66) Sort [codegen id : 25] -Input [2]: [customer_id#48, year_total#49] -Arguments: [customer_id#48 ASC NULLS FIRST], false, 0 +(65) Sort [codegen id : 25] +Input [2]: [customer_id#46, year_total#47] +Arguments: [customer_id#46 ASC NULLS FIRST], false, 0 -(67) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#48] +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#46] Join condition: None -(68) Project [codegen id : 26] -Output [5]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, year_total#49] -Input [6]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, customer_id#48, year_total#49] +(67) Project [codegen id : 26] +Output [5]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, year_total#47] +Input [6]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, customer_id#46, year_total#47] -(69) 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] +(68) 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 -(70) ColumnarToRow [codegen id : 28] -Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] +(69) ColumnarToRow [codegen id : 28] +Input [4]: [ws_sold_date_sk#35, ws_bill_customer_sk#36, ws_ext_discount_amt#37, ws_ext_list_price#38] -(71) Filter [codegen id : 28] -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)) +(70) Filter [codegen id : 28] +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)) -(72) ReusedExchange [Reuses operator id: 32] +(71) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#5, d_year#6] -(73) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#37] +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#35] Right keys [1]: [d_date_sk#5] Join condition: None -(74) Project [codegen id : 28] -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] +(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] -(75) Exchange -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=#51] +(74) Exchange +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] -(76) Sort [codegen id : 29] -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 +(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] +Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0 -(77) ReusedExchange [Reuses operator id: 15] +(76) 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] -(78) Sort [codegen id : 31] +(77) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(79) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#38] +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#36] Right keys [1]: [c_customer_sk#9] Join condition: None -(80) 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#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] +(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] -(81) 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#39, ws_ext_list_price#40, d_year#6] +(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] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#52] -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#53] +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] -(82) 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#53] -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=#54] +(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] -(83) 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#53] +(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] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55] -Results [2]: [c_customer_id#10 AS customer_id#56, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55,18,2) AS year_total#57] - -(84) Exchange -Input [2]: [customer_id#56, year_total#57] -Arguments: hashpartitioning(customer_id#56, 5), true, [id=#58] - -(85) Sort [codegen id : 34] -Input [2]: [customer_id#56, year_total#57] -Arguments: [customer_id#56 ASC NULLS FIRST], false, 0 - -(86) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#56] -Join condition: (CASE WHEN (year_total#49 > 0.00) THEN CheckOverflow((promote_precision(year_total#57) / promote_precision(year_total#49)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#25 > 0.00) THEN CheckOverflow((promote_precision(year_total#35) / promote_precision(year_total#25)), DecimalType(38,20), true) ELSE null END) - -(87) Project [codegen id : 35] -Output [1]: [customer_preferred_cust_flag#34] -Input [7]: [customer_id#24, year_total#25, customer_preferred_cust_flag#34, year_total#35, year_total#49, customer_id#56, year_total#57] - -(88) TakeOrderedAndProject -Input [1]: [customer_preferred_cust_flag#34] -Arguments: 100, [customer_preferred_cust_flag#34 ASC NULLS FIRST], [customer_preferred_cust_flag#34] +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] + +(83) Exchange +Input [2]: [customer_id#54, year_total#55] +Arguments: hashpartitioning(customer_id#54, 5), true, [id=#56] + +(84) Sort [codegen id : 34] +Input [2]: [customer_id#54, year_total#55] +Arguments: [customer_id#54 ASC NULLS FIRST], false, 0 + +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#54] +Join condition: (CASE WHEN (year_total#47 > 0.00) THEN CheckOverflow((promote_precision(year_total#55) / promote_precision(year_total#47)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#33) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE null END) + +(86) Project [codegen id : 35] +Output [1]: [customer_preferred_cust_flag#32] +Input [7]: [customer_id#22, year_total#23, customer_preferred_cust_flag#32, year_total#33, year_total#47, customer_id#54, year_total#55] + +(87) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#32] +Arguments: 100, [customer_preferred_cust_flag#32 ASC NULLS FIRST], [customer_preferred_cust_flag#32] 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 7ceaae76e2b9c..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 @@ -16,44 +16,43 @@ TakeOrderedAndProject [customer_preferred_cust_flag] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt index d7d0f8b888b3b..246a5d5b0b586 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt @@ -1,78 +1,77 @@ == Physical Plan == -TakeOrderedAndProject (74) -+- * Project (73) - +- * BroadcastHashJoin Inner BuildRight (72) - :- * Project (58) - : +- * BroadcastHashJoin Inner BuildRight (57) - : :- * Project (38) - : : +- * BroadcastHashJoin Inner BuildRight (37) - : : :- * Project (20) - : : : +- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (36) - : : +- * HashAggregate (35) - : : +- Exchange (34) - : : +- * HashAggregate (33) - : : +- * Project (32) - : : +- * BroadcastHashJoin Inner BuildRight (31) - : : :- * Project (26) - : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : :- * Filter (23) - : : : : +- * ColumnarToRow (22) - : : : : +- Scan parquet default.customer (21) - : : : +- ReusedExchange (24) - : : +- BroadcastExchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.date_dim (27) - : +- BroadcastExchange (56) - : +- * Project (55) - : +- * Filter (54) - : +- * HashAggregate (53) - : +- Exchange (52) - : +- * HashAggregate (51) - : +- * Project (50) - : +- * BroadcastHashJoin Inner BuildRight (49) - : :- * Project (47) - : : +- * BroadcastHashJoin Inner BuildRight (46) - : : :- * Filter (41) - : : : +- * ColumnarToRow (40) - : : : +- Scan parquet default.customer (39) - : : +- BroadcastExchange (45) - : : +- * Filter (44) - : : +- * ColumnarToRow (43) - : : +- Scan parquet default.web_sales (42) - : +- ReusedExchange (48) - +- BroadcastExchange (71) - +- * HashAggregate (70) - +- Exchange (69) - +- * HashAggregate (68) - +- * Project (67) - +- * BroadcastHashJoin Inner BuildRight (66) - :- * Project (64) - : +- * BroadcastHashJoin Inner BuildRight (63) - : :- * Filter (61) - : : +- * ColumnarToRow (60) - : : +- Scan parquet default.customer (59) - : +- ReusedExchange (62) - +- ReusedExchange (65) +TakeOrderedAndProject (73) ++- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (57) + : +- * BroadcastHashJoin Inner BuildRight (56) + : :- * Project (37) + : : +- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (35) + : : +- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- ReusedExchange (23) + : : +- BroadcastExchange (29) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.date_dim (26) + : +- BroadcastExchange (55) + : +- * Project (54) + : +- * Filter (53) + : +- * HashAggregate (52) + : +- Exchange (51) + : +- * HashAggregate (50) + : +- * Project (49) + : +- * BroadcastHashJoin Inner BuildRight (48) + : :- * Project (46) + : : +- * BroadcastHashJoin Inner BuildRight (45) + : : :- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.customer (38) + : : +- BroadcastExchange (44) + : : +- * Filter (43) + : : +- * ColumnarToRow (42) + : : +- Scan parquet default.web_sales (41) + : +- ReusedExchange (47) + +- BroadcastExchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Filter (60) + : : +- * ColumnarToRow (59) + : : +- Scan parquet default.customer (58) + : +- ReusedExchange (61) + +- ReusedExchange (64) (1) Scan parquet default.customer @@ -165,256 +164,252 @@ Results [2]: [c_customer_id#2 AS customer_id#21, MakeDecimal(sum(UnscaledValue(C Input [2]: [customer_id#21, year_total#22] Condition : (isnotnull(year_total#22) AND (year_total#22 > 0.00)) -(20) Project [codegen id : 16] -Output [2]: [customer_id#21 AS customer_id#23, year_total#22 AS year_total#24] -Input [2]: [customer_id#21, year_total#22] - -(21) Scan parquet default.customer +(20) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 6] +(21) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(23) Filter [codegen id : 6] +(22) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(24) ReusedExchange [Reuses operator id: 7] +(23) ReusedExchange [Reuses operator id: 7] Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(25) BroadcastHashJoin [codegen id : 6] +(24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(26) Project [codegen id : 6] +(25) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12] Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(27) Scan parquet default.date_dim +(26) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] 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 -(28) ColumnarToRow [codegen id : 5] +(27) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] -(29) Filter [codegen id : 5] +(28) Filter [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) -(30) BroadcastExchange +(29) BroadcastExchange Input [2]: [d_date_sk#14, d_year#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] -(31) BroadcastHashJoin [codegen id : 6] +(30) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#14] Join condition: None -(32) Project [codegen id : 6] +(31) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, d_date_sk#14, d_year#15] -(33) HashAggregate [codegen id : 6] +(32) HashAggregate [codegen id : 6] Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#26] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +Aggregate Attributes [1]: [sum#24] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] -(34) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#28] +(33) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#26] -(35) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +(34) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29] -Results [3]: [c_customer_id#2 AS customer_id#30, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#31, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29,18,2) AS year_total#32] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27] +Results [3]: [c_customer_id#2 AS customer_id#28, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#29, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27,18,2) AS year_total#30] -(36) BroadcastExchange -Input [3]: [customer_id#30, customer_preferred_cust_flag#31, year_total#32] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#33] +(35) BroadcastExchange +Input [3]: [customer_id#28, customer_preferred_cust_flag#29, year_total#30] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#31] -(37) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#30] +(36) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#28] Join condition: None -(38) Project [codegen id : 16] -Output [4]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32] -Input [5]: [customer_id#23, year_total#24, customer_id#30, customer_preferred_cust_flag#31, year_total#32] +(37) Project [codegen id : 16] +Output [4]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30] +Input [5]: [customer_id#21, year_total#22, customer_id#28, customer_preferred_cust_flag#29, year_total#30] -(39) Scan parquet default.customer +(38) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(40) ColumnarToRow [codegen id : 10] +(39) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(41) Filter [codegen id : 10] +(40) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(42) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(41) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(43) ColumnarToRow [codegen id : 8] -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(42) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -(44) Filter [codegen id : 8] -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -Condition : (isnotnull(ws_bill_customer_sk#35) AND isnotnull(ws_sold_date_sk#34)) +(43) Filter [codegen id : 8] +Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +Condition : (isnotnull(ws_bill_customer_sk#33) AND isnotnull(ws_sold_date_sk#32)) -(45) BroadcastExchange -Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#38] +(44) BroadcastExchange +Input [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#36] -(46) BroadcastHashJoin [codegen id : 10] +(45) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#35] +Right keys [1]: [ws_bill_customer_sk#33] Join condition: None -(47) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(46) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -(48) ReusedExchange [Reuses operator id: 13] +(47) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#14, d_year#15] -(49) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#34] +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#32] Right keys [1]: [d_date_sk#14] Join condition: None -(50) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] +(49) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35, d_date_sk#14, d_year#15] -(51) HashAggregate [codegen id : 10] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +(50) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#39] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#37] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] -(52) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#41] +(51) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#39] -(53) HashAggregate [codegen id : 11] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +(52) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#38] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42] -Results [2]: [c_customer_id#2 AS customer_id#43, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42,18,2) AS year_total#44] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#40] +Results [2]: [c_customer_id#2 AS customer_id#41, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#40,18,2) AS year_total#42] -(54) Filter [codegen id : 11] -Input [2]: [customer_id#43, year_total#44] -Condition : (isnotnull(year_total#44) AND (year_total#44 > 0.00)) +(53) Filter [codegen id : 11] +Input [2]: [customer_id#41, year_total#42] +Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) -(55) Project [codegen id : 11] -Output [2]: [customer_id#43 AS customer_id#45, year_total#44 AS year_total#46] -Input [2]: [customer_id#43, year_total#44] +(54) Project [codegen id : 11] +Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] +Input [2]: [customer_id#41, year_total#42] -(56) BroadcastExchange -Input [2]: [customer_id#45, year_total#46] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] +(55) BroadcastExchange +Input [2]: [customer_id#43, year_total#44] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#45] -(57) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#45] +(56) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#43] Join condition: None -(58) Project [codegen id : 16] -Output [5]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, year_total#46] -Input [6]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, customer_id#45, year_total#46] +(57) Project [codegen id : 16] +Output [5]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, year_total#44] +Input [6]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, customer_id#43, year_total#44] -(59) Scan parquet default.customer +(58) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(60) ColumnarToRow [codegen id : 14] +(59) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(61) Filter [codegen id : 14] +(60) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(62) ReusedExchange [Reuses operator id: 45] -Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(61) ReusedExchange [Reuses operator id: 44] +Output [4]: [ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -(63) BroadcastHashJoin [codegen id : 14] +(62) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#35] +Right keys [1]: [ws_bill_customer_sk#33] Join condition: None -(64) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +(63) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_bill_customer_sk#33, ws_ext_discount_amt#34, ws_ext_list_price#35] -(65) ReusedExchange [Reuses operator id: 30] +(64) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#14, d_year#15] -(66) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#34] +(65) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#32] Right keys [1]: [d_date_sk#14] Join condition: None -(67) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] +(66) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#32, ws_ext_discount_amt#34, ws_ext_list_price#35, d_date_sk#14, d_year#15] -(68) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +(67) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#34, ws_ext_list_price#35, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#48] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#46] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] -(69) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#50] +(68) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#48] -(70) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +(69) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#47] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51] -Results [2]: [c_customer_id#2 AS customer_id#52, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51,18,2) AS year_total#53] - -(71) BroadcastExchange -Input [2]: [customer_id#52, year_total#53] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#54] - -(72) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#52] -Join condition: (CASE WHEN (year_total#46 > 0.00) THEN CheckOverflow((promote_precision(year_total#53) / promote_precision(year_total#46)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#32) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE null END) - -(73) Project [codegen id : 16] -Output [1]: [customer_preferred_cust_flag#31] -Input [7]: [customer_id#23, year_total#24, customer_preferred_cust_flag#31, year_total#32, year_total#46, customer_id#52, year_total#53] - -(74) TakeOrderedAndProject -Input [1]: [customer_preferred_cust_flag#31] -Arguments: 100, [customer_preferred_cust_flag#31 ASC NULLS FIRST], [customer_preferred_cust_flag#31] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#49] +Results [2]: [c_customer_id#2 AS customer_id#50, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#35 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#34 as decimal(8,2)))), DecimalType(8,2), true)))#49,18,2) AS year_total#51] + +(70) BroadcastExchange +Input [2]: [customer_id#50, year_total#51] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#52] + +(71) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#50] +Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#51) / promote_precision(year_total#44)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#22 > 0.00) THEN CheckOverflow((promote_precision(year_total#30) / promote_precision(year_total#22)), DecimalType(38,20), true) ELSE null END) + +(72) Project [codegen id : 16] +Output [1]: [customer_preferred_cust_flag#29] +Input [7]: [customer_id#21, year_total#22, customer_preferred_cust_flag#29, year_total#30, year_total#44, customer_id#50, year_total#51] + +(73) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#29] +Arguments: 100, [customer_preferred_cust_flag#29 ASC NULLS FIRST], [customer_preferred_cust_flag#29] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt index 705d31a439d7f..3850cea62922e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt @@ -6,35 +6,34 @@ TakeOrderedAndProject [customer_preferred_cust_flag] BroadcastHashJoin [customer_id,customer_id] Project [customer_id,year_total,customer_preferred_cust_flag,year_total] BroadcastHashJoin [customer_id,customer_id] - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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 bc728c51d526d..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 @@ -696,33 +696,32 @@ Output [6]: [sales#76, number_sales#77, web AS channel#79, i_brand_id#7, i_class 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 -Arguments: [sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85] (127) Expand [codegen id : 118] -Input [6]: [sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85] -Arguments: [List(sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, i_category_id#85, 0), List(sales#80, number_sales#81, channel#82, i_brand_id#83, i_class_id#84, null, 1), List(sales#80, number_sales#81, channel#82, i_brand_id#83, null, null, 3), List(sales#80, number_sales#81, channel#82, null, null, null, 7), List(sales#80, number_sales#81, null, null, null, null, 15)], [sales#80, number_sales#81, channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] +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#80, number_sales#81, channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] -Keys [5]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] -Functions [2]: [partial_sum(sales#80), partial_sum(number_sales#81)] -Aggregate Attributes [3]: [sum#91, isEmpty#92, sum#93] -Results [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] +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] +Keys [5]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#85, isEmpty#86, sum#87] +Results [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] (129) Exchange -Input [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] -Arguments: hashpartitioning(channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, 5), true, [id=#97] +Input [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] +Arguments: hashpartitioning(channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, 5), true, [id=#91] (130) HashAggregate [codegen id : 119] -Input [8]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90, sum#94, isEmpty#95, sum#96] -Keys [5]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, spark_grouping_id#90] -Functions [2]: [sum(sales#80), sum(number_sales#81)] -Aggregate Attributes [2]: [sum(sales#80)#98, sum(number_sales#81)#99] -Results [6]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales#80)#98 AS sum(sales)#100, sum(number_sales#81)#99 AS sum(number_sales)#101] +Input [8]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84, sum#88, isEmpty#89, sum#90] +Keys [5]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, spark_grouping_id#84] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#92, sum(number_sales#43)#93] +Results [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales#42)#92 AS sum(sales)#94, sum(number_sales#43)#93 AS sum(number_sales)#95] (131) TakeOrderedAndProject -Input [6]: [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales)#100, sum(number_sales)#101] -Arguments: 100, [channel#86 ASC NULLS FIRST, i_brand_id#87 ASC NULLS FIRST, i_class_id#88 ASC NULLS FIRST, i_category_id#89 ASC NULLS FIRST], [channel#86, i_brand_id#87, i_class_id#88, i_category_id#89, sum(sales)#100, sum(number_sales)#101] +Input [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales)#94, sum(number_sales)#95] +Arguments: 100, [channel#80 ASC NULLS FIRST, i_brand_id#81 ASC NULLS FIRST, i_class_id#82 ASC NULLS FIRST, i_category_id#83 ASC NULLS FIRST], [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales)#94, sum(number_sales)#95] ===== Subqueries ===== @@ -789,7 +788,7 @@ Input [2]: [d_date_sk#10, d_year#11] (139) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] +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] @@ -797,7 +796,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (141) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#103, ss_list_price#4 AS list_price#104] +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 @@ -823,7 +822,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (147) Project [codegen id : 4] -Output [2]: [cs_quantity#48 AS quantity#105, cs_list_price#49 AS list_price#106] +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] (148) Scan parquet default.web_sales @@ -849,29 +848,28 @@ Right keys [1]: [d_date_sk#10] Join condition: None (153) Project [codegen id : 6] -Output [2]: [ws_quantity#64 AS quantity#107, ws_list_price#65 AS list_price#108] +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] (154) Union -Arguments: [quantity#109, list_price#110] (155) HashAggregate [codegen id : 7] -Input [2]: [quantity#109, list_price#110] +Input [2]: [quantity#97, list_price#98] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#111, count#112] -Results [2]: [sum#113, count#114] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#103, count#104] +Results [2]: [sum#105, count#106] (156) Exchange -Input [2]: [sum#113, count#114] -Arguments: SinglePartition, true, [id=#115] +Input [2]: [sum#105, count#106] +Arguments: SinglePartition, true, [id=#107] (157) HashAggregate [codegen id : 8] -Input [2]: [sum#113, count#114] +Input [2]: [sum#105, count#106] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))#116] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#109 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#110 as decimal(12,2)))), DecimalType(18,2), true))#116 AS average_sales#117] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))#108] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#97 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#98 as decimal(12,2)))), DecimalType(18,2), true))#108 AS average_sales#109] Subquery:2 Hosting operator id = 105 Hosting Expression = ReusedSubquery Subquery scalar-subquery#45, [id=#46] 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 2a549de175854..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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] InputAdapter - Union [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] + Union WholeStageCodegen (39) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt index 85ea5e118b9d0..3f0cc9e7acb1e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt @@ -616,33 +616,32 @@ Output [6]: [sales#71, number_sales#72, web AS channel#74, i_brand_id#6, i_class Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#73] (110) Union -Arguments: [sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80] (111) Expand [codegen id : 79] -Input [6]: [sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80] -Arguments: [List(sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, i_category_id#80, 0), List(sales#75, number_sales#76, channel#77, i_brand_id#78, i_class_id#79, null, 1), List(sales#75, number_sales#76, channel#77, i_brand_id#78, null, null, 3), List(sales#75, number_sales#76, channel#77, null, null, null, 7), List(sales#75, number_sales#76, null, null, null, null, 15)], [sales#75, number_sales#76, channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] +Input [6]: [sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Arguments: [List(sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 0), List(sales#39, number_sales#40, channel#44, i_brand_id#6, i_class_id#7, null, 1), List(sales#39, number_sales#40, channel#44, i_brand_id#6, null, null, 3), List(sales#39, number_sales#40, channel#44, null, null, null, 7), List(sales#39, number_sales#40, null, null, null, null, 15)], [sales#39, number_sales#40, channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] (112) HashAggregate [codegen id : 79] -Input [7]: [sales#75, number_sales#76, channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] -Keys [5]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] -Functions [2]: [partial_sum(sales#75), partial_sum(number_sales#76)] -Aggregate Attributes [3]: [sum#86, isEmpty#87, sum#88] -Results [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] +Input [7]: [sales#39, number_sales#40, channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] +Keys [5]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#80, isEmpty#81, sum#82] +Results [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] (113) Exchange -Input [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] -Arguments: hashpartitioning(channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, 5), true, [id=#92] +Input [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] +Arguments: hashpartitioning(channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, 5), true, [id=#86] (114) HashAggregate [codegen id : 80] -Input [8]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85, sum#89, isEmpty#90, sum#91] -Keys [5]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, spark_grouping_id#85] -Functions [2]: [sum(sales#75), sum(number_sales#76)] -Aggregate Attributes [2]: [sum(sales#75)#93, sum(number_sales#76)#94] -Results [6]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales#75)#93 AS sum(sales)#95, sum(number_sales#76)#94 AS sum(number_sales)#96] +Input [8]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79, sum#83, isEmpty#84, sum#85] +Keys [5]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, spark_grouping_id#79] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#87, sum(number_sales#40)#88] +Results [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales#39)#87 AS sum(sales)#89, sum(number_sales#40)#88 AS sum(number_sales)#90] (115) TakeOrderedAndProject -Input [6]: [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales)#95, sum(number_sales)#96] -Arguments: 100, [channel#81 ASC NULLS FIRST, i_brand_id#82 ASC NULLS FIRST, i_class_id#83 ASC NULLS FIRST, i_category_id#84 ASC NULLS FIRST], [channel#81, i_brand_id#82, i_class_id#83, i_category_id#84, sum(sales)#95, sum(number_sales)#96] +Input [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales)#89, sum(number_sales)#90] +Arguments: 100, [channel#75 ASC NULLS FIRST, i_brand_id#76 ASC NULLS FIRST, i_class_id#77 ASC NULLS FIRST, i_category_id#78 ASC NULLS FIRST], [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales)#89, sum(number_sales)#90] ===== Subqueries ===== @@ -709,7 +708,7 @@ Input [2]: [d_date_sk#10, d_year#11] (123) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#97] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#91] (124) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -717,7 +716,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (125) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#98, ss_list_price#4 AS list_price#99] +Output [2]: [ss_quantity#3 AS quantity#92, ss_list_price#4 AS list_price#93] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (126) Scan parquet default.catalog_sales @@ -743,7 +742,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (131) Project [codegen id : 4] -Output [2]: [cs_quantity#45 AS quantity#100, cs_list_price#46 AS list_price#101] +Output [2]: [cs_quantity#45 AS quantity#94, cs_list_price#46 AS list_price#95] Input [4]: [cs_sold_date_sk#16, cs_quantity#45, cs_list_price#46, d_date_sk#10] (132) Scan parquet default.web_sales @@ -769,29 +768,28 @@ Right keys [1]: [d_date_sk#10] Join condition: None (137) Project [codegen id : 6] -Output [2]: [ws_quantity#60 AS quantity#102, ws_list_price#61 AS list_price#103] +Output [2]: [ws_quantity#60 AS quantity#96, ws_list_price#61 AS list_price#97] Input [4]: [ws_sold_date_sk#20, ws_quantity#60, ws_list_price#61, d_date_sk#10] (138) Union -Arguments: [quantity#104, list_price#105] (139) HashAggregate [codegen id : 7] -Input [2]: [quantity#104, list_price#105] +Input [2]: [quantity#92, list_price#93] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#106, count#107] -Results [2]: [sum#108, count#109] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#98, count#99] +Results [2]: [sum#100, count#101] (140) Exchange -Input [2]: [sum#108, count#109] -Arguments: SinglePartition, true, [id=#110] +Input [2]: [sum#100, count#101] +Arguments: SinglePartition, true, [id=#102] (141) HashAggregate [codegen id : 8] -Input [2]: [sum#108, count#109] +Input [2]: [sum#100, count#101] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))#111] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#104 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#105 as decimal(12,2)))), DecimalType(18,2), true))#111 AS average_sales#112] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#103] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#103 AS average_sales#104] Subquery:2 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#42, [id=#43] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt index 1bee1e990d52b..dfa8c1bcc1579 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] InputAdapter - Union [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] + Union WholeStageCodegen (26) Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),su WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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 424c068f9cb3e..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 @@ -736,25 +736,24 @@ 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] (133) Union -Arguments: [quantity#82, list_price#83] (134) HashAggregate [codegen id : 7] -Input [2]: [quantity#82, list_price#83] +Input [2]: [quantity#72, list_price#73] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#84, count#85] -Results [2]: [sum#86, count#87] +Functions [1]: [partial_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))] +Aggregate Attributes [2]: [sum#82, count#83] +Results [2]: [sum#84, count#85] (135) Exchange -Input [2]: [sum#86, count#87] -Arguments: SinglePartition, true, [id=#88] +Input [2]: [sum#84, count#85] +Arguments: SinglePartition, true, [id=#86] (136) HashAggregate [codegen id : 8] -Input [2]: [sum#86, count#87] +Input [2]: [sum#84, count#85] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89 AS average_sales#90] +Functions [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))] +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] * Project (140) @@ -764,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#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 2000)) AND (d_moy#91 = 12)) AND (d_dom#92 = 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#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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] @@ -791,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#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1999)) AND (d_moy#91 = 12)) AND (d_dom#92 = 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#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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 911c66b997afd..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 @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt index 0e0ccc64c05f1..1f31ded51f1ef 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt @@ -689,25 +689,24 @@ Output [2]: [ws_quantity#75 AS quantity#77, ws_list_price#76 AS list_price#78] Input [4]: [ws_sold_date_sk#20, ws_quantity#75, ws_list_price#76, d_date_sk#10] (123) Union -Arguments: [quantity#79, list_price#80] (124) HashAggregate [codegen id : 7] -Input [2]: [quantity#79, list_price#80] +Input [2]: [quantity#69, list_price#70] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#81, count#82] -Results [2]: [sum#83, count#84] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#79, count#80] +Results [2]: [sum#81, count#82] (125) Exchange -Input [2]: [sum#83, count#84] -Arguments: SinglePartition, true, [id=#85] +Input [2]: [sum#81, count#82] +Arguments: SinglePartition, true, [id=#83] (126) HashAggregate [codegen id : 8] -Input [2]: [sum#83, count#84] +Input [2]: [sum#81, count#82] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86 AS average_sales#87] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84 AS average_sales#85] Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#29, [id=#30] * Project (130) @@ -717,22 +716,22 @@ Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquer (127) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] 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 (128) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] (129) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 2000)) AND (d_moy#88 = 12)) AND (d_dom#89 = 11)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 2000)) AND (d_moy#86 = 12)) AND (d_dom#87 = 11)) (130) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] Subquery:3 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#44, [id=#45] @@ -744,21 +743,21 @@ Subquery:4 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] 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 (132) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] (133) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1999)) AND (d_moy#88 = 12)) AND (d_dom#89 = 11)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1999)) AND (d_moy#86 = 12)) AND (d_dom#87 = 11)) (134) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt index c3079dd2643bb..7bbf83e3de707 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt index 0648683149ca8..fe5966bb4dfb3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt @@ -80,155 +80,154 @@ Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_ Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6] (9) Union -Arguments: [sold_date_sk#9, sales_price#10] (10) Scan parquet default.date_dim -Output [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] (12) Filter [codegen id : 3] -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] -Condition : (isnotnull(d_date_sk#11) AND isnotnull(d_week_seq#12)) +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) (13) BroadcastExchange -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [sold_date_sk#9] -Right keys [1]: [d_date_sk#11] +Left keys [1]: [sold_date_sk#3] +Right keys [1]: [d_date_sk#9] Join condition: None (15) Project [codegen id : 4] -Output [3]: [sales_price#10, d_week_seq#12, d_day_name#13] -Input [5]: [sold_date_sk#9, sales_price#10, d_date_sk#11, d_week_seq#12, d_day_name#13] +Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] (16) HashAggregate [codegen id : 4] -Input [3]: [sales_price#10, d_week_seq#12, d_day_name#13] -Keys [1]: [d_week_seq#12] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] -Aggregate Attributes [7]: [sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] -Results [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Keys [1]: [d_week_seq#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] (17) Exchange -Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] -Arguments: hashpartitioning(d_week_seq#12, 5), true, [id=#29] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(d_week_seq#10, 5), true, [id=#27] (18) HashAggregate [codegen id : 6] -Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] -Keys [1]: [d_week_seq#12] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36] -Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36,17,2) AS sat_sales#43] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] (19) Scan parquet default.date_dim -Output [2]: [d_week_seq#44, d_year#45] +Output [2]: [d_week_seq#42, d_year#43] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [2]: [d_week_seq#44, d_year#45] +Input [2]: [d_week_seq#42, d_year#43] (21) Filter [codegen id : 5] -Input [2]: [d_week_seq#44, d_year#45] -Condition : ((isnotnull(d_year#45) AND (d_year#45 = 2001)) AND isnotnull(d_week_seq#44)) +Input [2]: [d_week_seq#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) (22) Project [codegen id : 5] -Output [1]: [d_week_seq#44] -Input [2]: [d_week_seq#44, d_year#45] +Output [1]: [d_week_seq#42] +Input [2]: [d_week_seq#42, d_year#43] (23) BroadcastExchange -Input [1]: [d_week_seq#44] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] (24) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [d_week_seq#12] -Right keys [1]: [d_week_seq#44] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#42] Join condition: None (25) Project [codegen id : 6] -Output [8]: [d_week_seq#12 AS d_week_seq1#47, sun_sales#37 AS sun_sales1#48, mon_sales#38 AS mon_sales1#49, tue_sales#39 AS tue_sales1#50, wed_sales#40 AS wed_sales1#51, thu_sales#41 AS thu_sales1#52, fri_sales#42 AS fri_sales1#53, sat_sales#43 AS sat_sales1#54] -Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#44] +Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] (26) Exchange -Input [8]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54] -Arguments: hashpartitioning(d_week_seq1#47, 5), true, [id=#55] +Input [8]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52] +Arguments: hashpartitioning(d_week_seq1#45, 5), true, [id=#53] (27) Sort [codegen id : 7] -Input [8]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54] -Arguments: [d_week_seq1#47 ASC NULLS FIRST], false, 0 +Input [8]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52] +Arguments: [d_week_seq1#45 ASC NULLS FIRST], false, 0 (28) ReusedExchange [Reuses operator id: 17] -Output [8]: [d_week_seq#12, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] +Output [8]: [d_week_seq#10, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] (29) HashAggregate [codegen id : 13] -Input [8]: [d_week_seq#12, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] -Keys [1]: [d_week_seq#12] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END))#69, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))#70] -Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#63 ELSE null END))#64,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#63 ELSE null END))#65,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#63 ELSE null END))#66,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#63 ELSE null END))#67,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#63 ELSE null END))#68,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#63 ELSE null END))#69,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#63 ELSE null END))#70,17,2) AS sat_sales#43] +Input [8]: [d_week_seq#10, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#61, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#67] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#61,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#62,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#63,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#64,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#65,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#66,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#67,17,2) AS sat_sales#41] (30) Scan parquet default.date_dim -Output [2]: [d_week_seq#71, d_year#72] +Output [2]: [d_week_seq#68, d_year#69] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] ReadSchema: struct (31) ColumnarToRow [codegen id : 12] -Input [2]: [d_week_seq#71, d_year#72] +Input [2]: [d_week_seq#68, d_year#69] (32) Filter [codegen id : 12] -Input [2]: [d_week_seq#71, d_year#72] -Condition : ((isnotnull(d_year#72) AND (d_year#72 = 2002)) AND isnotnull(d_week_seq#71)) +Input [2]: [d_week_seq#68, d_year#69] +Condition : ((isnotnull(d_year#69) AND (d_year#69 = 2002)) AND isnotnull(d_week_seq#68)) (33) Project [codegen id : 12] -Output [1]: [d_week_seq#71] -Input [2]: [d_week_seq#71, d_year#72] +Output [1]: [d_week_seq#68] +Input [2]: [d_week_seq#68, d_year#69] (34) BroadcastExchange -Input [1]: [d_week_seq#71] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#73] +Input [1]: [d_week_seq#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#70] (35) BroadcastHashJoin [codegen id : 13] -Left keys [1]: [d_week_seq#12] -Right keys [1]: [d_week_seq#71] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#68] Join condition: None (36) Project [codegen id : 13] -Output [8]: [d_week_seq#12 AS d_week_seq2#74, sun_sales#37 AS sun_sales2#75, mon_sales#38 AS mon_sales2#76, tue_sales#39 AS tue_sales2#77, wed_sales#40 AS wed_sales2#78, thu_sales#41 AS thu_sales2#79, fri_sales#42 AS fri_sales2#80, sat_sales#43 AS sat_sales2#81] -Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#71] +Output [8]: [d_week_seq#10 AS d_week_seq2#71, sun_sales#35 AS sun_sales2#72, mon_sales#36 AS mon_sales2#73, tue_sales#37 AS tue_sales2#74, wed_sales#38 AS wed_sales2#75, thu_sales#39 AS thu_sales2#76, fri_sales#40 AS fri_sales2#77, sat_sales#41 AS sat_sales2#78] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#68] (37) Exchange -Input [8]: [d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] -Arguments: hashpartitioning((d_week_seq2#74 - 53), 5), true, [id=#82] +Input [8]: [d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] +Arguments: hashpartitioning((d_week_seq2#71 - 53), 5), true, [id=#79] (38) Sort [codegen id : 14] -Input [8]: [d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] -Arguments: [(d_week_seq2#74 - 53) ASC NULLS FIRST], false, 0 +Input [8]: [d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] +Arguments: [(d_week_seq2#71 - 53) ASC NULLS FIRST], false, 0 (39) SortMergeJoin [codegen id : 15] -Left keys [1]: [d_week_seq1#47] -Right keys [1]: [(d_week_seq2#74 - 53)] +Left keys [1]: [d_week_seq1#45] +Right keys [1]: [(d_week_seq2#71 - 53)] Join condition: None (40) Project [codegen id : 15] -Output [8]: [d_week_seq1#47, round(CheckOverflow((promote_precision(sun_sales1#48) / promote_precision(sun_sales2#75)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#83, round(CheckOverflow((promote_precision(mon_sales1#49) / promote_precision(mon_sales2#76)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#84, round(CheckOverflow((promote_precision(tue_sales1#50) / promote_precision(tue_sales2#77)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#85, round(CheckOverflow((promote_precision(wed_sales1#51) / promote_precision(wed_sales2#78)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#86, round(CheckOverflow((promote_precision(thu_sales1#52) / promote_precision(thu_sales2#79)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#87, round(CheckOverflow((promote_precision(fri_sales1#53) / promote_precision(fri_sales2#80)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#88, round(CheckOverflow((promote_precision(sat_sales1#54) / promote_precision(sat_sales2#81)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#89] -Input [16]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54, d_week_seq2#74, sun_sales2#75, mon_sales2#76, tue_sales2#77, wed_sales2#78, thu_sales2#79, fri_sales2#80, sat_sales2#81] +Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#72)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#80, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#73)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#81, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#74)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#82, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#75)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#83, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#76)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#84, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#77)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#85, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#78)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#86] +Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#71, sun_sales2#72, mon_sales2#73, tue_sales2#74, wed_sales2#75, thu_sales2#76, fri_sales2#77, sat_sales2#78] (41) Exchange -Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#83, round((mon_sales1 / mon_sales2), 2)#84, round((tue_sales1 / tue_sales2), 2)#85, round((wed_sales1 / wed_sales2), 2)#86, round((thu_sales1 / thu_sales2), 2)#87, round((fri_sales1 / fri_sales2), 2)#88, round((sat_sales1 / sat_sales2), 2)#89] -Arguments: rangepartitioning(d_week_seq1#47 ASC NULLS FIRST, 5), true, [id=#90] +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#80, round((mon_sales1 / mon_sales2), 2)#81, round((tue_sales1 / tue_sales2), 2)#82, round((wed_sales1 / wed_sales2), 2)#83, round((thu_sales1 / thu_sales2), 2)#84, round((fri_sales1 / fri_sales2), 2)#85, round((sat_sales1 / sat_sales2), 2)#86] +Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), true, [id=#87] (42) Sort [codegen id : 16] -Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#83, round((mon_sales1 / mon_sales2), 2)#84, round((tue_sales1 / tue_sales2), 2)#85, round((wed_sales1 / wed_sales2), 2)#86, round((thu_sales1 / thu_sales2), 2)#87, round((fri_sales1 / fri_sales2), 2)#88, round((sat_sales1 / sat_sales2), 2)#89] -Arguments: [d_week_seq1#47 ASC NULLS FIRST], true, 0 +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#80, round((mon_sales1 / mon_sales2), 2)#81, round((tue_sales1 / tue_sales2), 2)#82, round((wed_sales1 / wed_sales2), 2)#83, round((thu_sales1 / thu_sales2), 2)#84, round((fri_sales1 / fri_sales2), 2)#85, round((sat_sales1 / sat_sales2), 2)#86] +Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt index b3d0992d9f97e..3df7e4c8e6f3f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (16) Project [sales_price,d_week_seq,d_day_name] BroadcastHashJoin [sold_date_sk,d_date_sk] InputAdapter - Union [sold_date_sk,sales_price] + Union WholeStageCodegen (1) Project [ws_sold_date_sk,ws_ext_sales_price] Filter [ws_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt index 9f2dd31a5d146..7eff75a0220a4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt @@ -77,143 +77,142 @@ Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_ Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6] (9) Union -Arguments: [sold_date_sk#9, sales_price#10] (10) Scan parquet default.date_dim -Output [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] (12) Filter [codegen id : 3] -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] -Condition : (isnotnull(d_date_sk#11) AND isnotnull(d_week_seq#12)) +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) (13) BroadcastExchange -Input [3]: [d_date_sk#11, d_week_seq#12, d_day_name#13] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] (14) BroadcastHashJoin [codegen id : 4] -Left keys [1]: [sold_date_sk#9] -Right keys [1]: [d_date_sk#11] +Left keys [1]: [sold_date_sk#3] +Right keys [1]: [d_date_sk#9] Join condition: None (15) Project [codegen id : 4] -Output [3]: [sales_price#10, d_week_seq#12, d_day_name#13] -Input [5]: [sold_date_sk#9, sales_price#10, d_date_sk#11, d_week_seq#12, d_day_name#13] +Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] (16) HashAggregate [codegen id : 4] -Input [3]: [sales_price#10, d_week_seq#12, d_day_name#13] -Keys [1]: [d_week_seq#12] -Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] -Aggregate Attributes [7]: [sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] -Results [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] +Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Keys [1]: [d_week_seq#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] (17) Exchange -Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] -Arguments: hashpartitioning(d_week_seq#12, 5), true, [id=#29] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(d_week_seq#10, 5), true, [id=#27] (18) HashAggregate [codegen id : 12] -Input [8]: [d_week_seq#12, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27, sum#28] -Keys [1]: [d_week_seq#12] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36] -Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#10 ELSE null END))#30,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#10 ELSE null END))#31,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#10 ELSE null END))#32,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#10 ELSE null END))#33,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#10 ELSE null END))#34,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#10 ELSE null END))#35,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#10 ELSE null END))#36,17,2) AS sat_sales#43] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] (19) Scan parquet default.date_dim -Output [2]: [d_week_seq#44, d_year#45] +Output [2]: [d_week_seq#42, d_year#43] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] ReadSchema: struct (20) ColumnarToRow [codegen id : 5] -Input [2]: [d_week_seq#44, d_year#45] +Input [2]: [d_week_seq#42, d_year#43] (21) Filter [codegen id : 5] -Input [2]: [d_week_seq#44, d_year#45] -Condition : ((isnotnull(d_year#45) AND (d_year#45 = 2001)) AND isnotnull(d_week_seq#44)) +Input [2]: [d_week_seq#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) (22) Project [codegen id : 5] -Output [1]: [d_week_seq#44] -Input [2]: [d_week_seq#44, d_year#45] +Output [1]: [d_week_seq#42] +Input [2]: [d_week_seq#42, d_year#43] (23) BroadcastExchange -Input [1]: [d_week_seq#44] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] (24) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [d_week_seq#12] -Right keys [1]: [d_week_seq#44] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#42] Join condition: None (25) Project [codegen id : 12] -Output [8]: [d_week_seq#12 AS d_week_seq1#47, sun_sales#37 AS sun_sales1#48, mon_sales#38 AS mon_sales1#49, tue_sales#39 AS tue_sales1#50, wed_sales#40 AS wed_sales1#51, thu_sales#41 AS thu_sales1#52, fri_sales#42 AS fri_sales1#53, sat_sales#43 AS sat_sales1#54] -Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#44] +Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] (26) ReusedExchange [Reuses operator id: 17] -Output [8]: [d_week_seq#12, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61] +Output [8]: [d_week_seq#10, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59] (27) HashAggregate [codegen id : 11] -Input [8]: [d_week_seq#12, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61] -Keys [1]: [d_week_seq#12] -Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))] -Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))#69] -Results [8]: [d_week_seq#12, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Sunday) THEN sales_price#62 ELSE null END))#63,17,2) AS sun_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Monday) THEN sales_price#62 ELSE null END))#64,17,2) AS mon_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Tuesday) THEN sales_price#62 ELSE null END))#65,17,2) AS tue_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Wednesday) THEN sales_price#62 ELSE null END))#66,17,2) AS wed_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Thursday) THEN sales_price#62 ELSE null END))#67,17,2) AS thu_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Friday) THEN sales_price#62 ELSE null END))#68,17,2) AS fri_sales#42, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#13 = Saturday) THEN sales_price#62 ELSE null END))#69,17,2) AS sat_sales#43] +Input [8]: [d_week_seq#10, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#60, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#61, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#66] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 ELSE null END))#60,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 ELSE null END))#61,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 ELSE null END))#62,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#63,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 ELSE null END))#64,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 ELSE null END))#65,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 ELSE null END))#66,17,2) AS sat_sales#41] (28) Scan parquet default.date_dim -Output [2]: [d_week_seq#70, d_year#71] +Output [2]: [d_week_seq#67, d_year#68] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] ReadSchema: struct (29) ColumnarToRow [codegen id : 10] -Input [2]: [d_week_seq#70, d_year#71] +Input [2]: [d_week_seq#67, d_year#68] (30) Filter [codegen id : 10] -Input [2]: [d_week_seq#70, d_year#71] -Condition : ((isnotnull(d_year#71) AND (d_year#71 = 2002)) AND isnotnull(d_week_seq#70)) +Input [2]: [d_week_seq#67, d_year#68] +Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2002)) AND isnotnull(d_week_seq#67)) (31) Project [codegen id : 10] -Output [1]: [d_week_seq#70] -Input [2]: [d_week_seq#70, d_year#71] +Output [1]: [d_week_seq#67] +Input [2]: [d_week_seq#67, d_year#68] (32) BroadcastExchange -Input [1]: [d_week_seq#70] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#72] +Input [1]: [d_week_seq#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#69] (33) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [d_week_seq#12] -Right keys [1]: [d_week_seq#70] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#67] Join condition: None (34) Project [codegen id : 11] -Output [8]: [d_week_seq#12 AS d_week_seq2#73, sun_sales#37 AS sun_sales2#74, mon_sales#38 AS mon_sales2#75, tue_sales#39 AS tue_sales2#76, wed_sales#40 AS wed_sales2#77, thu_sales#41 AS thu_sales2#78, fri_sales#42 AS fri_sales2#79, sat_sales#43 AS sat_sales2#80] -Input [9]: [d_week_seq#12, sun_sales#37, mon_sales#38, tue_sales#39, wed_sales#40, thu_sales#41, fri_sales#42, sat_sales#43, d_week_seq#70] +Output [8]: [d_week_seq#10 AS d_week_seq2#70, sun_sales#35 AS sun_sales2#71, mon_sales#36 AS mon_sales2#72, tue_sales#37 AS tue_sales2#73, wed_sales#38 AS wed_sales2#74, thu_sales#39 AS thu_sales2#75, fri_sales#40 AS fri_sales2#76, sat_sales#41 AS sat_sales2#77] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#67] (35) BroadcastExchange -Input [8]: [d_week_seq2#73, sun_sales2#74, mon_sales2#75, tue_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80] -Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#81] +Input [8]: [d_week_seq2#70, sun_sales2#71, mon_sales2#72, tue_sales2#73, wed_sales2#74, thu_sales2#75, fri_sales2#76, sat_sales2#77] +Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#78] (36) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [d_week_seq1#47] -Right keys [1]: [(d_week_seq2#73 - 53)] +Left keys [1]: [d_week_seq1#45] +Right keys [1]: [(d_week_seq2#70 - 53)] Join condition: None (37) Project [codegen id : 12] -Output [8]: [d_week_seq1#47, round(CheckOverflow((promote_precision(sun_sales1#48) / promote_precision(sun_sales2#74)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#82, round(CheckOverflow((promote_precision(mon_sales1#49) / promote_precision(mon_sales2#75)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#83, round(CheckOverflow((promote_precision(tue_sales1#50) / promote_precision(tue_sales2#76)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#84, round(CheckOverflow((promote_precision(wed_sales1#51) / promote_precision(wed_sales2#77)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#85, round(CheckOverflow((promote_precision(thu_sales1#52) / promote_precision(thu_sales2#78)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#86, round(CheckOverflow((promote_precision(fri_sales1#53) / promote_precision(fri_sales2#79)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#87, round(CheckOverflow((promote_precision(sat_sales1#54) / promote_precision(sat_sales2#80)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#88] -Input [16]: [d_week_seq1#47, sun_sales1#48, mon_sales1#49, tue_sales1#50, wed_sales1#51, thu_sales1#52, fri_sales1#53, sat_sales1#54, d_week_seq2#73, sun_sales2#74, mon_sales2#75, tue_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80] +Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#71)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#79, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#72)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#80, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#73)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#81, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#74)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#82, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#75)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#83, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#76)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#84, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#77)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#85] +Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#70, sun_sales2#71, mon_sales2#72, tue_sales2#73, wed_sales2#74, thu_sales2#75, fri_sales2#76, sat_sales2#77] (38) Exchange -Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#82, round((mon_sales1 / mon_sales2), 2)#83, round((tue_sales1 / tue_sales2), 2)#84, round((wed_sales1 / wed_sales2), 2)#85, round((thu_sales1 / thu_sales2), 2)#86, round((fri_sales1 / fri_sales2), 2)#87, round((sat_sales1 / sat_sales2), 2)#88] -Arguments: rangepartitioning(d_week_seq1#47 ASC NULLS FIRST, 5), true, [id=#89] +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#79, round((mon_sales1 / mon_sales2), 2)#80, round((tue_sales1 / tue_sales2), 2)#81, round((wed_sales1 / wed_sales2), 2)#82, round((thu_sales1 / thu_sales2), 2)#83, round((fri_sales1 / fri_sales2), 2)#84, round((sat_sales1 / sat_sales2), 2)#85] +Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), true, [id=#86] (39) Sort [codegen id : 13] -Input [8]: [d_week_seq1#47, round((sun_sales1 / sun_sales2), 2)#82, round((mon_sales1 / mon_sales2), 2)#83, round((tue_sales1 / tue_sales2), 2)#84, round((wed_sales1 / wed_sales2), 2)#85, round((thu_sales1 / thu_sales2), 2)#86, round((fri_sales1 / fri_sales2), 2)#87, round((sat_sales1 / sat_sales2), 2)#88] -Arguments: [d_week_seq1#47 ASC NULLS FIRST], true, 0 +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#79, round((mon_sales1 / mon_sales2), 2)#80, round((tue_sales1 / tue_sales2), 2)#81, round((wed_sales1 / wed_sales2), 2)#82, round((thu_sales1 / thu_sales2), 2)#83, round((fri_sales1 / fri_sales2), 2)#84, round((sat_sales1 / sat_sales2), 2)#85] +Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt index b260506021d88..424a535e14847 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt @@ -15,7 +15,7 @@ WholeStageCodegen (13) Project [sales_price,d_week_seq,d_day_name] BroadcastHashJoin [sold_date_sk,d_date_sk] InputAdapter - Union [sold_date_sk,sales_price] + Union WholeStageCodegen (1) Project [ws_sold_date_sk,ws_ext_sales_price] Filter [ws_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt index 4a9afe3f27dde..c5988072f758d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt @@ -482,28 +482,27 @@ Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#45 as decima Input [4]: [ws_sold_date_sk#42, ws_quantity#45, ws_list_price#46, d_date_sk#9] (88) Union -Arguments: [sales#56] (89) HashAggregate [codegen id : 37] -Input [1]: [sales#56] +Input [1]: [sales#41] Keys: [] -Functions [1]: [partial_sum(sales#56)] -Aggregate Attributes [2]: [sum#57, isEmpty#58] -Results [2]: [sum#59, isEmpty#60] +Functions [1]: [partial_sum(sales#41)] +Aggregate Attributes [2]: [sum#56, isEmpty#57] +Results [2]: [sum#58, isEmpty#59] (90) Exchange -Input [2]: [sum#59, isEmpty#60] -Arguments: SinglePartition, true, [id=#61] +Input [2]: [sum#58, isEmpty#59] +Arguments: SinglePartition, true, [id=#60] (91) HashAggregate [codegen id : 38] -Input [2]: [sum#59, isEmpty#60] +Input [2]: [sum#58, isEmpty#59] Keys: [] -Functions [1]: [sum(sales#56)] -Aggregate Attributes [1]: [sum(sales#56)#62] -Results [1]: [sum(sales#56)#62 AS sum(sales)#63] +Functions [1]: [sum(sales#41)] +Aggregate Attributes [1]: [sum(sales#41)#61] +Results [1]: [sum(sales#41)#61 AS sum(sales)#62] (92) CollectLimit -Input [1]: [sum(sales)#63] +Input [1]: [sum(sales)#62] Arguments: 100 ===== Subqueries ===== @@ -569,7 +568,7 @@ Input [2]: [d_date_sk#9, d_year#11] (100) BroadcastExchange Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#63] (101) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#7] @@ -582,7 +581,7 @@ Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price (103) Exchange Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#65] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#64] (104) Sort [codegen id : 3] Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] @@ -604,7 +603,7 @@ Condition : isnotnull(c_customer_sk#29) (108) Exchange Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#66] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#65] (109) Sort [codegen id : 5] Input [1]: [c_customer_sk#29] @@ -623,33 +622,33 @@ Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk# 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#67, isEmpty#68] -Results [3]: [c_customer_sk#29, sum#69, isEmpty#70] +Aggregate Attributes [2]: [sum#66, isEmpty#67] +Results [3]: [c_customer_sk#29, sum#68, isEmpty#69] (113) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#29, sum#69, isEmpty#70] +Input [3]: [c_customer_sk#29, sum#68, isEmpty#69] 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))#71] -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))#71 AS csales#72] +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))#70] +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))#70 AS csales#71] (114) HashAggregate [codegen id : 6] -Input [1]: [csales#72] +Input [1]: [csales#71] Keys: [] -Functions [1]: [partial_max(csales#72)] -Aggregate Attributes [1]: [max#73] -Results [1]: [max#74] +Functions [1]: [partial_max(csales#71)] +Aggregate Attributes [1]: [max#72] +Results [1]: [max#73] (115) Exchange -Input [1]: [max#74] -Arguments: SinglePartition, true, [id=#75] +Input [1]: [max#73] +Arguments: SinglePartition, true, [id=#74] (116) HashAggregate [codegen id : 7] -Input [1]: [max#74] +Input [1]: [max#73] Keys: [] -Functions [1]: [max(csales#72)] -Aggregate Attributes [1]: [max(csales#72)#76] -Results [1]: [max(csales#72)#76 AS tpcds_cmax#77] +Functions [1]: [max(csales#71)] +Aggregate Attributes [1]: [max(csales#71)#75] +Results [1]: [max(csales#71)#75 AS tpcds_cmax#76] Subquery:2 Hosting operator id = 80 Hosting Expression = ReusedSubquery Subquery scalar-subquery#37, [id=#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt index d52842b48a33e..9ee444cdd988c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt @@ -6,7 +6,7 @@ CollectLimit WholeStageCodegen (37) HashAggregate [sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [sales] + Union WholeStageCodegen (18) Project [cs_quantity,cs_list_price] BroadcastHashJoin [cs_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt index be5a0b0cdc318..6d2b5b0013d8f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt @@ -379,28 +379,27 @@ Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#44 as decima Input [4]: [ws_sold_date_sk#41, ws_quantity#44, ws_list_price#45, d_date_sk#8] (68) Union -Arguments: [sales#52] (69) HashAggregate [codegen id : 19] -Input [1]: [sales#52] +Input [1]: [sales#40] Keys: [] -Functions [1]: [partial_sum(sales#52)] -Aggregate Attributes [2]: [sum#53, isEmpty#54] -Results [2]: [sum#55, isEmpty#56] +Functions [1]: [partial_sum(sales#40)] +Aggregate Attributes [2]: [sum#52, isEmpty#53] +Results [2]: [sum#54, isEmpty#55] (70) Exchange -Input [2]: [sum#55, isEmpty#56] -Arguments: SinglePartition, true, [id=#57] +Input [2]: [sum#54, isEmpty#55] +Arguments: SinglePartition, true, [id=#56] (71) HashAggregate [codegen id : 20] -Input [2]: [sum#55, isEmpty#56] +Input [2]: [sum#54, isEmpty#55] Keys: [] -Functions [1]: [sum(sales#52)] -Aggregate Attributes [1]: [sum(sales#52)#58] -Results [1]: [sum(sales#52)#58 AS sum(sales)#59] +Functions [1]: [sum(sales#40)] +Aggregate Attributes [1]: [sum(sales#40)#57] +Results [1]: [sum(sales#40)#57 AS sum(sales)#58] (72) CollectLimit -Input [1]: [sum(sales)#59] +Input [1]: [sum(sales)#58] Arguments: 100 ===== Subqueries ===== @@ -460,7 +459,7 @@ Condition : isnotnull(c_customer_sk#26) (79) BroadcastExchange Input [1]: [c_customer_sk#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#60] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#59] (80) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_customer_sk#23] @@ -491,7 +490,7 @@ Input [2]: [d_date_sk#8, d_year#10] (86) BroadcastExchange Input [1]: [d_date_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#61] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#60] (87) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_sold_date_sk#6] @@ -506,37 +505,37 @@ Input [5]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk# Input [3]: [ss_quantity#24, ss_sales_price#25, c_customer_sk#26] Keys [1]: [c_customer_sk#26] Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#62, isEmpty#63] -Results [3]: [c_customer_sk#26, sum#64, isEmpty#65] +Aggregate Attributes [2]: [sum#61, isEmpty#62] +Results [3]: [c_customer_sk#26, sum#63, isEmpty#64] (90) Exchange -Input [3]: [c_customer_sk#26, sum#64, isEmpty#65] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#66] +Input [3]: [c_customer_sk#26, sum#63, isEmpty#64] +Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#65] (91) HashAggregate [codegen id : 4] -Input [3]: [c_customer_sk#26, sum#64, isEmpty#65] +Input [3]: [c_customer_sk#26, sum#63, isEmpty#64] Keys [1]: [c_customer_sk#26] Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#67] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#67 AS csales#68] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66 AS csales#67] (92) HashAggregate [codegen id : 4] -Input [1]: [csales#68] +Input [1]: [csales#67] Keys: [] -Functions [1]: [partial_max(csales#68)] -Aggregate Attributes [1]: [max#69] -Results [1]: [max#70] +Functions [1]: [partial_max(csales#67)] +Aggregate Attributes [1]: [max#68] +Results [1]: [max#69] (93) Exchange -Input [1]: [max#70] -Arguments: SinglePartition, true, [id=#71] +Input [1]: [max#69] +Arguments: SinglePartition, true, [id=#70] (94) HashAggregate [codegen id : 5] -Input [1]: [max#70] +Input [1]: [max#69] Keys: [] -Functions [1]: [max(csales#68)] -Aggregate Attributes [1]: [max(csales#68)#72] -Results [1]: [max(csales#68)#72 AS tpcds_cmax#73] +Functions [1]: [max(csales#67)] +Aggregate Attributes [1]: [max(csales#67)#71] +Results [1]: [max(csales#67)#71 AS tpcds_cmax#72] Subquery:2 Hosting operator id = 60 Hosting Expression = ReusedSubquery Subquery scalar-subquery#35, [id=#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt index dd19be71cd6e7..d860e18574f2a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt @@ -6,7 +6,7 @@ CollectLimit WholeStageCodegen (19) HashAggregate [sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [sales] + Union WholeStageCodegen (9) Project [cs_quantity,cs_list_price] BroadcastHashJoin [cs_sold_date_sk,d_date_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 6ba16c626e030..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 @@ -711,11 +711,10 @@ Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_qua Results [3]: [c_last_name#42, c_first_name#41, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#56 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#57 as decimal(12,2)))), DecimalType(18,2), true))#73 AS sales#74] (129) Union -Arguments: [c_last_name#75, c_first_name#76, sales#77] (130) TakeOrderedAndProject -Input [3]: [c_last_name#75, c_first_name#76, sales#77] -Arguments: 100, [c_last_name#75 ASC NULLS FIRST, c_first_name#76 ASC NULLS FIRST, sales#77 ASC NULLS FIRST], [c_last_name#75, c_first_name#76, sales#77] +Input [3]: [c_last_name#42, c_first_name#41, sales#52] +Arguments: 100, [c_last_name#42 ASC NULLS FIRST, c_first_name#41 ASC NULLS FIRST, sales#52 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, sales#52] ===== Subqueries ===== @@ -780,7 +779,7 @@ Input [2]: [d_date_sk#9, d_year#11] (138) BroadcastExchange Input [1]: [d_date_sk#9] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#78] +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] @@ -793,7 +792,7 @@ Input [5]: [ss_sold_date_sk#7, ss_customer_sk#25, ss_quantity#26, ss_sales_price (141) Exchange Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] -Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#79] +Arguments: hashpartitioning(ss_customer_sk#25, 5), true, [id=#76] (142) Sort [codegen id : 3] Input [3]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27] @@ -815,7 +814,7 @@ Condition : isnotnull(c_customer_sk#29) (146) Exchange Input [1]: [c_customer_sk#29] -Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#80] +Arguments: hashpartitioning(c_customer_sk#29, 5), true, [id=#77] (147) Sort [codegen id : 5] Input [1]: [c_customer_sk#29] @@ -834,33 +833,33 @@ Input [4]: [ss_customer_sk#25, ss_quantity#26, ss_sales_price#27, c_customer_sk# 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#81, isEmpty#82] -Results [3]: [c_customer_sk#29, sum#83, isEmpty#84] +Aggregate Attributes [2]: [sum#78, isEmpty#79] +Results [3]: [c_customer_sk#29, sum#80, isEmpty#81] (151) HashAggregate [codegen id : 6] -Input [3]: [c_customer_sk#29, sum#83, isEmpty#84] +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))#85] -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))#85 AS csales#86] +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#86] +Input [1]: [csales#83] Keys: [] -Functions [1]: [partial_max(csales#86)] -Aggregate Attributes [1]: [max#87] -Results [1]: [max#88] +Functions [1]: [partial_max(csales#83)] +Aggregate Attributes [1]: [max#84] +Results [1]: [max#85] (153) Exchange -Input [1]: [max#88] -Arguments: SinglePartition, true, [id=#89] +Input [1]: [max#85] +Arguments: SinglePartition, true, [id=#86] (154) HashAggregate [codegen id : 7] -Input [1]: [max#88] +Input [1]: [max#85] Keys: [] -Functions [1]: [max(csales#86)] -Aggregate Attributes [1]: [max(csales#86)#90] -Results [1]: [max(csales#86)#90 AS tpcds_cmax#91] +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] 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 55f738d37e0eb..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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] - Union [c_last_name,c_first_name,sales] + Union WholeStageCodegen (28) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [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)),sales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt index f4c4ea181cb6f..b5213786c93bc 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt @@ -540,11 +540,10 @@ Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_qua Results [3]: [c_last_name#39, c_first_name#38, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#55 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#56 as decimal(12,2)))), DecimalType(18,2), true))#70 AS sales#71] (96) Union -Arguments: [c_last_name#72, c_first_name#73, sales#74] (97) TakeOrderedAndProject -Input [3]: [c_last_name#72, c_first_name#73, sales#74] -Arguments: 100, [c_last_name#72 ASC NULLS FIRST, c_first_name#73 ASC NULLS FIRST, sales#74 ASC NULLS FIRST], [c_last_name#72, c_first_name#73, sales#74] +Input [3]: [c_last_name#39, c_first_name#38, sales#51] +Arguments: 100, [c_last_name#39 ASC NULLS FIRST, c_first_name#38 ASC NULLS FIRST, sales#51 ASC NULLS FIRST], [c_last_name#39, c_first_name#38, sales#51] ===== Subqueries ===== @@ -603,7 +602,7 @@ Condition : isnotnull(c_customer_sk#26) (104) BroadcastExchange Input [1]: [c_customer_sk#26] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#75] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] (105) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_customer_sk#23] @@ -634,7 +633,7 @@ Input [2]: [d_date_sk#8, d_year#10] (111) BroadcastExchange Input [1]: [d_date_sk#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#73] (112) BroadcastHashJoin [codegen id : 3] Left keys [1]: [ss_sold_date_sk#6] @@ -649,37 +648,37 @@ Input [5]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk# Input [3]: [ss_quantity#24, ss_sales_price#25, c_customer_sk#26] Keys [1]: [c_customer_sk#26] Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#77, isEmpty#78] -Results [3]: [c_customer_sk#26, sum#79, isEmpty#80] +Aggregate Attributes [2]: [sum#74, isEmpty#75] +Results [3]: [c_customer_sk#26, sum#76, isEmpty#77] (115) Exchange -Input [3]: [c_customer_sk#26, sum#79, isEmpty#80] -Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#81] +Input [3]: [c_customer_sk#26, sum#76, isEmpty#77] +Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#78] (116) HashAggregate [codegen id : 4] -Input [3]: [c_customer_sk#26, sum#79, isEmpty#80] +Input [3]: [c_customer_sk#26, sum#76, isEmpty#77] Keys [1]: [c_customer_sk#26] Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#82] -Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#82 AS csales#83] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#79] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#79 AS csales#80] (117) HashAggregate [codegen id : 4] -Input [1]: [csales#83] +Input [1]: [csales#80] Keys: [] -Functions [1]: [partial_max(csales#83)] -Aggregate Attributes [1]: [max#84] -Results [1]: [max#85] +Functions [1]: [partial_max(csales#80)] +Aggregate Attributes [1]: [max#81] +Results [1]: [max#82] (118) Exchange -Input [1]: [max#85] -Arguments: SinglePartition, true, [id=#86] +Input [1]: [max#82] +Arguments: SinglePartition, true, [id=#83] (119) HashAggregate [codegen id : 5] -Input [1]: [max#85] +Input [1]: [max#82] Keys: [] -Functions [1]: [max(csales#83)] -Aggregate Attributes [1]: [max(csales#83)#87] -Results [1]: [max(csales#83)#87 AS tpcds_cmax#88] +Functions [1]: [max(csales#80)] +Aggregate Attributes [1]: [max(csales#80)#84] +Results [1]: [max(csales#80)#84 AS tpcds_cmax#85] Subquery:2 Hosting operator id = 49 Hosting Expression = ReusedSubquery Subquery scalar-subquery#35, [id=#36] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt index 3223fc64cedc8..f879f38d556e7 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales] - Union [c_last_name,c_first_name,sales] + Union WholeStageCodegen (14) HashAggregate [c_last_name,c_first_name,sum,isEmpty] [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)),sales,sum,isEmpty] InputAdapter 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 19a984476f929..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 @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_manufact_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_manufact_id#41, total_sales#42] -Keys [1]: [i_manufact_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Input [2]: [i_manufact_id#10, total_sales#22] +Keys [1]: [i_manufact_id#10] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_manufact_id#10, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_manufact_id#41, 5), true, [id=#47] +Input [3]: [i_manufact_id#10, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_manufact_id#10, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] -Keys [1]: [i_manufact_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_manufact_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_manufact_id#10, sum#43, isEmpty#44] +Keys [1]: [i_manufact_id#10] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_manufact_id#10, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_manufact_id#41, total_sales#49] -Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_manufact_id#41, total_sales#49] +Input [2]: [i_manufact_id#10, total_sales#47] +Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_manufact_id#10, total_sales#47] 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 2a38ee527e84c..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_manufact_id] WholeStageCodegen (19) HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_manufact_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt index b5b7982a171f0..8d1558a01cfde 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_manufact_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_manufact_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_manufact_id#41, total_sales#42] -Keys [1]: [i_manufact_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_manufact_id#41, sum#45, isEmpty#46] +Input [2]: [i_manufact_id#13, total_sales#22] +Keys [1]: [i_manufact_id#13] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_manufact_id#13, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_manufact_id#41, 5), true, [id=#47] +Input [3]: [i_manufact_id#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_manufact_id#13, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_manufact_id#41, sum#45, isEmpty#46] -Keys [1]: [i_manufact_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_manufact_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_manufact_id#13, sum#43, isEmpty#44] +Keys [1]: [i_manufact_id#13] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_manufact_id#13, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_manufact_id#41, total_sales#49] -Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_manufact_id#41, total_sales#49] +Input [2]: [i_manufact_id#13, total_sales#47] +Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_manufact_id#13, total_sales#47] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt index 82f777448f71f..14787f0bbce7b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_manufact_id] WholeStageCodegen (19) HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_manufact_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter 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/q36/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt index 1c1439e129fc8..73174b7351002 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/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/q4.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt index aff16f5cfc30f..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 @@ -1,131 +1,130 @@ == Physical Plan == -TakeOrderedAndProject (127) -+- * Project (126) - +- * SortMergeJoin Inner (125) - :- * Project (107) - : +- * SortMergeJoin Inner (106) - : :- * Project (86) - : : +- * SortMergeJoin Inner (85) - : : :- * Project (67) - : : : +- * SortMergeJoin Inner (66) - : : : :- * SortMergeJoin Inner (46) - : : : : :- * Sort (25) - : : : : : +- Exchange (24) - : : : : : +- * Project (23) - : : : : : +- * Filter (22) - : : : : : +- * 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 (12) - : : : : +- * Sort (45) - : : : : +- Exchange (44) - : : : : +- * HashAggregate (43) - : : : : +- Exchange (42) - : : : : +- * HashAggregate (41) - : : : : +- * Project (40) - : : : : +- * SortMergeJoin Inner (39) - : : : : :- * Sort (36) - : : : : : +- Exchange (35) - : : : : : +- * Project (34) - : : : : : +- * BroadcastHashJoin Inner BuildRight (33) - : : : : : :- * Filter (28) - : : : : : : +- * ColumnarToRow (27) - : : : : : : +- Scan parquet default.store_sales (26) - : : : : : +- BroadcastExchange (32) - : : : : : +- * Filter (31) - : : : : : +- * ColumnarToRow (30) - : : : : : +- Scan parquet default.date_dim (29) - : : : : +- * Sort (38) - : : : : +- ReusedExchange (37) - : : : +- * Sort (65) - : : : +- Exchange (64) - : : : +- * Project (63) - : : : +- * Filter (62) - : : : +- * HashAggregate (61) - : : : +- Exchange (60) - : : : +- * HashAggregate (59) - : : : +- * Project (58) - : : : +- * SortMergeJoin Inner (57) - : : : :- * Sort (54) - : : : : +- Exchange (53) - : : : : +- * Project (52) - : : : : +- * BroadcastHashJoin Inner BuildRight (51) - : : : : :- * Filter (49) - : : : : : +- * ColumnarToRow (48) - : : : : : +- Scan parquet default.catalog_sales (47) - : : : : +- ReusedExchange (50) - : : : +- * Sort (56) - : : : +- ReusedExchange (55) - : : +- * Sort (84) - : : +- Exchange (83) - : : +- * HashAggregate (82) - : : +- Exchange (81) - : : +- * HashAggregate (80) - : : +- * Project (79) - : : +- * SortMergeJoin Inner (78) - : : :- * Sort (75) - : : : +- Exchange (74) - : : : +- * Project (73) - : : : +- * BroadcastHashJoin Inner BuildRight (72) - : : : :- * Filter (70) - : : : : +- * ColumnarToRow (69) - : : : : +- Scan parquet default.catalog_sales (68) - : : : +- ReusedExchange (71) - : : +- * Sort (77) - : : +- ReusedExchange (76) - : +- * Sort (105) - : +- Exchange (104) - : +- * Project (103) - : +- * Filter (102) - : +- * HashAggregate (101) - : +- Exchange (100) - : +- * HashAggregate (99) - : +- * Project (98) - : +- * SortMergeJoin Inner (97) - : :- * Sort (94) - : : +- Exchange (93) - : : +- * Project (92) - : : +- * BroadcastHashJoin Inner BuildRight (91) - : : :- * Filter (89) - : : : +- * ColumnarToRow (88) - : : : +- Scan parquet default.web_sales (87) - : : +- ReusedExchange (90) - : +- * Sort (96) - : +- ReusedExchange (95) - +- * Sort (124) - +- Exchange (123) - +- * HashAggregate (122) - +- Exchange (121) - +- * HashAggregate (120) - +- * Project (119) - +- * SortMergeJoin Inner (118) - :- * Sort (115) - : +- Exchange (114) - : +- * Project (113) - : +- * BroadcastHashJoin Inner BuildRight (112) - : :- * Filter (110) - : : +- * ColumnarToRow (109) - : : +- Scan parquet default.web_sales (108) - : +- ReusedExchange (111) - +- * Sort (117) - +- ReusedExchange (116) +TakeOrderedAndProject (126) ++- * Project (125) + +- * SortMergeJoin Inner (124) + :- * Project (106) + : +- * SortMergeJoin Inner (105) + : :- * Project (85) + : : +- * SortMergeJoin Inner (84) + : : :- * Project (66) + : : : +- * SortMergeJoin Inner (65) + : : : :- * SortMergeJoin Inner (45) + : : : : :- * Sort (24) + : : : : : +- Exchange (23) + : : : : : +- * Filter (22) + : : : : : +- * 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 (12) + : : : : +- * Sort (44) + : : : : +- Exchange (43) + : : : : +- * HashAggregate (42) + : : : : +- Exchange (41) + : : : : +- * HashAggregate (40) + : : : : +- * Project (39) + : : : : +- * SortMergeJoin Inner (38) + : : : : :- * 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) + : : : : +- * Sort (37) + : : : : +- ReusedExchange (36) + : : : +- * Sort (64) + : : : +- Exchange (63) + : : : +- * Project (62) + : : : +- * Filter (61) + : : : +- * HashAggregate (60) + : : : +- Exchange (59) + : : : +- * HashAggregate (58) + : : : +- * Project (57) + : : : +- * SortMergeJoin Inner (56) + : : : :- * Sort (53) + : : : : +- Exchange (52) + : : : : +- * Project (51) + : : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : : :- * Filter (48) + : : : : : +- * ColumnarToRow (47) + : : : : : +- Scan parquet default.catalog_sales (46) + : : : : +- ReusedExchange (49) + : : : +- * Sort (55) + : : : +- ReusedExchange (54) + : : +- * Sort (83) + : : +- Exchange (82) + : : +- * HashAggregate (81) + : : +- Exchange (80) + : : +- * HashAggregate (79) + : : +- * Project (78) + : : +- * SortMergeJoin Inner (77) + : : :- * Sort (74) + : : : +- Exchange (73) + : : : +- * Project (72) + : : : +- * BroadcastHashJoin Inner BuildRight (71) + : : : :- * Filter (69) + : : : : +- * ColumnarToRow (68) + : : : : +- Scan parquet default.catalog_sales (67) + : : : +- ReusedExchange (70) + : : +- * Sort (76) + : : +- ReusedExchange (75) + : +- * Sort (104) + : +- Exchange (103) + : +- * Project (102) + : +- * Filter (101) + : +- * HashAggregate (100) + : +- Exchange (99) + : +- * HashAggregate (98) + : +- * Project (97) + : +- * SortMergeJoin Inner (96) + : :- * Sort (93) + : : +- Exchange (92) + : : +- * Project (91) + : : +- * BroadcastHashJoin Inner BuildRight (90) + : : :- * Filter (88) + : : : +- * ColumnarToRow (87) + : : : +- Scan parquet default.web_sales (86) + : : +- ReusedExchange (89) + : +- * Sort (95) + : +- ReusedExchange (94) + +- * Sort (123) + +- Exchange (122) + +- * HashAggregate (121) + +- Exchange (120) + +- * HashAggregate (119) + +- * Project (118) + +- * SortMergeJoin Inner (117) + :- * Sort (114) + : +- Exchange (113) + : +- * Project (112) + : +- * BroadcastHashJoin Inner BuildRight (111) + : :- * Filter (109) + : : +- * ColumnarToRow (108) + : : +- Scan parquet default.web_sales (107) + : +- ReusedExchange (110) + +- * Sort (116) + +- ReusedExchange (115) (1) Scan parquet default.store_sales @@ -230,471 +229,467 @@ Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_pre Input [2]: [customer_id#26, year_total#27] Condition : (isnotnull(year_total#27) AND (year_total#27 > 0.000000)) -(23) Project [codegen id : 7] -Output [2]: [customer_id#26 AS customer_id#28, year_total#27 AS year_total#29] +(23) Exchange Input [2]: [customer_id#26, year_total#27] +Arguments: hashpartitioning(customer_id#26, 5), true, [id=#28] -(24) Exchange -Input [2]: [customer_id#28, year_total#29] -Arguments: hashpartitioning(customer_id#28, 5), true, [id=#30] - -(25) Sort [codegen id : 8] -Input [2]: [customer_id#28, year_total#29] -Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 8] +Input [2]: [customer_id#26, year_total#27] +Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 -(26) Scan parquet default.store_sales +(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 -(27) ColumnarToRow [codegen id : 10] +(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] -(28) Filter [codegen id : 10] +(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)) -(29) Scan parquet default.date_dim +(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 -(30) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#7, d_year#8] -(31) Filter [codegen id : 9] +(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)) -(32) BroadcastExchange +(31) BroadcastExchange Input [2]: [d_date_sk#7, d_year#8] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] -(33) BroadcastHashJoin [codegen id : 10] +(32) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#7] Join condition: None -(34) Project [codegen id : 10] +(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] -(35) Exchange +(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=#32] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30] -(36) Sort [codegen id : 11] +(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 -(37) ReusedExchange [Reuses operator id: 15] +(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] -(38) Sort [codegen id : 13] +(37) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(39) SortMergeJoin [codegen id : 14] +(38) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#11] Join condition: None -(40) Project [codegen id : 14] +(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] -(41) HashAggregate [codegen id : 14] +(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))] -Aggregate Attributes [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#35, isEmpty#36] +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] -(42) 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#35, isEmpty#36] -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=#37] +(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] -(43) 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#35, isEmpty#36] +(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))#38] -Results [8]: [c_customer_id#12 AS customer_id#39, c_first_name#13 AS customer_first_name#40, c_last_name#14 AS customer_last_name#41, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#42, c_birth_country#16 AS customer_birth_country#43, c_login#17 AS customer_login#44, c_email_address#18 AS customer_email_address#45, 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))#38 AS year_total#46] +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] -(44) Exchange -Input [8]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46] -Arguments: hashpartitioning(customer_id#39, 5), true, [id=#47] +(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] +Arguments: hashpartitioning(customer_id#37, 5), true, [id=#45] -(45) Sort [codegen id : 16] -Input [8]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46] -Arguments: [customer_id#39 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 16] +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] +Arguments: [customer_id#37 ASC NULLS FIRST], false, 0 -(46) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#28] -Right keys [1]: [customer_id#39] +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#37] Join condition: None -(47) Scan parquet default.catalog_sales -Output [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +(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 [codegen id : 19] -Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +(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 [codegen id : 19] -Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] -Condition : (isnotnull(cs_bill_customer_sk#49) AND isnotnull(cs_sold_date_sk#48)) +(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)) -(50) ReusedExchange [Reuses operator id: 7] +(49) ReusedExchange [Reuses operator id: 7] Output [2]: [d_date_sk#7, d_year#8] -(51) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [cs_sold_date_sk#48] +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#46] Right keys [1]: [d_date_sk#7] Join condition: None -(52) Project [codegen id : 19] -Output [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Input [8]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_date_sk#7, d_year#8] +(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] -(53) Exchange -Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Arguments: hashpartitioning(cs_bill_customer_sk#49, 5), true, [id=#54] +(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] +Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#52] -(54) Sort [codegen id : 20] -Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Arguments: [cs_bill_customer_sk#49 ASC NULLS FIRST], false, 0 +(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] +Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 -(55) ReusedExchange [Reuses operator id: 15] +(54) 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] -(56) Sort [codegen id : 22] +(55) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(57) SortMergeJoin [codegen id : 23] -Left keys [1]: [cs_bill_customer_sk#49] +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [cs_bill_customer_sk#47] Right keys [1]: [c_customer_sk#11] Join condition: None -(58) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Input [14]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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] +(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] -(59) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +(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] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [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#57, isEmpty#58] +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] -(60) 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#57, isEmpty#58] -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=#59] +(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] -(61) 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#57, isEmpty#58] +(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] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 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#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#60] -Results [2]: [c_customer_id#12 AS customer_id#61, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#60 AS year_total#62] +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] -(62) Filter [codegen id : 24] -Input [2]: [customer_id#61, year_total#62] -Condition : (isnotnull(year_total#62) AND (year_total#62 > 0.000000)) +(61) Filter [codegen id : 24] +Input [2]: [customer_id#59, year_total#60] +Condition : (isnotnull(year_total#60) AND (year_total#60 > 0.000000)) -(63) Project [codegen id : 24] -Output [2]: [customer_id#61 AS customer_id#63, year_total#62 AS year_total#64] -Input [2]: [customer_id#61, year_total#62] +(62) Project [codegen id : 24] +Output [2]: [customer_id#59 AS customer_id#61, year_total#60 AS year_total#62] +Input [2]: [customer_id#59, year_total#60] -(64) Exchange -Input [2]: [customer_id#63, year_total#64] -Arguments: hashpartitioning(customer_id#63, 5), true, [id=#65] +(63) Exchange +Input [2]: [customer_id#61, year_total#62] +Arguments: hashpartitioning(customer_id#61, 5), true, [id=#63] -(65) Sort [codegen id : 25] -Input [2]: [customer_id#63, year_total#64] -Arguments: [customer_id#63 ASC NULLS FIRST], false, 0 +(64) Sort [codegen id : 25] +Input [2]: [customer_id#61, year_total#62] +Arguments: [customer_id#61 ASC NULLS FIRST], false, 0 -(66) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#28] -Right keys [1]: [customer_id#63] +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#61] Join condition: None -(67) Project [codegen id : 26] -Output [11]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, year_total#64] -Input [12]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, customer_id#63, year_total#64] +(66) Project [codegen id : 26] +Output [11]: [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] +Input [12]: [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, customer_id#61, year_total#62] -(68) Scan parquet default.catalog_sales -Output [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +(67) 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 -(69) ColumnarToRow [codegen id : 28] -Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] +(68) ColumnarToRow [codegen id : 28] +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] -(70) Filter [codegen id : 28] -Input [6]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53] -Condition : (isnotnull(cs_bill_customer_sk#49) AND isnotnull(cs_sold_date_sk#48)) +(69) Filter [codegen id : 28] +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)) -(71) ReusedExchange [Reuses operator id: 32] +(70) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#7, d_year#8] -(72) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [cs_sold_date_sk#48] +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#46] Right keys [1]: [d_date_sk#7] Join condition: None -(73) Project [codegen id : 28] -Output [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Input [8]: [cs_sold_date_sk#48, cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_date_sk#7, d_year#8] +(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] -(74) Exchange -Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Arguments: hashpartitioning(cs_bill_customer_sk#49, 5), true, [id=#66] +(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] +Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#64] -(75) Sort [codegen id : 29] -Input [6]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Arguments: [cs_bill_customer_sk#49 ASC NULLS FIRST], false, 0 +(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] +Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0 -(76) ReusedExchange [Reuses operator id: 15] +(75) 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] -(77) Sort [codegen id : 31] +(76) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(78) SortMergeJoin [codegen id : 32] -Left keys [1]: [cs_bill_customer_sk#49] +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [cs_bill_customer_sk#47] Right keys [1]: [c_customer_sk#11] Join condition: None -(79) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] -Input [14]: [cs_bill_customer_sk#49, cs_ext_discount_amt#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, 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] +(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] -(80) 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#50, cs_ext_sales_price#51, cs_ext_wholesale_cost#52, cs_ext_list_price#53, d_year#8] +(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] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [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#69, isEmpty#70] +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] -(81) 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#69, isEmpty#70] -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=#71] +(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] -(82) 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#69, isEmpty#70] +(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] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 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#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#72] -Results [2]: [c_customer_id#12 AS customer_id#73, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#52 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#50 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#51 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#72 AS year_total#74] +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] -(83) Exchange -Input [2]: [customer_id#73, year_total#74] -Arguments: hashpartitioning(customer_id#73, 5), true, [id=#75] +(82) Exchange +Input [2]: [customer_id#71, year_total#72] +Arguments: hashpartitioning(customer_id#71, 5), true, [id=#73] -(84) Sort [codegen id : 34] -Input [2]: [customer_id#73, year_total#74] -Arguments: [customer_id#73 ASC NULLS FIRST], false, 0 +(83) Sort [codegen id : 34] +Input [2]: [customer_id#71, year_total#72] +Arguments: [customer_id#71 ASC NULLS FIRST], false, 0 -(85) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#28] -Right keys [1]: [customer_id#73] -Join condition: (CASE WHEN (year_total#64 > 0.000000) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#64)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#29 > 0.000000) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#29)), DecimalType(38,14), true) ELSE null END) +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#71] +Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#27 > 0.000000) THEN CheckOverflow((promote_precision(year_total#44) / promote_precision(year_total#27)), DecimalType(38,14), true) ELSE null END) -(86) Project [codegen id : 35] -Output [10]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74] -Input [13]: [customer_id#28, year_total#29, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#46, year_total#64, customer_id#73, year_total#74] +(85) Project [codegen id : 35] +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] -(87) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +(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 [codegen id : 37] -Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +(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 [codegen id : 37] -Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] -Condition : (isnotnull(ws_bill_customer_sk#77) AND isnotnull(ws_sold_date_sk#76)) +(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)) -(90) ReusedExchange [Reuses operator id: 7] +(89) ReusedExchange [Reuses operator id: 7] Output [2]: [d_date_sk#7, d_year#8] -(91) BroadcastHashJoin [codegen id : 37] -Left keys [1]: [ws_sold_date_sk#76] +(90) BroadcastHashJoin [codegen id : 37] +Left keys [1]: [ws_sold_date_sk#74] Right keys [1]: [d_date_sk#7] Join condition: None -(92) Project [codegen id : 37] -Output [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Input [8]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_date_sk#7, d_year#8] +(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] -(93) Exchange -Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Arguments: hashpartitioning(ws_bill_customer_sk#77, 5), true, [id=#82] +(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] +Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#80] -(94) Sort [codegen id : 38] -Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Arguments: [ws_bill_customer_sk#77 ASC NULLS FIRST], false, 0 +(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] +Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 -(95) ReusedExchange [Reuses operator id: 15] +(94) 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] -(96) Sort [codegen id : 40] +(95) Sort [codegen id : 40] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(97) SortMergeJoin [codegen id : 41] -Left keys [1]: [ws_bill_customer_sk#77] +(96) SortMergeJoin [codegen id : 41] +Left keys [1]: [ws_bill_customer_sk#75] Right keys [1]: [c_customer_sk#11] Join condition: None -(98) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Input [14]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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] +(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] -(99) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +(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] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [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#85, isEmpty#86] +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] -(100) 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#85, isEmpty#86] -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=#87] +(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] -(101) 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#85, isEmpty#86] +(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] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 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#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#88] -Results [2]: [c_customer_id#12 AS customer_id#89, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#88 AS year_total#90] +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] -(102) Filter [codegen id : 42] -Input [2]: [customer_id#89, year_total#90] -Condition : (isnotnull(year_total#90) AND (year_total#90 > 0.000000)) +(101) Filter [codegen id : 42] +Input [2]: [customer_id#87, year_total#88] +Condition : (isnotnull(year_total#88) AND (year_total#88 > 0.000000)) -(103) Project [codegen id : 42] -Output [2]: [customer_id#89 AS customer_id#91, year_total#90 AS year_total#92] -Input [2]: [customer_id#89, year_total#90] +(102) Project [codegen id : 42] +Output [2]: [customer_id#87 AS customer_id#89, year_total#88 AS year_total#90] +Input [2]: [customer_id#87, year_total#88] -(104) Exchange -Input [2]: [customer_id#91, year_total#92] -Arguments: hashpartitioning(customer_id#91, 5), true, [id=#93] +(103) Exchange +Input [2]: [customer_id#89, year_total#90] +Arguments: hashpartitioning(customer_id#89, 5), true, [id=#91] -(105) Sort [codegen id : 43] -Input [2]: [customer_id#91, year_total#92] -Arguments: [customer_id#91 ASC NULLS FIRST], false, 0 +(104) Sort [codegen id : 43] +Input [2]: [customer_id#89, year_total#90] +Arguments: [customer_id#89 ASC NULLS FIRST], false, 0 -(106) SortMergeJoin [codegen id : 44] -Left keys [1]: [customer_id#28] -Right keys [1]: [customer_id#91] +(105) SortMergeJoin [codegen id : 44] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#89] Join condition: None -(107) Project [codegen id : 44] -Output [11]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, year_total#92] -Input [12]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, customer_id#91, year_total#92] +(106) Project [codegen id : 44] +Output [11]: [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, year_total#90] +Input [12]: [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, customer_id#89, year_total#90] -(108) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +(107) 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 -(109) ColumnarToRow [codegen id : 46] -Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] +(108) ColumnarToRow [codegen id : 46] +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] -(110) Filter [codegen id : 46] -Input [6]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81] -Condition : (isnotnull(ws_bill_customer_sk#77) AND isnotnull(ws_sold_date_sk#76)) +(109) Filter [codegen id : 46] +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)) -(111) ReusedExchange [Reuses operator id: 32] +(110) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#7, d_year#8] -(112) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#76] +(111) BroadcastHashJoin [codegen id : 46] +Left keys [1]: [ws_sold_date_sk#74] Right keys [1]: [d_date_sk#7] Join condition: None -(113) Project [codegen id : 46] -Output [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Input [8]: [ws_sold_date_sk#76, ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_date_sk#7, d_year#8] +(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] -(114) Exchange -Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Arguments: hashpartitioning(ws_bill_customer_sk#77, 5), true, [id=#94] +(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] +Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#92] -(115) Sort [codegen id : 47] -Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Arguments: [ws_bill_customer_sk#77 ASC NULLS FIRST], false, 0 +(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] +Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 -(116) ReusedExchange [Reuses operator id: 15] +(115) 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] -(117) Sort [codegen id : 49] +(116) Sort [codegen id : 49] Input [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] Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0 -(118) SortMergeJoin [codegen id : 50] -Left keys [1]: [ws_bill_customer_sk#77] +(117) SortMergeJoin [codegen id : 50] +Left keys [1]: [ws_bill_customer_sk#75] Right keys [1]: [c_customer_sk#11] Join condition: None -(119) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] -Input [14]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, 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] +(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] -(120) 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#78, ws_ext_sales_price#79, ws_ext_wholesale_cost#80, ws_ext_list_price#81, d_year#8] +(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] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [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#97, isEmpty#98] +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] -(121) 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#97, isEmpty#98] -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=#99] +(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] -(122) 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#97, isEmpty#98] +(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] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 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#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#100] -Results [2]: [c_customer_id#12 AS customer_id#101, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#81 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#80 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#79 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#100 AS year_total#102] - -(123) Exchange -Input [2]: [customer_id#101, year_total#102] -Arguments: hashpartitioning(customer_id#101, 5), true, [id=#103] - -(124) Sort [codegen id : 52] -Input [2]: [customer_id#101, year_total#102] -Arguments: [customer_id#101 ASC NULLS FIRST], false, 0 - -(125) SortMergeJoin [codegen id : 53] -Left keys [1]: [customer_id#28] -Right keys [1]: [customer_id#101] -Join condition: (CASE WHEN (year_total#64 > 0.000000) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#64)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#92 > 0.000000) THEN CheckOverflow((promote_precision(year_total#102) / promote_precision(year_total#92)), DecimalType(38,14), true) ELSE null END) - -(126) Project [codegen id : 53] -Output [7]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] -Input [13]: [customer_id#28, customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45, year_total#64, year_total#74, year_total#92, customer_id#101, year_total#102] - -(127) TakeOrderedAndProject -Input [7]: [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] -Arguments: 100, [customer_id#39 ASC NULLS FIRST, customer_first_name#40 ASC NULLS FIRST, customer_last_name#41 ASC NULLS FIRST, customer_preferred_cust_flag#42 ASC NULLS FIRST, customer_birth_country#43 ASC NULLS FIRST, customer_login#44 ASC NULLS FIRST, customer_email_address#45 ASC NULLS FIRST], [customer_id#39, customer_first_name#40, customer_last_name#41, customer_preferred_cust_flag#42, customer_birth_country#43, customer_login#44, customer_email_address#45] +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] + +(122) Exchange +Input [2]: [customer_id#99, year_total#100] +Arguments: hashpartitioning(customer_id#99, 5), true, [id=#101] + +(123) Sort [codegen id : 52] +Input [2]: [customer_id#99, year_total#100] +Arguments: [customer_id#99 ASC NULLS FIRST], false, 0 + +(124) SortMergeJoin [codegen id : 53] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#99] +Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#90 > 0.000000) THEN CheckOverflow((promote_precision(year_total#100) / promote_precision(year_total#90)), DecimalType(38,14), true) ELSE null END) + +(125) Project [codegen id : 53] +Output [7]: [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] +Input [13]: [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, year_total#90, customer_id#99, year_total#100] + +(126) TakeOrderedAndProject +Input [7]: [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] +Arguments: 100, [customer_id#37 ASC NULLS FIRST, customer_first_name#38 ASC NULLS FIRST, customer_last_name#39 ASC NULLS FIRST, customer_preferred_cust_flag#40 ASC NULLS FIRST, customer_birth_country#41 ASC NULLS FIRST, customer_login#42 ASC NULLS FIRST, customer_email_address#43 ASC NULLS FIRST], [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] 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 41d3762fecc1b..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 @@ -23,44 +23,43 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt index f1ea24f01e36b..79a7abdcff5db 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt @@ -1,112 +1,111 @@ == Physical Plan == -TakeOrderedAndProject (108) -+- * Project (107) - +- * BroadcastHashJoin Inner BuildRight (106) - :- * Project (92) - : +- * BroadcastHashJoin Inner BuildRight (91) - : :- * Project (72) - : : +- * BroadcastHashJoin Inner BuildRight (71) - : : :- * Project (57) - : : : +- * BroadcastHashJoin Inner BuildRight (56) - : : : :- * BroadcastHashJoin Inner BuildRight (37) - : : : : :- * Project (20) - : : : : : +- * Filter (19) - : : : : : +- * HashAggregate (18) - : : : : : +- Exchange (17) - : : : : : +- * HashAggregate (16) - : : : : : +- * Project (15) - : : : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : : : :- * Project (9) - : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : : : :- * Filter (3) - : : : : : : : +- * ColumnarToRow (2) - : : : : : : : +- Scan parquet default.customer (1) - : : : : : : +- BroadcastExchange (7) - : : : : : : +- * Filter (6) - : : : : : : +- * ColumnarToRow (5) - : : : : : : +- Scan parquet default.store_sales (4) - : : : : : +- BroadcastExchange (13) - : : : : : +- * Filter (12) - : : : : : +- * ColumnarToRow (11) - : : : : : +- Scan parquet default.date_dim (10) - : : : : +- BroadcastExchange (36) - : : : : +- * HashAggregate (35) - : : : : +- Exchange (34) - : : : : +- * HashAggregate (33) - : : : : +- * Project (32) - : : : : +- * BroadcastHashJoin Inner BuildRight (31) - : : : : :- * Project (26) - : : : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : : : :- * Filter (23) - : : : : : : +- * ColumnarToRow (22) - : : : : : : +- Scan parquet default.customer (21) - : : : : : +- ReusedExchange (24) - : : : : +- BroadcastExchange (30) - : : : : +- * Filter (29) - : : : : +- * ColumnarToRow (28) - : : : : +- Scan parquet default.date_dim (27) - : : : +- BroadcastExchange (55) - : : : +- * Project (54) - : : : +- * Filter (53) - : : : +- * HashAggregate (52) - : : : +- Exchange (51) - : : : +- * HashAggregate (50) - : : : +- * Project (49) - : : : +- * BroadcastHashJoin Inner BuildRight (48) - : : : :- * Project (46) - : : : : +- * BroadcastHashJoin Inner BuildRight (45) - : : : : :- * Filter (40) - : : : : : +- * ColumnarToRow (39) - : : : : : +- Scan parquet default.customer (38) - : : : : +- BroadcastExchange (44) - : : : : +- * Filter (43) - : : : : +- * ColumnarToRow (42) - : : : : +- Scan parquet default.catalog_sales (41) - : : : +- ReusedExchange (47) - : : +- BroadcastExchange (70) - : : +- * HashAggregate (69) - : : +- Exchange (68) - : : +- * HashAggregate (67) - : : +- * Project (66) - : : +- * BroadcastHashJoin Inner BuildRight (65) - : : :- * Project (63) - : : : +- * BroadcastHashJoin Inner BuildRight (62) - : : : :- * Filter (60) - : : : : +- * ColumnarToRow (59) - : : : : +- Scan parquet default.customer (58) - : : : +- ReusedExchange (61) - : : +- ReusedExchange (64) - : +- BroadcastExchange (90) - : +- * Project (89) - : +- * Filter (88) - : +- * HashAggregate (87) - : +- Exchange (86) - : +- * HashAggregate (85) - : +- * Project (84) - : +- * BroadcastHashJoin Inner BuildRight (83) - : :- * Project (81) - : : +- * BroadcastHashJoin Inner BuildRight (80) - : : :- * Filter (75) - : : : +- * ColumnarToRow (74) - : : : +- Scan parquet default.customer (73) - : : +- BroadcastExchange (79) - : : +- * Filter (78) - : : +- * ColumnarToRow (77) - : : +- Scan parquet default.web_sales (76) - : +- ReusedExchange (82) - +- BroadcastExchange (105) - +- * HashAggregate (104) - +- Exchange (103) - +- * HashAggregate (102) - +- * Project (101) - +- * BroadcastHashJoin Inner BuildRight (100) - :- * Project (98) - : +- * BroadcastHashJoin Inner BuildRight (97) - : :- * Filter (95) - : : +- * ColumnarToRow (94) - : : +- Scan parquet default.customer (93) - : +- ReusedExchange (96) - +- ReusedExchange (99) +TakeOrderedAndProject (107) ++- * Project (106) + +- * BroadcastHashJoin Inner BuildRight (105) + :- * Project (91) + : +- * BroadcastHashJoin Inner BuildRight (90) + : :- * Project (71) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- * Project (56) + : : : +- * BroadcastHashJoin Inner BuildRight (55) + : : : :- * BroadcastHashJoin Inner BuildRight (36) + : : : : :- * Filter (19) + : : : : : +- * HashAggregate (18) + : : : : : +- Exchange (17) + : : : : : +- * HashAggregate (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.customer (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_sales (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.date_dim (10) + : : : : +- BroadcastExchange (35) + : : : : +- * HashAggregate (34) + : : : : +- Exchange (33) + : : : : +- * HashAggregate (32) + : : : : +- * Project (31) + : : : : +- * BroadcastHashJoin Inner BuildRight (30) + : : : : :- * Project (25) + : : : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : : : :- * Filter (22) + : : : : : : +- * ColumnarToRow (21) + : : : : : : +- Scan parquet default.customer (20) + : : : : : +- ReusedExchange (23) + : : : : +- BroadcastExchange (29) + : : : : +- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.date_dim (26) + : : : +- BroadcastExchange (54) + : : : +- * Project (53) + : : : +- * Filter (52) + : : : +- * HashAggregate (51) + : : : +- Exchange (50) + : : : +- * HashAggregate (49) + : : : +- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (45) + : : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : : :- * Filter (39) + : : : : : +- * ColumnarToRow (38) + : : : : : +- Scan parquet default.customer (37) + : : : : +- BroadcastExchange (43) + : : : : +- * Filter (42) + : : : : +- * ColumnarToRow (41) + : : : : +- Scan parquet default.catalog_sales (40) + : : : +- ReusedExchange (46) + : : +- BroadcastExchange (69) + : : +- * HashAggregate (68) + : : +- Exchange (67) + : : +- * HashAggregate (66) + : : +- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * Project (62) + : : : +- * BroadcastHashJoin Inner BuildRight (61) + : : : :- * Filter (59) + : : : : +- * ColumnarToRow (58) + : : : : +- Scan parquet default.customer (57) + : : : +- ReusedExchange (60) + : : +- ReusedExchange (63) + : +- BroadcastExchange (89) + : +- * Project (88) + : +- * Filter (87) + : +- * HashAggregate (86) + : +- Exchange (85) + : +- * HashAggregate (84) + : +- * Project (83) + : +- * BroadcastHashJoin Inner BuildRight (82) + : :- * Project (80) + : : +- * BroadcastHashJoin Inner BuildRight (79) + : : :- * Filter (74) + : : : +- * ColumnarToRow (73) + : : : +- Scan parquet default.customer (72) + : : +- BroadcastExchange (78) + : : +- * Filter (77) + : : +- * ColumnarToRow (76) + : : +- Scan parquet default.web_sales (75) + : +- ReusedExchange (81) + +- BroadcastExchange (104) + +- * HashAggregate (103) + +- Exchange (102) + +- * HashAggregate (101) + +- * Project (100) + +- * BroadcastHashJoin Inner BuildRight (99) + :- * Project (97) + : +- * BroadcastHashJoin Inner BuildRight (96) + : :- * Filter (94) + : : +- * ColumnarToRow (93) + : : +- Scan parquet default.customer (92) + : +- ReusedExchange (95) + +- ReusedExchange (98) (1) Scan parquet default.customer @@ -199,413 +198,409 @@ Results [2]: [c_customer_id#2 AS customer_id#25, sum(CheckOverflow((promote_prec Input [2]: [customer_id#25, year_total#26] Condition : (isnotnull(year_total#26) AND (year_total#26 > 0.000000)) -(20) Project [codegen id : 24] -Output [2]: [customer_id#25 AS customer_id#27, year_total#26 AS year_total#28] -Input [2]: [customer_id#25, year_total#26] - -(21) Scan parquet default.customer +(20) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 6] +(21) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(23) Filter [codegen id : 6] +(22) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(24) ReusedExchange [Reuses operator id: 7] +(23) ReusedExchange [Reuses operator id: 7] Output [6]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] -(25) BroadcastHashJoin [codegen id : 6] +(24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(26) Project [codegen id : 6] +(25) Project [codegen id : 6] Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14] -(27) Scan parquet default.date_dim +(26) Scan parquet default.date_dim Output [2]: [d_date_sk#16, d_year#17] 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 -(28) ColumnarToRow [codegen id : 5] +(27) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#16, d_year#17] -(29) Filter [codegen id : 5] +(28) Filter [codegen id : 5] Input [2]: [d_date_sk#16, d_year#17] Condition : ((isnotnull(d_year#17) AND (d_year#17 = 2002)) AND isnotnull(d_date_sk#16)) -(30) BroadcastExchange +(29) BroadcastExchange Input [2]: [d_date_sk#16, d_year#17] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] -(31) BroadcastHashJoin [codegen id : 6] +(30) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#16] Join condition: None -(32) Project [codegen id : 6] +(31) Project [codegen id : 6] Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_year#17] Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_date_sk#16, d_year#17] -(33) HashAggregate [codegen id : 6] +(32) HashAggregate [codegen id : 6] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_sales_price#12, ss_ext_wholesale_cost#13, ss_ext_list_price#14, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#30, isEmpty#31] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] +Aggregate Attributes [2]: [sum#28, isEmpty#29] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] -(34) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#34] +(33) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#32] -(35) HashAggregate [codegen id : 7] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#32, isEmpty#33] +(34) HashAggregate [codegen id : 7] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#30, isEmpty#31] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 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#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#35] -Results [8]: [c_customer_id#2 AS customer_id#36, c_first_name#3 AS customer_first_name#37, c_last_name#4 AS customer_last_name#38, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#39, c_birth_country#6 AS customer_birth_country#40, c_login#7 AS customer_login#41, c_email_address#8 AS customer_email_address#42, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#35 AS year_total#43] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#33] +Results [8]: [c_customer_id#2 AS customer_id#34, c_first_name#3 AS customer_first_name#35, c_last_name#4 AS customer_last_name#36, c_preferred_cust_flag#5 AS customer_preferred_cust_flag#37, c_birth_country#6 AS customer_birth_country#38, c_login#7 AS customer_login#39, c_email_address#8 AS customer_email_address#40, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#14 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#13 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#12 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#33 AS year_total#41] -(36) BroadcastExchange -Input [8]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#44] +(35) BroadcastExchange +Input [8]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] -(37) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#27] -Right keys [1]: [customer_id#36] +(36) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#25] +Right keys [1]: [customer_id#34] Join condition: None -(38) Scan parquet default.customer +(37) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 10] +(38) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(40) Filter [codegen id : 10] +(39) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(41) Scan parquet default.catalog_sales -Output [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +(40) Scan parquet default.catalog_sales +Output [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)] ReadSchema: struct -(42) ColumnarToRow [codegen id : 8] -Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +(41) ColumnarToRow [codegen id : 8] +Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -(43) Filter [codegen id : 8] -Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -Condition : (isnotnull(cs_bill_customer_sk#46) AND isnotnull(cs_sold_date_sk#45)) +(42) Filter [codegen id : 8] +Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +Condition : (isnotnull(cs_bill_customer_sk#44) AND isnotnull(cs_sold_date_sk#43)) -(44) BroadcastExchange -Input [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#51] +(43) BroadcastExchange +Input [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#49] -(45) BroadcastHashJoin [codegen id : 10] +(44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cs_bill_customer_sk#46] +Right keys [1]: [cs_bill_customer_sk#44] Join condition: None -(46) Project [codegen id : 10] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +(45) Project [codegen id : 10] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -(47) ReusedExchange [Reuses operator id: 13] +(46) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#16, d_year#17] -(48) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [cs_sold_date_sk#45] +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#43] Right keys [1]: [d_date_sk#16] Join condition: None -(49) Project [codegen id : 10] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_date_sk#16, d_year#17] +(48) Project [codegen id : 10] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_date_sk#16, d_year#17] -(50) HashAggregate [codegen id : 10] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] +(49) HashAggregate [codegen id : 10] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#52, isEmpty#53] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] -(51) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#56] +(50) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#54] -(52) HashAggregate [codegen id : 11] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#54, isEmpty#55] +(51) HashAggregate [codegen id : 11] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#52, isEmpty#53] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 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#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#57] -Results [2]: [c_customer_id#2 AS customer_id#58, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#57 AS year_total#59] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 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#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#55] +Results [2]: [c_customer_id#2 AS customer_id#56, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#55 AS year_total#57] -(53) Filter [codegen id : 11] -Input [2]: [customer_id#58, year_total#59] -Condition : (isnotnull(year_total#59) AND (year_total#59 > 0.000000)) +(52) Filter [codegen id : 11] +Input [2]: [customer_id#56, year_total#57] +Condition : (isnotnull(year_total#57) AND (year_total#57 > 0.000000)) -(54) Project [codegen id : 11] -Output [2]: [customer_id#58 AS customer_id#60, year_total#59 AS year_total#61] -Input [2]: [customer_id#58, year_total#59] +(53) Project [codegen id : 11] +Output [2]: [customer_id#56 AS customer_id#58, year_total#57 AS year_total#59] +Input [2]: [customer_id#56, year_total#57] -(55) BroadcastExchange -Input [2]: [customer_id#60, year_total#61] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#62] +(54) BroadcastExchange +Input [2]: [customer_id#58, year_total#59] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#60] -(56) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#27] -Right keys [1]: [customer_id#60] +(55) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#25] +Right keys [1]: [customer_id#58] Join condition: None -(57) Project [codegen id : 24] -Output [11]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, year_total#61] -Input [12]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, customer_id#60, year_total#61] +(56) Project [codegen id : 24] +Output [11]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, year_total#59] +Input [12]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, customer_id#58, year_total#59] -(58) Scan parquet default.customer +(57) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(59) ColumnarToRow [codegen id : 14] +(58) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(60) Filter [codegen id : 14] +(59) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(61) ReusedExchange [Reuses operator id: 44] -Output [6]: [cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +(60) ReusedExchange [Reuses operator id: 43] +Output [6]: [cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -(62) BroadcastHashJoin [codegen id : 14] +(61) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [cs_bill_customer_sk#46] +Right keys [1]: [cs_bill_customer_sk#44] Join condition: None -(63) Project [codegen id : 14] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_bill_customer_sk#46, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50] +(62) Project [codegen id : 14] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_bill_customer_sk#44, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48] -(64) ReusedExchange [Reuses operator id: 30] +(63) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#16, d_year#17] -(65) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [cs_sold_date_sk#45] +(64) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [cs_sold_date_sk#43] Right keys [1]: [d_date_sk#16] Join condition: None -(66) Project [codegen id : 14] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#45, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_date_sk#16, d_year#17] +(65) Project [codegen id : 14] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_sold_date_sk#43, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_date_sk#16, d_year#17] -(67) HashAggregate [codegen id : 14] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#47, cs_ext_sales_price#48, cs_ext_wholesale_cost#49, cs_ext_list_price#50, d_year#17] +(66) HashAggregate [codegen id : 14] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, cs_ext_discount_amt#45, cs_ext_sales_price#46, cs_ext_wholesale_cost#47, cs_ext_list_price#48, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#63, isEmpty#64] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#61, isEmpty#62] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] -(68) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#67] +(67) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#65] -(69) HashAggregate [codegen id : 15] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#65, isEmpty#66] +(68) HashAggregate [codegen id : 15] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#63, isEmpty#64] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 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#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#68] -Results [2]: [c_customer_id#2 AS customer_id#69, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#49 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#47 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#48 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#68 AS year_total#70] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 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#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#66] +Results [2]: [c_customer_id#2 AS customer_id#67, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#48 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#47 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#45 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#46 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#66 AS year_total#68] -(70) BroadcastExchange -Input [2]: [customer_id#69, year_total#70] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#71] +(69) BroadcastExchange +Input [2]: [customer_id#67, year_total#68] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#69] -(71) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#27] -Right keys [1]: [customer_id#69] -Join condition: (CASE WHEN (year_total#61 > 0.000000) THEN CheckOverflow((promote_precision(year_total#70) / promote_precision(year_total#61)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#28 > 0.000000) THEN CheckOverflow((promote_precision(year_total#43) / promote_precision(year_total#28)), DecimalType(38,14), true) ELSE null END) +(70) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#25] +Right keys [1]: [customer_id#67] +Join condition: (CASE WHEN (year_total#59 > 0.000000) THEN CheckOverflow((promote_precision(year_total#68) / promote_precision(year_total#59)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#26 > 0.000000) THEN CheckOverflow((promote_precision(year_total#41) / promote_precision(year_total#26)), DecimalType(38,14), true) ELSE null END) -(72) Project [codegen id : 24] -Output [10]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70] -Input [13]: [customer_id#27, year_total#28, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#43, year_total#61, customer_id#69, year_total#70] +(71) Project [codegen id : 24] +Output [10]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68] +Input [13]: [customer_id#25, year_total#26, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#41, year_total#59, customer_id#67, year_total#68] -(73) Scan parquet default.customer +(72) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(74) ColumnarToRow [codegen id : 18] +(73) ColumnarToRow [codegen id : 18] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(75) Filter [codegen id : 18] +(74) Filter [codegen id : 18] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(76) Scan parquet default.web_sales -Output [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +(75) Scan parquet default.web_sales +Output [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(77) ColumnarToRow [codegen id : 16] -Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +(76) ColumnarToRow [codegen id : 16] +Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -(78) Filter [codegen id : 16] -Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -Condition : (isnotnull(ws_bill_customer_sk#73) AND isnotnull(ws_sold_date_sk#72)) +(77) Filter [codegen id : 16] +Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +Condition : (isnotnull(ws_bill_customer_sk#71) AND isnotnull(ws_sold_date_sk#70)) -(79) BroadcastExchange -Input [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#78] +(78) BroadcastExchange +Input [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#76] -(80) BroadcastHashJoin [codegen id : 18] +(79) BroadcastHashJoin [codegen id : 18] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#73] +Right keys [1]: [ws_bill_customer_sk#71] Join condition: None -(81) Project [codegen id : 18] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +(80) Project [codegen id : 18] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -(82) ReusedExchange [Reuses operator id: 13] +(81) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#16, d_year#17] -(83) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [ws_sold_date_sk#72] +(82) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ws_sold_date_sk#70] Right keys [1]: [d_date_sk#16] Join condition: None -(84) Project [codegen id : 18] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_date_sk#16, d_year#17] +(83) Project [codegen id : 18] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_date_sk#16, d_year#17] -(85) HashAggregate [codegen id : 18] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] +(84) HashAggregate [codegen id : 18] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#79, isEmpty#80] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#77, isEmpty#78] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] -(86) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#83] +(85) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#81] -(87) HashAggregate [codegen id : 19] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#81, isEmpty#82] +(86) HashAggregate [codegen id : 19] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#79, isEmpty#80] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 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#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84] -Results [2]: [c_customer_id#2 AS customer_id#85, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84 AS year_total#86] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 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#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#82] +Results [2]: [c_customer_id#2 AS customer_id#83, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#82 AS year_total#84] -(88) Filter [codegen id : 19] -Input [2]: [customer_id#85, year_total#86] -Condition : (isnotnull(year_total#86) AND (year_total#86 > 0.000000)) +(87) Filter [codegen id : 19] +Input [2]: [customer_id#83, year_total#84] +Condition : (isnotnull(year_total#84) AND (year_total#84 > 0.000000)) -(89) Project [codegen id : 19] -Output [2]: [customer_id#85 AS customer_id#87, year_total#86 AS year_total#88] -Input [2]: [customer_id#85, year_total#86] +(88) Project [codegen id : 19] +Output [2]: [customer_id#83 AS customer_id#85, year_total#84 AS year_total#86] +Input [2]: [customer_id#83, year_total#84] -(90) BroadcastExchange -Input [2]: [customer_id#87, year_total#88] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#89] +(89) BroadcastExchange +Input [2]: [customer_id#85, year_total#86] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#87] -(91) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#27] -Right keys [1]: [customer_id#87] +(90) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#25] +Right keys [1]: [customer_id#85] Join condition: None -(92) Project [codegen id : 24] -Output [11]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, year_total#88] -Input [12]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, customer_id#87, year_total#88] +(91) Project [codegen id : 24] +Output [11]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, year_total#86] +Input [12]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, customer_id#85, year_total#86] -(93) Scan parquet default.customer +(92) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(94) ColumnarToRow [codegen id : 22] +(93) ColumnarToRow [codegen id : 22] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(95) Filter [codegen id : 22] +(94) Filter [codegen id : 22] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(96) ReusedExchange [Reuses operator id: 79] -Output [6]: [ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +(95) ReusedExchange [Reuses operator id: 78] +Output [6]: [ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -(97) BroadcastHashJoin [codegen id : 22] +(96) BroadcastHashJoin [codegen id : 22] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#73] +Right keys [1]: [ws_bill_customer_sk#71] Join condition: None -(98) Project [codegen id : 22] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] -Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_bill_customer_sk#73, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77] +(97) Project [codegen id : 22] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_bill_customer_sk#71, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75] -(99) ReusedExchange [Reuses operator id: 30] +(98) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#16, d_year#17] -(100) BroadcastHashJoin [codegen id : 22] -Left keys [1]: [ws_sold_date_sk#72] +(99) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#70] Right keys [1]: [d_date_sk#16] Join condition: None -(101) Project [codegen id : 22] -Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] -Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#72, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_date_sk#16, d_year#17] +(100) Project [codegen id : 22] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#70, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_date_sk#16, d_year#17] -(102) HashAggregate [codegen id : 22] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#74, ws_ext_sales_price#75, ws_ext_wholesale_cost#76, ws_ext_list_price#77, d_year#17] +(101) HashAggregate [codegen id : 22] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#72, ws_ext_sales_price#73, ws_ext_wholesale_cost#74, ws_ext_list_price#75, d_year#17] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] -Aggregate Attributes [2]: [sum#90, isEmpty#91] -Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#88, isEmpty#89] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] -(103) Exchange -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#94] +(102) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, 5), true, [id=#92] -(104) HashAggregate [codegen id : 23] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#92, isEmpty#93] +(103) HashAggregate [codegen id : 23] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17, sum#90, isEmpty#91] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#17] -Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 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#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#95] -Results [2]: [c_customer_id#2 AS customer_id#96, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#76 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#74 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#75 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#95 AS year_total#97] - -(105) BroadcastExchange -Input [2]: [customer_id#96, year_total#97] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#98] - -(106) BroadcastHashJoin [codegen id : 24] -Left keys [1]: [customer_id#27] -Right keys [1]: [customer_id#96] -Join condition: (CASE WHEN (year_total#61 > 0.000000) THEN CheckOverflow((promote_precision(year_total#70) / promote_precision(year_total#61)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#88 > 0.000000) THEN CheckOverflow((promote_precision(year_total#97) / promote_precision(year_total#88)), DecimalType(38,14), true) ELSE null END) - -(107) Project [codegen id : 24] -Output [7]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] -Input [13]: [customer_id#27, customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42, year_total#61, year_total#70, year_total#88, customer_id#96, year_total#97] - -(108) TakeOrderedAndProject -Input [7]: [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] -Arguments: 100, [customer_id#36 ASC NULLS FIRST, customer_first_name#37 ASC NULLS FIRST, customer_last_name#38 ASC NULLS FIRST, customer_preferred_cust_flag#39 ASC NULLS FIRST, customer_birth_country#40 ASC NULLS FIRST, customer_login#41 ASC NULLS FIRST, customer_email_address#42 ASC NULLS FIRST], [customer_id#36, customer_first_name#37, customer_last_name#38, customer_preferred_cust_flag#39, customer_birth_country#40, customer_login#41, customer_email_address#42] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 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#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#93] +Results [2]: [c_customer_id#2 AS customer_id#94, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#75 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#74 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#72 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#73 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#93 AS year_total#95] + +(104) BroadcastExchange +Input [2]: [customer_id#94, year_total#95] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#96] + +(105) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#25] +Right keys [1]: [customer_id#94] +Join condition: (CASE WHEN (year_total#59 > 0.000000) THEN CheckOverflow((promote_precision(year_total#68) / promote_precision(year_total#59)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#86 > 0.000000) THEN CheckOverflow((promote_precision(year_total#95) / promote_precision(year_total#86)), DecimalType(38,14), true) ELSE null END) + +(106) Project [codegen id : 24] +Output [7]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] +Input [13]: [customer_id#25, customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40, year_total#59, year_total#68, year_total#86, customer_id#94, year_total#95] + +(107) TakeOrderedAndProject +Input [7]: [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] +Arguments: 100, [customer_id#34 ASC NULLS FIRST, customer_first_name#35 ASC NULLS FIRST, customer_last_name#36 ASC NULLS FIRST, customer_preferred_cust_flag#37 ASC NULLS FIRST, customer_birth_country#38 ASC NULLS FIRST, customer_login#39 ASC NULLS FIRST, customer_email_address#40 ASC NULLS FIRST], [customer_id#34, customer_first_name#35, customer_last_name#36, customer_preferred_cust_flag#37, customer_birth_country#38, customer_login#39, customer_email_address#40] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt index 28fcbb7fb2ab6..017b34451ef7e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt @@ -9,35 +9,34 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,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] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,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] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt index a22571168c014..114b5e0568223 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt @@ -453,27 +453,26 @@ Output [5]: [store AS channel#112, item#106, return_ratio#107, return_rank#110, Input [5]: [item#106, return_ratio#107, currency_ratio#108, return_rank#110, currency_rank#111] (83) Union -Arguments: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (84) HashAggregate [codegen id : 31] -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] (85) Exchange -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Arguments: hashpartitioning(channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117, 5), true, [id=#118] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Arguments: hashpartitioning(channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39, 5), true, [id=#113] (86) HashAggregate [codegen id : 32] -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] (87) TakeOrderedAndProject -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Arguments: 100, [channel#113 ASC NULLS FIRST, return_rank#116 ASC NULLS FIRST, currency_rank#117 ASC NULLS FIRST], [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Arguments: 100, [channel#40 ASC NULLS FIRST, return_rank#38 ASC NULLS FIRST, currency_rank#39 ASC NULLS FIRST], [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt index d8c5e9679b1cf..ab300ca150457 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (31) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union [channel,item,return_ratio,return_rank,currency_rank] + Union WholeStageCodegen (10) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt index 1dd5ee2bda48d..8d10c1641ef46 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt @@ -408,27 +408,26 @@ Output [5]: [store AS channel#109, item#103, return_ratio#104, return_rank#107, Input [5]: [item#103, return_ratio#104, currency_ratio#105, return_rank#107, currency_rank#108] (74) Union -Arguments: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (75) HashAggregate [codegen id : 22] -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] (76) Exchange -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Arguments: hashpartitioning(channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114, 5), true, [id=#115] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Arguments: hashpartitioning(channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38, 5), true, [id=#110] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] (78) TakeOrderedAndProject -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Arguments: 100, [channel#110 ASC NULLS FIRST, return_rank#113 ASC NULLS FIRST, currency_rank#114 ASC NULLS FIRST], [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Arguments: 100, [channel#39 ASC NULLS FIRST, return_rank#37 ASC NULLS FIRST, currency_rank#38 ASC NULLS FIRST], [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt index e156919a29dd1..c15f2394e1a44 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (22) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union [channel,item,return_ratio,return_rank,currency_rank] + Union WholeStageCodegen (7) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt index 811082c1c0844..55bd25c501294 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt @@ -118,337 +118,333 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union -Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_date#28] +Output [2]: [d_date_sk#21, d_date#22] 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-06), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] +Input [2]: [d_date_sk#21, d_date#22] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] -Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 11192)) AND (d_date#28 <= 11206)) AND isnotnull(d_date_sk#27)) +Input [2]: [d_date_sk#21, d_date#22] +Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 11192)) AND (d_date#22 <= 11206)) AND isnotnull(d_date_sk#21)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#27] -Input [2]: [d_date_sk#27, d_date#28] +Output [1]: [d_date_sk#21] +Input [2]: [d_date_sk#21, d_date#22] (14) BroadcastExchange -Input [1]: [d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#22] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#6] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] -Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] +Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] +Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] (17) Scan parquet default.store -Output [2]: [s_store_sk#30, s_store_id#31] +Output [2]: [s_store_sk#24, s_store_id#25] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] +Input [2]: [s_store_sk#24, s_store_id#25] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] -Condition : isnotnull(s_store_sk#30) +Input [2]: [s_store_sk#24, s_store_id#25] +Condition : isnotnull(s_store_sk#24) (20) BroadcastExchange -Input [2]: [s_store_sk#30, s_store_id#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [2]: [s_store_sk#24, s_store_id#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#21] -Right keys [1]: [cast(s_store_sk#30 as bigint)] +Left keys [1]: [store_sk#5] +Right keys [1]: [cast(s_store_sk#24 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] +Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Keys [1]: [s_store_id#31] -Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] -Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Keys [1]: [s_store_id#25] +Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] +Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] (24) Exchange -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Keys [1]: [s_store_id#31] -Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#46, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS RETURNS#47, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#48, store channel AS channel#49, concat(store, s_store_id#31) AS id#50] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Keys [1]: [s_store_id#25] +Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#40, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS RETURNS#41, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#42, store channel AS channel#43, concat(store, s_store_id#25) AS id#44] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] -Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] -Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (34) Union -Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#72] -Right keys [1]: [d_date_sk#27] +Left keys [1]: [date_sk#50] +Right keys [1]: [d_date_sk#21] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] -Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] +Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] +Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Condition : isnotnull(cp_catalog_page_sk#77) +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Condition : isnotnull(cp_catalog_page_sk#65) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#71] -Right keys [1]: [cp_catalog_page_sk#77] +Left keys [1]: [page_sk#49] +Right keys [1]: [cp_catalog_page_sk#65] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] -Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] +Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] (45) Exchange -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#93, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS RETURNS#94, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#95, catalog channel AS channel#96, concat(catalog_page, cp_catalog_page_id#78) AS id#97] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#81, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS RETURNS#82, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#66) AS id#85] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] -Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] (53) Filter [codegen id : 14] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Condition : isnotnull(wr_returned_date_sk#108) +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Condition : isnotnull(wr_returned_date_sk#96) (54) Exchange -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Arguments: hashpartitioning(wr_item_sk#109, wr_order_number#110, 5), true, [id=#113] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Arguments: hashpartitioning(wr_item_sk#97, wr_order_number#98, 5), true, [id=#101] (55) Sort [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Arguments: [wr_item_sk#109 ASC NULLS FIRST, wr_order_number#110 ASC NULLS FIRST], false, 0 +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Arguments: [wr_item_sk#97 ASC NULLS FIRST, wr_order_number#98 ASC NULLS FIRST], false, 0 (56) Scan parquet default.web_sales -Output [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Output [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (57) ColumnarToRow [codegen id : 16] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] (58) Filter [codegen id : 16] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Condition : ((isnotnull(ws_item_sk#114) AND isnotnull(ws_order_number#115)) AND isnotnull(ws_web_site_sk#99)) +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Condition : ((isnotnull(ws_item_sk#102) AND isnotnull(ws_order_number#103)) AND isnotnull(ws_web_site_sk#87)) (59) Exchange -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Arguments: hashpartitioning(cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint), 5), true, [id=#116] +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Arguments: hashpartitioning(cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint), 5), true, [id=#104] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Arguments: [cast(ws_item_sk#114 as bigint) ASC NULLS FIRST, cast(ws_order_number#115 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Arguments: [cast(ws_item_sk#102 as bigint) ASC NULLS FIRST, cast(ws_order_number#103 as bigint) ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#109, wr_order_number#110] -Right keys [2]: [cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint)] +Left keys [2]: [wr_item_sk#97, wr_order_number#98] +Right keys [2]: [cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint)] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#117, wr_returned_date_sk#108 AS date_sk#118, 0.00 AS sales_price#119, 0.00 AS profit#120, wr_return_amt#111 AS return_amt#121, wr_net_loss#112 AS net_loss#122] -Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#105, wr_returned_date_sk#96 AS date_sk#106, 0.00 AS sales_price#107, 0.00 AS profit#108, wr_return_amt#99 AS return_amt#109, wr_net_loss#100 AS net_loss#110] +Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] (63) Union -Arguments: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128] (64) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (65) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#124] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#91] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (66) Project [codegen id : 21] -Output [5]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128] -Input [7]: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128, d_date_sk#27] +Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] +Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] (67) Scan parquet default.web_site -Output [2]: [web_site_sk#129, web_site_id#130] +Output [2]: [web_site_sk#111, web_site_id#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (68) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#129, web_site_id#130] +Input [2]: [web_site_sk#111, web_site_id#112] (69) Filter [codegen id : 20] -Input [2]: [web_site_sk#129, web_site_id#130] -Condition : isnotnull(web_site_sk#129) +Input [2]: [web_site_sk#111, web_site_id#112] +Condition : isnotnull(web_site_sk#111) (70) BroadcastExchange -Input [2]: [web_site_sk#129, web_site_id#130] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#131] +Input [2]: [web_site_sk#111, web_site_id#112] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#113] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#123] -Right keys [1]: [web_site_sk#129] +Left keys [1]: [wsr_web_site_sk#90] +Right keys [1]: [web_site_sk#111] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] -Input [7]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_sk#129, web_site_id#130] +Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] +Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#111, web_site_id#112] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] -Keys [1]: [web_site_id#130] -Functions [4]: [partial_sum(UnscaledValue(sales_price#125)), partial_sum(UnscaledValue(return_amt#127)), partial_sum(UnscaledValue(profit#126)), partial_sum(UnscaledValue(net_loss#128))] -Aggregate Attributes [4]: [sum#132, sum#133, sum#134, sum#135] -Results [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] +Keys [1]: [web_site_id#112] +Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum#114, sum#115, sum#116, sum#117] +Results [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] (74) Exchange -Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] -Arguments: hashpartitioning(web_site_id#130, 5), true, [id=#140] +Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Arguments: hashpartitioning(web_site_id#112, 5), true, [id=#122] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] -Keys [1]: [web_site_id#130] -Functions [4]: [sum(UnscaledValue(sales_price#125)), sum(UnscaledValue(return_amt#127)), sum(UnscaledValue(profit#126)), sum(UnscaledValue(net_loss#128))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#125))#141, sum(UnscaledValue(return_amt#127))#142, sum(UnscaledValue(profit#126))#143, sum(UnscaledValue(net_loss#128))#144] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#125))#141,17,2) AS sales#145, MakeDecimal(sum(UnscaledValue(return_amt#127))#142,17,2) AS RETURNS#146, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#126))#143,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#128))#144,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#147, web channel AS channel#148, concat(web_site, web_site_id#130) AS id#149] +Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Keys [1]: [web_site_id#112] +Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#123, sum(UnscaledValue(return_amt#94))#124, sum(UnscaledValue(profit#93))#125, sum(UnscaledValue(net_loss#95))#126] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#92))#123,17,2) AS sales#127, MakeDecimal(sum(UnscaledValue(return_amt#94))#124,17,2) AS RETURNS#128, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#125,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#126,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#129, web channel AS channel#130, concat(web_site, web_site_id#112) AS id#131] (76) Union -Arguments: [sales#150, returns#151, profit#152, channel#153, id#154] (77) Expand [codegen id : 23] -Input [5]: [sales#150, returns#151, profit#152, channel#153, id#154] -Arguments: [List(sales#150, returns#151, profit#152, channel#153, id#154, 0), List(sales#150, returns#151, profit#152, channel#153, null, 1), List(sales#150, returns#151, profit#152, null, null, 3)], [sales#150, returns#151, profit#152, channel#155, id#156, spark_grouping_id#157] +Input [5]: [sales#40, RETURNS#41, profit#42, channel#43, id#44] +Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#132, id#133, spark_grouping_id#134] (78) HashAggregate [codegen id : 23] -Input [6]: [sales#150, returns#151, profit#152, channel#155, id#156, spark_grouping_id#157] -Keys [3]: [channel#155, id#156, spark_grouping_id#157] -Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] -Aggregate Attributes [6]: [sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] -Results [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Input [6]: [sales#40, returns#41, profit#42, channel#132, id#133, spark_grouping_id#134] +Keys [3]: [channel#132, id#133, spark_grouping_id#134] +Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] +Aggregate Attributes [6]: [sum#135, isEmpty#136, sum#137, isEmpty#138, sum#139, isEmpty#140] +Results [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] (79) Exchange -Input [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Arguments: hashpartitioning(channel#155, id#156, spark_grouping_id#157, 5), true, [id=#170] +Input [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] +Arguments: hashpartitioning(channel#132, id#133, spark_grouping_id#134, 5), true, [id=#147] (80) HashAggregate [codegen id : 24] -Input [9]: [channel#155, id#156, spark_grouping_id#157, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] -Keys [3]: [channel#155, id#156, spark_grouping_id#157] -Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] -Aggregate Attributes [3]: [sum(sales#150)#171, sum(returns#151)#172, sum(profit#152)#173] -Results [5]: [channel#155, id#156, sum(sales#150)#171 AS sales#174, sum(returns#151)#172 AS returns#175, sum(profit#152)#173 AS profit#176] +Input [9]: [channel#132, id#133, spark_grouping_id#134, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] +Keys [3]: [channel#132, id#133, spark_grouping_id#134] +Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] +Aggregate Attributes [3]: [sum(sales#40)#148, sum(returns#41)#149, sum(profit#42)#150] +Results [5]: [channel#132, id#133, sum(sales#40)#148 AS sales#151, sum(returns#41)#149 AS returns#152, sum(profit#42)#150 AS profit#153] (81) TakeOrderedAndProject -Input [5]: [channel#155, id#156, sales#174, returns#175, profit#176] -Arguments: 100, [channel#155 ASC NULLS FIRST, id#156 ASC NULLS FIRST], [channel#155, id#156, sales#174, returns#175, profit#176] +Input [5]: [channel#132, id#133, sales#151, returns#152, profit#153] +Arguments: 100, [channel#132 ASC NULLS FIRST, id#133 ASC NULLS FIRST], [channel#132, id#133, sales#151, returns#152, profit#153] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt index 1317d75129924..80b07a3712d36 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + Union WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] InputAdapter @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -58,7 +58,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -91,7 +91,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt index 2521aee61eaa7..15f0cda0b5f9f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt @@ -115,325 +115,321 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union -Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_date#28] +Output [2]: [d_date_sk#21, d_date#22] 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-06), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] +Input [2]: [d_date_sk#21, d_date#22] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] -Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 11192)) AND (d_date#28 <= 11206)) AND isnotnull(d_date_sk#27)) +Input [2]: [d_date_sk#21, d_date#22] +Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 11192)) AND (d_date#22 <= 11206)) AND isnotnull(d_date_sk#21)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#27] -Input [2]: [d_date_sk#27, d_date#28] +Output [1]: [d_date_sk#21] +Input [2]: [d_date_sk#21, d_date#22] (14) BroadcastExchange -Input [1]: [d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#22] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#6] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] -Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] +Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] +Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] (17) Scan parquet default.store -Output [2]: [s_store_sk#30, s_store_id#31] +Output [2]: [s_store_sk#24, s_store_id#25] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] +Input [2]: [s_store_sk#24, s_store_id#25] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] -Condition : isnotnull(s_store_sk#30) +Input [2]: [s_store_sk#24, s_store_id#25] +Condition : isnotnull(s_store_sk#24) (20) BroadcastExchange -Input [2]: [s_store_sk#30, s_store_id#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [2]: [s_store_sk#24, s_store_id#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#21] -Right keys [1]: [cast(s_store_sk#30 as bigint)] +Left keys [1]: [store_sk#5] +Right keys [1]: [cast(s_store_sk#24 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] +Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Keys [1]: [s_store_id#31] -Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] -Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Keys [1]: [s_store_id#25] +Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] +Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] (24) Exchange -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Keys [1]: [s_store_id#31] -Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#46, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS RETURNS#47, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#48, store channel AS channel#49, concat(store, s_store_id#31) AS id#50] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Keys [1]: [s_store_id#25] +Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#40, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS RETURNS#41, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#42, store channel AS channel#43, concat(store, s_store_id#25) AS id#44] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] -Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] -Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (34) Union -Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#72] -Right keys [1]: [d_date_sk#27] +Left keys [1]: [date_sk#50] +Right keys [1]: [d_date_sk#21] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] -Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] +Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] +Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Condition : isnotnull(cp_catalog_page_sk#77) +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Condition : isnotnull(cp_catalog_page_sk#65) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#71] -Right keys [1]: [cp_catalog_page_sk#77] +Left keys [1]: [page_sk#49] +Right keys [1]: [cp_catalog_page_sk#65] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] -Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] +Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] (45) Exchange -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#93, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS RETURNS#94, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#95, catalog channel AS channel#96, concat(catalog_page, cp_catalog_page_id#78) AS id#97] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#81, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS RETURNS#82, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#66) AS id#85] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] -Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] (53) Filter [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Condition : isnotnull(wr_returned_date_sk#108) +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Condition : isnotnull(wr_returned_date_sk#96) (54) Scan parquet default.web_sales -Output [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Output [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 14] -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] (56) Filter [codegen id : 14] -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] -Condition : ((isnotnull(ws_item_sk#113) AND isnotnull(ws_order_number#114)) AND isnotnull(ws_web_site_sk#99)) +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Condition : ((isnotnull(ws_item_sk#101) AND isnotnull(ws_order_number#102)) AND isnotnull(ws_web_site_sk#87)) (57) BroadcastExchange -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#115] +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#103] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#109, wr_order_number#110] -Right keys [2]: [cast(ws_item_sk#113 as bigint), cast(ws_order_number#114 as bigint)] +Left keys [2]: [wr_item_sk#97, wr_order_number#98] +Right keys [2]: [cast(ws_item_sk#101 as bigint), cast(ws_order_number#102 as bigint)] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#116, wr_returned_date_sk#108 AS date_sk#117, 0.00 AS sales_price#118, 0.00 AS profit#119, wr_return_amt#111 AS return_amt#120, wr_net_loss#112 AS net_loss#121] -Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#104, wr_returned_date_sk#96 AS date_sk#105, 0.00 AS sales_price#106, 0.00 AS profit#107, wr_return_amt#99 AS return_amt#108, wr_net_loss#100 AS net_loss#109] +Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] (60) Union -Arguments: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127] (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#123] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#91] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127] -Input [7]: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127, d_date_sk#27] +Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] +Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#128, web_site_id#129] +Output [2]: [web_site_sk#110, web_site_id#111] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#128, web_site_id#129] +Input [2]: [web_site_sk#110, web_site_id#111] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#128, web_site_id#129] -Condition : isnotnull(web_site_sk#128) +Input [2]: [web_site_sk#110, web_site_id#111] +Condition : isnotnull(web_site_sk#110) (67) BroadcastExchange -Input [2]: [web_site_sk#128, web_site_id#129] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#130] +Input [2]: [web_site_sk#110, web_site_id#111] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#112] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#122] -Right keys [1]: [web_site_sk#128] +Left keys [1]: [wsr_web_site_sk#90] +Right keys [1]: [web_site_sk#110] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] -Input [7]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_sk#128, web_site_id#129] +Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] +Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#110, web_site_id#111] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] -Keys [1]: [web_site_id#129] -Functions [4]: [partial_sum(UnscaledValue(sales_price#124)), partial_sum(UnscaledValue(return_amt#126)), partial_sum(UnscaledValue(profit#125)), partial_sum(UnscaledValue(net_loss#127))] -Aggregate Attributes [4]: [sum#131, sum#132, sum#133, sum#134] -Results [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] +Keys [1]: [web_site_id#111] +Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum#113, sum#114, sum#115, sum#116] +Results [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] (71) Exchange -Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] -Arguments: hashpartitioning(web_site_id#129, 5), true, [id=#139] +Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Arguments: hashpartitioning(web_site_id#111, 5), true, [id=#121] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] -Keys [1]: [web_site_id#129] -Functions [4]: [sum(UnscaledValue(sales_price#124)), sum(UnscaledValue(return_amt#126)), sum(UnscaledValue(profit#125)), sum(UnscaledValue(net_loss#127))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#124))#140, sum(UnscaledValue(return_amt#126))#141, sum(UnscaledValue(profit#125))#142, sum(UnscaledValue(net_loss#127))#143] -Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#124))#140,17,2) AS sales#144, MakeDecimal(sum(UnscaledValue(return_amt#126))#141,17,2) AS RETURNS#145, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#125))#142,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#127))#143,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#146, web channel AS channel#147, concat(web_site, web_site_id#129) AS id#148] +Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Keys [1]: [web_site_id#111] +Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#122, sum(UnscaledValue(return_amt#94))#123, sum(UnscaledValue(profit#93))#124, sum(UnscaledValue(net_loss#95))#125] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#92))#122,17,2) AS sales#126, MakeDecimal(sum(UnscaledValue(return_amt#94))#123,17,2) AS RETURNS#127, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#124,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#125,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#128, web channel AS channel#129, concat(web_site, web_site_id#111) AS id#130] (73) Union -Arguments: [sales#149, returns#150, profit#151, channel#152, id#153] (74) Expand [codegen id : 20] -Input [5]: [sales#149, returns#150, profit#151, channel#152, id#153] -Arguments: [List(sales#149, returns#150, profit#151, channel#152, id#153, 0), List(sales#149, returns#150, profit#151, channel#152, null, 1), List(sales#149, returns#150, profit#151, null, null, 3)], [sales#149, returns#150, profit#151, channel#154, id#155, spark_grouping_id#156] +Input [5]: [sales#40, RETURNS#41, profit#42, channel#43, id#44] +Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#131, id#132, spark_grouping_id#133] (75) HashAggregate [codegen id : 20] -Input [6]: [sales#149, returns#150, profit#151, channel#154, id#155, spark_grouping_id#156] -Keys [3]: [channel#154, id#155, spark_grouping_id#156] -Functions [3]: [partial_sum(sales#149), partial_sum(returns#150), partial_sum(profit#151)] -Aggregate Attributes [6]: [sum#157, isEmpty#158, sum#159, isEmpty#160, sum#161, isEmpty#162] -Results [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] +Input [6]: [sales#40, returns#41, profit#42, channel#131, id#132, spark_grouping_id#133] +Keys [3]: [channel#131, id#132, spark_grouping_id#133] +Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] +Aggregate Attributes [6]: [sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Results [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] (76) Exchange -Input [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] -Arguments: hashpartitioning(channel#154, id#155, spark_grouping_id#156, 5), true, [id=#169] +Input [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] +Arguments: hashpartitioning(channel#131, id#132, spark_grouping_id#133, 5), true, [id=#146] (77) HashAggregate [codegen id : 21] -Input [9]: [channel#154, id#155, spark_grouping_id#156, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] -Keys [3]: [channel#154, id#155, spark_grouping_id#156] -Functions [3]: [sum(sales#149), sum(returns#150), sum(profit#151)] -Aggregate Attributes [3]: [sum(sales#149)#170, sum(returns#150)#171, sum(profit#151)#172] -Results [5]: [channel#154, id#155, sum(sales#149)#170 AS sales#173, sum(returns#150)#171 AS returns#174, sum(profit#151)#172 AS profit#175] +Input [9]: [channel#131, id#132, spark_grouping_id#133, sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] +Keys [3]: [channel#131, id#132, spark_grouping_id#133] +Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] +Aggregate Attributes [3]: [sum(sales#40)#147, sum(returns#41)#148, sum(profit#42)#149] +Results [5]: [channel#131, id#132, sum(sales#40)#147 AS sales#150, sum(returns#41)#148 AS returns#151, sum(profit#42)#149 AS profit#152] (78) TakeOrderedAndProject -Input [5]: [channel#154, id#155, sales#173, returns#174, profit#175] -Arguments: 100, [channel#154 ASC NULLS FIRST, id#155 ASC NULLS FIRST], [channel#154, id#155, sales#173, returns#174, profit#175] +Input [5]: [channel#131, id#132, sales#150, returns#151, profit#152] +Arguments: 100, [channel#131 ASC NULLS FIRST, id#132 ASC NULLS FIRST], [channel#131, id#132, sales#150, returns#151, profit#152] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt index f50bfd019faf5..9b7cc3360367c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + Union WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] InputAdapter @@ -19,7 +19,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -58,7 +58,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -91,7 +91,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt index 784e657f4dce2..d78565986bc0a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt @@ -109,298 +109,297 @@ Output [3]: [ws_sold_date_sk#7 AS sold_date_sk#10, ws_bill_customer_sk#9 AS cust Input [3]: [ws_sold_date_sk#7, ws_item_sk#8, ws_bill_customer_sk#9] (9) Union -Arguments: [sold_date_sk#13, customer_sk#14, item_sk#15] (10) Scan parquet default.item -Output [3]: [i_item_sk#16, i_class#17, i_category#18] +Output [3]: [i_item_sk#13, i_class#14, i_category#15] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women), EqualTo(i_class,maternity), IsNotNull(i_item_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] (12) Filter [codegen id : 3] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] -Condition : ((((isnotnull(i_category#18) AND isnotnull(i_class#17)) AND (i_category#18 = Women)) AND (i_class#17 = maternity)) AND isnotnull(i_item_sk#16)) +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Condition : ((((isnotnull(i_category#15) AND isnotnull(i_class#14)) AND (i_category#15 = Women)) AND (i_class#14 = maternity)) AND isnotnull(i_item_sk#13)) (13) Project [codegen id : 3] -Output [1]: [i_item_sk#16] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Output [1]: [i_item_sk#13] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] (14) BroadcastExchange -Input [1]: [i_item_sk#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] +Input [1]: [i_item_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [item_sk#15] -Right keys [1]: [i_item_sk#16] +Left keys [1]: [item_sk#6] +Right keys [1]: [i_item_sk#13] Join condition: None (16) Project [codegen id : 5] -Output [2]: [sold_date_sk#13, customer_sk#14] -Input [4]: [sold_date_sk#13, customer_sk#14, item_sk#15, i_item_sk#16] +Output [2]: [sold_date_sk#4, customer_sk#5] +Input [4]: [sold_date_sk#4, customer_sk#5, item_sk#6, i_item_sk#13] (17) Scan parquet default.date_dim -Output [3]: [d_date_sk#20, d_year#21, d_moy#22] +Output [3]: [d_date_sk#17, d_year#18, d_moy#19] 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), IsNotNull(d_date_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] (19) Filter [codegen id : 4] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] -Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 12)) AND (d_year#21 = 1998)) AND isnotnull(d_date_sk#20)) +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Condition : ((((isnotnull(d_moy#19) AND isnotnull(d_year#18)) AND (d_moy#19 = 12)) AND (d_year#18 = 1998)) AND isnotnull(d_date_sk#17)) (20) Project [codegen id : 4] -Output [1]: [d_date_sk#20] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Output [1]: [d_date_sk#17] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] (21) BroadcastExchange -Input [1]: [d_date_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [sold_date_sk#13] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [sold_date_sk#4] +Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 5] -Output [1]: [customer_sk#14] -Input [3]: [sold_date_sk#13, customer_sk#14, d_date_sk#20] +Output [1]: [customer_sk#5] +Input [3]: [sold_date_sk#4, customer_sk#5, d_date_sk#17] (24) Exchange -Input [1]: [customer_sk#14] -Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#24] +Input [1]: [customer_sk#5] +Arguments: hashpartitioning(customer_sk#5, 5), true, [id=#21] (25) Sort [codegen id : 6] -Input [1]: [customer_sk#14] -Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 +Input [1]: [customer_sk#5] +Arguments: [customer_sk#5 ASC NULLS FIRST], false, 0 (26) Scan parquet default.customer -Output [2]: [c_customer_sk#25, c_current_addr_sk#26] +Output [2]: [c_customer_sk#22, c_current_addr_sk#23] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] (28) Filter [codegen id : 7] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Condition : (isnotnull(c_customer_sk#25) AND isnotnull(c_current_addr_sk#26)) +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Condition : (isnotnull(c_customer_sk#22) AND isnotnull(c_current_addr_sk#23)) (29) Exchange -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Arguments: hashpartitioning(c_customer_sk#25, 5), true, [id=#27] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: hashpartitioning(c_customer_sk#22, 5), true, [id=#24] (30) Sort [codegen id : 8] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0 (31) SortMergeJoin [codegen id : 9] -Left keys [1]: [customer_sk#14] -Right keys [1]: [c_customer_sk#25] +Left keys [1]: [customer_sk#5] +Right keys [1]: [c_customer_sk#22] Join condition: None (32) Project [codegen id : 9] -Output [2]: [c_customer_sk#25, c_current_addr_sk#26] -Input [3]: [customer_sk#14, c_customer_sk#25, c_current_addr_sk#26] +Output [2]: [c_customer_sk#22, c_current_addr_sk#23] +Input [3]: [customer_sk#5, c_customer_sk#22, c_current_addr_sk#23] (33) HashAggregate [codegen id : 9] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Keys [2]: [c_customer_sk#25, c_current_addr_sk#26] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#25, c_current_addr_sk#26] +Results [2]: [c_customer_sk#22, c_current_addr_sk#23] (34) HashAggregate [codegen id : 9] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Keys [2]: [c_customer_sk#25, c_current_addr_sk#26] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#25, c_current_addr_sk#26] +Results [2]: [c_customer_sk#22, c_current_addr_sk#23] (35) Sort [codegen id : 9] -Input [2]: [c_customer_sk#25, c_current_addr_sk#26] -Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0 (36) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Output [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_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 (37) ColumnarToRow [codegen id : 10] -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] (38) Filter [codegen id : 10] -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] -Condition : (isnotnull(ss_customer_sk#29) AND isnotnull(ss_sold_date_sk#28)) +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Condition : (isnotnull(ss_customer_sk#26) AND isnotnull(ss_sold_date_sk#25)) (39) Exchange -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] -Arguments: hashpartitioning(ss_customer_sk#29, 5), true, [id=#31] +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Arguments: hashpartitioning(ss_customer_sk#26, 5), true, [id=#28] (40) Sort [codegen id : 11] -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] -Arguments: [ss_customer_sk#29 ASC NULLS FIRST], false, 0 +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 (41) SortMergeJoin [codegen id : 12] -Left keys [1]: [c_customer_sk#25] -Right keys [1]: [ss_customer_sk#29] +Left keys [1]: [c_customer_sk#22] +Right keys [1]: [ss_customer_sk#26] Join condition: None (42) Project [codegen id : 12] -Output [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] -Input [5]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Output [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] +Input [5]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] (43) Exchange -Input [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] -Arguments: hashpartitioning(c_current_addr_sk#26, 5), true, [id=#32] +Input [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] +Arguments: hashpartitioning(c_current_addr_sk#23, 5), true, [id=#29] (44) Sort [codegen id : 13] -Input [4]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30] -Arguments: [c_current_addr_sk#26 ASC NULLS FIRST], false, 0 +Input [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27] +Arguments: [c_current_addr_sk#23 ASC NULLS FIRST], false, 0 (45) Scan parquet default.customer_address -Output [3]: [ca_address_sk#33, ca_county#34, ca_state#35] +Output [3]: [ca_address_sk#30, ca_county#31, ca_state#32] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] ReadSchema: struct (46) ColumnarToRow [codegen id : 14] -Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] +Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] (47) Filter [codegen id : 14] -Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] -Condition : ((isnotnull(ca_address_sk#33) AND isnotnull(ca_county#34)) AND isnotnull(ca_state#35)) +Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] +Condition : ((isnotnull(ca_address_sk#30) AND isnotnull(ca_county#31)) AND isnotnull(ca_state#32)) (48) Exchange -Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] -Arguments: hashpartitioning(ca_address_sk#33, 5), true, [id=#36] +Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] +Arguments: hashpartitioning(ca_address_sk#30, 5), true, [id=#33] (49) Sort [codegen id : 15] -Input [3]: [ca_address_sk#33, ca_county#34, ca_state#35] -Arguments: [ca_address_sk#33 ASC NULLS FIRST], false, 0 +Input [3]: [ca_address_sk#30, ca_county#31, ca_state#32] +Arguments: [ca_address_sk#30 ASC NULLS FIRST], false, 0 (50) SortMergeJoin [codegen id : 18] -Left keys [1]: [c_current_addr_sk#26] -Right keys [1]: [ca_address_sk#33] +Left keys [1]: [c_current_addr_sk#23] +Right keys [1]: [ca_address_sk#30] Join condition: None (51) Project [codegen id : 18] -Output [5]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#34, ca_state#35] -Input [7]: [c_customer_sk#25, c_current_addr_sk#26, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_address_sk#33, ca_county#34, ca_state#35] +Output [5]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#31, ca_state#32] +Input [7]: [c_customer_sk#22, c_current_addr_sk#23, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_address_sk#30, ca_county#31, ca_state#32] (52) Scan parquet default.store -Output [2]: [s_county#37, s_state#38] +Output [2]: [s_county#34, s_state#35] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] ReadSchema: struct (53) ColumnarToRow [codegen id : 16] -Input [2]: [s_county#37, s_state#38] +Input [2]: [s_county#34, s_state#35] (54) Filter [codegen id : 16] -Input [2]: [s_county#37, s_state#38] -Condition : (isnotnull(s_county#37) AND isnotnull(s_state#38)) +Input [2]: [s_county#34, s_state#35] +Condition : (isnotnull(s_county#34) AND isnotnull(s_state#35)) (55) BroadcastExchange -Input [2]: [s_county#37, s_state#38] -Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#39] +Input [2]: [s_county#34, s_state#35] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#36] (56) BroadcastHashJoin [codegen id : 18] -Left keys [2]: [ca_county#34, ca_state#35] -Right keys [2]: [s_county#37, s_state#38] +Left keys [2]: [ca_county#31, ca_state#32] +Right keys [2]: [s_county#34, s_state#35] Join condition: None (57) Project [codegen id : 18] -Output [3]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30] -Input [7]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#34, ca_state#35, s_county#37, s_state#38] +Output [3]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27] +Input [7]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#31, ca_state#32, s_county#34, s_state#35] (58) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_month_seq#40] +Output [2]: [d_date_sk#17, d_month_seq#37] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] ReadSchema: struct (59) ColumnarToRow [codegen id : 17] -Input [2]: [d_date_sk#20, d_month_seq#40] +Input [2]: [d_date_sk#17, d_month_seq#37] (60) Filter [codegen id : 17] -Input [2]: [d_date_sk#20, d_month_seq#40] -Condition : (((isnotnull(d_month_seq#40) AND (d_month_seq#40 >= Subquery scalar-subquery#41, [id=#42])) AND (d_month_seq#40 <= Subquery scalar-subquery#43, [id=#44])) AND isnotnull(d_date_sk#20)) +Input [2]: [d_date_sk#17, d_month_seq#37] +Condition : (((isnotnull(d_month_seq#37) AND (d_month_seq#37 >= Subquery scalar-subquery#38, [id=#39])) AND (d_month_seq#37 <= Subquery scalar-subquery#40, [id=#41])) AND isnotnull(d_date_sk#17)) (61) Project [codegen id : 17] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_month_seq#40] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_month_seq#37] (62) BroadcastExchange -Input [1]: [d_date_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#45] +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] (63) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [ss_sold_date_sk#28] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ss_sold_date_sk#25] +Right keys [1]: [d_date_sk#17] Join condition: None (64) Project [codegen id : 18] -Output [2]: [c_customer_sk#25, ss_ext_sales_price#30] -Input [4]: [c_customer_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, d_date_sk#20] +Output [2]: [c_customer_sk#22, ss_ext_sales_price#27] +Input [4]: [c_customer_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, d_date_sk#17] (65) HashAggregate [codegen id : 18] -Input [2]: [c_customer_sk#25, ss_ext_sales_price#30] -Keys [1]: [c_customer_sk#25] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#30))] -Aggregate Attributes [1]: [sum#46] -Results [2]: [c_customer_sk#25, sum#47] +Input [2]: [c_customer_sk#22, ss_ext_sales_price#27] +Keys [1]: [c_customer_sk#22] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum#43] +Results [2]: [c_customer_sk#22, sum#44] (66) Exchange -Input [2]: [c_customer_sk#25, sum#47] -Arguments: hashpartitioning(c_customer_sk#25, 5), true, [id=#48] +Input [2]: [c_customer_sk#22, sum#44] +Arguments: hashpartitioning(c_customer_sk#22, 5), true, [id=#45] (67) HashAggregate [codegen id : 19] -Input [2]: [c_customer_sk#25, sum#47] -Keys [1]: [c_customer_sk#25] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#30))#49] -Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#30))#49,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#50] +Input [2]: [c_customer_sk#22, sum#44] +Keys [1]: [c_customer_sk#22] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#27))#46] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#27))#46,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#47] (68) HashAggregate [codegen id : 19] -Input [1]: [segment#50] -Keys [1]: [segment#50] +Input [1]: [segment#47] +Keys [1]: [segment#47] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#51] -Results [2]: [segment#50, count#52] +Aggregate Attributes [1]: [count#48] +Results [2]: [segment#47, count#49] (69) Exchange -Input [2]: [segment#50, count#52] -Arguments: hashpartitioning(segment#50, 5), true, [id=#53] +Input [2]: [segment#47, count#49] +Arguments: hashpartitioning(segment#47, 5), true, [id=#50] (70) HashAggregate [codegen id : 20] -Input [2]: [segment#50, count#52] -Keys [1]: [segment#50] +Input [2]: [segment#47, count#49] +Keys [1]: [segment#47] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#54] -Results [3]: [segment#50, count(1)#54 AS num_customers#55, (segment#50 * 50) AS segment_base#56] +Aggregate Attributes [1]: [count(1)#51] +Results [3]: [segment#47, count(1)#51 AS num_customers#52, (segment#47 * 50) AS segment_base#53] (71) TakeOrderedAndProject -Input [3]: [segment#50, num_customers#55, segment_base#56] -Arguments: 100, [segment#50 ASC NULLS FIRST, num_customers#55 ASC NULLS FIRST], [segment#50, num_customers#55, segment_base#56] +Input [3]: [segment#47, num_customers#52, segment_base#53] +Arguments: 100, [segment#47 ASC NULLS FIRST, num_customers#52 ASC NULLS FIRST], [segment#47, num_customers#52, segment_base#53] ===== Subqueries ===== -Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#38, [id=#39] * HashAggregate (78) +- Exchange (77) +- * HashAggregate (76) @@ -411,42 +410,42 @@ Subquery:1 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquer (72) Scan parquet default.date_dim -Output [3]: [d_month_seq#40, d_year#21, d_moy#22] +Output [3]: [d_month_seq#37, d_year#18, d_moy#19] 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,12)] ReadSchema: struct (73) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] (74) Filter [codegen id : 1] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] -Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) (75) Project [codegen id : 1] -Output [1]: [(d_month_seq#40 + 1) AS (d_month_seq + 1)#57] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Output [1]: [(d_month_seq#37 + 1) AS (d_month_seq + 1)#54] +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] (76) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 1)#57] -Keys [1]: [(d_month_seq + 1)#57] +Input [1]: [(d_month_seq + 1)#54] +Keys [1]: [(d_month_seq + 1)#54] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#57] +Results [1]: [(d_month_seq + 1)#54] (77) Exchange -Input [1]: [(d_month_seq + 1)#57] -Arguments: hashpartitioning((d_month_seq + 1)#57, 5), true, [id=#58] +Input [1]: [(d_month_seq + 1)#54] +Arguments: hashpartitioning((d_month_seq + 1)#54, 5), true, [id=#55] (78) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 1)#57] -Keys [1]: [(d_month_seq + 1)#57] +Input [1]: [(d_month_seq + 1)#54] +Keys [1]: [(d_month_seq + 1)#54] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#57] +Results [1]: [(d_month_seq + 1)#54] -Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#43, [id=#44] +Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquery#40, [id=#41] * HashAggregate (85) +- Exchange (84) +- * HashAggregate (83) @@ -457,39 +456,39 @@ Subquery:2 Hosting operator id = 60 Hosting Expression = Subquery scalar-subquer (79) Scan parquet default.date_dim -Output [3]: [d_month_seq#40, d_year#21, d_moy#22] +Output [3]: [d_month_seq#37, d_year#18, d_moy#19] 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,12)] ReadSchema: struct (80) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] (81) Filter [codegen id : 1] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] -Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] +Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) (82) Project [codegen id : 1] -Output [1]: [(d_month_seq#40 + 3) AS (d_month_seq + 3)#59] -Input [3]: [d_month_seq#40, d_year#21, d_moy#22] +Output [1]: [(d_month_seq#37 + 3) AS (d_month_seq + 3)#56] +Input [3]: [d_month_seq#37, d_year#18, d_moy#19] (83) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 3)#59] -Keys [1]: [(d_month_seq + 3)#59] +Input [1]: [(d_month_seq + 3)#56] +Keys [1]: [(d_month_seq + 3)#56] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#59] +Results [1]: [(d_month_seq + 3)#56] (84) Exchange -Input [1]: [(d_month_seq + 3)#59] -Arguments: hashpartitioning((d_month_seq + 3)#59, 5), true, [id=#60] +Input [1]: [(d_month_seq + 3)#56] +Arguments: hashpartitioning((d_month_seq + 3)#56, 5), true, [id=#57] (85) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 3)#59] -Keys [1]: [(d_month_seq + 3)#59] +Input [1]: [(d_month_seq + 3)#56] +Keys [1]: [(d_month_seq + 3)#56] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#59] +Results [1]: [(d_month_seq + 3)#56] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt index 1c1f3ecb168f1..cb7130f53c9a9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt @@ -42,7 +42,7 @@ TakeOrderedAndProject [segment,num_customers,segment_base] Project [sold_date_sk,customer_sk] BroadcastHashJoin [item_sk,i_item_sk] InputAdapter - Union [sold_date_sk,customer_sk,item_sk] + Union WholeStageCodegen (1) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] Filter [cs_item_sk,cs_sold_date_sk,cs_bill_customer_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt index e967b975da37c..2e93e26056615 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt @@ -102,270 +102,269 @@ Output [3]: [ws_sold_date_sk#7 AS sold_date_sk#10, ws_bill_customer_sk#9 AS cust Input [3]: [ws_sold_date_sk#7, ws_item_sk#8, ws_bill_customer_sk#9] (9) Union -Arguments: [sold_date_sk#13, customer_sk#14, item_sk#15] (10) Scan parquet default.item -Output [3]: [i_item_sk#16, i_class#17, i_category#18] +Output [3]: [i_item_sk#13, i_class#14, i_category#15] Batched: true Location [not included in comparison]/{warehouse_dir}/item] PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women), EqualTo(i_class,maternity), IsNotNull(i_item_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] (12) Filter [codegen id : 3] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] -Condition : ((((isnotnull(i_category#18) AND isnotnull(i_class#17)) AND (i_category#18 = Women)) AND (i_class#17 = maternity)) AND isnotnull(i_item_sk#16)) +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Condition : ((((isnotnull(i_category#15) AND isnotnull(i_class#14)) AND (i_category#15 = Women)) AND (i_class#14 = maternity)) AND isnotnull(i_item_sk#13)) (13) Project [codegen id : 3] -Output [1]: [i_item_sk#16] -Input [3]: [i_item_sk#16, i_class#17, i_category#18] +Output [1]: [i_item_sk#13] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] (14) BroadcastExchange -Input [1]: [i_item_sk#16] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] +Input [1]: [i_item_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] (15) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [item_sk#15] -Right keys [1]: [i_item_sk#16] +Left keys [1]: [item_sk#6] +Right keys [1]: [i_item_sk#13] Join condition: None (16) Project [codegen id : 6] -Output [2]: [sold_date_sk#13, customer_sk#14] -Input [4]: [sold_date_sk#13, customer_sk#14, item_sk#15, i_item_sk#16] +Output [2]: [sold_date_sk#4, customer_sk#5] +Input [4]: [sold_date_sk#4, customer_sk#5, item_sk#6, i_item_sk#13] (17) Scan parquet default.date_dim -Output [3]: [d_date_sk#20, d_year#21, d_moy#22] +Output [3]: [d_date_sk#17, d_year#18, d_moy#19] 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), IsNotNull(d_date_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] (19) Filter [codegen id : 4] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] -Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 12)) AND (d_year#21 = 1998)) AND isnotnull(d_date_sk#20)) +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Condition : ((((isnotnull(d_moy#19) AND isnotnull(d_year#18)) AND (d_moy#19 = 12)) AND (d_year#18 = 1998)) AND isnotnull(d_date_sk#17)) (20) Project [codegen id : 4] -Output [1]: [d_date_sk#20] -Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Output [1]: [d_date_sk#17] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] (21) BroadcastExchange -Input [1]: [d_date_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] (22) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [sold_date_sk#13] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [sold_date_sk#4] +Right keys [1]: [d_date_sk#17] Join condition: None (23) Project [codegen id : 6] -Output [1]: [customer_sk#14] -Input [3]: [sold_date_sk#13, customer_sk#14, d_date_sk#20] +Output [1]: [customer_sk#5] +Input [3]: [sold_date_sk#4, customer_sk#5, d_date_sk#17] (24) Scan parquet default.customer -Output [2]: [c_customer_sk#24, c_current_addr_sk#25] +Output [2]: [c_customer_sk#21, c_current_addr_sk#22] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] ReadSchema: struct (25) ColumnarToRow [codegen id : 5] -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] (26) Filter [codegen id : 5] -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] -Condition : (isnotnull(c_customer_sk#24) AND isnotnull(c_current_addr_sk#25)) +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_current_addr_sk#22)) (27) BroadcastExchange -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] (28) BroadcastHashJoin [codegen id : 6] -Left keys [1]: [customer_sk#14] -Right keys [1]: [c_customer_sk#24] +Left keys [1]: [customer_sk#5] +Right keys [1]: [c_customer_sk#21] Join condition: None (29) Project [codegen id : 6] -Output [2]: [c_customer_sk#24, c_current_addr_sk#25] -Input [3]: [customer_sk#14, c_customer_sk#24, c_current_addr_sk#25] +Output [2]: [c_customer_sk#21, c_current_addr_sk#22] +Input [3]: [customer_sk#5, c_customer_sk#21, c_current_addr_sk#22] (30) HashAggregate [codegen id : 6] -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] -Keys [2]: [c_customer_sk#24, c_current_addr_sk#25] +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Keys [2]: [c_customer_sk#21, c_current_addr_sk#22] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#24, c_current_addr_sk#25] +Results [2]: [c_customer_sk#21, c_current_addr_sk#22] (31) Exchange -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] -Arguments: hashpartitioning(c_customer_sk#24, c_current_addr_sk#25, 5), true, [id=#27] +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Arguments: hashpartitioning(c_customer_sk#21, c_current_addr_sk#22, 5), true, [id=#24] (32) HashAggregate [codegen id : 11] -Input [2]: [c_customer_sk#24, c_current_addr_sk#25] -Keys [2]: [c_customer_sk#24, c_current_addr_sk#25] +Input [2]: [c_customer_sk#21, c_current_addr_sk#22] +Keys [2]: [c_customer_sk#21, c_current_addr_sk#22] Functions: [] Aggregate Attributes: [] -Results [2]: [c_customer_sk#24, c_current_addr_sk#25] +Results [2]: [c_customer_sk#21, c_current_addr_sk#22] (33) Scan parquet default.store_sales -Output [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Output [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_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 (34) ColumnarToRow [codegen id : 7] -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] (35) Filter [codegen id : 7] -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] -Condition : (isnotnull(ss_customer_sk#29) AND isnotnull(ss_sold_date_sk#28)) +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Condition : (isnotnull(ss_customer_sk#26) AND isnotnull(ss_sold_date_sk#25)) (36) BroadcastExchange -Input [3]: [ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] +Input [3]: [ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#28] (37) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [c_customer_sk#24] -Right keys [1]: [ss_customer_sk#29] +Left keys [1]: [c_customer_sk#21] +Right keys [1]: [ss_customer_sk#26] Join condition: None (38) Project [codegen id : 11] -Output [4]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30] -Input [5]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_customer_sk#29, ss_ext_sales_price#30] +Output [4]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27] +Input [5]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_customer_sk#26, ss_ext_sales_price#27] (39) Scan parquet default.customer_address -Output [3]: [ca_address_sk#32, ca_county#33, ca_state#34] +Output [3]: [ca_address_sk#29, ca_county#30, ca_state#31] Batched: true Location [not included in comparison]/{warehouse_dir}/customer_address] PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] ReadSchema: struct (40) ColumnarToRow [codegen id : 8] -Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] +Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] (41) Filter [codegen id : 8] -Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] -Condition : ((isnotnull(ca_address_sk#32) AND isnotnull(ca_county#33)) AND isnotnull(ca_state#34)) +Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] +Condition : ((isnotnull(ca_address_sk#29) AND isnotnull(ca_county#30)) AND isnotnull(ca_state#31)) (42) BroadcastExchange -Input [3]: [ca_address_sk#32, ca_county#33, ca_state#34] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#35] +Input [3]: [ca_address_sk#29, ca_county#30, ca_state#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] (43) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [c_current_addr_sk#25] -Right keys [1]: [ca_address_sk#32] +Left keys [1]: [c_current_addr_sk#22] +Right keys [1]: [ca_address_sk#29] Join condition: None (44) Project [codegen id : 11] -Output [5]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#33, ca_state#34] -Input [7]: [c_customer_sk#24, c_current_addr_sk#25, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_address_sk#32, ca_county#33, ca_state#34] +Output [5]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#30, ca_state#31] +Input [7]: [c_customer_sk#21, c_current_addr_sk#22, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_address_sk#29, ca_county#30, ca_state#31] (45) Scan parquet default.store -Output [2]: [s_county#36, s_state#37] +Output [2]: [s_county#33, s_state#34] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] ReadSchema: struct (46) ColumnarToRow [codegen id : 9] -Input [2]: [s_county#36, s_state#37] +Input [2]: [s_county#33, s_state#34] (47) Filter [codegen id : 9] -Input [2]: [s_county#36, s_state#37] -Condition : (isnotnull(s_county#36) AND isnotnull(s_state#37)) +Input [2]: [s_county#33, s_state#34] +Condition : (isnotnull(s_county#33) AND isnotnull(s_state#34)) (48) BroadcastExchange -Input [2]: [s_county#36, s_state#37] -Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#38] +Input [2]: [s_county#33, s_state#34] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#35] (49) BroadcastHashJoin [codegen id : 11] -Left keys [2]: [ca_county#33, ca_state#34] -Right keys [2]: [s_county#36, s_state#37] +Left keys [2]: [ca_county#30, ca_state#31] +Right keys [2]: [s_county#33, s_state#34] Join condition: None (50) Project [codegen id : 11] -Output [3]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30] -Input [7]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, ca_county#33, ca_state#34, s_county#36, s_state#37] +Output [3]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27] +Input [7]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, ca_county#30, ca_state#31, s_county#33, s_state#34] (51) Scan parquet default.date_dim -Output [2]: [d_date_sk#20, d_month_seq#39] +Output [2]: [d_date_sk#17, d_month_seq#36] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 10] -Input [2]: [d_date_sk#20, d_month_seq#39] +Input [2]: [d_date_sk#17, d_month_seq#36] (53) Filter [codegen id : 10] -Input [2]: [d_date_sk#20, d_month_seq#39] -Condition : (((isnotnull(d_month_seq#39) AND (d_month_seq#39 >= Subquery scalar-subquery#40, [id=#41])) AND (d_month_seq#39 <= Subquery scalar-subquery#42, [id=#43])) AND isnotnull(d_date_sk#20)) +Input [2]: [d_date_sk#17, d_month_seq#36] +Condition : (((isnotnull(d_month_seq#36) AND (d_month_seq#36 >= Subquery scalar-subquery#37, [id=#38])) AND (d_month_seq#36 <= Subquery scalar-subquery#39, [id=#40])) AND isnotnull(d_date_sk#17)) (54) Project [codegen id : 10] -Output [1]: [d_date_sk#20] -Input [2]: [d_date_sk#20, d_month_seq#39] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_month_seq#36] (55) BroadcastExchange -Input [1]: [d_date_sk#20] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#41] (56) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [ss_sold_date_sk#28] -Right keys [1]: [d_date_sk#20] +Left keys [1]: [ss_sold_date_sk#25] +Right keys [1]: [d_date_sk#17] Join condition: None (57) Project [codegen id : 11] -Output [2]: [c_customer_sk#24, ss_ext_sales_price#30] -Input [4]: [c_customer_sk#24, ss_sold_date_sk#28, ss_ext_sales_price#30, d_date_sk#20] +Output [2]: [c_customer_sk#21, ss_ext_sales_price#27] +Input [4]: [c_customer_sk#21, ss_sold_date_sk#25, ss_ext_sales_price#27, d_date_sk#17] (58) HashAggregate [codegen id : 11] -Input [2]: [c_customer_sk#24, ss_ext_sales_price#30] -Keys [1]: [c_customer_sk#24] -Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#30))] -Aggregate Attributes [1]: [sum#45] -Results [2]: [c_customer_sk#24, sum#46] +Input [2]: [c_customer_sk#21, ss_ext_sales_price#27] +Keys [1]: [c_customer_sk#21] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum#42] +Results [2]: [c_customer_sk#21, sum#43] (59) Exchange -Input [2]: [c_customer_sk#24, sum#46] -Arguments: hashpartitioning(c_customer_sk#24, 5), true, [id=#47] +Input [2]: [c_customer_sk#21, sum#43] +Arguments: hashpartitioning(c_customer_sk#21, 5), true, [id=#44] (60) HashAggregate [codegen id : 12] -Input [2]: [c_customer_sk#24, sum#46] -Keys [1]: [c_customer_sk#24] -Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#30))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#30))#48] -Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#30))#48,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#49] +Input [2]: [c_customer_sk#21, sum#43] +Keys [1]: [c_customer_sk#21] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#27))#45] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#27))#45,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#46] (61) HashAggregate [codegen id : 12] -Input [1]: [segment#49] -Keys [1]: [segment#49] +Input [1]: [segment#46] +Keys [1]: [segment#46] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#50] -Results [2]: [segment#49, count#51] +Aggregate Attributes [1]: [count#47] +Results [2]: [segment#46, count#48] (62) Exchange -Input [2]: [segment#49, count#51] -Arguments: hashpartitioning(segment#49, 5), true, [id=#52] +Input [2]: [segment#46, count#48] +Arguments: hashpartitioning(segment#46, 5), true, [id=#49] (63) HashAggregate [codegen id : 13] -Input [2]: [segment#49, count#51] -Keys [1]: [segment#49] +Input [2]: [segment#46, count#48] +Keys [1]: [segment#46] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#53] -Results [3]: [segment#49, count(1)#53 AS num_customers#54, (segment#49 * 50) AS segment_base#55] +Aggregate Attributes [1]: [count(1)#50] +Results [3]: [segment#46, count(1)#50 AS num_customers#51, (segment#46 * 50) AS segment_base#52] (64) TakeOrderedAndProject -Input [3]: [segment#49, num_customers#54, segment_base#55] -Arguments: 100, [segment#49 ASC NULLS FIRST, num_customers#54 ASC NULLS FIRST], [segment#49, num_customers#54, segment_base#55] +Input [3]: [segment#46, num_customers#51, segment_base#52] +Arguments: 100, [segment#46 ASC NULLS FIRST, num_customers#51 ASC NULLS FIRST], [segment#46, num_customers#51, segment_base#52] ===== Subqueries ===== -Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#40, [id=#41] +Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#37, [id=#38] * HashAggregate (71) +- Exchange (70) +- * HashAggregate (69) @@ -376,42 +375,42 @@ Subquery:1 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquer (65) Scan parquet default.date_dim -Output [3]: [d_month_seq#39, d_year#21, d_moy#22] +Output [3]: [d_month_seq#36, d_year#18, d_moy#19] 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,12)] ReadSchema: struct (66) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] (67) Filter [codegen id : 1] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] -Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) (68) Project [codegen id : 1] -Output [1]: [(d_month_seq#39 + 1) AS (d_month_seq + 1)#56] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Output [1]: [(d_month_seq#36 + 1) AS (d_month_seq + 1)#53] +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] (69) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 1)#56] -Keys [1]: [(d_month_seq + 1)#56] +Input [1]: [(d_month_seq + 1)#53] +Keys [1]: [(d_month_seq + 1)#53] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#56] +Results [1]: [(d_month_seq + 1)#53] (70) Exchange -Input [1]: [(d_month_seq + 1)#56] -Arguments: hashpartitioning((d_month_seq + 1)#56, 5), true, [id=#57] +Input [1]: [(d_month_seq + 1)#53] +Arguments: hashpartitioning((d_month_seq + 1)#53, 5), true, [id=#54] (71) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 1)#56] -Keys [1]: [(d_month_seq + 1)#56] +Input [1]: [(d_month_seq + 1)#53] +Keys [1]: [(d_month_seq + 1)#53] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 1)#56] +Results [1]: [(d_month_seq + 1)#53] -Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#42, [id=#43] +Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#39, [id=#40] * HashAggregate (78) +- Exchange (77) +- * HashAggregate (76) @@ -422,39 +421,39 @@ Subquery:2 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquer (72) Scan parquet default.date_dim -Output [3]: [d_month_seq#39, d_year#21, d_moy#22] +Output [3]: [d_month_seq#36, d_year#18, d_moy#19] 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,12)] ReadSchema: struct (73) ColumnarToRow [codegen id : 1] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] (74) Filter [codegen id : 1] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] -Condition : (((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 12)) +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] +Condition : (((isnotnull(d_year#18) AND isnotnull(d_moy#19)) AND (d_year#18 = 1998)) AND (d_moy#19 = 12)) (75) Project [codegen id : 1] -Output [1]: [(d_month_seq#39 + 3) AS (d_month_seq + 3)#58] -Input [3]: [d_month_seq#39, d_year#21, d_moy#22] +Output [1]: [(d_month_seq#36 + 3) AS (d_month_seq + 3)#55] +Input [3]: [d_month_seq#36, d_year#18, d_moy#19] (76) HashAggregate [codegen id : 1] -Input [1]: [(d_month_seq + 3)#58] -Keys [1]: [(d_month_seq + 3)#58] +Input [1]: [(d_month_seq + 3)#55] +Keys [1]: [(d_month_seq + 3)#55] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#58] +Results [1]: [(d_month_seq + 3)#55] (77) Exchange -Input [1]: [(d_month_seq + 3)#58] -Arguments: hashpartitioning((d_month_seq + 3)#58, 5), true, [id=#59] +Input [1]: [(d_month_seq + 3)#55] +Arguments: hashpartitioning((d_month_seq + 3)#55, 5), true, [id=#56] (78) HashAggregate [codegen id : 2] -Input [1]: [(d_month_seq + 3)#58] -Keys [1]: [(d_month_seq + 3)#58] +Input [1]: [(d_month_seq + 3)#55] +Keys [1]: [(d_month_seq + 3)#55] Functions: [] Aggregate Attributes: [] -Results [1]: [(d_month_seq + 3)#58] +Results [1]: [(d_month_seq + 3)#55] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt index 9e30650c82e2e..dd92c52db4c7e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt @@ -30,7 +30,7 @@ TakeOrderedAndProject [segment,num_customers,segment_base] Project [sold_date_sk,customer_sk] BroadcastHashJoin [item_sk,i_item_sk] InputAdapter - Union [sold_date_sk,customer_sk,item_sk] + Union WholeStageCodegen (1) Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] Filter [cs_item_sk,cs_sold_date_sk,cs_bill_customer_sk] 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 08dd4f8e2b568..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 @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#41, total_sales#42] -Keys [1]: [i_item_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_item_id#41, sum#45, isEmpty#46] +Input [2]: [i_item_id#13, total_sales#22] +Keys [1]: [i_item_id#13] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_item_id#13, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Keys [1]: [i_item_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Keys [1]: [i_item_id#13] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_item_id#41, total_sales#49] -Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] +Input [2]: [i_item_id#13, total_sales#47] +Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] 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 d60caea0dd63d..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_item_id] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_item_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt index 08dd4f8e2b568..d0d64721100c3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#41, total_sales#42] -Keys [1]: [i_item_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_item_id#41, sum#45, isEmpty#46] +Input [2]: [i_item_id#13, total_sales#22] +Keys [1]: [i_item_id#13] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_item_id#13, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Keys [1]: [i_item_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Keys [1]: [i_item_id#13] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_item_id#41, total_sales#49] -Arguments: 100, [total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] +Input [2]: [i_item_id#13, total_sales#47] +Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt index d60caea0dd63d..5825c6f6e757a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [total_sales,i_item_id] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_item_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter 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 7ff60649a86ad..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 @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#41, total_sales#42] -Keys [1]: [i_item_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_item_id#41, sum#45, isEmpty#46] +Input [2]: [i_item_id#13, total_sales#22] +Keys [1]: [i_item_id#13] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_item_id#13, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Keys [1]: [i_item_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Keys [1]: [i_item_id#13] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_item_id#41, total_sales#49] -Arguments: 100, [i_item_id#41 ASC NULLS FIRST, total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] +Input [2]: [i_item_id#13, total_sales#47] +Arguments: 100, [i_item_id#13 ASC NULLS FIRST, total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] 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 131be7594dba5..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [i_item_id,total_sales] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_item_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt index 7ff60649a86ad..f838f8f1a18af 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt @@ -353,27 +353,26 @@ Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#35))#39] Results [2]: [i_item_id#13, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#35))#39,17,2) AS total_sales#40] (63) Union -Arguments: [i_item_id#41, total_sales#42] (64) HashAggregate [codegen id : 19] -Input [2]: [i_item_id#41, total_sales#42] -Keys [1]: [i_item_id#41] -Functions [1]: [partial_sum(total_sales#42)] -Aggregate Attributes [2]: [sum#43, isEmpty#44] -Results [3]: [i_item_id#41, sum#45, isEmpty#46] +Input [2]: [i_item_id#13, total_sales#22] +Keys [1]: [i_item_id#13] +Functions [1]: [partial_sum(total_sales#22)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [3]: [i_item_id#13, sum#43, isEmpty#44] (65) Exchange -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Arguments: hashpartitioning(i_item_id#41, 5), true, [id=#47] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(i_item_id#13, 5), true, [id=#45] (66) HashAggregate [codegen id : 20] -Input [3]: [i_item_id#41, sum#45, isEmpty#46] -Keys [1]: [i_item_id#41] -Functions [1]: [sum(total_sales#42)] -Aggregate Attributes [1]: [sum(total_sales#42)#48] -Results [2]: [i_item_id#41, sum(total_sales#42)#48 AS total_sales#49] +Input [3]: [i_item_id#13, sum#43, isEmpty#44] +Keys [1]: [i_item_id#13] +Functions [1]: [sum(total_sales#22)] +Aggregate Attributes [1]: [sum(total_sales#22)#46] +Results [2]: [i_item_id#13, sum(total_sales#22)#46 AS total_sales#47] (67) TakeOrderedAndProject -Input [2]: [i_item_id#41, total_sales#49] -Arguments: 100, [i_item_id#41 ASC NULLS FIRST, total_sales#49 ASC NULLS FIRST], [i_item_id#41, total_sales#49] +Input [2]: [i_item_id#13, total_sales#47] +Arguments: 100, [i_item_id#13 ASC NULLS FIRST, total_sales#47 ASC NULLS FIRST], [i_item_id#13, total_sales#47] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt index 131be7594dba5..fb9e4e50775dd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [i_item_id,total_sales] WholeStageCodegen (19) HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] InputAdapter - Union [i_item_id,total_sales] + Union WholeStageCodegen (6) HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt index 20e9a17c06a80..5db04537d6371 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt @@ -285,27 +285,26 @@ Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((pro Results [32]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, DHL,BARIAN AS ship_carriers#301, d_year#15 AS year#302, sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#277 AS jan_sales#303, sum(CASE WHEN (d_moy#16 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#278 AS feb_sales#304, sum(CASE WHEN (d_moy#16 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#279 AS mar_sales#305, sum(CASE WHEN (d_moy#16 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#280 AS apr_sales#306, sum(CASE WHEN (d_moy#16 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#281 AS may_sales#307, sum(CASE WHEN (d_moy#16 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#282 AS jun_sales#308, sum(CASE WHEN (d_moy#16 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#283 AS jul_sales#309, sum(CASE WHEN (d_moy#16 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#284 AS aug_sales#310, sum(CASE WHEN (d_moy#16 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#285 AS sep_sales#311, sum(CASE WHEN (d_moy#16 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#286 AS oct_sales#312, sum(CASE WHEN (d_moy#16 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#287 AS nov_sales#313, sum(CASE WHEN (d_moy#16 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#288 AS dec_sales#314, sum(CASE WHEN (d_moy#16 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#289 AS jan_net#315, sum(CASE WHEN (d_moy#16 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS feb_net#316, sum(CASE WHEN (d_moy#16 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS mar_net#317, sum(CASE WHEN (d_moy#16 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS apr_net#318, sum(CASE WHEN (d_moy#16 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS may_net#319, sum(CASE WHEN (d_moy#16 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS jun_net#320, sum(CASE WHEN (d_moy#16 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jul_net#321, sum(CASE WHEN (d_moy#16 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS aug_net#322, sum(CASE WHEN (d_moy#16 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS sep_net#323, sum(CASE WHEN (d_moy#16 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS oct_net#324, sum(CASE WHEN (d_moy#16 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS nov_net#325, sum(CASE WHEN (d_moy#16 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS dec_net#326] (51) Union -Arguments: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, ... 8 more fields] (52) HashAggregate [codegen id : 13] -Input [32]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, may_net#351, jun_net#352, jul_net#353, aug_net#354, sep_net#355, oct_net#356, nov_net#357, dec_net#358] -Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] -Functions [36]: [partial_sum(jan_sales#335), partial_sum(feb_sales#336), partial_sum(mar_sales#337), partial_sum(apr_sales#338), partial_sum(may_sales#339), partial_sum(jun_sales#340), partial_sum(jul_sales#341), partial_sum(aug_sales#342), partial_sum(sep_sales#343), partial_sum(oct_sales#344), partial_sum(nov_sales#345), partial_sum(dec_sales#346), partial_sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#347), partial_sum(feb_net#348), partial_sum(mar_net#349), partial_sum(apr_net#350), partial_sum(may_net#351), partial_sum(jun_net#352), partial_sum(jul_net#353), partial_sum(aug_net#354), partial_sum(sep_net#355), partial_sum(oct_net#356), partial_sum(nov_net#357), partial_sum(dec_net#358)] -Aggregate Attributes [72]: [sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430] -Results [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Input [32]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#149, feb_sales#150, mar_sales#151, apr_sales#152, may_sales#153, jun_sales#154, jul_sales#155, aug_sales#156, sep_sales#157, oct_sales#158, nov_sales#159, dec_sales#160, jan_net#161, feb_net#162, mar_net#163, apr_net#164, may_net#165, jun_net#166, jul_net#167, aug_net#168, sep_net#169, oct_net#170, nov_net#171, dec_net#172] +Keys [8]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148] +Functions [36]: [partial_sum(jan_sales#149), partial_sum(feb_sales#150), partial_sum(mar_sales#151), partial_sum(apr_sales#152), partial_sum(may_sales#153), partial_sum(jun_sales#154), partial_sum(jul_sales#155), partial_sum(aug_sales#156), partial_sum(sep_sales#157), partial_sum(oct_sales#158), partial_sum(nov_sales#159), partial_sum(dec_sales#160), partial_sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#161), partial_sum(feb_net#162), partial_sum(mar_net#163), partial_sum(apr_net#164), partial_sum(may_net#165), partial_sum(jun_net#166), partial_sum(jul_net#167), partial_sum(aug_net#168), partial_sum(sep_net#169), partial_sum(oct_net#170), partial_sum(nov_net#171), partial_sum(dec_net#172)] +Aggregate Attributes [72]: [sum#327, isEmpty#328, sum#329, isEmpty#330, sum#331, isEmpty#332, sum#333, isEmpty#334, sum#335, isEmpty#336, sum#337, isEmpty#338, sum#339, isEmpty#340, sum#341, isEmpty#342, sum#343, isEmpty#344, sum#345, isEmpty#346, sum#347, isEmpty#348, sum#349, isEmpty#350, sum#351, isEmpty#352, sum#353, isEmpty#354, sum#355, isEmpty#356, sum#357, isEmpty#358, sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398] +Results [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] (53) Exchange -Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] -Arguments: hashpartitioning(w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, 5), true, [id=#503] +Input [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Arguments: hashpartitioning(w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, 5), true, [id=#471] (54) HashAggregate [codegen id : 14] -Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] -Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] -Functions [36]: [sum(jan_sales#335), sum(feb_sales#336), sum(mar_sales#337), sum(apr_sales#338), sum(may_sales#339), sum(jun_sales#340), sum(jul_sales#341), sum(aug_sales#342), sum(sep_sales#343), sum(oct_sales#344), sum(nov_sales#345), sum(dec_sales#346), sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#347), sum(feb_net#348), sum(mar_net#349), sum(apr_net#350), sum(may_net#351), sum(jun_net#352), sum(jul_net#353), sum(aug_net#354), sum(sep_net#355), sum(oct_net#356), sum(nov_net#357), sum(dec_net#358)] -Aggregate Attributes [36]: [sum(jan_sales#335)#504, sum(feb_sales#336)#505, sum(mar_sales#337)#506, sum(apr_sales#338)#507, sum(may_sales#339)#508, sum(jun_sales#340)#509, sum(jul_sales#341)#510, sum(aug_sales#342)#511, sum(sep_sales#343)#512, sum(oct_sales#344)#513, sum(nov_sales#345)#514, sum(dec_sales#346)#515, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527, sum(jan_net#347)#528, sum(feb_net#348)#529, sum(mar_net#349)#530, sum(apr_net#350)#531, sum(may_net#351)#532, sum(jun_net#352)#533, sum(jul_net#353)#534, sum(aug_net#354)#535, sum(sep_net#355)#536, sum(oct_net#356)#537, sum(nov_net#357)#538, sum(dec_net#358)#539] -Results [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum(jan_sales#335)#504 AS jan_sales#540, sum(feb_sales#336)#505 AS feb_sales#541, sum(mar_sales#337)#506 AS mar_sales#542, sum(apr_sales#338)#507 AS apr_sales#543, sum(may_sales#339)#508 AS may_sales#544, sum(jun_sales#340)#509 AS jun_sales#545, sum(jul_sales#341)#510 AS jul_sales#546, sum(aug_sales#342)#511 AS aug_sales#547, sum(sep_sales#343)#512 AS sep_sales#548, sum(oct_sales#344)#513 AS oct_sales#549, sum(nov_sales#345)#514 AS nov_sales#550, sum(dec_sales#346)#515 AS dec_sales#551, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516 AS jan_sales_per_sq_foot#552, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517 AS feb_sales_per_sq_foot#553, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518 AS mar_sales_per_sq_foot#554, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519 AS apr_sales_per_sq_foot#555, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520 AS may_sales_per_sq_foot#556, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521 AS jun_sales_per_sq_foot#557, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522 AS jul_sales_per_sq_foot#558, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523 AS aug_sales_per_sq_foot#559, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524 AS sep_sales_per_sq_foot#560, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525 AS oct_sales_per_sq_foot#561, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526 AS nov_sales_per_sq_foot#562, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527 AS dec_sales_per_sq_foot#563, sum(jan_net#347)#528 AS jan_net#564, sum(feb_net#348)#529 AS feb_net#565, sum(mar_net#349)#530 AS mar_net#566, sum(apr_net#350)#531 AS apr_net#567, sum(may_net#351)#532 AS may_net#568, sum(jun_net#352)#533 AS jun_net#569, sum(jul_net#353)#534 AS jul_net#570, sum(aug_net#354)#535 AS aug_net#571, sum(sep_net#355)#536 AS sep_net#572, sum(oct_net#356)#537 AS oct_net#573, sum(nov_net#357)#538 AS nov_net#574, sum(dec_net#358)#539 AS dec_net#575] +Input [80]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Keys [8]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148] +Functions [36]: [sum(jan_sales#149), sum(feb_sales#150), sum(mar_sales#151), sum(apr_sales#152), sum(may_sales#153), sum(jun_sales#154), sum(jul_sales#155), sum(aug_sales#156), sum(sep_sales#157), sum(oct_sales#158), sum(nov_sales#159), sum(dec_sales#160), sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#161), sum(feb_net#162), sum(mar_net#163), sum(apr_net#164), sum(may_net#165), sum(jun_net#166), sum(jul_net#167), sum(aug_net#168), sum(sep_net#169), sum(oct_net#170), sum(nov_net#171), sum(dec_net#172)] +Aggregate Attributes [36]: [sum(jan_sales#149)#472, sum(feb_sales#150)#473, sum(mar_sales#151)#474, sum(apr_sales#152)#475, sum(may_sales#153)#476, sum(jun_sales#154)#477, sum(jul_sales#155)#478, sum(aug_sales#156)#479, sum(sep_sales#157)#480, sum(oct_sales#158)#481, sum(nov_sales#159)#482, sum(dec_sales#160)#483, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495, sum(jan_net#161)#496, sum(feb_net#162)#497, sum(mar_net#163)#498, sum(apr_net#164)#499, sum(may_net#165)#500, sum(jun_net#166)#501, sum(jul_net#167)#502, sum(aug_net#168)#503, sum(sep_net#169)#504, sum(oct_net#170)#505, sum(nov_net#171)#506, sum(dec_net#172)#507] +Results [44]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, sum(jan_sales#149)#472 AS jan_sales#508, sum(feb_sales#150)#473 AS feb_sales#509, sum(mar_sales#151)#474 AS mar_sales#510, sum(apr_sales#152)#475 AS apr_sales#511, sum(may_sales#153)#476 AS may_sales#512, sum(jun_sales#154)#477 AS jun_sales#513, sum(jul_sales#155)#478 AS jul_sales#514, sum(aug_sales#156)#479 AS aug_sales#515, sum(sep_sales#157)#480 AS sep_sales#516, sum(oct_sales#158)#481 AS oct_sales#517, sum(nov_sales#159)#482 AS nov_sales#518, sum(dec_sales#160)#483 AS dec_sales#519, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484 AS jan_sales_per_sq_foot#520, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485 AS feb_sales_per_sq_foot#521, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486 AS mar_sales_per_sq_foot#522, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487 AS apr_sales_per_sq_foot#523, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488 AS may_sales_per_sq_foot#524, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489 AS jun_sales_per_sq_foot#525, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490 AS jul_sales_per_sq_foot#526, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491 AS aug_sales_per_sq_foot#527, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492 AS sep_sales_per_sq_foot#528, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493 AS oct_sales_per_sq_foot#529, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494 AS nov_sales_per_sq_foot#530, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#20 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495 AS dec_sales_per_sq_foot#531, sum(jan_net#161)#496 AS jan_net#532, sum(feb_net#162)#497 AS feb_net#533, sum(mar_net#163)#498 AS mar_net#534, sum(apr_net#164)#499 AS apr_net#535, sum(may_net#165)#500 AS may_net#536, sum(jun_net#166)#501 AS jun_net#537, sum(jul_net#167)#502 AS jul_net#538, sum(aug_net#168)#503 AS aug_net#539, sum(sep_net#169)#504 AS sep_net#540, sum(oct_net#170)#505 AS oct_net#541, sum(nov_net#171)#506 AS nov_net#542, sum(dec_net#172)#507 AS dec_net#543] (55) TakeOrderedAndProject -Input [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, may_sales_per_sq_foot#556, jun_sales_per_sq_foot#557, jul_sales_per_sq_foot#558, aug_sales_per_sq_foot#559, sep_sales_per_sq_foot#560, oct_sales_per_sq_foot#561, nov_sales_per_sq_foot#562, dec_sales_per_sq_foot#563, jan_net#564, feb_net#565, mar_net#566, apr_net#567, may_net#568, jun_net#569, jul_net#570, aug_net#571, sep_net#572, oct_net#573, nov_net#574, dec_net#575] -Arguments: 100, [w_warehouse_name#327 ASC NULLS FIRST], [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, ... 20 more fields] +Input [44]: [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, may_sales_per_sq_foot#524, jun_sales_per_sq_foot#525, jul_sales_per_sq_foot#526, aug_sales_per_sq_foot#527, sep_sales_per_sq_foot#528, oct_sales_per_sq_foot#529, nov_sales_per_sq_foot#530, dec_sales_per_sq_foot#531, jan_net#532, feb_net#533, mar_net#534, apr_net#535, may_net#536, jun_net#537, jul_net#538, aug_net#539, sep_net#540, oct_net#541, nov_net#542, dec_net#543] +Arguments: 100, [w_warehouse_name#19 ASC NULLS FIRST], [w_warehouse_name#19, w_warehouse_sq_ft#20, w_city#21, w_county#22, w_state#23, w_country#24, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, ... 20 more fields] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt index 6c2c2d75edae1..ddfb04d8df5e3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_stat WholeStageCodegen (13) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] + Union WholeStageCodegen (6) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt index 8f8d119e78451..fc18efd3d32c1 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt @@ -285,27 +285,26 @@ Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((pro Results [32]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, DHL,BARIAN AS ship_carriers#301, d_year#17 AS year#302, sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#277 AS jan_sales#303, sum(CASE WHEN (d_moy#18 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#278 AS feb_sales#304, sum(CASE WHEN (d_moy#18 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#279 AS mar_sales#305, sum(CASE WHEN (d_moy#18 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#280 AS apr_sales#306, sum(CASE WHEN (d_moy#18 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#281 AS may_sales#307, sum(CASE WHEN (d_moy#18 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#282 AS jun_sales#308, sum(CASE WHEN (d_moy#18 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#283 AS jul_sales#309, sum(CASE WHEN (d_moy#18 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#284 AS aug_sales#310, sum(CASE WHEN (d_moy#18 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#285 AS sep_sales#311, sum(CASE WHEN (d_moy#18 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#286 AS oct_sales#312, sum(CASE WHEN (d_moy#18 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#287 AS nov_sales#313, sum(CASE WHEN (d_moy#18 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#288 AS dec_sales#314, sum(CASE WHEN (d_moy#18 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#289 AS jan_net#315, sum(CASE WHEN (d_moy#18 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS feb_net#316, sum(CASE WHEN (d_moy#18 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS mar_net#317, sum(CASE WHEN (d_moy#18 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS apr_net#318, sum(CASE WHEN (d_moy#18 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS may_net#319, sum(CASE WHEN (d_moy#18 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS jun_net#320, sum(CASE WHEN (d_moy#18 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jul_net#321, sum(CASE WHEN (d_moy#18 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS aug_net#322, sum(CASE WHEN (d_moy#18 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS sep_net#323, sum(CASE WHEN (d_moy#18 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS oct_net#324, sum(CASE WHEN (d_moy#18 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS nov_net#325, sum(CASE WHEN (d_moy#18 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS dec_net#326] (51) Union -Arguments: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, ... 8 more fields] (52) HashAggregate [codegen id : 13] -Input [32]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#335, feb_sales#336, mar_sales#337, apr_sales#338, may_sales#339, jun_sales#340, jul_sales#341, aug_sales#342, sep_sales#343, oct_sales#344, nov_sales#345, dec_sales#346, jan_net#347, feb_net#348, mar_net#349, apr_net#350, may_net#351, jun_net#352, jul_net#353, aug_net#354, sep_net#355, oct_net#356, nov_net#357, dec_net#358] -Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] -Functions [36]: [partial_sum(jan_sales#335), partial_sum(feb_sales#336), partial_sum(mar_sales#337), partial_sum(apr_sales#338), partial_sum(may_sales#339), partial_sum(jun_sales#340), partial_sum(jul_sales#341), partial_sum(aug_sales#342), partial_sum(sep_sales#343), partial_sum(oct_sales#344), partial_sum(nov_sales#345), partial_sum(dec_sales#346), partial_sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#347), partial_sum(feb_net#348), partial_sum(mar_net#349), partial_sum(apr_net#350), partial_sum(may_net#351), partial_sum(jun_net#352), partial_sum(jul_net#353), partial_sum(aug_net#354), partial_sum(sep_net#355), partial_sum(oct_net#356), partial_sum(nov_net#357), partial_sum(dec_net#358)] -Aggregate Attributes [72]: [sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430] -Results [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] +Input [32]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#149, feb_sales#150, mar_sales#151, apr_sales#152, may_sales#153, jun_sales#154, jul_sales#155, aug_sales#156, sep_sales#157, oct_sales#158, nov_sales#159, dec_sales#160, jan_net#161, feb_net#162, mar_net#163, apr_net#164, may_net#165, jun_net#166, jul_net#167, aug_net#168, sep_net#169, oct_net#170, nov_net#171, dec_net#172] +Keys [8]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148] +Functions [36]: [partial_sum(jan_sales#149), partial_sum(feb_sales#150), partial_sum(mar_sales#151), partial_sum(apr_sales#152), partial_sum(may_sales#153), partial_sum(jun_sales#154), partial_sum(jul_sales#155), partial_sum(aug_sales#156), partial_sum(sep_sales#157), partial_sum(oct_sales#158), partial_sum(nov_sales#159), partial_sum(dec_sales#160), partial_sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#161), partial_sum(feb_net#162), partial_sum(mar_net#163), partial_sum(apr_net#164), partial_sum(may_net#165), partial_sum(jun_net#166), partial_sum(jul_net#167), partial_sum(aug_net#168), partial_sum(sep_net#169), partial_sum(oct_net#170), partial_sum(nov_net#171), partial_sum(dec_net#172)] +Aggregate Attributes [72]: [sum#327, isEmpty#328, sum#329, isEmpty#330, sum#331, isEmpty#332, sum#333, isEmpty#334, sum#335, isEmpty#336, sum#337, isEmpty#338, sum#339, isEmpty#340, sum#341, isEmpty#342, sum#343, isEmpty#344, sum#345, isEmpty#346, sum#347, isEmpty#348, sum#349, isEmpty#350, sum#351, isEmpty#352, sum#353, isEmpty#354, sum#355, isEmpty#356, sum#357, isEmpty#358, sum#359, isEmpty#360, sum#361, isEmpty#362, sum#363, isEmpty#364, sum#365, isEmpty#366, sum#367, isEmpty#368, sum#369, isEmpty#370, sum#371, isEmpty#372, sum#373, isEmpty#374, sum#375, isEmpty#376, sum#377, isEmpty#378, sum#379, isEmpty#380, sum#381, isEmpty#382, sum#383, isEmpty#384, sum#385, isEmpty#386, sum#387, isEmpty#388, sum#389, isEmpty#390, sum#391, isEmpty#392, sum#393, isEmpty#394, sum#395, isEmpty#396, sum#397, isEmpty#398] +Results [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] (53) Exchange -Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] -Arguments: hashpartitioning(w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, 5), true, [id=#503] +Input [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Arguments: hashpartitioning(w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, 5), true, [id=#471] (54) HashAggregate [codegen id : 14] -Input [80]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470, sum#471, isEmpty#472, sum#473, isEmpty#474, sum#475, isEmpty#476, sum#477, isEmpty#478, sum#479, isEmpty#480, sum#481, isEmpty#482, sum#483, isEmpty#484, sum#485, isEmpty#486, sum#487, isEmpty#488, sum#489, isEmpty#490, sum#491, isEmpty#492, sum#493, isEmpty#494, sum#495, isEmpty#496, sum#497, isEmpty#498, sum#499, isEmpty#500, sum#501, isEmpty#502] -Keys [8]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334] -Functions [36]: [sum(jan_sales#335), sum(feb_sales#336), sum(mar_sales#337), sum(apr_sales#338), sum(may_sales#339), sum(jun_sales#340), sum(jul_sales#341), sum(aug_sales#342), sum(sep_sales#343), sum(oct_sales#344), sum(nov_sales#345), sum(dec_sales#346), sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#347), sum(feb_net#348), sum(mar_net#349), sum(apr_net#350), sum(may_net#351), sum(jun_net#352), sum(jul_net#353), sum(aug_net#354), sum(sep_net#355), sum(oct_net#356), sum(nov_net#357), sum(dec_net#358)] -Aggregate Attributes [36]: [sum(jan_sales#335)#504, sum(feb_sales#336)#505, sum(mar_sales#337)#506, sum(apr_sales#338)#507, sum(may_sales#339)#508, sum(jun_sales#340)#509, sum(jul_sales#341)#510, sum(aug_sales#342)#511, sum(sep_sales#343)#512, sum(oct_sales#344)#513, sum(nov_sales#345)#514, sum(dec_sales#346)#515, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527, sum(jan_net#347)#528, sum(feb_net#348)#529, sum(mar_net#349)#530, sum(apr_net#350)#531, sum(may_net#351)#532, sum(jun_net#352)#533, sum(jul_net#353)#534, sum(aug_net#354)#535, sum(sep_net#355)#536, sum(oct_net#356)#537, sum(nov_net#357)#538, sum(dec_net#358)#539] -Results [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, sum(jan_sales#335)#504 AS jan_sales#540, sum(feb_sales#336)#505 AS feb_sales#541, sum(mar_sales#337)#506 AS mar_sales#542, sum(apr_sales#338)#507 AS apr_sales#543, sum(may_sales#339)#508 AS may_sales#544, sum(jun_sales#340)#509 AS jun_sales#545, sum(jul_sales#341)#510 AS jul_sales#546, sum(aug_sales#342)#511 AS aug_sales#547, sum(sep_sales#343)#512 AS sep_sales#548, sum(oct_sales#344)#513 AS oct_sales#549, sum(nov_sales#345)#514 AS nov_sales#550, sum(dec_sales#346)#515 AS dec_sales#551, sum(CheckOverflow((promote_precision(jan_sales#335) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#516 AS jan_sales_per_sq_foot#552, sum(CheckOverflow((promote_precision(feb_sales#336) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#517 AS feb_sales_per_sq_foot#553, sum(CheckOverflow((promote_precision(mar_sales#337) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#518 AS mar_sales_per_sq_foot#554, sum(CheckOverflow((promote_precision(apr_sales#338) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#519 AS apr_sales_per_sq_foot#555, sum(CheckOverflow((promote_precision(may_sales#339) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#520 AS may_sales_per_sq_foot#556, sum(CheckOverflow((promote_precision(jun_sales#340) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#521 AS jun_sales_per_sq_foot#557, sum(CheckOverflow((promote_precision(jul_sales#341) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#522 AS jul_sales_per_sq_foot#558, sum(CheckOverflow((promote_precision(aug_sales#342) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#523 AS aug_sales_per_sq_foot#559, sum(CheckOverflow((promote_precision(sep_sales#343) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#524 AS sep_sales_per_sq_foot#560, sum(CheckOverflow((promote_precision(oct_sales#344) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#525 AS oct_sales_per_sq_foot#561, sum(CheckOverflow((promote_precision(nov_sales#345) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#526 AS nov_sales_per_sq_foot#562, sum(CheckOverflow((promote_precision(dec_sales#346) / promote_precision(cast(cast(w_warehouse_sq_ft#328 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#527 AS dec_sales_per_sq_foot#563, sum(jan_net#347)#528 AS jan_net#564, sum(feb_net#348)#529 AS feb_net#565, sum(mar_net#349)#530 AS mar_net#566, sum(apr_net#350)#531 AS apr_net#567, sum(may_net#351)#532 AS may_net#568, sum(jun_net#352)#533 AS jun_net#569, sum(jul_net#353)#534 AS jul_net#570, sum(aug_net#354)#535 AS aug_net#571, sum(sep_net#355)#536 AS sep_net#572, sum(oct_net#356)#537 AS oct_net#573, sum(nov_net#357)#538 AS nov_net#574, sum(dec_net#358)#539 AS dec_net#575] +Input [80]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum#399, isEmpty#400, sum#401, isEmpty#402, sum#403, isEmpty#404, sum#405, isEmpty#406, sum#407, isEmpty#408, sum#409, isEmpty#410, sum#411, isEmpty#412, sum#413, isEmpty#414, sum#415, isEmpty#416, sum#417, isEmpty#418, sum#419, isEmpty#420, sum#421, isEmpty#422, sum#423, isEmpty#424, sum#425, isEmpty#426, sum#427, isEmpty#428, sum#429, isEmpty#430, sum#431, isEmpty#432, sum#433, isEmpty#434, sum#435, isEmpty#436, sum#437, isEmpty#438, sum#439, isEmpty#440, sum#441, isEmpty#442, sum#443, isEmpty#444, sum#445, isEmpty#446, sum#447, isEmpty#448, sum#449, isEmpty#450, sum#451, isEmpty#452, sum#453, isEmpty#454, sum#455, isEmpty#456, sum#457, isEmpty#458, sum#459, isEmpty#460, sum#461, isEmpty#462, sum#463, isEmpty#464, sum#465, isEmpty#466, sum#467, isEmpty#468, sum#469, isEmpty#470] +Keys [8]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148] +Functions [36]: [sum(jan_sales#149), sum(feb_sales#150), sum(mar_sales#151), sum(apr_sales#152), sum(may_sales#153), sum(jun_sales#154), sum(jul_sales#155), sum(aug_sales#156), sum(sep_sales#157), sum(oct_sales#158), sum(nov_sales#159), sum(dec_sales#160), sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#161), sum(feb_net#162), sum(mar_net#163), sum(apr_net#164), sum(may_net#165), sum(jun_net#166), sum(jul_net#167), sum(aug_net#168), sum(sep_net#169), sum(oct_net#170), sum(nov_net#171), sum(dec_net#172)] +Aggregate Attributes [36]: [sum(jan_sales#149)#472, sum(feb_sales#150)#473, sum(mar_sales#151)#474, sum(apr_sales#152)#475, sum(may_sales#153)#476, sum(jun_sales#154)#477, sum(jul_sales#155)#478, sum(aug_sales#156)#479, sum(sep_sales#157)#480, sum(oct_sales#158)#481, sum(nov_sales#159)#482, sum(dec_sales#160)#483, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495, sum(jan_net#161)#496, sum(feb_net#162)#497, sum(mar_net#163)#498, sum(apr_net#164)#499, sum(may_net#165)#500, sum(jun_net#166)#501, sum(jul_net#167)#502, sum(aug_net#168)#503, sum(sep_net#169)#504, sum(oct_net#170)#505, sum(nov_net#171)#506, sum(dec_net#172)#507] +Results [44]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, sum(jan_sales#149)#472 AS jan_sales#508, sum(feb_sales#150)#473 AS feb_sales#509, sum(mar_sales#151)#474 AS mar_sales#510, sum(apr_sales#152)#475 AS apr_sales#511, sum(may_sales#153)#476 AS may_sales#512, sum(jun_sales#154)#477 AS jun_sales#513, sum(jul_sales#155)#478 AS jul_sales#514, sum(aug_sales#156)#479 AS aug_sales#515, sum(sep_sales#157)#480 AS sep_sales#516, sum(oct_sales#158)#481 AS oct_sales#517, sum(nov_sales#159)#482 AS nov_sales#518, sum(dec_sales#160)#483 AS dec_sales#519, sum(CheckOverflow((promote_precision(jan_sales#149) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#484 AS jan_sales_per_sq_foot#520, sum(CheckOverflow((promote_precision(feb_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#485 AS feb_sales_per_sq_foot#521, sum(CheckOverflow((promote_precision(mar_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#486 AS mar_sales_per_sq_foot#522, sum(CheckOverflow((promote_precision(apr_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#487 AS apr_sales_per_sq_foot#523, sum(CheckOverflow((promote_precision(may_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#488 AS may_sales_per_sq_foot#524, sum(CheckOverflow((promote_precision(jun_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#489 AS jun_sales_per_sq_foot#525, sum(CheckOverflow((promote_precision(jul_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#490 AS jul_sales_per_sq_foot#526, sum(CheckOverflow((promote_precision(aug_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#491 AS aug_sales_per_sq_foot#527, sum(CheckOverflow((promote_precision(sep_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#492 AS sep_sales_per_sq_foot#528, sum(CheckOverflow((promote_precision(oct_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#493 AS oct_sales_per_sq_foot#529, sum(CheckOverflow((promote_precision(nov_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#494 AS nov_sales_per_sq_foot#530, sum(CheckOverflow((promote_precision(dec_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#10 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#495 AS dec_sales_per_sq_foot#531, sum(jan_net#161)#496 AS jan_net#532, sum(feb_net#162)#497 AS feb_net#533, sum(mar_net#163)#498 AS mar_net#534, sum(apr_net#164)#499 AS apr_net#535, sum(may_net#165)#500 AS may_net#536, sum(jun_net#166)#501 AS jun_net#537, sum(jul_net#167)#502 AS jul_net#538, sum(aug_net#168)#503 AS aug_net#539, sum(sep_net#169)#504 AS sep_net#540, sum(oct_net#170)#505 AS oct_net#541, sum(nov_net#171)#506 AS nov_net#542, sum(dec_net#172)#507 AS dec_net#543] (55) TakeOrderedAndProject -Input [44]: [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, may_sales_per_sq_foot#556, jun_sales_per_sq_foot#557, jul_sales_per_sq_foot#558, aug_sales_per_sq_foot#559, sep_sales_per_sq_foot#560, oct_sales_per_sq_foot#561, nov_sales_per_sq_foot#562, dec_sales_per_sq_foot#563, jan_net#564, feb_net#565, mar_net#566, apr_net#567, may_net#568, jun_net#569, jul_net#570, aug_net#571, sep_net#572, oct_net#573, nov_net#574, dec_net#575] -Arguments: 100, [w_warehouse_name#327 ASC NULLS FIRST], [w_warehouse_name#327, w_warehouse_sq_ft#328, w_city#329, w_county#330, w_state#331, w_country#332, ship_carriers#333, year#334, jan_sales#540, feb_sales#541, mar_sales#542, apr_sales#543, may_sales#544, jun_sales#545, jul_sales#546, aug_sales#547, sep_sales#548, oct_sales#549, nov_sales#550, dec_sales#551, jan_sales_per_sq_foot#552, feb_sales_per_sq_foot#553, mar_sales_per_sq_foot#554, apr_sales_per_sq_foot#555, ... 20 more fields] +Input [44]: [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, may_sales_per_sq_foot#524, jun_sales_per_sq_foot#525, jul_sales_per_sq_foot#526, aug_sales_per_sq_foot#527, sep_sales_per_sq_foot#528, oct_sales_per_sq_foot#529, nov_sales_per_sq_foot#530, dec_sales_per_sq_foot#531, jan_net#532, feb_net#533, mar_net#534, apr_net#535, may_net#536, jun_net#537, jul_net#538, aug_net#539, sep_net#540, oct_net#541, nov_net#542, dec_net#543] +Arguments: 100, [w_warehouse_name#9 ASC NULLS FIRST], [w_warehouse_name#9, w_warehouse_sq_ft#10, w_city#11, w_county#12, w_state#13, w_country#14, ship_carriers#147, year#148, jan_sales#508, feb_sales#509, mar_sales#510, apr_sales#511, may_sales#512, jun_sales#513, jul_sales#514, aug_sales#515, sep_sales#516, oct_sales#517, nov_sales#518, dec_sales#519, jan_sales_per_sq_foot#520, feb_sales_per_sq_foot#521, mar_sales_per_sq_foot#522, apr_sales_per_sq_foot#523, ... 20 more fields] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt index d78aba27797e5..ac7379973630f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_stat WholeStageCodegen (13) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] + Union WholeStageCodegen (6) HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter 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 4a6a7429cc4e7..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 @@ -240,7 +240,7 @@ 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((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS _w3#32] +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/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt index 106cbe896dc6f..05b533aa65a63 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt @@ -240,7 +240,7 @@ 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((shiftright(spark_grouping_id#23, 0) & 1) as tinyint) = 0) THEN s_state#21 END AS _w2#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#27,17,2) AS _w3#32] +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/q71.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt index 007583a61d58e..9471377a18a19 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt @@ -163,71 +163,70 @@ Output [3]: [ss_ext_sales_price#27 AS ext_price#28, ss_item_sk#26 AS sold_item_s Input [5]: [ss_sold_date_sk#24, ss_sold_time_sk#25, ss_item_sk#26, ss_ext_sales_price#27, d_date_sk#10] (28) Union -Arguments: [ext_price#31, sold_item_sk#32, time_sk#33] (29) BroadcastHashJoin [codegen id : 9] Left keys [1]: [i_item_sk#1] -Right keys [1]: [sold_item_sk#32] +Right keys [1]: [sold_item_sk#15] Join condition: None (30) Project [codegen id : 9] -Output [4]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#31, sold_item_sk#32, time_sk#33] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#14, sold_item_sk#15, time_sk#16] (31) Scan parquet default.time_dim -Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Output [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [Or(EqualTo(t_meal_time,breakfast),EqualTo(t_meal_time,dinner)), IsNotNull(t_time_sk)] ReadSchema: struct (32) ColumnarToRow [codegen id : 8] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] (33) Filter [codegen id : 8] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] -Condition : (((t_meal_time#37 = breakfast) OR (t_meal_time#37 = dinner)) AND isnotnull(t_time_sk#34)) +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Condition : (((t_meal_time#34 = breakfast) OR (t_meal_time#34 = dinner)) AND isnotnull(t_time_sk#31)) (34) Project [codegen id : 8] -Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Output [3]: [t_time_sk#31, t_hour#32, t_minute#33] +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] (35) BroadcastExchange -Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] +Input [3]: [t_time_sk#31, t_hour#32, t_minute#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [time_sk#33] -Right keys [1]: [t_time_sk#34] +Left keys [1]: [time_sk#16] +Right keys [1]: [t_time_sk#31] Join condition: None (37) Project [codegen id : 9] -Output [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] -Input [7]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33, t_time_sk#34, t_hour#35, t_minute#36] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16, t_time_sk#31, t_hour#32, t_minute#33] (38) HashAggregate [codegen id : 9] -Input [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] -Functions [1]: [partial_sum(UnscaledValue(ext_price#31))] -Aggregate Attributes [1]: [sum#39] -Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] +Functions [1]: [partial_sum(UnscaledValue(ext_price#14))] +Aggregate Attributes [1]: [sum#36] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] (39) Exchange -Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), true, [id=#41] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, 5), true, [id=#38] (40) HashAggregate [codegen id : 10] -Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] -Functions [1]: [sum(UnscaledValue(ext_price#31))] -Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#31))#42] -Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#31))#42,17,2) AS ext_price#45] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] +Functions [1]: [sum(UnscaledValue(ext_price#14))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#14))#39] +Results [5]: [i_brand_id#2 AS brand_id#40, i_brand#3 AS brand#41, t_hour#32, t_minute#33, MakeDecimal(sum(UnscaledValue(ext_price#14))#39,17,2) AS ext_price#42] (41) Exchange -Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] -Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), true, [id=#46] +Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] +Arguments: rangepartitioning(ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST, 5), true, [id=#43] (42) Sort [codegen id : 11] -Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] -Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 +Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] +Arguments: [ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt index e3c87b5444244..7fb18bbd622ff 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (11) InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] InputAdapter - Union [ext_price,sold_item_sk,time_sk] + Union WholeStageCodegen (3) Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt index 007583a61d58e..9471377a18a19 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt @@ -163,71 +163,70 @@ Output [3]: [ss_ext_sales_price#27 AS ext_price#28, ss_item_sk#26 AS sold_item_s Input [5]: [ss_sold_date_sk#24, ss_sold_time_sk#25, ss_item_sk#26, ss_ext_sales_price#27, d_date_sk#10] (28) Union -Arguments: [ext_price#31, sold_item_sk#32, time_sk#33] (29) BroadcastHashJoin [codegen id : 9] Left keys [1]: [i_item_sk#1] -Right keys [1]: [sold_item_sk#32] +Right keys [1]: [sold_item_sk#15] Join condition: None (30) Project [codegen id : 9] -Output [4]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33] -Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#31, sold_item_sk#32, time_sk#33] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#14, sold_item_sk#15, time_sk#16] (31) Scan parquet default.time_dim -Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Output [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] Batched: true Location [not included in comparison]/{warehouse_dir}/time_dim] PushedFilters: [Or(EqualTo(t_meal_time,breakfast),EqualTo(t_meal_time,dinner)), IsNotNull(t_time_sk)] ReadSchema: struct (32) ColumnarToRow [codegen id : 8] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] (33) Filter [codegen id : 8] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] -Condition : (((t_meal_time#37 = breakfast) OR (t_meal_time#37 = dinner)) AND isnotnull(t_time_sk#34)) +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] +Condition : (((t_meal_time#34 = breakfast) OR (t_meal_time#34 = dinner)) AND isnotnull(t_time_sk#31)) (34) Project [codegen id : 8] -Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] -Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Output [3]: [t_time_sk#31, t_hour#32, t_minute#33] +Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34] (35) BroadcastExchange -Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] +Input [3]: [t_time_sk#31, t_hour#32, t_minute#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] (36) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [time_sk#33] -Right keys [1]: [t_time_sk#34] +Left keys [1]: [time_sk#16] +Right keys [1]: [t_time_sk#31] Join condition: None (37) Project [codegen id : 9] -Output [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] -Input [7]: [i_brand_id#2, i_brand#3, ext_price#31, time_sk#33, t_time_sk#34, t_hour#35, t_minute#36] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#14, time_sk#16, t_time_sk#31, t_hour#32, t_minute#33] (38) HashAggregate [codegen id : 9] -Input [5]: [i_brand_id#2, i_brand#3, ext_price#31, t_hour#35, t_minute#36] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] -Functions [1]: [partial_sum(UnscaledValue(ext_price#31))] -Aggregate Attributes [1]: [sum#39] -Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#14, t_hour#32, t_minute#33] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] +Functions [1]: [partial_sum(UnscaledValue(ext_price#14))] +Aggregate Attributes [1]: [sum#36] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] (39) Exchange -Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] -Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), true, [id=#41] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, 5), true, [id=#38] (40) HashAggregate [codegen id : 10] -Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] -Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] -Functions [1]: [sum(UnscaledValue(ext_price#31))] -Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#31))#42] -Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#31))#42,17,2) AS ext_price#45] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33] +Functions [1]: [sum(UnscaledValue(ext_price#14))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#14))#39] +Results [5]: [i_brand_id#2 AS brand_id#40, i_brand#3 AS brand#41, t_hour#32, t_minute#33, MakeDecimal(sum(UnscaledValue(ext_price#14))#39,17,2) AS ext_price#42] (41) Exchange -Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] -Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), true, [id=#46] +Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] +Arguments: rangepartitioning(ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST, 5), true, [id=#43] (42) Sort [codegen id : 11] -Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] -Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 +Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42] +Arguments: [ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST], true, 0 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt index e3c87b5444244..7fb18bbd622ff 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt @@ -21,7 +21,7 @@ WholeStageCodegen (11) InputAdapter Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] InputAdapter - Union [ext_price,sold_item_sk,time_sk] + Union WholeStageCodegen (3) Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] BroadcastHashJoin [ws_sold_date_sk,d_date_sk] 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 741a1f802592a..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 @@ -1,91 +1,90 @@ == Physical Plan == -TakeOrderedAndProject (87) -+- * Project (86) - +- * SortMergeJoin Inner (85) - :- * Project (67) - : +- * SortMergeJoin Inner (66) - : :- * SortMergeJoin Inner (46) - : : :- * Sort (25) - : : : +- Exchange (24) - : : : +- * Project (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (45) - : : +- Exchange (44) - : : +- * HashAggregate (43) - : : +- Exchange (42) - : : +- * HashAggregate (41) - : : +- * Project (40) - : : +- * SortMergeJoin Inner (39) - : : :- * Sort (36) - : : : +- Exchange (35) - : : : +- * Project (34) - : : : +- * BroadcastHashJoin Inner BuildRight (33) - : : : :- * Filter (28) - : : : : +- * ColumnarToRow (27) - : : : : +- Scan parquet default.store_sales (26) - : : : +- BroadcastExchange (32) - : : : +- * Filter (31) - : : : +- * ColumnarToRow (30) - : : : +- Scan parquet default.date_dim (29) - : : +- * Sort (38) - : : +- ReusedExchange (37) - : +- * Sort (65) - : +- Exchange (64) - : +- * Project (63) - : +- * Filter (62) - : +- * HashAggregate (61) - : +- Exchange (60) - : +- * HashAggregate (59) - : +- * Project (58) - : +- * SortMergeJoin Inner (57) - : :- * Sort (54) - : : +- Exchange (53) - : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildRight (51) - : : :- * Filter (49) - : : : +- * ColumnarToRow (48) - : : : +- Scan parquet default.web_sales (47) - : : +- ReusedExchange (50) - : +- * Sort (56) - : +- ReusedExchange (55) - +- * Sort (84) - +- Exchange (83) - +- * HashAggregate (82) - +- Exchange (81) - +- * HashAggregate (80) - +- * Project (79) - +- * SortMergeJoin Inner (78) - :- * Sort (75) - : +- Exchange (74) - : +- * Project (73) - : +- * BroadcastHashJoin Inner BuildRight (72) - : :- * Filter (70) - : : +- * ColumnarToRow (69) - : : +- Scan parquet default.web_sales (68) - : +- ReusedExchange (71) - +- * Sort (77) - +- ReusedExchange (76) +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * 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) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) (1) Scan parquet default.store_sales @@ -190,293 +189,289 @@ Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#17, year_total#18] Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) -(23) Project [codegen id : 7] -Output [2]: [customer_id#17 AS customer_id#19, year_total#18 AS year_total#20] +(23) Exchange Input [2]: [customer_id#17, year_total#18] +Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] -(24) Exchange -Input [2]: [customer_id#19, year_total#20] -Arguments: hashpartitioning(customer_id#19, 5), true, [id=#21] - -(25) Sort [codegen id : 8] -Input [2]: [customer_id#19, year_total#20] -Arguments: [customer_id#19 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 8] +Input [2]: [customer_id#17, year_total#18] +Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 -(26) Scan parquet default.store_sales +(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 -(27) ColumnarToRow [codegen id : 10] +(26) ColumnarToRow [codegen id : 10] Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -(28) Filter [codegen id : 10] +(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)) -(29) Scan parquet default.date_dim +(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 -(30) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#4, d_year#5] -(31) Filter [codegen id : 9] +(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)) -(32) BroadcastExchange +(31) BroadcastExchange Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(33) BroadcastHashJoin [codegen id : 10] +(32) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None -(34) Project [codegen id : 10] +(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] -(35) Exchange +(34) Exchange Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] -(36) Sort [codegen id : 11] +(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 -(37) ReusedExchange [Reuses operator id: 15] +(36) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(38) Sort [codegen id : 13] +(37) Sort [codegen id : 13] 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 -(39) SortMergeJoin [codegen id : 14] +(38) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None -(40) Project [codegen id : 14] +(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] -(41) HashAggregate [codegen id : 14] +(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))] -Aggregate Attributes [1]: [sum#24] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +Aggregate Attributes [1]: [sum#22] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] -(42) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#26] +(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] -(43) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +(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))#27] -Results [4]: [c_customer_id#9 AS customer_id#28, c_first_name#10 AS customer_first_name#29, c_last_name#11 AS customer_last_name#30, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#27,17,2) AS year_total#31] +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] -(44) Exchange -Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] -Arguments: hashpartitioning(customer_id#28, 5), true, [id=#32] +(43) Exchange +Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] +Arguments: hashpartitioning(customer_id#26, 5), true, [id=#30] -(45) Sort [codegen id : 16] -Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] -Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 16] +Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] +Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 -(46) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#28] +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#26] Join condition: None -(47) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(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 [codegen id : 19] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(47) ColumnarToRow [codegen id : 19] +Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(49) Filter [codegen id : 19] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) +(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)) -(50) ReusedExchange [Reuses operator id: 7] +(49) ReusedExchange [Reuses operator id: 7] Output [2]: [d_date_sk#4, d_year#5] -(51) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#33] +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#31] Right keys [1]: [d_date_sk#4] Join condition: None -(52) Project [codegen id : 19] -Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] +(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] -(53) Exchange -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#36] +(52) Exchange +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] -(54) Sort [codegen id : 20] -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 +(53) Sort [codegen id : 20] +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 -(55) ReusedExchange [Reuses operator id: 15] +(54) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(56) Sort [codegen id : 22] +(55) Sort [codegen id : 22] 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 -(57) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#34] +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#32] Right keys [1]: [c_customer_sk#8] Join condition: None -(58) Project [codegen id : 23] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] -Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +(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] -(59) HashAggregate [codegen id : 23] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +(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] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum#37] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +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] -(60) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#39] +(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] -(61) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +(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] -Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#40] -Results [2]: [c_customer_id#9 AS customer_id#41, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#40,17,2) AS year_total#42] +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] -(62) Filter [codegen id : 24] -Input [2]: [customer_id#41, year_total#42] -Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) +(61) Filter [codegen id : 24] +Input [2]: [customer_id#39, year_total#40] +Condition : (isnotnull(year_total#40) AND (year_total#40 > 0.00)) -(63) Project [codegen id : 24] -Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] -Input [2]: [customer_id#41, year_total#42] +(62) Project [codegen id : 24] +Output [2]: [customer_id#39 AS customer_id#41, year_total#40 AS year_total#42] +Input [2]: [customer_id#39, year_total#40] -(64) Exchange -Input [2]: [customer_id#43, year_total#44] -Arguments: hashpartitioning(customer_id#43, 5), true, [id=#45] +(63) Exchange +Input [2]: [customer_id#41, year_total#42] +Arguments: hashpartitioning(customer_id#41, 5), true, [id=#43] -(65) Sort [codegen id : 25] -Input [2]: [customer_id#43, year_total#44] -Arguments: [customer_id#43 ASC NULLS FIRST], false, 0 +(64) Sort [codegen id : 25] +Input [2]: [customer_id#41, year_total#42] +Arguments: [customer_id#41 ASC NULLS FIRST], false, 0 -(66) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#43] +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#41] Join condition: None -(67) Project [codegen id : 26] -Output [7]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44] -Input [8]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, customer_id#43, year_total#44] +(66) Project [codegen id : 26] +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] -(68) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(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 [codegen id : 28] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(68) ColumnarToRow [codegen id : 28] +Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(70) Filter [codegen id : 28] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) +(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)) -(71) ReusedExchange [Reuses operator id: 32] +(70) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#4, d_year#5] -(72) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#33] +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#31] Right keys [1]: [d_date_sk#4] Join condition: None -(73) Project [codegen id : 28] -Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] +(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] -(74) Exchange -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#46] +(73) Exchange +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] -(75) Sort [codegen id : 29] -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 +(74) Sort [codegen id : 29] +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 -(76) ReusedExchange [Reuses operator id: 15] +(75) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(77) Sort [codegen id : 31] +(76) Sort [codegen id : 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 -(78) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#34] +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#32] Right keys [1]: [c_customer_sk#8] Join condition: None -(79) Project [codegen id : 32] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] -Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +(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] -(80) HashAggregate [codegen id : 32] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +(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] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum#47] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +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] -(81) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#49] +(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] -(82) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +(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] -Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#50] -Results [2]: [c_customer_id#9 AS customer_id#51, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#50,17,2) AS year_total#52] - -(83) Exchange -Input [2]: [customer_id#51, year_total#52] -Arguments: hashpartitioning(customer_id#51, 5), true, [id=#53] - -(84) Sort [codegen id : 34] -Input [2]: [customer_id#51, year_total#52] -Arguments: [customer_id#51 ASC NULLS FIRST], false, 0 - -(85) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#51] -Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#52) / promote_precision(year_total#44)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#20 > 0.00) THEN CheckOverflow((promote_precision(year_total#31) / promote_precision(year_total#20)), DecimalType(37,20), true) ELSE null END) - -(86) Project [codegen id : 35] -Output [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] -Input [9]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44, customer_id#51, year_total#52] - -(87) TakeOrderedAndProject -Input [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] -Arguments: 100, [customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30] +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] + +(82) Exchange +Input [2]: [customer_id#49, year_total#50] +Arguments: hashpartitioning(customer_id#49, 5), true, [id=#51] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#49, year_total#50] +Arguments: [customer_id#49 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#49] +Join condition: (CASE WHEN (year_total#42 > 0.00) THEN CheckOverflow((promote_precision(year_total#50) / promote_precision(year_total#42)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#29) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) + +(85) Project [codegen id : 35] +Output [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] +Input [9]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42, customer_id#49, year_total#50] + +(86) TakeOrderedAndProject +Input [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] +Arguments: 100, [customer_id#26 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST], [customer_id#26, customer_first_name#27, customer_last_name#28] 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 e8d7eaccdf114..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 @@ -15,44 +15,43 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt index 5bdf305dfd857..4c9bad96e2027 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt @@ -1,77 +1,76 @@ == Physical Plan == -TakeOrderedAndProject (73) -+- * Project (72) - +- * BroadcastHashJoin Inner BuildRight (71) - :- * Project (57) - : +- * BroadcastHashJoin Inner BuildRight (56) - : :- * BroadcastHashJoin Inner BuildRight (37) - : : :- * Project (20) - : : : +- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (36) - : : +- * HashAggregate (35) - : : +- Exchange (34) - : : +- * HashAggregate (33) - : : +- * Project (32) - : : +- * BroadcastHashJoin Inner BuildRight (31) - : : :- * Project (26) - : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : :- * Filter (23) - : : : : +- * ColumnarToRow (22) - : : : : +- Scan parquet default.customer (21) - : : : +- ReusedExchange (24) - : : +- BroadcastExchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.date_dim (27) - : +- BroadcastExchange (55) - : +- * Project (54) - : +- * Filter (53) - : +- * HashAggregate (52) - : +- Exchange (51) - : +- * HashAggregate (50) - : +- * Project (49) - : +- * BroadcastHashJoin Inner BuildRight (48) - : :- * Project (46) - : : +- * BroadcastHashJoin Inner BuildRight (45) - : : :- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.customer (38) - : : +- BroadcastExchange (44) - : : +- * Filter (43) - : : +- * ColumnarToRow (42) - : : +- Scan parquet default.web_sales (41) - : +- ReusedExchange (47) - +- BroadcastExchange (70) - +- * HashAggregate (69) - +- Exchange (68) - +- * HashAggregate (67) - +- * Project (66) - +- * BroadcastHashJoin Inner BuildRight (65) - :- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Filter (60) - : : +- * ColumnarToRow (59) - : : +- Scan parquet default.customer (58) - : +- ReusedExchange (61) - +- ReusedExchange (64) +TakeOrderedAndProject (72) ++- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (35) + : : +- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- ReusedExchange (23) + : : +- BroadcastExchange (29) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.date_dim (26) + : +- BroadcastExchange (54) + : +- * Project (53) + : +- * Filter (52) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * Project (45) + : : +- * BroadcastHashJoin Inner BuildRight (44) + : : :- * Filter (39) + : : : +- * ColumnarToRow (38) + : : : +- Scan parquet default.customer (37) + : : +- BroadcastExchange (43) + : : +- * Filter (42) + : : +- * ColumnarToRow (41) + : : +- Scan parquet default.web_sales (40) + : +- ReusedExchange (46) + +- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * BroadcastHashJoin Inner BuildRight (61) + : :- * Filter (59) + : : +- * ColumnarToRow (58) + : : +- Scan parquet default.customer (57) + : +- ReusedExchange (60) + +- ReusedExchange (63) (1) Scan parquet default.customer @@ -164,252 +163,248 @@ Results [2]: [c_customer_id#2 AS customer_id#16, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#16, year_total#17] Condition : (isnotnull(year_total#17) AND (year_total#17 > 0.00)) -(20) Project [codegen id : 16] -Output [2]: [customer_id#16 AS customer_id#18, year_total#17 AS year_total#19] -Input [2]: [customer_id#16, year_total#17] - -(21) Scan parquet default.customer +(20) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 6] +(21) ColumnarToRow [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(23) Filter [codegen id : 6] +(22) Filter [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(24) ReusedExchange [Reuses operator id: 7] +(23) ReusedExchange [Reuses operator id: 7] Output [3]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(25) BroadcastHashJoin [codegen id : 6] +(24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(26) Project [codegen id : 6] +(25) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7] Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(27) Scan parquet default.date_dim +(26) 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,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 5] +(27) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] -(29) Filter [codegen id : 5] +(28) Filter [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] Condition : (((isnotnull(d_year#10) AND (d_year#10 = 2002)) AND d_year#10 IN (2001,2002)) AND isnotnull(d_date_sk#9)) -(30) BroadcastExchange +(29) BroadcastExchange Input [2]: [d_date_sk#9, d_year#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] -(31) BroadcastHashJoin [codegen id : 6] +(30) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#5] Right keys [1]: [d_date_sk#9] Join condition: None -(32) Project [codegen id : 6] +(31) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7, d_date_sk#9, d_year#10] -(33) HashAggregate [codegen id : 6] +(32) HashAggregate [codegen id : 6] Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum#21] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +Aggregate Attributes [1]: [sum#19] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] -(34) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#23] +(33) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#21] -(35) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +(34) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#24] -Results [4]: [c_customer_id#2 AS customer_id#25, c_first_name#3 AS customer_first_name#26, c_last_name#4 AS customer_last_name#27, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#24,17,2) AS year_total#28] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#22] +Results [4]: [c_customer_id#2 AS customer_id#23, c_first_name#3 AS customer_first_name#24, c_last_name#4 AS customer_last_name#25, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#22,17,2) AS year_total#26] -(36) BroadcastExchange -Input [4]: [customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] +(35) BroadcastExchange +Input [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#27] -(37) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#25] +(36) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#23] Join condition: None -(38) Scan parquet default.customer +(37) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 10] +(38) ColumnarToRow [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(40) Filter [codegen id : 10] +(39) Filter [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(41) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(40) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(42) ColumnarToRow [codegen id : 8] -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(41) ColumnarToRow [codegen id : 8] +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(43) Filter [codegen id : 8] -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -Condition : (isnotnull(ws_bill_customer_sk#31) AND isnotnull(ws_sold_date_sk#30)) +(42) Filter [codegen id : 8] +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +Condition : (isnotnull(ws_bill_customer_sk#29) AND isnotnull(ws_sold_date_sk#28)) -(44) BroadcastExchange -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#33] +(43) BroadcastExchange +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] -(45) BroadcastHashJoin [codegen id : 10] +(44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#31] +Right keys [1]: [ws_bill_customer_sk#29] Join condition: None -(46) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(45) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(47) ReusedExchange [Reuses operator id: 13] +(46) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#9, d_year#10] -(48) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#30] +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#28] Right keys [1]: [d_date_sk#9] Join condition: None -(49) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] +(48) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] -(50) HashAggregate [codegen id : 10] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +(49) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum#34] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum#32] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] -(51) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#36] +(50) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#34] -(52) HashAggregate [codegen id : 11] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +(51) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#37] -Results [2]: [c_customer_id#2 AS customer_id#38, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#37,17,2) AS year_total#39] +Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#35] +Results [2]: [c_customer_id#2 AS customer_id#36, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#35,17,2) AS year_total#37] -(53) Filter [codegen id : 11] -Input [2]: [customer_id#38, year_total#39] -Condition : (isnotnull(year_total#39) AND (year_total#39 > 0.00)) +(52) Filter [codegen id : 11] +Input [2]: [customer_id#36, year_total#37] +Condition : (isnotnull(year_total#37) AND (year_total#37 > 0.00)) -(54) Project [codegen id : 11] -Output [2]: [customer_id#38 AS customer_id#40, year_total#39 AS year_total#41] -Input [2]: [customer_id#38, year_total#39] +(53) Project [codegen id : 11] +Output [2]: [customer_id#36 AS customer_id#38, year_total#37 AS year_total#39] +Input [2]: [customer_id#36, year_total#37] -(55) BroadcastExchange -Input [2]: [customer_id#40, year_total#41] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] +(54) BroadcastExchange +Input [2]: [customer_id#38, year_total#39] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] -(56) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#40] +(55) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#38] Join condition: None -(57) Project [codegen id : 16] -Output [7]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41] -Input [8]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, customer_id#40, year_total#41] +(56) Project [codegen id : 16] +Output [7]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39] +Input [8]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, customer_id#38, year_total#39] -(58) Scan parquet default.customer +(57) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(59) ColumnarToRow [codegen id : 14] +(58) ColumnarToRow [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(60) Filter [codegen id : 14] +(59) Filter [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(61) ReusedExchange [Reuses operator id: 44] -Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(60) ReusedExchange [Reuses operator id: 43] +Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(62) BroadcastHashJoin [codegen id : 14] +(61) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#31] +Right keys [1]: [ws_bill_customer_sk#29] Join condition: None -(63) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(62) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(64) ReusedExchange [Reuses operator id: 30] +(63) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#9, d_year#10] -(65) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#30] +(64) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#28] Right keys [1]: [d_date_sk#9] Join condition: None -(66) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] +(65) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] -(67) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +(66) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum#43] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum#41] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] -(68) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#45] +(67) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#43] -(69) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +(68) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#46] -Results [2]: [c_customer_id#2 AS customer_id#47, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#46,17,2) AS year_total#48] - -(70) BroadcastExchange -Input [2]: [customer_id#47, year_total#48] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] - -(71) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#47] -Join condition: (CASE WHEN (year_total#41 > 0.00) THEN CheckOverflow((promote_precision(year_total#48) / promote_precision(year_total#41)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#28) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) - -(72) Project [codegen id : 16] -Output [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] -Input [9]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41, customer_id#47, year_total#48] - -(73) TakeOrderedAndProject -Input [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] -Arguments: 100, [customer_id#25 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST], [customer_id#25, customer_first_name#26, customer_last_name#27] +Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#44] +Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#44,17,2) AS year_total#46] + +(69) BroadcastExchange +Input [2]: [customer_id#45, year_total#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] + +(70) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#45] +Join condition: (CASE WHEN (year_total#39 > 0.00) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#39)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#17 > 0.00) THEN CheckOverflow((promote_precision(year_total#26) / promote_precision(year_total#17)), DecimalType(37,20), true) ELSE null END) + +(71) Project [codegen id : 16] +Output [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] +Input [9]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39, customer_id#45, year_total#46] + +(72) TakeOrderedAndProject +Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] +Arguments: 100, [customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST], [customer_id#23, customer_first_name#24, customer_last_name#25] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt index 38f95db3e7eda..add2d43fc5807 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt @@ -5,35 +5,34 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt index b375b9567f9da..39748bdd2772b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt @@ -328,149 +328,147 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ 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 -Arguments: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (45) HashAggregate [codegen id : 15] -Input [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Arguments: hashpartitioning(d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43, 5), true, [id=#44] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (49) ColumnarToRow [codegen id : 19] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] (50) Filter [codegen id : 19] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] -Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) +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] (52) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_item_sk#46] +Left keys [1]: [ws_item_sk#39] Right keys [1]: [i_item_sk#6] Join condition: None (53) Project [codegen id : 19] -Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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] (55) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#45] +Left keys [1]: [ws_sold_date_sk#38] Right keys [1]: [d_date_sk#13] Join condition: None (56) Project [codegen id : 19] -Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#50] +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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 +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 -Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (60) ColumnarToRow [codegen id : 21] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (61) Filter [codegen id : 21] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Condition : (isnotnull(wr_order_number#52) AND isnotnull(wr_item_sk#51)) +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Condition : (isnotnull(wr_order_number#45) AND isnotnull(wr_item_sk#44)) (62) Exchange -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: hashpartitioning(wr_order_number#52, wr_item_sk#51, 5), true, [id=#55] +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: hashpartitioning(wr_order_number#45, wr_item_sk#44, 5), true, [id=#48] (63) Sort [codegen id : 22] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 (64) SortMergeJoin -Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] -Right keys [2]: [wr_order_number#52, wr_item_sk#51] +Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] +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#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#57] -Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +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 -Arguments: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (67) HashAggregate [codegen id : 24] -Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64, 5), true, [id=#65] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [partial_sum(cast(sales_cnt#63 as bigint)), partial_sum(UnscaledValue(sales_amt#64))] -Aggregate Attributes [2]: [sum#66, sum#67] -Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +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#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] (71) Exchange -Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] -Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#70] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] -Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [sum(cast(sales_cnt#63 as bigint)), sum(UnscaledValue(sales_amt#64))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#63 as bigint))#71, sum(UnscaledValue(sales_amt#64))#72] -Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#63 as bigint))#71 AS sales_cnt#73, MakeDecimal(sum(UnscaledValue(sales_amt#64))#72,18,2) AS sales_amt#74] +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#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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] -Arguments: hashpartitioning(i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#75] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] -Arguments: [i_brand_id#59 ASC NULLS FIRST, i_class_id#60 ASC NULLS FIRST, i_category_id#61 ASC NULLS FIRST, i_manufact_id#62 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) 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] @@ -487,50 +485,50 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (78) 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] +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]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#62] 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#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]: [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#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] 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 (82) ColumnarToRow [codegen id : 29] -Input [2]: [d_date_sk#13, d_year#14] +Input [2]: [d_date_sk#67, d_year#68] (83) Filter [codegen id : 29] -Input [2]: [d_date_sk#13, d_year#14] -Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) +Input [2]: [d_date_sk#67, d_year#68] +Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2001)) AND isnotnull(d_date_sk#67)) (84) BroadcastExchange -Input [2]: [d_date_sk#13, d_year#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] +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] -Right keys [1]: [d_date_sk#13] +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#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#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#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=#77] +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#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 [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] @@ -546,8 +544,8 @@ Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (92) Project [codegen id : 34] -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#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] @@ -564,35 +562,35 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) (96) 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] +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] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#62] Join condition: None (98) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (99) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] (100) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_sold_date_sk#24] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#67] Join condition: None (101) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] (102) 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] -Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#78] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#71] (103) Sort [codegen id : 38] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] Arguments: [cast(ss_ticket_number#26 as bigint) ASC NULLS FIRST, cast(ss_item_sk#25 as bigint) ASC NULLS FIRST], false, 0 (104) ReusedExchange [Reuses operator id: 40] @@ -608,149 +606,147 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (107) Project [codegen id : 41] -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#79, 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#80] -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#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#72, 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#73] +Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] (108) Union -Arguments: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (109) HashAggregate [codegen id : 42] -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (110) Exchange -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Arguments: hashpartitioning(d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87, 5), true, [id=#88] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#74] (111) HashAggregate [codegen id : 43] -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (112) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 46] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] (114) Filter [codegen id : 46] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] -Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) +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] -Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +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] -Left keys [1]: [ws_item_sk#46] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ws_item_sk#39] +Right keys [1]: [i_item_sk#62] Join condition: None (117) Project [codegen id : 46] -Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (118) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] (119) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#45] -Right keys [1]: [d_date_sk#13] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#67] Join condition: None (120) Project [codegen id : 46] -Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] (121) Exchange -Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#89] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#75] (122) Sort [codegen id : 47] -Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 (123) ReusedExchange [Reuses operator id: 62] -Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (124) Sort [codegen id : 49] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 (125) SortMergeJoin -Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] -Right keys [2]: [wr_order_number#52, wr_item_sk#51] +Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] +Right keys [2]: [wr_order_number#45, wr_item_sk#44] Join condition: None (126) Project [codegen id : 50] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#90] -Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#76, 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#77] +Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (127) Union -Arguments: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (128) HashAggregate [codegen id : 51] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (129) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97, 5), true, [id=#98] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#78] (130) HashAggregate [codegen id : 52] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (131) HashAggregate [codegen id : 52] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Functions [2]: [partial_sum(cast(sales_cnt#96 as bigint)), partial_sum(UnscaledValue(sales_amt#97))] -Aggregate Attributes [2]: [sum#99, sum#100] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] +Aggregate Attributes [2]: [sum#79, sum#80] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] (132) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] -Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#103] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#83] (133) HashAggregate [codegen id : 53] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] -Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Functions [2]: [sum(cast(sales_cnt#96 as bigint)), sum(UnscaledValue(sales_amt#97))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#96 as bigint))#104, sum(UnscaledValue(sales_amt#97))#105] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum(cast(sales_cnt#96 as bigint))#104 AS sales_cnt#106, MakeDecimal(sum(UnscaledValue(sales_amt#97))#105,18,2) AS sales_amt#107] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#84, sum(UnscaledValue(sales_amt#23))#85] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum(cast(sales_cnt#22 as bigint))#84 AS sales_cnt#86, MakeDecimal(sum(UnscaledValue(sales_amt#23))#85,18,2) AS sales_amt#87] (134) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] -Arguments: hashpartitioning(i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#108] +Input [7]: [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] +Arguments: hashpartitioning(i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#88] (135) Sort [codegen id : 54] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] -Arguments: [i_brand_id#92 ASC NULLS FIRST, i_class_id#93 ASC NULLS FIRST, i_category_id#94 ASC NULLS FIRST, i_manufact_id#95 ASC NULLS FIRST], false, 0 +Input [7]: [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] +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Right keys [4]: [i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#73 as decimal(17,2))) / promote_precision(cast(sales_cnt#106 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +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#91 AS prev_year#109, d_year#58 AS year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#106 AS prev_yr_cnt#111, sales_cnt#73 AS curr_yr_cnt#112, (sales_cnt#73 - sales_cnt#106) AS sales_cnt_diff#113, CheckOverflow((promote_precision(cast(sales_amt#74 as decimal(19,2))) - promote_precision(cast(sales_amt#107 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#114] -Input [14]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74, d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +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#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] -Arguments: 100, [sales_cnt_diff#113 ASC NULLS FIRST], [prev_year#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] +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], [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-v1_4/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt index 8326127eae3dd..d8d1a3976559d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt @@ -19,7 +19,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (24) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (16) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -27,7 +27,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (7) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter @@ -146,7 +146,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (51) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (43) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -154,7 +154,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (42) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (34) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt index a3c4812097176..292a44930ed3d 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt @@ -283,129 +283,127 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (38) Union -Arguments: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (39) HashAggregate [codegen id : 9] -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (40) Exchange -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Arguments: hashpartitioning(d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41, 5), true, [id=#42] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#35] (41) HashAggregate [codegen id : 10] -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (42) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] 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 : 14] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] (44) Filter [codegen id : 14] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] -Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) (45) 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] (46) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#44] +Left keys [1]: [ws_item_sk#37] Right keys [1]: [i_item_sk#6] Join condition: None (47) Project [codegen id : 14] -Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (48) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#43] +Left keys [1]: [ws_sold_date_sk#36] Right keys [1]: [d_date_sk#13] Join condition: None (50) Project [codegen id : 14] -Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (51) Scan parquet default.web_returns -Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 13] -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (53) Filter [codegen id : 13] -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] -Condition : (isnotnull(wr_order_number#49) AND isnotnull(wr_item_sk#48)) +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Condition : (isnotnull(wr_order_number#42) AND isnotnull(wr_item_sk#41)) (54) BroadcastExchange -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#52] +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#45] (55) BroadcastHashJoin [codegen id : 14] -Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] -Right keys [2]: [wr_order_number#49, wr_item_sk#48] +Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] +Right keys [2]: [wr_order_number#42, wr_item_sk#41] Join condition: None (56) 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, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#54] -Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#46, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#47] +Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (57) Union -Arguments: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (58) HashAggregate [codegen id : 15] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (59) Exchange -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61, 5), true, [id=#62] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#48] (60) HashAggregate [codegen id : 16] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (61) HashAggregate [codegen id : 16] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Functions [2]: [partial_sum(cast(sales_cnt#60 as bigint)), partial_sum(UnscaledValue(sales_amt#61))] -Aggregate Attributes [2]: [sum#63, sum#64] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +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#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum#49, sum#50] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] (62) Exchange -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] -Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, 5), true, [id=#67] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#53] (63) HashAggregate [codegen id : 34] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] -Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Functions [2]: [sum(cast(sales_cnt#60 as bigint)), sum(UnscaledValue(sales_amt#61))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#60 as bigint))#68, sum(UnscaledValue(sales_amt#61))#69] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum(cast(sales_cnt#60 as bigint))#68 AS sales_cnt#70, MakeDecimal(sum(UnscaledValue(sales_amt#61))#69,18,2) AS sales_amt#71] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +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#21 as bigint)), sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#54, sum(UnscaledValue(sales_amt#22))#55] +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#21 as bigint))#54 AS sales_cnt#56, MakeDecimal(sum(UnscaledValue(sales_amt#22))#55,18,2) AS sales_amt#57] (64) 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] @@ -422,43 +420,43 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (67) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (68) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#58] Join condition: None (69) Project [codegen id : 20] -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]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (70) Scan parquet default.date_dim -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] 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 (71) ColumnarToRow [codegen id : 18] -Input [2]: [d_date_sk#13, d_year#14] +Input [2]: [d_date_sk#63, d_year#64] (72) Filter [codegen id : 18] -Input [2]: [d_date_sk#13, d_year#14] -Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) +Input [2]: [d_date_sk#63, d_year#64] +Condition : ((isnotnull(d_year#64) AND (d_year#64 = 2001)) AND isnotnull(d_date_sk#63)) (73) BroadcastExchange -Input [2]: [d_date_sk#13, d_year#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] +Input [2]: [d_date_sk#63, d_year#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#65] (74) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#63] Join condition: None (75) Project [codegen id : 20] -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#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (76) ReusedExchange [Reuses operator id: 20] Output [4]: [cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] @@ -469,8 +467,8 @@ Right keys [2]: [cr_order_number#17, cr_item_sk#16] Join condition: None (78) Project [codegen id : 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#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] -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#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (cs_quantity#4 - coalesce(cr_return_quantity#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] +Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] (79) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27] @@ -487,28 +485,28 @@ Input [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity# Condition : (isnotnull(ss_item_sk#24) AND isnotnull(ss_sold_date_sk#23)) (82) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (83) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_item_sk#24] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#58] Join condition: None (84) Project [codegen id : 24] -Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (85) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] (86) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_sold_date_sk#23] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#63] Join condition: None (87) Project [codegen id : 24] -Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +Input [11]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (88) ReusedExchange [Reuses operator id: 35] Output [4]: [sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] @@ -519,133 +517,131 @@ Right keys [2]: [sr_ticket_number#29, sr_item_sk#28] Join condition: None (90) Project [codegen id : 24] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#73, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#74] -Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (91) Union -Arguments: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (92) HashAggregate [codegen id : 25] -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (93) Exchange -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Arguments: hashpartitioning(d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81, 5), true, [id=#82] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#68] (94) HashAggregate [codegen id : 26] -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (95) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (96) ColumnarToRow [codegen id : 30] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] (97) Filter [codegen id : 30] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] -Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) (98) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (99) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_item_sk#44] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#58] Join condition: None (100) Project [codegen id : 30] -Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (101) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] (102) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_sold_date_sk#43] -Right keys [1]: [d_date_sk#13] +Left keys [1]: [ws_sold_date_sk#36] +Right keys [1]: [d_date_sk#63] Join condition: None (103) Project [codegen id : 30] -Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +Input [11]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (104) ReusedExchange [Reuses operator id: 54] -Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (105) BroadcastHashJoin [codegen id : 30] -Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] -Right keys [2]: [wr_order_number#49, wr_item_sk#48] +Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] +Right keys [2]: [wr_order_number#42, wr_item_sk#41] Join condition: None (106) Project [codegen id : 30] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#83] -Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#69, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#70] +Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (107) Union -Arguments: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (108) HashAggregate [codegen id : 31] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (109) Exchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90, 5), true, [id=#91] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#71] (110) HashAggregate [codegen id : 32] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (111) HashAggregate [codegen id : 32] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Functions [2]: [partial_sum(cast(sales_cnt#89 as bigint)), partial_sum(UnscaledValue(sales_amt#90))] -Aggregate Attributes [2]: [sum#92, sum#93] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [partial_sum(cast(sales_cnt#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum#72, sum#73] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] (112) Exchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] -Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, 5), true, [id=#96] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#76] (113) HashAggregate [codegen id : 33] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] -Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Functions [2]: [sum(cast(sales_cnt#89 as bigint)), sum(UnscaledValue(sales_amt#90))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#89 as bigint))#97, sum(UnscaledValue(sales_amt#90))#98] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum(cast(sales_cnt#89 as bigint))#97 AS sales_cnt#99, MakeDecimal(sum(UnscaledValue(sales_amt#90))#98,18,2) AS sales_amt#100] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [sum(cast(sales_cnt#21 as bigint)), sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#77, sum(UnscaledValue(sales_amt#22))#78] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#21 as bigint))#77 AS sales_cnt#79, MakeDecimal(sum(UnscaledValue(sales_amt#22))#78,18,2) AS sales_amt#80] (114) BroadcastExchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] -Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#101] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#81] (115) BroadcastHashJoin [codegen id : 34] -Left keys [4]: [i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Right keys [4]: [i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#70 as decimal(17,2))) / promote_precision(cast(sales_cnt#99 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#56 as decimal(17,2))) / promote_precision(cast(sales_cnt#79 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (116) Project [codegen id : 34] -Output [10]: [d_year#84 AS prev_year#102, d_year#55 AS year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#99 AS prev_yr_cnt#104, sales_cnt#70 AS curr_yr_cnt#105, (sales_cnt#70 - sales_cnt#99) AS sales_cnt_diff#106, CheckOverflow((promote_precision(cast(sales_amt#71 as decimal(19,2))) - promote_precision(cast(sales_amt#100 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#107] -Input [14]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#70, sales_amt#71, d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] +Output [10]: [d_year#64 AS prev_year#82, d_year#14 AS year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#79 AS prev_yr_cnt#84, sales_cnt#56 AS curr_yr_cnt#85, (sales_cnt#56 - sales_cnt#79) AS sales_cnt_diff#86, CheckOverflow((promote_precision(cast(sales_amt#57 as decimal(19,2))) - promote_precision(cast(sales_amt#80 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#87] +Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#56, sales_amt#57, d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] (117) TakeOrderedAndProject -Input [10]: [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] -Arguments: 100, [sales_cnt_diff#106 ASC NULLS FIRST], [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] +Input [10]: [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] +Arguments: 100, [sales_cnt_diff#86 ASC NULLS FIRST], [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt index 601547223bcfa..298a06b87762f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (10) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -21,7 +21,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (9) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (4) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] @@ -113,7 +113,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (31) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (26) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -121,7 +121,7 @@ TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_cat WholeStageCodegen (25) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (20) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_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 97621bed43138..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 @@ -220,27 +220,26 @@ Output [6]: [catalog AS channel#28, cs_ship_addr_sk#25 AS col_name#29, d_year#6, 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 -Arguments: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, ext_sales_price#36] (41) HashAggregate [codegen id : 10] -Input [6]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, ext_sales_price#36] -Keys [5]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35] -Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#36))] -Aggregate Attributes [2]: [count#37, sum#38] -Results [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] +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#6, d_qoy#7, i_category#10, count#33, sum#34] (42) Exchange -Input [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] -Arguments: hashpartitioning(channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, 5), true, [id=#41] +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#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count#39, sum#40] -Keys [5]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35] -Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#36))] -Aggregate Attributes [2]: [count(1)#42, sum(UnscaledValue(ext_sales_price#36))#43] -Results [7]: [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, count(1)#42 AS sales_cnt#44, MakeDecimal(sum(UnscaledValue(ext_sales_price#36))#43,17,2) AS sales_amt#45] +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#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#31, col_name#32, d_year#33, d_qoy#34, i_category#35, sales_cnt#44, sales_amt#45] -Arguments: 100, [channel#31 ASC NULLS FIRST, col_name#32 ASC NULLS FIRST, d_year#33 ASC NULLS FIRST, d_qoy#34 ASC NULLS FIRST, i_category#35 ASC NULLS FIRST], [channel#31, col_name#32, d_year#33, d_qoy#34, i_category#35, sales_cnt#44, sales_amt#45] +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 aea65ecfcb19f..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (10) HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] InputAdapter - Union [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] + Union WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_item_sk,i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt index aa0d38c8d197b..917e2b028106c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt @@ -184,27 +184,26 @@ Output [6]: [catalog AS channel#26, cs_ship_addr_sk#23 AS col_name#27, d_year#9, Input [7]: [cs_sold_date_sk#22, cs_ship_addr_sk#23, cs_ext_sales_price#25, i_category#6, d_date_sk#8, d_year#9, d_qoy#10] (34) Union -Arguments: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, ext_sales_price#34] (35) HashAggregate [codegen id : 10] -Input [6]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, ext_sales_price#34] -Keys [5]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33] -Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#34))] -Aggregate Attributes [2]: [count#35, sum#36] -Results [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] +Input [6]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, ext_sales_price#14] +Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] +Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count#29, sum#30] +Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] (36) Exchange -Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] -Arguments: hashpartitioning(channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, 5), true, [id=#39] +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] +Arguments: hashpartitioning(channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, 5), true, [id=#33] (37) HashAggregate [codegen id : 11] -Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count#37, sum#38] -Keys [5]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33] -Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#34))] -Aggregate Attributes [2]: [count(1)#40, sum(UnscaledValue(ext_sales_price#34))#41] -Results [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, count(1)#40 AS sales_cnt#42, MakeDecimal(sum(UnscaledValue(ext_sales_price#34))#41,17,2) AS sales_amt#43] +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#31, sum#32] +Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] +Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count(1)#34, sum(UnscaledValue(ext_sales_price#14))#35] +Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count(1)#34 AS sales_cnt#36, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#35,17,2) AS sales_amt#37] (38) TakeOrderedAndProject -Input [7]: [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, sales_cnt#42, sales_amt#43] -Arguments: 100, [channel#29 ASC NULLS FIRST, col_name#30 ASC NULLS FIRST, d_year#31 ASC NULLS FIRST, d_qoy#32 ASC NULLS FIRST, i_category#33 ASC NULLS FIRST], [channel#29, col_name#30, d_year#31, d_qoy#32, i_category#33, sales_cnt#42, sales_amt#43] +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#36, sales_amt#37] +Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#9 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, i_category#6 ASC NULLS FIRST], [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#36, sales_amt#37] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt index 98674c3255845..f01916baaac78 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_ WholeStageCodegen (10) HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] InputAdapter - Union [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] + Union WholeStageCodegen (3) Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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 ade117b9465d1..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 @@ -491,31 +491,30 @@ Output [5]: [sales#80, coalesce(returns#94, 0.00) AS returns#97, CheckOverflow(( Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union -Arguments: [sales#101, returns#102, profit#103, channel#104, id#105] (87) Expand [codegen id : 24] -Input [5]: [sales#101, returns#102, profit#103, channel#104, id#105] -Arguments: [List(sales#101, returns#102, profit#103, channel#104, id#105, 0), List(sales#101, returns#102, profit#103, channel#104, null, 1), List(sales#101, returns#102, profit#103, null, null, 3)], [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] +Input [5]: [sales#17, returns#34, profit#35, channel#36, id#37] +Arguments: [List(sales#17, returns#34, profit#35, channel#36, id#37, 0), List(sales#17, returns#34, profit#35, channel#36, null, 1), List(sales#17, returns#34, profit#35, null, null, 3)], [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] (88) HashAggregate [codegen id : 24] -Input [6]: [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] -Keys [3]: [channel#106, id#107, spark_grouping_id#108] -Functions [3]: [partial_sum(sales#101), partial_sum(returns#102), partial_sum(profit#103)] -Aggregate Attributes [6]: [sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114] -Results [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Input [6]: [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] +Keys [3]: [channel#101, id#102, spark_grouping_id#103] +Functions [3]: [partial_sum(sales#17), partial_sum(returns#34), partial_sum(profit#35)] +Aggregate Attributes [6]: [sum#104, isEmpty#105, sum#106, isEmpty#107, sum#108, isEmpty#109] +Results [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] (89) Exchange -Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Arguments: hashpartitioning(channel#106, id#107, spark_grouping_id#108, 5), true, [id=#121] +Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(channel#101, id#102, spark_grouping_id#103, 5), true, [id=#116] (90) HashAggregate [codegen id : 25] -Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Keys [3]: [channel#106, id#107, spark_grouping_id#108] -Functions [3]: [sum(sales#101), sum(returns#102), sum(profit#103)] -Aggregate Attributes [3]: [sum(sales#101)#122, sum(returns#102)#123, sum(profit#103)#124] -Results [5]: [channel#106, id#107, sum(sales#101)#122 AS sales#125, sum(returns#102)#123 AS returns#126, sum(profit#103)#124 AS profit#127] +Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [3]: [channel#101, id#102, spark_grouping_id#103] +Functions [3]: [sum(sales#17), sum(returns#34), sum(profit#35)] +Aggregate Attributes [3]: [sum(sales#17)#117, sum(returns#34)#118, sum(profit#35)#119] +Results [5]: [channel#101, id#102, sum(sales#17)#117 AS sales#120, sum(returns#34)#118 AS returns#121, sum(profit#35)#119 AS profit#122] (91) TakeOrderedAndProject -Input [5]: [channel#106, id#107, sales#125, returns#126, profit#127] -Arguments: 100, [channel#106 ASC NULLS FIRST, id#107 ASC NULLS FIRST], [channel#106, id#107, sales#125, returns#126, profit#127] +Input [5]: [channel#101, id#102, sales#120, returns#121, profit#122] +Arguments: 100, [channel#101 ASC NULLS FIRST, id#102 ASC NULLS FIRST], [channel#101, id#102, sales#120, returns#121, profit#122] 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 510b344a7db49..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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + Union WholeStageCodegen (8) Project [sales,returns,profit,profit_loss,s_store_sk] BroadcastHashJoin [s_store_sk,s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt index aead42d6abb99..c232055ba8c34 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt @@ -491,31 +491,30 @@ Output [5]: [sales#80, coalesce(returns#94, 0.00) AS returns#97, CheckOverflow(( Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union -Arguments: [sales#101, returns#102, profit#103, channel#104, id#105] (87) Expand [codegen id : 24] -Input [5]: [sales#101, returns#102, profit#103, channel#104, id#105] -Arguments: [List(sales#101, returns#102, profit#103, channel#104, id#105, 0), List(sales#101, returns#102, profit#103, channel#104, null, 1), List(sales#101, returns#102, profit#103, null, null, 3)], [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] +Input [5]: [sales#17, returns#34, profit#35, channel#36, id#37] +Arguments: [List(sales#17, returns#34, profit#35, channel#36, id#37, 0), List(sales#17, returns#34, profit#35, channel#36, null, 1), List(sales#17, returns#34, profit#35, null, null, 3)], [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] (88) HashAggregate [codegen id : 24] -Input [6]: [sales#101, returns#102, profit#103, channel#106, id#107, spark_grouping_id#108] -Keys [3]: [channel#106, id#107, spark_grouping_id#108] -Functions [3]: [partial_sum(sales#101), partial_sum(returns#102), partial_sum(profit#103)] -Aggregate Attributes [6]: [sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114] -Results [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Input [6]: [sales#17, returns#34, profit#35, channel#101, id#102, spark_grouping_id#103] +Keys [3]: [channel#101, id#102, spark_grouping_id#103] +Functions [3]: [partial_sum(sales#17), partial_sum(returns#34), partial_sum(profit#35)] +Aggregate Attributes [6]: [sum#104, isEmpty#105, sum#106, isEmpty#107, sum#108, isEmpty#109] +Results [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] (89) Exchange -Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Arguments: hashpartitioning(channel#106, id#107, spark_grouping_id#108, 5), true, [id=#121] +Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(channel#101, id#102, spark_grouping_id#103, 5), true, [id=#116] (90) HashAggregate [codegen id : 25] -Input [9]: [channel#106, id#107, spark_grouping_id#108, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] -Keys [3]: [channel#106, id#107, spark_grouping_id#108] -Functions [3]: [sum(sales#101), sum(returns#102), sum(profit#103)] -Aggregate Attributes [3]: [sum(sales#101)#122, sum(returns#102)#123, sum(profit#103)#124] -Results [5]: [channel#106, id#107, sum(sales#101)#122 AS sales#125, sum(returns#102)#123 AS returns#126, sum(profit#103)#124 AS profit#127] +Input [9]: [channel#101, id#102, spark_grouping_id#103, sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [3]: [channel#101, id#102, spark_grouping_id#103] +Functions [3]: [sum(sales#17), sum(returns#34), sum(profit#35)] +Aggregate Attributes [3]: [sum(sales#17)#117, sum(returns#34)#118, sum(profit#35)#119] +Results [5]: [channel#101, id#102, sum(sales#17)#117 AS sales#120, sum(returns#34)#118 AS returns#121, sum(profit#35)#119 AS profit#122] (91) TakeOrderedAndProject -Input [5]: [channel#106, id#107, sales#125, returns#126, profit#127] -Arguments: 100, [channel#106 ASC NULLS FIRST, id#107 ASC NULLS FIRST], [channel#106, id#107, sales#125, returns#126, profit#127] +Input [5]: [channel#101, id#102, sales#120, returns#121, profit#122] +Arguments: 100, [channel#101 ASC NULLS FIRST, id#102 ASC NULLS FIRST], [channel#101, id#102, sales#120, returns#121, profit#122] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt index 968f37fb6eeb0..bfbeff02b63be 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + Union WholeStageCodegen (8) Project [sales,returns,profit,profit_loss,s_store_sk] BroadcastHashJoin [s_store_sk,s_store_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 a8a8f5f848109..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 @@ -569,31 +569,30 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#85))#107, sum(co Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#85))#107,17,2) AS sales#110, sum(coalesce(cast(wr_return_amt#90 as decimal(12,2)), 0.00))#108 AS returns#111, sum(CheckOverflow((promote_precision(cast(ws_net_profit#86 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#91 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#109 AS profit#112, web channel AS channel#113, concat(web_site, web_site_id#94) AS id#114] (103) Union -Arguments: [sales#115, returns#116, profit#117, channel#118, id#119] (104) Expand [codegen id : 31] -Input [5]: [sales#115, returns#116, profit#117, channel#118, id#119] -Arguments: [List(sales#115, returns#116, profit#117, channel#118, id#119, 0), List(sales#115, returns#116, profit#117, channel#118, null, 1), List(sales#115, returns#116, profit#117, null, null, 3)], [sales#115, returns#116, profit#117, channel#120, id#121, spark_grouping_id#122] +Input [5]: [sales#40, returns#41, profit#42, channel#43, id#44] +Arguments: [List(sales#40, returns#41, profit#42, channel#43, id#44, 0), List(sales#40, returns#41, profit#42, channel#43, null, 1), List(sales#40, returns#41, profit#42, null, null, 3)], [sales#40, returns#41, profit#42, channel#115, id#116, spark_grouping_id#117] (105) HashAggregate [codegen id : 31] -Input [6]: [sales#115, returns#116, profit#117, channel#120, id#121, spark_grouping_id#122] -Keys [3]: [channel#120, id#121, spark_grouping_id#122] -Functions [3]: [partial_sum(sales#115), partial_sum(returns#116), partial_sum(profit#117)] -Aggregate Attributes [6]: [sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] -Results [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] +Input [6]: [sales#40, returns#41, profit#42, channel#115, id#116, spark_grouping_id#117] +Keys [3]: [channel#115, id#116, spark_grouping_id#117] +Functions [3]: [partial_sum(sales#40), partial_sum(returns#41), partial_sum(profit#42)] +Aggregate Attributes [6]: [sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] +Results [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, sum#126, isEmpty#127, sum#128, isEmpty#129] (106) Exchange -Input [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] -Arguments: hashpartitioning(channel#120, id#121, spark_grouping_id#122, 5), true, [id=#135] +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] (107) HashAggregate [codegen id : 32] -Input [9]: [channel#120, id#121, spark_grouping_id#122, sum#129, isEmpty#130, sum#131, isEmpty#132, sum#133, isEmpty#134] -Keys [3]: [channel#120, id#121, spark_grouping_id#122] -Functions [3]: [sum(sales#115), sum(returns#116), sum(profit#117)] -Aggregate Attributes [3]: [sum(sales#115)#136, sum(returns#116)#137, sum(profit#117)#138] -Results [5]: [channel#120, id#121, sum(sales#115)#136 AS sales#139, sum(returns#116)#137 AS returns#140, sum(profit#117)#138 AS profit#141] +Input [9]: [channel#115, id#116, spark_grouping_id#117, sum#124, isEmpty#125, sum#126, isEmpty#127, sum#128, isEmpty#129] +Keys [3]: [channel#115, id#116, spark_grouping_id#117] +Functions [3]: [sum(sales#40), sum(returns#41), sum(profit#42)] +Aggregate Attributes [3]: [sum(sales#40)#131, sum(returns#41)#132, sum(profit#42)#133] +Results [5]: [channel#115, id#116, sum(sales#40)#131 AS sales#134, sum(returns#41)#132 AS returns#135, sum(profit#42)#133 AS profit#136] (108) TakeOrderedAndProject -Input [5]: [channel#120, id#121, sales#139, returns#140, profit#141] -Arguments: 100, [channel#120 ASC NULLS FIRST, id#121 ASC NULLS FIRST], [channel#120, id#121, sales#139, returns#140, profit#141] +Input [5]: [channel#115, id#116, sales#134, returns#135, profit#136] +Arguments: 100, [channel#115 ASC NULLS FIRST, id#116 ASC NULLS FIRST], [channel#115, id#116, sales#134, returns#135, profit#136] 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 2d0b88add7b2b..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 @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + 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)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt index 3457adff35a8e..36b045bfd9129 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt @@ -524,31 +524,30 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#83))#104, sum(co Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#83))#104,17,2) AS sales#107, sum(coalesce(cast(wr_return_amt#87 as decimal(12,2)), 0.00))#105 AS returns#108, sum(CheckOverflow((promote_precision(cast(ws_net_profit#84 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#88 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#106 AS profit#109, web channel AS channel#110, concat(web_site, web_site_id#91) AS id#111] (94) Union -Arguments: [sales#112, returns#113, profit#114, channel#115, id#116] (95) Expand [codegen id : 22] -Input [5]: [sales#112, returns#113, profit#114, channel#115, id#116] -Arguments: [List(sales#112, returns#113, profit#114, channel#115, id#116, 0), List(sales#112, returns#113, profit#114, channel#115, null, 1), List(sales#112, returns#113, profit#114, null, null, 3)], [sales#112, returns#113, profit#114, channel#117, id#118, spark_grouping_id#119] +Input [5]: [sales#39, returns#40, profit#41, channel#42, id#43] +Arguments: [List(sales#39, returns#40, profit#41, channel#42, id#43, 0), List(sales#39, returns#40, profit#41, channel#42, null, 1), List(sales#39, returns#40, profit#41, null, null, 3)], [sales#39, returns#40, profit#41, channel#112, id#113, spark_grouping_id#114] (96) HashAggregate [codegen id : 22] -Input [6]: [sales#112, returns#113, profit#114, channel#117, id#118, spark_grouping_id#119] -Keys [3]: [channel#117, id#118, spark_grouping_id#119] -Functions [3]: [partial_sum(sales#112), partial_sum(returns#113), partial_sum(profit#114)] -Aggregate Attributes [6]: [sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] -Results [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Input [6]: [sales#39, returns#40, profit#41, channel#112, id#113, spark_grouping_id#114] +Keys [3]: [channel#112, id#113, spark_grouping_id#114] +Functions [3]: [partial_sum(sales#39), partial_sum(returns#40), partial_sum(profit#41)] +Aggregate Attributes [6]: [sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Results [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] (97) Exchange -Input [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] -Arguments: hashpartitioning(channel#117, id#118, spark_grouping_id#119, 5), true, [id=#132] +Input [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Arguments: hashpartitioning(channel#112, id#113, spark_grouping_id#114, 5), true, [id=#127] (98) HashAggregate [codegen id : 23] -Input [9]: [channel#117, id#118, spark_grouping_id#119, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] -Keys [3]: [channel#117, id#118, spark_grouping_id#119] -Functions [3]: [sum(sales#112), sum(returns#113), sum(profit#114)] -Aggregate Attributes [3]: [sum(sales#112)#133, sum(returns#113)#134, sum(profit#114)#135] -Results [5]: [channel#117, id#118, sum(sales#112)#133 AS sales#136, sum(returns#113)#134 AS returns#137, sum(profit#114)#135 AS profit#138] +Input [9]: [channel#112, id#113, spark_grouping_id#114, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Keys [3]: [channel#112, id#113, spark_grouping_id#114] +Functions [3]: [sum(sales#39), sum(returns#40), sum(profit#41)] +Aggregate Attributes [3]: [sum(sales#39)#128, sum(returns#40)#129, sum(profit#41)#130] +Results [5]: [channel#112, id#113, sum(sales#39)#128 AS sales#131, sum(returns#40)#129 AS returns#132, sum(profit#41)#130 AS profit#133] (99) TakeOrderedAndProject -Input [5]: [channel#117, id#118, sales#136, returns#137, profit#138] -Arguments: 100, [channel#117 ASC NULLS FIRST, id#118 ASC NULLS FIRST], [channel#117, id#118, sales#136, returns#137, profit#138] +Input [5]: [channel#112, id#113, sales#131, returns#132, profit#133] +Arguments: 100, [channel#112 ASC NULLS FIRST, id#113 ASC NULLS FIRST], [channel#112, id#113, sales#131, returns#132, profit#133] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt index 3e79691bfc873..37f46f14e467b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] Expand [sales,returns,profit,channel,id] InputAdapter - Union [sales,returns,profit,channel,id] + Union WholeStageCodegen (7) 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)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] InputAdapter 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/q86/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt index 20beeb9d31d89..20ae4d244dcd8 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/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-v2_7/q10a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt index e1b217a52b521..1146a80d45727 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt @@ -1,55 +1,56 @@ == Physical Plan == -TakeOrderedAndProject (51) -+- * HashAggregate (50) - +- Exchange (49) - +- * HashAggregate (48) - +- * Project (47) - +- BroadcastNestedLoopJoin LeftSemi BuildLeft (46) - :- BroadcastExchange (32) - : +- * Project (31) - : +- * BroadcastHashJoin Inner BuildLeft (30) - : :- BroadcastExchange (26) - : : +- * Project (25) - : : +- * BroadcastHashJoin Inner BuildRight (24) - : : :- 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) - : : +- BroadcastExchange (23) - : : +- * Project (22) - : : +- * Filter (21) - : : +- * ColumnarToRow (20) - : : +- Scan parquet default.customer_address (19) - : +- * Filter (29) - : +- * ColumnarToRow (28) - : +- Scan parquet default.customer_demographics (27) - +- Union (45) - :- * Project (38) - : +- * BroadcastHashJoin Inner BuildRight (37) - : :- * Filter (35) - : : +- * ColumnarToRow (34) - : : +- Scan parquet default.web_sales (33) - : +- ReusedExchange (36) - +- * Project (44) - +- * BroadcastHashJoin Inner BuildRight (43) - :- * Filter (41) - : +- * ColumnarToRow (40) - : +- Scan parquet default.catalog_sales (39) - +- ReusedExchange (42) +TakeOrderedAndProject (52) ++- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * BroadcastHashJoin Inner BuildLeft (47) + :- BroadcastExchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- SortMergeJoin LeftSemi (34) + : : :- 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 (33) + : : +- Exchange (32) + : : +- Union (31) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.catalog_sales (25) + : : +- ReusedExchange (28) + : +- 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 @@ -132,148 +133,154 @@ Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(19) Scan parquet default.customer_address -Output [2]: [ca_address_sk#12, ca_county#13] +(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}/customer_address] -PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] -ReadSchema: struct - -(20) ColumnarToRow [codegen id : 6] -Input [2]: [ca_address_sk#12, ca_county#13] +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(21) Filter [codegen id : 6] -Input [2]: [ca_address_sk#12, ca_county#13] -Condition : (ca_county#13 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#12)) +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -(22) Project [codegen id : 6] -Output [1]: [ca_address_sk#12] -Input [2]: [ca_address_sk#12, ca_county#13] +(21) Filter [codegen id : 7] +Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] +Condition : isnotnull(ws_sold_date_sk#12) -(23) BroadcastExchange -Input [1]: [ca_address_sk#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(24) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#12] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#12] +Right keys [1]: [d_date_sk#7] Join condition: None -(25) Project [codegen id : 7] -Output [2]: [c_customer_sk#1, c_current_cdemo_sk#2] -Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#12] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#13 AS customer_sk#14] +Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] -(26) BroadcastExchange -Input [2]: [c_customer_sk#1, c_current_cdemo_sk#2] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#15] - -(27) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +(25) 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}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(28) ColumnarToRow -Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(29) Filter -Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -Condition : isnotnull(cd_demo_sk#16) +(26) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -(30) BroadcastHashJoin [codegen id : 8] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#16] -Join condition: None +(27) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +Condition : isnotnull(cs_sold_date_sk#15) -(31) Project [codegen id : 8] -Output [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -Input [11]: [c_customer_sk#1, c_current_cdemo_sk#2, cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(32) BroadcastExchange -Input [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -Arguments: IdentityBroadcastMode, [id=#25] +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#15] +Right keys [1]: [d_date_sk#7] +Join condition: None -(33) Scan parquet default.web_sales -Output [1]: [ws_sold_date_sk#26] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +(30) Project [codegen id : 9] +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#7] -(34) ColumnarToRow [codegen id : 10] -Input [1]: [ws_sold_date_sk#26] +(31) Union -(35) Filter [codegen id : 10] -Input [1]: [ws_sold_date_sk#26] -Condition : isnotnull(ws_sold_date_sk#26) +(32) Exchange +Input [1]: [customer_sk#14] +Arguments: hashpartitioning(customer_sk#14, 5), true, [id=#18] -(36) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(33) Sort [codegen id : 10] +Input [1]: [customer_sk#14] +Arguments: [customer_sk#14 ASC NULLS FIRST], false, 0 -(37) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#26] -Right keys [1]: [d_date_sk#7] +(34) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#14] Join condition: None -(38) Project [codegen id : 10] -Output: [] -Input [2]: [ws_sold_date_sk#26, d_date_sk#7] +(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] -(39) Scan parquet default.catalog_sales -Output [1]: [cs_sold_date_sk#27] +(36) Scan parquet default.customer_address +Output [2]: [ca_address_sk#19, ca_county#20] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +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 -(40) ColumnarToRow [codegen id : 12] -Input [1]: [cs_sold_date_sk#27] +(37) ColumnarToRow [codegen id : 11] +Input [2]: [ca_address_sk#19, ca_county#20] -(41) Filter [codegen id : 12] -Input [1]: [cs_sold_date_sk#27] -Condition : isnotnull(cs_sold_date_sk#27) +(38) Filter [codegen id : 11] +Input [2]: [ca_address_sk#19, ca_county#20] +Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19)) -(42) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(39) Project [codegen id : 11] +Output [1]: [ca_address_sk#19] +Input [2]: [ca_address_sk#19, ca_county#20] -(43) BroadcastHashJoin [codegen id : 12] -Left keys [1]: [cs_sold_date_sk#27] -Right keys [1]: [d_date_sk#7] +(40) BroadcastExchange +Input [1]: [ca_address_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(41) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#19] Join condition: None -(44) Project [codegen id : 12] -Output: [] -Input [2]: [cs_sold_date_sk#27, d_date_sk#7] +(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#19] -(45) Union +(43) BroadcastExchange +Input [1]: [c_current_cdemo_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] -(46) BroadcastNestedLoopJoin -Join condition: (c_customer_sk#1 = customer_sk#28) +(44) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(45) ColumnarToRow +Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] + +(46) Filter +Input [9]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Condition : isnotnull(cd_demo_sk#23) + +(47) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#23] +Join condition: None -(47) Project [codegen id : 13] -Output [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -Input [9]: [c_customer_sk#1, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +(48) Project [codegen id : 13] +Output [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] -(48) HashAggregate [codegen id : 13] -Input [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] -Keys [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +(49) HashAggregate [codegen id : 13] +Input [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] +Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#29] -Results [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] +Aggregate Attributes [1]: [count#32] +Results [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] -(49) Exchange -Input [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] -Arguments: hashpartitioning(cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, 5), true, [id=#31] +(50) Exchange +Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] +Arguments: hashpartitioning(cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, 5), true, [id=#34] -(50) HashAggregate [codegen id : 14] -Input [9]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30] -Keys [8]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24] +(51) HashAggregate [codegen id : 14] +Input [9]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31, count#33] +Keys [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, cd_dep_count#29, cd_dep_employed_count#30, cd_dep_college_count#31] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#32] -Results [14]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, count(1)#32 AS cnt1#33, cd_purchase_estimate#20, count(1)#32 AS cnt2#34, cd_credit_rating#21, count(1)#32 AS cnt3#35, cd_dep_count#22, count(1)#32 AS cnt4#36, cd_dep_employed_count#23, count(1)#32 AS cnt5#37, cd_dep_college_count#24, count(1)#32 AS cnt6#38] +Aggregate Attributes [1]: [count(1)#35] +Results [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, count(1)#35 AS cnt1#36, cd_purchase_estimate#27, count(1)#35 AS cnt2#37, cd_credit_rating#28, count(1)#35 AS cnt3#38, cd_dep_count#29, count(1)#35 AS cnt4#39, cd_dep_employed_count#30, count(1)#35 AS cnt5#40, cd_dep_college_count#31, count(1)#35 AS cnt6#41] -(51) TakeOrderedAndProject -Input [14]: [cd_gender#17, cd_marital_status#18, cd_education_status#19, cnt1#33, cd_purchase_estimate#20, cnt2#34, cd_credit_rating#21, cnt3#35, cd_dep_count#22, cnt4#36, cd_dep_employed_count#23, cnt5#37, cd_dep_college_count#24, cnt6#38] -Arguments: 100, [cd_gender#17 ASC NULLS FIRST, cd_marital_status#18 ASC NULLS FIRST, cd_education_status#19 ASC NULLS FIRST, cd_purchase_estimate#20 ASC NULLS FIRST, cd_credit_rating#21 ASC NULLS FIRST, cd_dep_count#22 ASC NULLS FIRST, cd_dep_employed_count#23 ASC NULLS FIRST, cd_dep_college_count#24 ASC NULLS FIRST], [cd_gender#17, cd_marital_status#18, cd_education_status#19, cnt1#33, cd_purchase_estimate#20, cnt2#34, cd_credit_rating#21, cnt3#35, cd_dep_count#22, cnt4#36, cd_dep_employed_count#23, cnt5#37, cd_dep_college_count#24, cnt6#38] +(52) TakeOrderedAndProject +Input [14]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#36, cd_purchase_estimate#27, cnt2#37, cd_credit_rating#28, cnt3#38, cd_dep_count#29, cnt4#39, cd_dep_employed_count#30, cnt5#40, cd_dep_college_count#31, cnt6#41] +Arguments: 100, [cd_gender#24 ASC NULLS FIRST, cd_marital_status#25 ASC NULLS FIRST, cd_education_status#26 ASC NULLS FIRST, cd_purchase_estimate#27 ASC NULLS FIRST, cd_credit_rating#28 ASC NULLS FIRST, cd_dep_count#29 ASC NULLS FIRST, cd_dep_employed_count#30 ASC NULLS FIRST, cd_dep_college_count#31 ASC NULLS FIRST], [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#36, cd_purchase_estimate#27, cnt2#37, cd_credit_rating#28, cnt3#38, cd_dep_count#29, cnt4#39, cd_dep_employed_count#30, cnt5#40, cd_dep_college_count#31, cnt6#41] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt index 09e974f0297b1..f9276bf1058fd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt @@ -6,75 +6,76 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purcha WholeStageCodegen (13) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - InputAdapter - BroadcastNestedLoopJoin [c_customer_sk,customer_sk] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter BroadcastExchange #2 - WholeStageCodegen (8) - Project [c_customer_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - InputAdapter - BroadcastExchange #3 - WholeStageCodegen (7) - Project [c_customer_sk,c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - InputAdapter - SortMergeJoin [c_customer_sk,ss_customer_sk] - WholeStageCodegen (2) - Sort [c_customer_sk] - InputAdapter - 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 (5) - Sort [ss_customer_sk] - InputAdapter - Exchange [ss_customer_sk] #5 - WholeStageCodegen (4) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] - InputAdapter - BroadcastExchange #6 - 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] - InputAdapter - BroadcastExchange #7 - WholeStageCodegen (6) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] + WholeStageCodegen (12) + Project [c_current_cdemo_sk] + 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,ss_customer_sk] + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - Union - WholeStageCodegen (10) - Project - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (12) - Project - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk] + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] + InputAdapter + 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 (10) + Sort [customer_sk] + InputAdapter + Exchange [customer_sk] #6 + Union + WholeStageCodegen (7) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (9) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 InputAdapter - ReusedExchange [d_date_sk] #6 + 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 + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt index 5387b0309bd45..40d3299de4ac9 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt @@ -4,11 +4,11 @@ TakeOrderedAndProject (48) +- Exchange (46) +- * HashAggregate (45) +- * Project (44) - +- BroadcastNestedLoopJoin LeftSemi BuildRight (43) - :- * Project (28) - : +- * BroadcastHashJoin Inner BuildRight (27) - : :- * Project (22) - : : +- * BroadcastHashJoin Inner BuildRight (21) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (31) + : : +- * BroadcastHashJoin LeftSemi BuildRight (30) : : :- * BroadcastHashJoin LeftSemi BuildRight (15) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) @@ -24,29 +24,29 @@ TakeOrderedAndProject (48) : : : +- * Filter (9) : : : +- * ColumnarToRow (8) : : : +- Scan parquet default.date_dim (7) - : : +- BroadcastExchange (20) - : : +- * Project (19) - : : +- * Filter (18) - : : +- * ColumnarToRow (17) - : : +- Scan parquet default.customer_address (16) - : +- BroadcastExchange (26) - : +- * Filter (25) - : +- * ColumnarToRow (24) - : +- Scan parquet default.customer_demographics (23) + : : +- BroadcastExchange (29) + : : +- Union (28) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.web_sales (16) + : : : +- ReusedExchange (19) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Filter (24) + : : : +- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (25) + : +- BroadcastExchange (36) + : +- * Project (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.customer_address (32) +- BroadcastExchange (42) - +- Union (41) - :- * Project (34) - : +- * BroadcastHashJoin Inner BuildRight (33) - : :- * Filter (31) - : : +- * ColumnarToRow (30) - : : +- Scan parquet default.web_sales (29) - : +- ReusedExchange (32) - +- * Project (40) - +- * BroadcastHashJoin Inner BuildRight (39) - :- * Filter (37) - : +- * ColumnarToRow (36) - : +- Scan parquet default.catalog_sales (35) - +- ReusedExchange (38) + +- * Filter (41) + +- * ColumnarToRow (40) + +- Scan parquet default.customer_demographics (39) (1) Scan parquet default.customer @@ -56,10 +56,10 @@ 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 : 5] +(2) ColumnarToRow [codegen id : 9] Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(3) Filter [codegen id : 5] +(3) Filter [codegen id : 9] 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)) @@ -112,153 +112,155 @@ Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, d_date_sk#6] Input [1]: [ss_customer_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(15) BroadcastHashJoin [codegen id : 5] +(15) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#5] Join condition: None -(16) Scan parquet default.customer_address -Output [2]: [ca_address_sk#11, ca_county#12] +(16) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] 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 - -(17) ColumnarToRow [codegen id : 3] -Input [2]: [ca_address_sk#11, ca_county#12] +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(18) Filter [codegen id : 3] -Input [2]: [ca_address_sk#11, ca_county#12] -Condition : (ca_county#12 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#11)) +(17) ColumnarToRow [codegen id : 4] +Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] -(19) Project [codegen id : 3] -Output [1]: [ca_address_sk#11] -Input [2]: [ca_address_sk#11, ca_county#12] +(18) Filter [codegen id : 4] +Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +Condition : isnotnull(ws_sold_date_sk#11) -(20) BroadcastExchange -Input [1]: [ca_address_sk#11] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] +(19) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#11] +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#11] +Right keys [1]: [d_date_sk#6] Join condition: None -(22) Project [codegen id : 5] -Output [2]: [c_customer_sk#1, c_current_cdemo_sk#2] -Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#11] +(21) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#12 AS customer_sk#13] +Input [3]: [ws_sold_date_sk#11, ws_bill_customer_sk#12, d_date_sk#6] -(23) Scan parquet default.customer_demographics -Output [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(22) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(24) ColumnarToRow [codegen id : 4] -Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] -(25) Filter [codegen id : 4] -Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Condition : isnotnull(cd_demo_sk#14) +(24) Filter [codegen id : 6] +Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +Condition : isnotnull(cs_sold_date_sk#14) -(26) BroadcastExchange -Input [9]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] +(25) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(27) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#14] +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#14] +Right keys [1]: [d_date_sk#6] Join condition: None -(28) Project [codegen id : 5] -Output [9]: [c_customer_sk#1, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Input [11]: [c_customer_sk#1, c_current_cdemo_sk#2, cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(27) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#15 AS customer_sk#16] +Input [3]: [cs_sold_date_sk#14, cs_ship_customer_sk#15, d_date_sk#6] -(29) Scan parquet default.web_sales -Output [1]: [ws_sold_date_sk#24] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +(28) Union -(30) ColumnarToRow [codegen id : 7] -Input [1]: [ws_sold_date_sk#24] +(29) BroadcastExchange +Input [1]: [customer_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] -(31) Filter [codegen id : 7] -Input [1]: [ws_sold_date_sk#24] -Condition : isnotnull(ws_sold_date_sk#24) - -(32) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] - -(33) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#24] -Right keys [1]: [d_date_sk#6] +(30) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#13] Join condition: None -(34) Project [codegen id : 7] -Output: [] -Input [2]: [ws_sold_date_sk#24, d_date_sk#6] +(31) Project [codegen id : 9] +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] -(35) Scan parquet default.catalog_sales -Output [1]: [cs_sold_date_sk#25] +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#18, ca_county#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +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 -(36) ColumnarToRow [codegen id : 9] -Input [1]: [cs_sold_date_sk#25] +(33) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#18, ca_county#19] -(37) Filter [codegen id : 9] -Input [1]: [cs_sold_date_sk#25] -Condition : isnotnull(cs_sold_date_sk#25) +(34) Filter [codegen id : 7] +Input [2]: [ca_address_sk#18, ca_county#19] +Condition : (ca_county#19 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#18)) -(38) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(35) Project [codegen id : 7] +Output [1]: [ca_address_sk#18] +Input [2]: [ca_address_sk#18, ca_county#19] -(39) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#25] -Right keys [1]: [d_date_sk#6] +(36) BroadcastExchange +Input [1]: [ca_address_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#18] Join condition: None -(40) Project [codegen id : 9] -Output: [] -Input [2]: [cs_sold_date_sk#25, d_date_sk#6] +(38) Project [codegen id : 9] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18] + +(39) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -(41) Union +(41) Filter [codegen id : 8] +Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Condition : isnotnull(cd_demo_sk#21) (42) BroadcastExchange -Input: [] -Arguments: IdentityBroadcastMode, [id=#26] +Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] -(43) BroadcastNestedLoopJoin -Join condition: (c_customer_sk#1 = customer_sk#27) +(43) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#21] +Join condition: None -(44) Project [codegen id : 10] -Output [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Input [9]: [c_customer_sk#1, cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(44) Project [codegen id : 9] +Output [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -(45) HashAggregate [codegen id : 10] -Input [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Keys [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(45) HashAggregate [codegen id : 9] +Input [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Keys [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] Functions [1]: [partial_count(1)] -Aggregate Attributes [1]: [count#28] -Results [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] +Aggregate Attributes [1]: [count#31] +Results [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] (46) Exchange -Input [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] -Arguments: hashpartitioning(cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, 5), true, [id=#30] +Input [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] +Arguments: hashpartitioning(cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, 5), true, [id=#33] -(47) HashAggregate [codegen id : 11] -Input [9]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#29] -Keys [8]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cd_purchase_estimate#18, cd_credit_rating#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(47) HashAggregate [codegen id : 10] +Input [9]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#32] +Keys [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] Functions [1]: [count(1)] -Aggregate Attributes [1]: [count(1)#31] -Results [14]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, count(1)#31 AS cnt1#32, cd_purchase_estimate#18, count(1)#31 AS cnt2#33, cd_credit_rating#19, count(1)#31 AS cnt3#34, cd_dep_count#20, count(1)#31 AS cnt4#35, cd_dep_employed_count#21, count(1)#31 AS cnt5#36, cd_dep_college_count#22, count(1)#31 AS cnt6#37] +Aggregate Attributes [1]: [count(1)#34] +Results [14]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, count(1)#34 AS cnt1#35, cd_purchase_estimate#25, count(1)#34 AS cnt2#36, cd_credit_rating#26, count(1)#34 AS cnt3#37, cd_dep_count#27, count(1)#34 AS cnt4#38, cd_dep_employed_count#28, count(1)#34 AS cnt5#39, cd_dep_college_count#29, count(1)#34 AS cnt6#40] (48) TakeOrderedAndProject -Input [14]: [cd_gender#15, cd_marital_status#16, cd_education_status#17, cnt1#32, cd_purchase_estimate#18, cnt2#33, cd_credit_rating#19, cnt3#34, cd_dep_count#20, cnt4#35, cd_dep_employed_count#21, cnt5#36, cd_dep_college_count#22, cnt6#37] -Arguments: 100, [cd_gender#15 ASC NULLS FIRST, cd_marital_status#16 ASC NULLS FIRST, cd_education_status#17 ASC NULLS FIRST, cd_purchase_estimate#18 ASC NULLS FIRST, cd_credit_rating#19 ASC NULLS FIRST, cd_dep_count#20 ASC NULLS FIRST, cd_dep_employed_count#21 ASC NULLS FIRST, cd_dep_college_count#22 ASC NULLS FIRST], [cd_gender#15, cd_marital_status#16, cd_education_status#17, cnt1#32, cd_purchase_estimate#18, cnt2#33, cd_credit_rating#19, cnt3#34, cd_dep_count#20, cnt4#35, cd_dep_employed_count#21, cnt5#36, cd_dep_college_count#22, cnt6#37] +Input [14]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#35, cd_purchase_estimate#25, cnt2#36, cd_credit_rating#26, cnt3#37, cd_dep_count#27, cnt4#38, cd_dep_employed_count#28, cnt5#39, cd_dep_college_count#29, cnt6#40] +Arguments: 100, [cd_gender#22 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_education_status#24 ASC NULLS FIRST, cd_purchase_estimate#25 ASC NULLS FIRST, cd_credit_rating#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#35, cd_purchase_estimate#25, cnt2#36, cd_credit_rating#26, cnt3#37, cd_dep_count#27, cnt4#38, cd_dep_employed_count#28, cnt5#39, cd_dep_college_count#29, cnt6#40] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt index f7382e147e6f6..c4567e89049ac 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt @@ -1,72 +1,71 @@ TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] - WholeStageCodegen (11) + WholeStageCodegen (10) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] InputAdapter Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (10) + WholeStageCodegen (9) HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - InputAdapter - BroadcastNestedLoopJoin [c_customer_sk,customer_sk] - WholeStageCodegen (5) - Project [c_customer_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - Project [c_customer_sk,c_current_cdemo_sk] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - 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] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow InputAdapter - BroadcastExchange #2 - WholeStageCodegen (2) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_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 - BroadcastExchange #4 - WholeStageCodegen (3) - Project [ca_address_sk] - Filter [ca_county,ca_address_sk] + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_county] + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_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 - BroadcastExchange #5 - WholeStageCodegen (4) - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastExchange #6 - Union - WholeStageCodegen (7) - Project - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - WholeStageCodegen (9) - Project - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] + BroadcastExchange #4 + Union + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] 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 7ed5cc9ab6262..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 @@ -1,91 +1,90 @@ == Physical Plan == -TakeOrderedAndProject (87) -+- * Project (86) - +- * SortMergeJoin Inner (85) - :- * Project (67) - : +- * SortMergeJoin Inner (66) - : :- * SortMergeJoin Inner (46) - : : :- * Sort (25) - : : : +- Exchange (24) - : : : +- * Project (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (45) - : : +- Exchange (44) - : : +- * HashAggregate (43) - : : +- Exchange (42) - : : +- * HashAggregate (41) - : : +- * Project (40) - : : +- * SortMergeJoin Inner (39) - : : :- * Sort (36) - : : : +- Exchange (35) - : : : +- * Project (34) - : : : +- * BroadcastHashJoin Inner BuildRight (33) - : : : :- * Filter (28) - : : : : +- * ColumnarToRow (27) - : : : : +- Scan parquet default.store_sales (26) - : : : +- BroadcastExchange (32) - : : : +- * Filter (31) - : : : +- * ColumnarToRow (30) - : : : +- Scan parquet default.date_dim (29) - : : +- * Sort (38) - : : +- ReusedExchange (37) - : +- * Sort (65) - : +- Exchange (64) - : +- * Project (63) - : +- * Filter (62) - : +- * HashAggregate (61) - : +- Exchange (60) - : +- * HashAggregate (59) - : +- * Project (58) - : +- * SortMergeJoin Inner (57) - : :- * Sort (54) - : : +- Exchange (53) - : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildRight (51) - : : :- * Filter (49) - : : : +- * ColumnarToRow (48) - : : : +- Scan parquet default.web_sales (47) - : : +- ReusedExchange (50) - : +- * Sort (56) - : +- ReusedExchange (55) - +- * Sort (84) - +- Exchange (83) - +- * HashAggregate (82) - +- Exchange (81) - +- * HashAggregate (80) - +- * Project (79) - +- * SortMergeJoin Inner (78) - :- * Sort (75) - : +- Exchange (74) - : +- * Project (73) - : +- * BroadcastHashJoin Inner BuildRight (72) - : :- * Filter (70) - : : +- * ColumnarToRow (69) - : : +- Scan parquet default.web_sales (68) - : +- ReusedExchange (71) - +- * Sort (77) - +- ReusedExchange (76) +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * 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) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) (1) Scan parquet default.store_sales @@ -190,293 +189,289 @@ Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue( Input [2]: [customer_id#22, year_total#23] Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) -(23) Project [codegen id : 7] -Output [2]: [customer_id#22 AS customer_id#24, year_total#23 AS year_total#25] +(23) Exchange Input [2]: [customer_id#22, year_total#23] +Arguments: hashpartitioning(customer_id#22, 5), true, [id=#24] -(24) Exchange -Input [2]: [customer_id#24, year_total#25] -Arguments: hashpartitioning(customer_id#24, 5), true, [id=#26] - -(25) Sort [codegen id : 8] -Input [2]: [customer_id#24, year_total#25] -Arguments: [customer_id#24 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 8] +Input [2]: [customer_id#22, year_total#23] +Arguments: [customer_id#22 ASC NULLS FIRST], false, 0 -(26) Scan parquet default.store_sales +(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] Batched: true Location [not included in comparison]/{warehouse_dir}/store_sales] PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)] ReadSchema: struct -(27) ColumnarToRow [codegen id : 10] +(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] -(28) Filter [codegen id : 10] +(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)) -(29) Scan parquet default.date_dim +(28) 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 -(30) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#5, d_year#6] -(31) Filter [codegen id : 9] +(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)) -(32) BroadcastExchange +(31) BroadcastExchange Input [2]: [d_date_sk#5, d_year#6] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] -(33) BroadcastHashJoin [codegen id : 10] +(32) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#5] Join condition: None -(34) Project [codegen id : 10] +(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] -(35) Exchange +(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=#28] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#26] -(36) Sort [codegen id : 11] +(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 -(37) ReusedExchange [Reuses operator id: 15] +(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] -(38) Sort [codegen id : 13] +(37) Sort [codegen id : 13] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(39) SortMergeJoin [codegen id : 14] +(38) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#9] Join condition: None -(40) Project [codegen id : 14] +(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] -(41) HashAggregate [codegen id : 14] +(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)))] -Aggregate Attributes [1]: [sum#29] -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#30] +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] -(42) 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#30] -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=#31] +(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] -(43) 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#30] +(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)))#32] -Results [5]: [c_customer_id#10 AS customer_id#33, c_first_name#11 AS customer_first_name#34, c_last_name#12 AS customer_last_name#35, c_email_address#16 AS customer_email_address#36, 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)))#32,18,2) AS year_total#37] +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 [5]: [c_customer_id#10 AS customer_id#31, c_first_name#11 AS customer_first_name#32, c_last_name#12 AS customer_last_name#33, c_email_address#16 AS customer_email_address#34, 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#35] -(44) Exchange -Input [5]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37] -Arguments: hashpartitioning(customer_id#33, 5), true, [id=#38] +(43) Exchange +Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35] +Arguments: hashpartitioning(customer_id#31, 5), true, [id=#36] -(45) Sort [codegen id : 16] -Input [5]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37] -Arguments: [customer_id#33 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 16] +Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35] +Arguments: [customer_id#31 ASC NULLS FIRST], false, 0 -(46) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#33] +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#31] Join condition: None -(47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +(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 [codegen id : 19] -Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +(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 [codegen id : 19] -Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] -Condition : (isnotnull(ws_bill_customer_sk#40) AND isnotnull(ws_sold_date_sk#39)) +(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)) -(50) ReusedExchange [Reuses operator id: 7] +(49) 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#39] +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#37] Right keys [1]: [d_date_sk#5] Join condition: None -(52) Project [codegen id : 19] -Output [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Input [6]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_date_sk#5, d_year#6] +(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] -(53) Exchange -Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Arguments: hashpartitioning(ws_bill_customer_sk#40, 5), true, [id=#43] +(52) Exchange +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] -(54) Sort [codegen id : 20] -Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Arguments: [ws_bill_customer_sk#40 ASC NULLS FIRST], false, 0 +(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] +Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0 -(55) ReusedExchange [Reuses operator id: 15] +(54) 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] -(56) Sort [codegen id : 22] +(55) Sort [codegen id : 22] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(57) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#40] +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#38] 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#41, ws_ext_list_price#42, d_year#6] -Input [12]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, 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] +(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] -(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#41, ws_ext_list_price#42, d_year#6] +(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] 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#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#44] -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#45] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#42] +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#43] -(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#45] -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=#46] +(59) 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#43] +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=#44] -(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#45] +(60) 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#43] 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#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#47] -Results [2]: [c_customer_id#10 AS customer_id#48, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#47,18,2) AS year_total#49] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45] +Results [2]: [c_customer_id#10 AS customer_id#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45,18,2) AS year_total#47] -(62) Filter [codegen id : 24] -Input [2]: [customer_id#48, year_total#49] -Condition : (isnotnull(year_total#49) AND (year_total#49 > 0.00)) +(61) Filter [codegen id : 24] +Input [2]: [customer_id#46, year_total#47] +Condition : (isnotnull(year_total#47) AND (year_total#47 > 0.00)) -(63) Project [codegen id : 24] -Output [2]: [customer_id#48 AS customer_id#50, year_total#49 AS year_total#51] -Input [2]: [customer_id#48, year_total#49] +(62) Project [codegen id : 24] +Output [2]: [customer_id#46 AS customer_id#48, year_total#47 AS year_total#49] +Input [2]: [customer_id#46, year_total#47] -(64) Exchange -Input [2]: [customer_id#50, year_total#51] -Arguments: hashpartitioning(customer_id#50, 5), true, [id=#52] +(63) Exchange +Input [2]: [customer_id#48, year_total#49] +Arguments: hashpartitioning(customer_id#48, 5), true, [id=#50] -(65) Sort [codegen id : 25] -Input [2]: [customer_id#50, year_total#51] -Arguments: [customer_id#50 ASC NULLS FIRST], false, 0 +(64) Sort [codegen id : 25] +Input [2]: [customer_id#48, year_total#49] +Arguments: [customer_id#48 ASC NULLS FIRST], false, 0 -(66) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#50] +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#48] Join condition: None -(67) Project [codegen id : 26] -Output [8]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, year_total#51] -Input [9]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, customer_id#50, year_total#51] +(66) Project [codegen id : 26] +Output [8]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49] +Input [9]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, customer_id#48, year_total#49] -(68) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +(67) 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 -(69) ColumnarToRow [codegen id : 28] -Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] +(68) ColumnarToRow [codegen id : 28] +Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40] -(70) Filter [codegen id : 28] -Input [4]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42] -Condition : (isnotnull(ws_bill_customer_sk#40) AND isnotnull(ws_sold_date_sk#39)) +(69) Filter [codegen id : 28] +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)) -(71) ReusedExchange [Reuses operator id: 32] +(70) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#5, d_year#6] -(72) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#39] +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#37] Right keys [1]: [d_date_sk#5] Join condition: None -(73) Project [codegen id : 28] -Output [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Input [6]: [ws_sold_date_sk#39, ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_date_sk#5, d_year#6] +(72) Project [codegen id : 28] +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] -(74) Exchange -Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Arguments: hashpartitioning(ws_bill_customer_sk#40, 5), true, [id=#53] +(73) Exchange +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=#51] -(75) Sort [codegen id : 29] -Input [4]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, d_year#6] -Arguments: [ws_bill_customer_sk#40 ASC NULLS FIRST], false, 0 +(74) Sort [codegen id : 29] +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 -(76) ReusedExchange [Reuses operator id: 15] +(75) 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] -(77) Sort [codegen id : 31] +(76) Sort [codegen id : 31] Input [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] Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 -(78) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#40] +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#38] 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#41, ws_ext_list_price#42, d_year#6] -Input [12]: [ws_bill_customer_sk#40, ws_ext_discount_amt#41, ws_ext_list_price#42, 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] +(78) 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#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] -(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#41, ws_ext_list_price#42, d_year#6] +(79) 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#39, ws_ext_list_price#40, 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#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#54] -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#55] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#52] +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#53] -(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#55] -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=#56] +(80) 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#53] +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=#54] -(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#55] +(81) 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#53] 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#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#57] -Results [2]: [c_customer_id#10 AS customer_id#58, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#42 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#41 as decimal(8,2)))), DecimalType(8,2), true)))#57,18,2) AS year_total#59] - -(83) Exchange -Input [2]: [customer_id#58, year_total#59] -Arguments: hashpartitioning(customer_id#58, 5), true, [id=#60] - -(84) Sort [codegen id : 34] -Input [2]: [customer_id#58, year_total#59] -Arguments: [customer_id#58 ASC NULLS FIRST], false, 0 - -(85) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#24] -Right keys [1]: [customer_id#58] -Join condition: (CASE WHEN (year_total#51 > 0.00) THEN CheckOverflow((promote_precision(year_total#59) / promote_precision(year_total#51)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#25 > 0.00) THEN CheckOverflow((promote_precision(year_total#37) / promote_precision(year_total#25)), DecimalType(38,20), true) ELSE 0E-20 END) - -(86) Project [codegen id : 35] -Output [4]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] -Input [10]: [customer_id#24, year_total#25, customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36, year_total#37, year_total#51, customer_id#58, year_total#59] - -(87) TakeOrderedAndProject -Input [4]: [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] -Arguments: 100, [customer_id#33 ASC NULLS FIRST, customer_first_name#34 ASC NULLS FIRST, customer_last_name#35 ASC NULLS FIRST, customer_email_address#36 ASC NULLS FIRST], [customer_id#33, customer_first_name#34, customer_last_name#35, customer_email_address#36] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55] +Results [2]: [c_customer_id#10 AS customer_id#56, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55,18,2) AS year_total#57] + +(82) Exchange +Input [2]: [customer_id#56, year_total#57] +Arguments: hashpartitioning(customer_id#56, 5), true, [id=#58] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#56, year_total#57] +Arguments: [customer_id#56 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#56] +Join condition: (CASE WHEN (year_total#49 > 0.00) THEN CheckOverflow((promote_precision(year_total#57) / promote_precision(year_total#49)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#35) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE 0E-20 END) + +(85) Project [codegen id : 35] +Output [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] +Input [10]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49, customer_id#56, year_total#57] + +(86) TakeOrderedAndProject +Input [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] +Arguments: 100, [customer_id#31 ASC NULLS FIRST, customer_first_name#32 ASC NULLS FIRST, customer_last_name#33 ASC NULLS FIRST, customer_email_address#34 ASC NULLS FIRST], [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34] 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 2857d41125ee7..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 @@ -15,44 +15,43 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt index 4e6fee0076626..fc0b38368e006 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt @@ -1,77 +1,76 @@ == Physical Plan == -TakeOrderedAndProject (73) -+- * Project (72) - +- * BroadcastHashJoin Inner BuildRight (71) - :- * Project (57) - : +- * BroadcastHashJoin Inner BuildRight (56) - : :- * BroadcastHashJoin Inner BuildRight (37) - : : :- * Project (20) - : : : +- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (36) - : : +- * HashAggregate (35) - : : +- Exchange (34) - : : +- * HashAggregate (33) - : : +- * Project (32) - : : +- * BroadcastHashJoin Inner BuildRight (31) - : : :- * Project (26) - : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : :- * Filter (23) - : : : : +- * ColumnarToRow (22) - : : : : +- Scan parquet default.customer (21) - : : : +- ReusedExchange (24) - : : +- BroadcastExchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.date_dim (27) - : +- BroadcastExchange (55) - : +- * Project (54) - : +- * Filter (53) - : +- * HashAggregate (52) - : +- Exchange (51) - : +- * HashAggregate (50) - : +- * Project (49) - : +- * BroadcastHashJoin Inner BuildRight (48) - : :- * Project (46) - : : +- * BroadcastHashJoin Inner BuildRight (45) - : : :- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.customer (38) - : : +- BroadcastExchange (44) - : : +- * Filter (43) - : : +- * ColumnarToRow (42) - : : +- Scan parquet default.web_sales (41) - : +- ReusedExchange (47) - +- BroadcastExchange (70) - +- * HashAggregate (69) - +- Exchange (68) - +- * HashAggregate (67) - +- * Project (66) - +- * BroadcastHashJoin Inner BuildRight (65) - :- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Filter (60) - : : +- * ColumnarToRow (59) - : : +- Scan parquet default.customer (58) - : +- ReusedExchange (61) - +- ReusedExchange (64) +TakeOrderedAndProject (72) ++- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (35) + : : +- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- ReusedExchange (23) + : : +- BroadcastExchange (29) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.date_dim (26) + : +- BroadcastExchange (54) + : +- * Project (53) + : +- * Filter (52) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * Project (45) + : : +- * BroadcastHashJoin Inner BuildRight (44) + : : :- * Filter (39) + : : : +- * ColumnarToRow (38) + : : : +- Scan parquet default.customer (37) + : : +- BroadcastExchange (43) + : : +- * Filter (42) + : : +- * ColumnarToRow (41) + : : +- Scan parquet default.web_sales (40) + : +- ReusedExchange (46) + +- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * BroadcastHashJoin Inner BuildRight (61) + : :- * Filter (59) + : : +- * ColumnarToRow (58) + : : +- Scan parquet default.customer (57) + : +- ReusedExchange (60) + +- ReusedExchange (63) (1) Scan parquet default.customer @@ -164,252 +163,248 @@ Results [2]: [c_customer_id#2 AS customer_id#21, MakeDecimal(sum(UnscaledValue(C Input [2]: [customer_id#21, year_total#22] Condition : (isnotnull(year_total#22) AND (year_total#22 > 0.00)) -(20) Project [codegen id : 16] -Output [2]: [customer_id#21 AS customer_id#23, year_total#22 AS year_total#24] -Input [2]: [customer_id#21, year_total#22] - -(21) Scan parquet default.customer +(20) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 6] +(21) ColumnarToRow [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(23) Filter [codegen id : 6] +(22) Filter [codegen id : 6] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(24) ReusedExchange [Reuses operator id: 7] +(23) ReusedExchange [Reuses operator id: 7] Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(25) BroadcastHashJoin [codegen id : 6] +(24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#10] Join condition: None -(26) Project [codegen id : 6] +(25) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12] Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12] -(27) Scan parquet default.date_dim +(26) Scan parquet default.date_dim Output [2]: [d_date_sk#14, d_year#15] 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 -(28) ColumnarToRow [codegen id : 5] +(27) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] -(29) Filter [codegen id : 5] +(28) Filter [codegen id : 5] Input [2]: [d_date_sk#14, d_year#15] Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) -(30) BroadcastExchange +(29) BroadcastExchange Input [2]: [d_date_sk#14, d_year#15] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] -(31) BroadcastHashJoin [codegen id : 6] +(30) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#9] Right keys [1]: [d_date_sk#14] Join condition: None -(32) Project [codegen id : 6] +(31) Project [codegen id : 6] Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, d_date_sk#14, d_year#15] -(33) HashAggregate [codegen id : 6] +(32) HashAggregate [codegen id : 6] Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#26] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +Aggregate Attributes [1]: [sum#24] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] -(34) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#28] +(33) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), true, [id=#26] -(35) HashAggregate [codegen id : 7] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#27] +(34) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#25] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29] -Results [5]: [c_customer_id#2 AS customer_id#30, c_first_name#3 AS customer_first_name#31, c_last_name#4 AS customer_last_name#32, c_email_address#8 AS customer_email_address#33, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#29,18,2) AS year_total#34] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27] +Results [5]: [c_customer_id#2 AS customer_id#28, c_first_name#3 AS customer_first_name#29, c_last_name#4 AS customer_last_name#30, c_email_address#8 AS customer_email_address#31, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#12 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#11 as decimal(8,2)))), DecimalType(8,2), true)))#27,18,2) AS year_total#32] -(36) BroadcastExchange -Input [5]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#35] +(35) BroadcastExchange +Input [5]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#33] -(37) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#30] +(36) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#28] Join condition: None -(38) Scan parquet default.customer +(37) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 10] +(38) ColumnarToRow [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(40) Filter [codegen id : 10] +(39) Filter [codegen id : 10] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(41) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +(40) Scan parquet default.web_sales +Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(42) ColumnarToRow [codegen id : 8] -Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +(41) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(43) Filter [codegen id : 8] -Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -Condition : (isnotnull(ws_bill_customer_sk#37) AND isnotnull(ws_sold_date_sk#36)) +(42) Filter [codegen id : 8] +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +Condition : (isnotnull(ws_bill_customer_sk#35) AND isnotnull(ws_sold_date_sk#34)) -(44) BroadcastExchange -Input [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#40] +(43) BroadcastExchange +Input [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#38] -(45) BroadcastHashJoin [codegen id : 10] +(44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#37] +Right keys [1]: [ws_bill_customer_sk#35] Join condition: None -(46) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +(45) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(47) ReusedExchange [Reuses operator id: 13] +(46) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#14, d_year#15] -(48) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#36] +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#34] Right keys [1]: [d_date_sk#14] Join condition: None -(49) Project [codegen id : 10] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39, d_date_sk#14, d_year#15] +(48) Project [codegen id : 10] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] -(50) HashAggregate [codegen id : 10] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] +(49) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#41] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#39] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] -(51) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#43] +(50) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#41] -(52) HashAggregate [codegen id : 11] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#42] +(51) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#40] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#44] -Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#44,18,2) AS year_total#46] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42] +Results [2]: [c_customer_id#2 AS customer_id#43, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#42,18,2) AS year_total#44] -(53) Filter [codegen id : 11] -Input [2]: [customer_id#45, year_total#46] -Condition : (isnotnull(year_total#46) AND (year_total#46 > 0.00)) +(52) Filter [codegen id : 11] +Input [2]: [customer_id#43, year_total#44] +Condition : (isnotnull(year_total#44) AND (year_total#44 > 0.00)) -(54) Project [codegen id : 11] -Output [2]: [customer_id#45 AS customer_id#47, year_total#46 AS year_total#48] -Input [2]: [customer_id#45, year_total#46] +(53) Project [codegen id : 11] +Output [2]: [customer_id#43 AS customer_id#45, year_total#44 AS year_total#46] +Input [2]: [customer_id#43, year_total#44] -(55) BroadcastExchange -Input [2]: [customer_id#47, year_total#48] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] +(54) BroadcastExchange +Input [2]: [customer_id#45, year_total#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] -(56) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#47] +(55) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#45] Join condition: None -(57) Project [codegen id : 16] -Output [8]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, year_total#48] -Input [9]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, customer_id#47, year_total#48] +(56) Project [codegen id : 16] +Output [8]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, year_total#46] +Input [9]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, customer_id#45, year_total#46] -(58) Scan parquet default.customer +(57) Scan parquet default.customer Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Batched: true Location [not included in comparison]/{warehouse_dir}/customer] PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] ReadSchema: struct -(59) ColumnarToRow [codegen id : 14] +(58) ColumnarToRow [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] -(60) Filter [codegen id : 14] +(59) Filter [codegen id : 14] Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(61) ReusedExchange [Reuses operator id: 44] -Output [4]: [ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +(60) ReusedExchange [Reuses operator id: 43] +Output [4]: [ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(62) BroadcastHashJoin [codegen id : 14] +(61) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#37] +Right keys [1]: [ws_bill_customer_sk#35] Join condition: None -(63) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39] -Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_bill_customer_sk#37, ws_ext_discount_amt#38, ws_ext_list_price#39] +(62) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_bill_customer_sk#35, ws_ext_discount_amt#36, ws_ext_list_price#37] -(64) ReusedExchange [Reuses operator id: 30] +(63) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#14, d_year#15] -(65) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#36] +(64) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#34] Right keys [1]: [d_date_sk#14] Join condition: None -(66) Project [codegen id : 14] -Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] -Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#36, ws_ext_discount_amt#38, ws_ext_list_price#39, d_date_sk#14, d_year#15] +(65) Project [codegen id : 14] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_sold_date_sk#34, ws_ext_discount_amt#36, ws_ext_list_price#37, d_date_sk#14, d_year#15] -(67) HashAggregate [codegen id : 14] -Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#38, ws_ext_list_price#39, d_year#15] +(66) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ws_ext_discount_amt#36, ws_ext_list_price#37, d_year#15] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum#50] -Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#48] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] -(68) Exchange -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#52] +(67) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, 5), true, [id=#50] -(69) HashAggregate [codegen id : 15] -Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#51] +(68) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15, sum#49] Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#15] -Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))] -Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#53] -Results [2]: [c_customer_id#2 AS customer_id#54, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#39 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#38 as decimal(8,2)))), DecimalType(8,2), true)))#53,18,2) AS year_total#55] - -(70) BroadcastExchange -Input [2]: [customer_id#54, year_total#55] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#56] - -(71) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#23] -Right keys [1]: [customer_id#54] -Join condition: (CASE WHEN (year_total#48 > 0.00) THEN CheckOverflow((promote_precision(year_total#55) / promote_precision(year_total#48)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#34) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE 0E-20 END) - -(72) Project [codegen id : 16] -Output [4]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] -Input [10]: [customer_id#23, year_total#24, customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33, year_total#34, year_total#48, customer_id#54, year_total#55] - -(73) TakeOrderedAndProject -Input [4]: [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] -Arguments: 100, [customer_id#30 ASC NULLS FIRST, customer_first_name#31 ASC NULLS FIRST, customer_last_name#32 ASC NULLS FIRST, customer_email_address#33 ASC NULLS FIRST], [customer_id#30, customer_first_name#31, customer_last_name#32, customer_email_address#33] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51] +Results [2]: [c_customer_id#2 AS customer_id#52, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#37 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#36 as decimal(8,2)))), DecimalType(8,2), true)))#51,18,2) AS year_total#53] + +(69) BroadcastExchange +Input [2]: [customer_id#52, year_total#53] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#54] + +(70) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#21] +Right keys [1]: [customer_id#52] +Join condition: (CASE WHEN (year_total#46 > 0.00) THEN CheckOverflow((promote_precision(year_total#53) / promote_precision(year_total#46)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#22 > 0.00) THEN CheckOverflow((promote_precision(year_total#32) / promote_precision(year_total#22)), DecimalType(38,20), true) ELSE 0E-20 END) + +(71) Project [codegen id : 16] +Output [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] +Input [10]: [customer_id#21, year_total#22, customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31, year_total#32, year_total#46, customer_id#52, year_total#53] + +(72) TakeOrderedAndProject +Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] +Arguments: 100, [customer_id#28 ASC NULLS FIRST, customer_first_name#29 ASC NULLS FIRST, customer_last_name#30 ASC NULLS FIRST, customer_email_address#31 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30, customer_email_address#31] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt index 0ac7ba7fb2b31..ab72d5041eeea 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt @@ -5,35 +5,34 @@ TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,custom Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_sold_date_sk,ss_ext_discount_amt,ss_ext_list_price] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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 9bd0b32a591d5..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 @@ -736,25 +736,24 @@ 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] (133) Union -Arguments: [quantity#82, list_price#83] (134) HashAggregate [codegen id : 7] -Input [2]: [quantity#82, list_price#83] +Input [2]: [quantity#72, list_price#73] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#84, count#85] -Results [2]: [sum#86, count#87] +Functions [1]: [partial_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))] +Aggregate Attributes [2]: [sum#82, count#83] +Results [2]: [sum#84, count#85] (135) Exchange -Input [2]: [sum#86, count#87] -Arguments: SinglePartition, true, [id=#88] +Input [2]: [sum#84, count#85] +Arguments: SinglePartition, true, [id=#86] (136) HashAggregate [codegen id : 8] -Input [2]: [sum#86, count#87] +Input [2]: [sum#84, count#85] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#82 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#83 as decimal(12,2)))), DecimalType(18,2), true))#89 AS average_sales#90] +Functions [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))] +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] * Project (140) @@ -764,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#91, d_dom#92] +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,16)] ReadSchema: struct (138) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1999)) AND (d_moy#91 = 12)) AND (d_dom#92 = 16)) +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 = 16)) (140) Project [codegen id : 1] Output [1]: [d_week_seq#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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] @@ -791,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#91, d_dom#92] +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,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] ReadSchema: struct (142) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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#29, d_year#11, d_moy#91, d_dom#92] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#91)) AND isnotnull(d_dom#92)) AND (d_year#11 = 1998)) AND (d_moy#91 = 12)) AND (d_dom#92 = 16)) +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 = 1998)) AND (d_moy#89 = 12)) AND (d_dom#90 = 16)) (144) Project [codegen id : 1] Output [1]: [d_week_seq#29] -Input [4]: [d_week_seq#29, d_year#11, d_moy#91, d_dom#92] +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-v2_7/q14.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt index 911c66b997afd..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 @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt index 1b54d866203e6..1af2e69d57338 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt @@ -689,25 +689,24 @@ Output [2]: [ws_quantity#75 AS quantity#77, ws_list_price#76 AS list_price#78] Input [4]: [ws_sold_date_sk#20, ws_quantity#75, ws_list_price#76, d_date_sk#10] (123) Union -Arguments: [quantity#79, list_price#80] (124) HashAggregate [codegen id : 7] -Input [2]: [quantity#79, list_price#80] +Input [2]: [quantity#69, list_price#70] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#81, count#82] -Results [2]: [sum#83, count#84] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#79, count#80] +Results [2]: [sum#81, count#82] (125) Exchange -Input [2]: [sum#83, count#84] -Arguments: SinglePartition, true, [id=#85] +Input [2]: [sum#81, count#82] +Arguments: SinglePartition, true, [id=#83] (126) HashAggregate [codegen id : 8] -Input [2]: [sum#83, count#84] +Input [2]: [sum#81, count#82] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#79 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#80 as decimal(12,2)))), DecimalType(18,2), true))#86 AS average_sales#87] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#84 AS average_sales#85] Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#29, [id=#30] * Project (130) @@ -717,22 +716,22 @@ Subquery:2 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquer (127) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] 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,16)] ReadSchema: struct (128) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] (129) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1999)) AND (d_moy#88 = 12)) AND (d_dom#89 = 16)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1999)) AND (d_moy#86 = 12)) AND (d_dom#87 = 16)) (130) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] Subquery:3 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#44, [id=#45] @@ -744,21 +743,21 @@ Subquery:4 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquer (131) Scan parquet default.date_dim -Output [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Output [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] Batched: true Location [not included in comparison]/{warehouse_dir}/date_dim] PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] ReadSchema: struct (132) ColumnarToRow [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] (133) Filter [codegen id : 1] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] -Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#88)) AND isnotnull(d_dom#89)) AND (d_year#11 = 1998)) AND (d_moy#88 = 12)) AND (d_dom#89 = 16)) +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#86)) AND isnotnull(d_dom#87)) AND (d_year#11 = 1998)) AND (d_moy#86 = 12)) AND (d_dom#87 = 16)) (134) Project [codegen id : 1] Output [1]: [d_week_seq#28] -Input [4]: [d_week_seq#28, d_year#11, d_moy#88, d_dom#89] +Input [4]: [d_week_seq#28, d_year#11, d_moy#86, d_dom#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt index c3079dd2643bb..7bbf83e3de707 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt @@ -11,7 +11,7 @@ TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_ WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] 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 2172be69af68c..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 @@ -787,485 +787,476 @@ Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sal 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 -Arguments: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sales#84, number_sales#85] (127) HashAggregate [codegen id : 118] -Input [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sales#84, number_sales#85] -Keys [4]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83] -Functions [2]: [partial_sum(sales#84), partial_sum(number_sales#85)] -Aggregate Attributes [3]: [sum#86, isEmpty#87, sum#88] -Results [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#80, isEmpty#81, sum#82] +Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] (128) Exchange -Input [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] -Arguments: hashpartitioning(channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, 5), true, [id=#92] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#86] (129) HashAggregate [codegen id : 119] -Input [7]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum#89, isEmpty#90, sum#91] -Keys [4]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83] -Functions [2]: [sum(sales#84), sum(number_sales#85)] -Aggregate Attributes [2]: [sum(sales#84)#93, sum(number_sales#85)#94] -Results [6]: [channel#80, i_brand_id#81, i_class_id#82, i_category_id#83, sum(sales#84)#93 AS sum_sales#95, sum(number_sales#85)#94 AS number_sales#96] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#83, isEmpty#84, sum#85] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#87, sum(number_sales#43)#88] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum(sales#42)#87 AS sum_sales#89, sum(number_sales#43)#88 AS number_sales#90] (130) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#91, isEmpty#92, count#93] (131) HashAggregate [codegen id : 158] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#91, isEmpty#92, count#93] 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))#100, count(1)#101] -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))#100 AS sales#42, count(1)#101 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))#100 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))#102] +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))#94, count(1)#95] +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))#94 AS sales#42, count(1)#95 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))#94 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))#96] (132) Filter [codegen id : 158] -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))#102] -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))#102) 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))#102 as decimal(32,6)) > cast(ReusedSubquery 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))#96] +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))#96) 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))#96 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (133) Project [codegen id : 158] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#102] +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))#96] (134) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#103, isEmpty#104, count#105] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] (135) HashAggregate [codegen id : 197] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#103, isEmpty#104, count#105] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#97, isEmpty#98, count#99] 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))#106, count(1)#107] -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))#106 AS sales#60, count(1)#107 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))#106 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))#108] +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))#100, count(1)#101] +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))#100 AS sales#60, count(1)#101 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))#100 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))#102] (136) Filter [codegen id : 197] -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))#108] -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))#108) 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))#108 as decimal(32,6)) > cast(ReusedSubquery 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#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))#102] +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))#102) 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))#102 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (137) Project [codegen id : 197] -Output [6]: [catalog AS channel#109, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#108] +Output [6]: [catalog AS channel#103, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#102] (138) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#110, isEmpty#111, count#112] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#104, isEmpty#105, count#106] (139) HashAggregate [codegen id : 236] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#110, isEmpty#111, count#112] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#104, isEmpty#105, count#106] 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))#113, count(1)#114] -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))#113 AS sales#76, count(1)#114 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))#113 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))#115] +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))#107, count(1)#108] +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))#107 AS sales#76, count(1)#108 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))#107 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))#109] (140) Filter [codegen id : 236] -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))#115] -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))#115) 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))#115 as decimal(32,6)) > cast(ReusedSubquery 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#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))#109] +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))#109) 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))#109 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (141) Project [codegen id : 236] -Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#115] +Output [6]: [web AS channel#110, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#109] (142) Union -Arguments: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sales#120, number_sales#121] (143) HashAggregate [codegen id : 237] -Input [6]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sales#120, number_sales#121] -Keys [4]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119] -Functions [2]: [partial_sum(sales#120), partial_sum(number_sales#121)] -Aggregate Attributes [3]: [sum#122, isEmpty#123, sum#124] -Results [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#111, isEmpty#112, sum#113] +Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] (144) Exchange -Input [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] -Arguments: hashpartitioning(channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, 5), true, [id=#128] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#117] (145) HashAggregate [codegen id : 238] -Input [7]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119, sum#125, isEmpty#126, sum#127] -Keys [4]: [channel#116, i_brand_id#117, i_class_id#118, i_category_id#119] -Functions [2]: [sum(sales#120), sum(number_sales#121)] -Aggregate Attributes [2]: [sum(sales#120)#129, sum(number_sales#121)#130] -Results [5]: [channel#116, i_brand_id#117, i_class_id#118, sum(sales#120)#129 AS sum_sales#95, sum(number_sales#121)#130 AS number_sales#96] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#114, isEmpty#115, sum#116] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#118, sum(number_sales#43)#119] +Results [5]: [channel#47, i_brand_id#7, i_class_id#8, sum(sales#42)#118 AS sum_sales#89, sum(number_sales#43)#119 AS number_sales#90] (146) HashAggregate [codegen id : 238] -Input [5]: [channel#116, i_brand_id#117, i_class_id#118, sum_sales#95, number_sales#96] -Keys [3]: [channel#116, i_brand_id#117, i_class_id#118] -Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] -Aggregate Attributes [3]: [sum#131, isEmpty#132, sum#133] -Results [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] +Input [5]: [channel#47, i_brand_id#7, i_class_id#8, sum_sales#89, number_sales#90] +Keys [3]: [channel#47, i_brand_id#7, i_class_id#8] +Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] +Aggregate Attributes [3]: [sum#120, isEmpty#121, sum#122] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] (147) Exchange -Input [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] -Arguments: hashpartitioning(channel#116, i_brand_id#117, i_class_id#118, 5), true, [id=#137] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, 5), true, [id=#126] (148) HashAggregate [codegen id : 239] -Input [6]: [channel#116, i_brand_id#117, i_class_id#118, sum#134, isEmpty#135, sum#136] -Keys [3]: [channel#116, i_brand_id#117, i_class_id#118] -Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] -Aggregate Attributes [2]: [sum(sum_sales#95)#138, sum(number_sales#96)#139] -Results [6]: [channel#116, i_brand_id#117, i_class_id#118, null AS i_category_id#140, sum(sum_sales#95)#138 AS sum(sum_sales)#141, sum(number_sales#96)#139 AS sum(number_sales)#142] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, sum#123, isEmpty#124, sum#125] +Keys [3]: [channel#47, i_brand_id#7, i_class_id#8] +Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] +Aggregate Attributes [2]: [sum(sum_sales#89)#127, sum(number_sales#90)#128] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, null AS i_category_id#129, sum(sum_sales#89)#127 AS sum(sum_sales)#130, sum(number_sales#90)#128 AS sum(number_sales)#131] (149) Union -Arguments: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] (150) HashAggregate [codegen id : 240] -Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] -Keys [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (151) Exchange -Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] -Arguments: hashpartitioning(channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148, 5), true, [id=#149] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#132] (152) HashAggregate [codegen id : 241] -Input [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] -Keys [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#143, i_brand_id#144, i_class_id#145, i_category_id#146, sum_sales#147, number_sales#148] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (153) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#150, isEmpty#151, count#152] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#133, isEmpty#134, count#135] (154) HashAggregate [codegen id : 280] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#150, isEmpty#151, count#152] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#133, isEmpty#134, count#135] 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))#153, count(1)#154] -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))#153 AS sales#42, count(1)#154 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))#153 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))#155] +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))#136, count(1)#137] +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))#136 AS sales#42, count(1)#137 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))#136 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))#138] (155) Filter [codegen id : 280] -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))#155] -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))#155) 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))#155 as decimal(32,6)) > cast(ReusedSubquery 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))#138] +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))#138) 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))#138 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (156) Project [codegen id : 280] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#155] +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))#138] (157) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, count#158] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#139, isEmpty#140, count#141] (158) HashAggregate [codegen id : 319] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, count#158] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#139, isEmpty#140, count#141] 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))#159, count(1)#160] -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))#159 AS sales#60, count(1)#160 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))#159 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))#161] +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))#142, count(1)#143] +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))#142 AS sales#60, count(1)#143 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))#142 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))#144] (159) Filter [codegen id : 319] -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))#161] -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))#161) 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))#161 as decimal(32,6)) > cast(ReusedSubquery 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#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))#144] +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))#144) 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))#144 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (160) Project [codegen id : 319] -Output [6]: [catalog AS channel#162, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#161] +Output [6]: [catalog AS channel#145, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#144] (161) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#163, isEmpty#164, count#165] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#146, isEmpty#147, count#148] (162) HashAggregate [codegen id : 358] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#163, isEmpty#164, count#165] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#146, isEmpty#147, count#148] 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))#166, count(1)#167] -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))#166 AS sales#76, count(1)#167 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))#166 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))#168] +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))#149, count(1)#150] +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))#149 AS sales#76, count(1)#150 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))#149 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))#151] (163) Filter [codegen id : 358] -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))#168] -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))#168) 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))#168 as decimal(32,6)) > cast(ReusedSubquery 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#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))#151] +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))#151) 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))#151 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (164) Project [codegen id : 358] -Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#168] +Output [6]: [web AS channel#152, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#151] (165) Union -Arguments: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sales#173, number_sales#174] (166) HashAggregate [codegen id : 359] -Input [6]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sales#173, number_sales#174] -Keys [4]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172] -Functions [2]: [partial_sum(sales#173), partial_sum(number_sales#174)] -Aggregate Attributes [3]: [sum#175, isEmpty#176, sum#177] -Results [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#153, isEmpty#154, sum#155] +Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] (167) Exchange -Input [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] -Arguments: hashpartitioning(channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, 5), true, [id=#181] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#159] (168) HashAggregate [codegen id : 360] -Input [7]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172, sum#178, isEmpty#179, sum#180] -Keys [4]: [channel#169, i_brand_id#170, i_class_id#171, i_category_id#172] -Functions [2]: [sum(sales#173), sum(number_sales#174)] -Aggregate Attributes [2]: [sum(sales#173)#182, sum(number_sales#174)#183] -Results [4]: [channel#169, i_brand_id#170, sum(sales#173)#182 AS sum_sales#95, sum(number_sales#174)#183 AS number_sales#96] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#156, isEmpty#157, sum#158] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#160, sum(number_sales#43)#161] +Results [4]: [channel#47, i_brand_id#7, sum(sales#42)#160 AS sum_sales#89, sum(number_sales#43)#161 AS number_sales#90] (169) HashAggregate [codegen id : 360] -Input [4]: [channel#169, i_brand_id#170, sum_sales#95, number_sales#96] -Keys [2]: [channel#169, i_brand_id#170] -Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] -Aggregate Attributes [3]: [sum#184, isEmpty#185, sum#186] -Results [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] +Input [4]: [channel#47, i_brand_id#7, sum_sales#89, number_sales#90] +Keys [2]: [channel#47, i_brand_id#7] +Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] +Aggregate Attributes [3]: [sum#162, isEmpty#163, sum#164] +Results [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] (170) Exchange -Input [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] -Arguments: hashpartitioning(channel#169, i_brand_id#170, 5), true, [id=#190] +Input [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] +Arguments: hashpartitioning(channel#47, i_brand_id#7, 5), true, [id=#168] (171) HashAggregate [codegen id : 361] -Input [5]: [channel#169, i_brand_id#170, sum#187, isEmpty#188, sum#189] -Keys [2]: [channel#169, i_brand_id#170] -Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] -Aggregate Attributes [2]: [sum(sum_sales#95)#191, sum(number_sales#96)#192] -Results [6]: [channel#169, i_brand_id#170, null AS i_class_id#193, null AS i_category_id#194, sum(sum_sales#95)#191 AS sum(sum_sales)#195, sum(number_sales#96)#192 AS sum(number_sales)#196] +Input [5]: [channel#47, i_brand_id#7, sum#165, isEmpty#166, sum#167] +Keys [2]: [channel#47, i_brand_id#7] +Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] +Aggregate Attributes [2]: [sum(sum_sales#89)#169, sum(number_sales#90)#170] +Results [6]: [channel#47, i_brand_id#7, null AS i_class_id#171, null AS i_category_id#172, sum(sum_sales#89)#169 AS sum(sum_sales)#173, sum(number_sales#90)#170 AS sum(number_sales)#174] (172) Union -Arguments: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] (173) HashAggregate [codegen id : 362] -Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] -Keys [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (174) Exchange -Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] -Arguments: hashpartitioning(channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202, 5), true, [id=#203] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#175] (175) HashAggregate [codegen id : 363] -Input [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] -Keys [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#197, i_brand_id#198, i_class_id#199, i_category_id#200, sum_sales#201, number_sales#202] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (176) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#204, isEmpty#205, count#206] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#176, isEmpty#177, count#178] (177) HashAggregate [codegen id : 402] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#204, isEmpty#205, count#206] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#176, isEmpty#177, count#178] 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))#207, count(1)#208] -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))#207 AS sales#42, count(1)#208 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))#207 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))#209] +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))#179, count(1)#180] +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))#179 AS sales#42, count(1)#180 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))#179 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))#181] (178) Filter [codegen id : 402] -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))#209] -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))#209) 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))#209 as decimal(32,6)) > cast(ReusedSubquery 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))#181] +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))#181) 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))#181 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (179) Project [codegen id : 402] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#209] +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))#181] (180) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#210, isEmpty#211, count#212] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#182, isEmpty#183, count#184] (181) HashAggregate [codegen id : 441] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#210, isEmpty#211, count#212] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#182, isEmpty#183, count#184] 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))#213, count(1)#214] -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))#213 AS sales#60, count(1)#214 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))#213 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))#215] +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))#185, count(1)#186] +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))#185 AS sales#60, count(1)#186 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))#185 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))#187] (182) Filter [codegen id : 441] -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))#215] -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))#215) 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))#215 as decimal(32,6)) > cast(ReusedSubquery 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#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))#187] +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))#187) 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))#187 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (183) Project [codegen id : 441] -Output [6]: [catalog AS channel#216, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#215] +Output [6]: [catalog AS channel#188, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#187] (184) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#217, isEmpty#218, count#219] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#189, isEmpty#190, count#191] (185) HashAggregate [codegen id : 480] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#217, isEmpty#218, count#219] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#189, isEmpty#190, count#191] 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))#220, count(1)#221] -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))#220 AS sales#76, count(1)#221 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))#220 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))#222] +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))#192, count(1)#193] +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))#192 AS sales#76, count(1)#193 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))#192 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))#194] (186) Filter [codegen id : 480] -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))#222] -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))#222) 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))#222 as decimal(32,6)) > cast(ReusedSubquery 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#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))#194] +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))#194) 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))#194 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (187) Project [codegen id : 480] -Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#222] +Output [6]: [web AS channel#195, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#194] (188) Union -Arguments: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sales#227, number_sales#228] (189) HashAggregate [codegen id : 481] -Input [6]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sales#227, number_sales#228] -Keys [4]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226] -Functions [2]: [partial_sum(sales#227), partial_sum(number_sales#228)] -Aggregate Attributes [3]: [sum#229, isEmpty#230, sum#231] -Results [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#196, isEmpty#197, sum#198] +Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] (190) Exchange -Input [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] -Arguments: hashpartitioning(channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, 5), true, [id=#235] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#202] (191) HashAggregate [codegen id : 482] -Input [7]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226, sum#232, isEmpty#233, sum#234] -Keys [4]: [channel#223, i_brand_id#224, i_class_id#225, i_category_id#226] -Functions [2]: [sum(sales#227), sum(number_sales#228)] -Aggregate Attributes [2]: [sum(sales#227)#236, sum(number_sales#228)#237] -Results [3]: [channel#223, sum(sales#227)#236 AS sum_sales#95, sum(number_sales#228)#237 AS number_sales#96] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#199, isEmpty#200, sum#201] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#203, sum(number_sales#43)#204] +Results [3]: [channel#47, sum(sales#42)#203 AS sum_sales#89, sum(number_sales#43)#204 AS number_sales#90] (192) HashAggregate [codegen id : 482] -Input [3]: [channel#223, sum_sales#95, number_sales#96] -Keys [1]: [channel#223] -Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] -Aggregate Attributes [3]: [sum#238, isEmpty#239, sum#240] -Results [4]: [channel#223, sum#241, isEmpty#242, sum#243] +Input [3]: [channel#47, sum_sales#89, number_sales#90] +Keys [1]: [channel#47] +Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] +Aggregate Attributes [3]: [sum#205, isEmpty#206, sum#207] +Results [4]: [channel#47, sum#208, isEmpty#209, sum#210] (193) Exchange -Input [4]: [channel#223, sum#241, isEmpty#242, sum#243] -Arguments: hashpartitioning(channel#223, 5), true, [id=#244] +Input [4]: [channel#47, sum#208, isEmpty#209, sum#210] +Arguments: hashpartitioning(channel#47, 5), true, [id=#211] (194) HashAggregate [codegen id : 483] -Input [4]: [channel#223, sum#241, isEmpty#242, sum#243] -Keys [1]: [channel#223] -Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] -Aggregate Attributes [2]: [sum(sum_sales#95)#245, sum(number_sales#96)#246] -Results [6]: [channel#223, null AS i_brand_id#247, null AS i_class_id#248, null AS i_category_id#249, sum(sum_sales#95)#245 AS sum(sum_sales)#250, sum(number_sales#96)#246 AS sum(number_sales)#251] +Input [4]: [channel#47, sum#208, isEmpty#209, sum#210] +Keys [1]: [channel#47] +Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] +Aggregate Attributes [2]: [sum(sum_sales#89)#212, sum(number_sales#90)#213] +Results [6]: [channel#47, null AS i_brand_id#214, null AS i_class_id#215, null AS i_category_id#216, sum(sum_sales#89)#212 AS sum(sum_sales)#217, sum(number_sales#90)#213 AS sum(number_sales)#218] (195) Union -Arguments: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] (196) HashAggregate [codegen id : 484] -Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] -Keys [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (197) Exchange -Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] -Arguments: hashpartitioning(channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257, 5), true, [id=#258] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#219] (198) HashAggregate [codegen id : 485] -Input [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] -Keys [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#252, i_brand_id#253, i_class_id#254, i_category_id#255, sum_sales#256, number_sales#257] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (199) ReusedExchange [Reuses operator id: 84] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#259, isEmpty#260, count#261] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#220, isEmpty#221, count#222] (200) HashAggregate [codegen id : 524] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#259, isEmpty#260, count#261] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#220, isEmpty#221, count#222] 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))#262, count(1)#263] -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))#262 AS sales#42, count(1)#263 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))#262 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))#264] +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))#223, count(1)#224] +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))#223 AS sales#42, count(1)#224 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))#223 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))#225] (201) Filter [codegen id : 524] -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))#264] -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))#264) 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))#264 as decimal(32,6)) > cast(ReusedSubquery 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))#225] +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))#225) 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))#225 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (202) Project [codegen id : 524] Output [6]: [store AS channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] -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))#264] +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))#225] (203) ReusedExchange [Reuses operator id: 103] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#265, isEmpty#266, count#267] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#226, isEmpty#227, count#228] (204) HashAggregate [codegen id : 563] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#265, isEmpty#266, count#267] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#226, isEmpty#227, count#228] 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))#268, count(1)#269] -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))#268 AS sales#60, count(1)#269 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))#268 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))#270] +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))#229, count(1)#230] +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))#229 AS sales#60, count(1)#230 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))#229 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))#231] (205) Filter [codegen id : 563] -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))#270] -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))#270) 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))#270 as decimal(32,6)) > cast(ReusedSubquery 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#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))#231] +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))#231) 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))#231 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (206) Project [codegen id : 563] -Output [6]: [catalog AS channel#271, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] -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))#270] +Output [6]: [catalog AS channel#232, i_brand_id#7, i_class_id#8, i_category_id#9, sales#60, number_sales#61] +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))#231] (207) ReusedExchange [Reuses operator id: 122] -Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#272, isEmpty#273, count#274] +Output [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#233, isEmpty#234, count#235] (208) HashAggregate [codegen id : 602] -Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#272, isEmpty#273, count#274] +Input [6]: [i_brand_id#7, i_class_id#8, i_category_id#9, sum#233, isEmpty#234, count#235] 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))#275, count(1)#276] -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))#275 AS sales#76, count(1)#276 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))#275 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))#277] +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))#236, count(1)#237] +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))#236 AS sales#76, count(1)#237 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))#236 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))#238] (209) Filter [codegen id : 602] -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))#277] -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))#277) 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))#277 as decimal(32,6)) > cast(ReusedSubquery 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#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))#238] +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))#238) 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))#238 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#45, [id=#46] as decimal(32,6)))) (210) Project [codegen id : 602] -Output [6]: [web AS channel#79, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] -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))#277] +Output [6]: [web AS channel#239, i_brand_id#7, i_class_id#8, i_category_id#9, sales#76, number_sales#77] +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))#238] (211) Union -Arguments: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sales#282, number_sales#283] (212) HashAggregate [codegen id : 603] -Input [6]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sales#282, number_sales#283] -Keys [4]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281] -Functions [2]: [partial_sum(sales#282), partial_sum(number_sales#283)] -Aggregate Attributes [3]: [sum#284, isEmpty#285, sum#286] -Results [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sales#42, number_sales#43] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [partial_sum(sales#42), partial_sum(number_sales#43)] +Aggregate Attributes [3]: [sum#240, isEmpty#241, sum#242] +Results [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] (213) Exchange -Input [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] -Arguments: hashpartitioning(channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, 5), true, [id=#290] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, 5), true, [id=#246] (214) HashAggregate [codegen id : 604] -Input [7]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281, sum#287, isEmpty#288, sum#289] -Keys [4]: [channel#278, i_brand_id#279, i_class_id#280, i_category_id#281] -Functions [2]: [sum(sales#282), sum(number_sales#283)] -Aggregate Attributes [2]: [sum(sales#282)#291, sum(number_sales#283)#292] -Results [2]: [sum(sales#282)#291 AS sum_sales#95, sum(number_sales#283)#292 AS number_sales#96] +Input [7]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum#243, isEmpty#244, sum#245] +Keys [4]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9] +Functions [2]: [sum(sales#42), sum(number_sales#43)] +Aggregate Attributes [2]: [sum(sales#42)#247, sum(number_sales#43)#248] +Results [2]: [sum(sales#42)#247 AS sum_sales#89, sum(number_sales#43)#248 AS number_sales#90] (215) HashAggregate [codegen id : 604] -Input [2]: [sum_sales#95, number_sales#96] +Input [2]: [sum_sales#89, number_sales#90] Keys: [] -Functions [2]: [partial_sum(sum_sales#95), partial_sum(number_sales#96)] -Aggregate Attributes [3]: [sum#293, isEmpty#294, sum#295] -Results [3]: [sum#296, isEmpty#297, sum#298] +Functions [2]: [partial_sum(sum_sales#89), partial_sum(number_sales#90)] +Aggregate Attributes [3]: [sum#249, isEmpty#250, sum#251] +Results [3]: [sum#252, isEmpty#253, sum#254] (216) Exchange -Input [3]: [sum#296, isEmpty#297, sum#298] -Arguments: SinglePartition, true, [id=#299] +Input [3]: [sum#252, isEmpty#253, sum#254] +Arguments: SinglePartition, true, [id=#255] (217) HashAggregate [codegen id : 605] -Input [3]: [sum#296, isEmpty#297, sum#298] +Input [3]: [sum#252, isEmpty#253, sum#254] Keys: [] -Functions [2]: [sum(sum_sales#95), sum(number_sales#96)] -Aggregate Attributes [2]: [sum(sum_sales#95)#300, sum(number_sales#96)#301] -Results [6]: [null AS channel#302, null AS i_brand_id#303, null AS i_class_id#304, null AS i_category_id#305, sum(sum_sales#95)#300 AS sum(sum_sales)#306, sum(number_sales#96)#301 AS sum(number_sales)#307] +Functions [2]: [sum(sum_sales#89), sum(number_sales#90)] +Aggregate Attributes [2]: [sum(sum_sales#89)#256, sum(number_sales#90)#257] +Results [6]: [null AS channel#258, null AS i_brand_id#259, null AS i_class_id#260, null AS i_category_id#261, sum(sum_sales#89)#256 AS sum(sum_sales)#262, sum(number_sales#90)#257 AS sum(number_sales)#263] (218) Union -Arguments: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] (219) HashAggregate [codegen id : 606] -Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] -Keys [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (220) Exchange -Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] -Arguments: hashpartitioning(channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313, 5), true, [id=#314] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Arguments: hashpartitioning(channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90, 5), true, [id=#264] (221) HashAggregate [codegen id : 607] -Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] -Keys [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Keys [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Results [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] (222) TakeOrderedAndProject -Input [6]: [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] -Arguments: 100, [channel#308 ASC NULLS FIRST, i_brand_id#309 ASC NULLS FIRST, i_class_id#310 ASC NULLS FIRST, i_category_id#311 ASC NULLS FIRST], [channel#308, i_brand_id#309, i_class_id#310, i_category_id#311, sum_sales#312, number_sales#313] +Input [6]: [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] +Arguments: 100, [channel#47 ASC NULLS FIRST, i_brand_id#7 ASC NULLS FIRST, i_class_id#8 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST], [channel#47, i_brand_id#7, i_class_id#8, i_category_id#9, sum_sales#89, number_sales#90] ===== Subqueries ===== @@ -1336,7 +1327,7 @@ Input [2]: [d_date_sk#10, d_year#11] (230) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#315] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#265] (231) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -1344,7 +1335,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (232) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#316, ss_list_price#4 AS list_price#317] +Output [2]: [ss_quantity#3 AS quantity#266, ss_list_price#4 AS list_price#267] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (233) Scan parquet default.catalog_sales @@ -1381,7 +1372,7 @@ Input [2]: [d_date_sk#10, d_year#11] (240) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#318] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#268] (241) BroadcastHashJoin [codegen id : 4] Left keys [1]: [cs_sold_date_sk#18] @@ -1389,7 +1380,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (242) Project [codegen id : 4] -Output [2]: [cs_quantity#48 AS quantity#319, cs_list_price#49 AS list_price#320] +Output [2]: [cs_quantity#48 AS quantity#269, cs_list_price#49 AS list_price#270] Input [4]: [cs_sold_date_sk#18, cs_quantity#48, cs_list_price#49, d_date_sk#10] (243) Scan parquet default.web_sales @@ -1415,29 +1406,28 @@ Right keys [1]: [d_date_sk#10] Join condition: None (248) Project [codegen id : 6] -Output [2]: [ws_quantity#64 AS quantity#321, ws_list_price#65 AS list_price#322] +Output [2]: [ws_quantity#64 AS quantity#271, ws_list_price#65 AS list_price#272] Input [4]: [ws_sold_date_sk#22, ws_quantity#64, ws_list_price#65, d_date_sk#10] (249) Union -Arguments: [quantity#323, list_price#324] (250) HashAggregate [codegen id : 7] -Input [2]: [quantity#323, list_price#324] +Input [2]: [quantity#266, list_price#267] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#325, count#326] -Results [2]: [sum#327, count#328] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#273, count#274] +Results [2]: [sum#275, count#276] (251) Exchange -Input [2]: [sum#327, count#328] -Arguments: SinglePartition, true, [id=#329] +Input [2]: [sum#275, count#276] +Arguments: SinglePartition, true, [id=#277] (252) HashAggregate [codegen id : 8] -Input [2]: [sum#327, count#328] +Input [2]: [sum#275, count#276] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))#330] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#323 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#324 as decimal(12,2)))), DecimalType(18,2), true))#330 AS average_sales#331] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))#278] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#266 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#267 as decimal(12,2)))), DecimalType(18,2), true))#278 AS average_sales#279] Subquery:2 Hosting operator id = 105 Hosting Expression = ReusedSubquery Subquery scalar-subquery#45, [id=#46] 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 a382362b32235..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (606) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (485) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (484) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (363) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (362) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (241) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -30,7 +30,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (240) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (119) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] InputAdapter @@ -38,7 +38,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (118) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (39) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -50,7 +50,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -301,7 +301,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (237) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (158) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -335,7 +335,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (359) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (280) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -369,7 +369,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (481) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (402) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -403,7 +403,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (603) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (524) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt index b1f1fca12cc0c..238053a3428e3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt @@ -707,485 +707,476 @@ Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sal Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#73] (110) Union -Arguments: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sales#79, number_sales#80] (111) HashAggregate [codegen id : 79] -Input [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sales#79, number_sales#80] -Keys [4]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78] -Functions [2]: [partial_sum(sales#79), partial_sum(number_sales#80)] -Aggregate Attributes [3]: [sum#81, isEmpty#82, sum#83] -Results [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#75, isEmpty#76, sum#77] +Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] (112) Exchange -Input [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] -Arguments: hashpartitioning(channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, 5), true, [id=#87] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#81] (113) HashAggregate [codegen id : 80] -Input [7]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum#84, isEmpty#85, sum#86] -Keys [4]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78] -Functions [2]: [sum(sales#79), sum(number_sales#80)] -Aggregate Attributes [2]: [sum(sales#79)#88, sum(number_sales#80)#89] -Results [6]: [channel#75, i_brand_id#76, i_class_id#77, i_category_id#78, sum(sales#79)#88 AS sum_sales#90, sum(number_sales#80)#89 AS number_sales#91] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#78, isEmpty#79, sum#80] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#82, sum(number_sales#40)#83] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum(sales#39)#82 AS sum_sales#84, sum(number_sales#40)#83 AS number_sales#85] (114) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#86, isEmpty#87, count#88] (115) HashAggregate [codegen id : 106] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#86, isEmpty#87, count#88] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#95, count(1)#96] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#95 AS sales#39, count(1)#96 AS number_sales#40, 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))#95 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))#97] +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))#89, count(1)#90] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#89 AS sales#39, count(1)#90 AS number_sales#40, 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))#89 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))#91] (116) Filter [codegen id : 106] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#97] -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))#97) 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))#97 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#91] +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))#91) 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))#91 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (117) Project [codegen id : 106] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#97] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#91] (118) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#98, isEmpty#99, count#100] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] (119) HashAggregate [codegen id : 132] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#98, isEmpty#99, count#100] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#92, isEmpty#93, count#94] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101, count(1)#102] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101 AS sales#56, count(1)#102 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#101 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95, count(1)#96] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95 AS sales#56, count(1)#96 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#95 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] (120) Filter [codegen id : 132] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (121) Project [codegen id : 132] -Output [6]: [catalog AS channel#104, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#103] +Output [6]: [catalog AS channel#98, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#97] (122) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#105, isEmpty#106, count#107] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#99, isEmpty#100, count#101] (123) HashAggregate [codegen id : 158] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#105, isEmpty#106, count#107] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#99, isEmpty#100, count#101] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108, count(1)#109] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108 AS sales#71, count(1)#109 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#108 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102, count(1)#103] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102 AS sales#71, count(1)#103 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#102 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] (124) Filter [codegen id : 158] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (125) Project [codegen id : 158] -Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#110] +Output [6]: [web AS channel#105, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#104] (126) Union -Arguments: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sales#115, number_sales#116] (127) HashAggregate [codegen id : 159] -Input [6]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sales#115, number_sales#116] -Keys [4]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114] -Functions [2]: [partial_sum(sales#115), partial_sum(number_sales#116)] -Aggregate Attributes [3]: [sum#117, isEmpty#118, sum#119] -Results [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#106, isEmpty#107, sum#108] +Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] (128) Exchange -Input [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] -Arguments: hashpartitioning(channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, 5), true, [id=#123] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#112] (129) HashAggregate [codegen id : 160] -Input [7]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114, sum#120, isEmpty#121, sum#122] -Keys [4]: [channel#111, i_brand_id#112, i_class_id#113, i_category_id#114] -Functions [2]: [sum(sales#115), sum(number_sales#116)] -Aggregate Attributes [2]: [sum(sales#115)#124, sum(number_sales#116)#125] -Results [5]: [channel#111, i_brand_id#112, i_class_id#113, sum(sales#115)#124 AS sum_sales#90, sum(number_sales#116)#125 AS number_sales#91] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#109, isEmpty#110, sum#111] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#113, sum(number_sales#40)#114] +Results [5]: [channel#44, i_brand_id#6, i_class_id#7, sum(sales#39)#113 AS sum_sales#84, sum(number_sales#40)#114 AS number_sales#85] (130) HashAggregate [codegen id : 160] -Input [5]: [channel#111, i_brand_id#112, i_class_id#113, sum_sales#90, number_sales#91] -Keys [3]: [channel#111, i_brand_id#112, i_class_id#113] -Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] -Aggregate Attributes [3]: [sum#126, isEmpty#127, sum#128] -Results [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] +Input [5]: [channel#44, i_brand_id#6, i_class_id#7, sum_sales#84, number_sales#85] +Keys [3]: [channel#44, i_brand_id#6, i_class_id#7] +Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] +Aggregate Attributes [3]: [sum#115, isEmpty#116, sum#117] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] (131) Exchange -Input [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] -Arguments: hashpartitioning(channel#111, i_brand_id#112, i_class_id#113, 5), true, [id=#132] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, 5), true, [id=#121] (132) HashAggregate [codegen id : 161] -Input [6]: [channel#111, i_brand_id#112, i_class_id#113, sum#129, isEmpty#130, sum#131] -Keys [3]: [channel#111, i_brand_id#112, i_class_id#113] -Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] -Aggregate Attributes [2]: [sum(sum_sales#90)#133, sum(number_sales#91)#134] -Results [6]: [channel#111, i_brand_id#112, i_class_id#113, null AS i_category_id#135, sum(sum_sales#90)#133 AS sum(sum_sales)#136, sum(number_sales#91)#134 AS sum(number_sales)#137] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, sum#118, isEmpty#119, sum#120] +Keys [3]: [channel#44, i_brand_id#6, i_class_id#7] +Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] +Aggregate Attributes [2]: [sum(sum_sales#84)#122, sum(number_sales#85)#123] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, null AS i_category_id#124, sum(sum_sales#84)#122 AS sum(sum_sales)#125, sum(number_sales#85)#123 AS sum(number_sales)#126] (133) Union -Arguments: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] (134) HashAggregate [codegen id : 162] -Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] -Keys [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (135) Exchange -Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] -Arguments: hashpartitioning(channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143, 5), true, [id=#144] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#127] (136) HashAggregate [codegen id : 163] -Input [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] -Keys [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#138, i_brand_id#139, i_class_id#140, i_category_id#141, sum_sales#142, number_sales#143] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (137) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#145, isEmpty#146, count#147] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#128, isEmpty#129, count#130] (138) HashAggregate [codegen id : 189] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#145, isEmpty#146, count#147] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#128, isEmpty#129, count#130] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#148, count(1)#149] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#148 AS sales#39, count(1)#149 AS number_sales#40, 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))#148 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))#150] +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))#131, count(1)#132] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#131 AS sales#39, count(1)#132 AS number_sales#40, 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))#131 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))#133] (139) Filter [codegen id : 189] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#150] -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))#150) 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))#150 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#133] +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))#133) 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))#133 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (140) Project [codegen id : 189] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#150] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#133] (141) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, count#153] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#134, isEmpty#135, count#136] (142) HashAggregate [codegen id : 215] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, count#153] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#134, isEmpty#135, count#136] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154, count(1)#155] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sales#56, count(1)#155 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137, count(1)#138] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137 AS sales#56, count(1)#138 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#137 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] (143) Filter [codegen id : 215] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (144) Project [codegen id : 215] -Output [6]: [catalog AS channel#157, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#156] +Output [6]: [catalog AS channel#140, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#139] (145) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#158, isEmpty#159, count#160] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#141, isEmpty#142, count#143] (146) HashAggregate [codegen id : 241] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#158, isEmpty#159, count#160] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#141, isEmpty#142, count#143] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161, count(1)#162] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sales#71, count(1)#162 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144, count(1)#145] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144 AS sales#71, count(1)#145 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#144 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] (147) Filter [codegen id : 241] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (148) Project [codegen id : 241] -Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#163] +Output [6]: [web AS channel#147, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#146] (149) Union -Arguments: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sales#168, number_sales#169] (150) HashAggregate [codegen id : 242] -Input [6]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sales#168, number_sales#169] -Keys [4]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167] -Functions [2]: [partial_sum(sales#168), partial_sum(number_sales#169)] -Aggregate Attributes [3]: [sum#170, isEmpty#171, sum#172] -Results [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#148, isEmpty#149, sum#150] +Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] (151) Exchange -Input [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] -Arguments: hashpartitioning(channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, 5), true, [id=#176] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#154] (152) HashAggregate [codegen id : 243] -Input [7]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167, sum#173, isEmpty#174, sum#175] -Keys [4]: [channel#164, i_brand_id#165, i_class_id#166, i_category_id#167] -Functions [2]: [sum(sales#168), sum(number_sales#169)] -Aggregate Attributes [2]: [sum(sales#168)#177, sum(number_sales#169)#178] -Results [4]: [channel#164, i_brand_id#165, sum(sales#168)#177 AS sum_sales#90, sum(number_sales#169)#178 AS number_sales#91] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#151, isEmpty#152, sum#153] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#155, sum(number_sales#40)#156] +Results [4]: [channel#44, i_brand_id#6, sum(sales#39)#155 AS sum_sales#84, sum(number_sales#40)#156 AS number_sales#85] (153) HashAggregate [codegen id : 243] -Input [4]: [channel#164, i_brand_id#165, sum_sales#90, number_sales#91] -Keys [2]: [channel#164, i_brand_id#165] -Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] -Aggregate Attributes [3]: [sum#179, isEmpty#180, sum#181] -Results [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] +Input [4]: [channel#44, i_brand_id#6, sum_sales#84, number_sales#85] +Keys [2]: [channel#44, i_brand_id#6] +Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] +Aggregate Attributes [3]: [sum#157, isEmpty#158, sum#159] +Results [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] (154) Exchange -Input [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] -Arguments: hashpartitioning(channel#164, i_brand_id#165, 5), true, [id=#185] +Input [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] +Arguments: hashpartitioning(channel#44, i_brand_id#6, 5), true, [id=#163] (155) HashAggregate [codegen id : 244] -Input [5]: [channel#164, i_brand_id#165, sum#182, isEmpty#183, sum#184] -Keys [2]: [channel#164, i_brand_id#165] -Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] -Aggregate Attributes [2]: [sum(sum_sales#90)#186, sum(number_sales#91)#187] -Results [6]: [channel#164, i_brand_id#165, null AS i_class_id#188, null AS i_category_id#189, sum(sum_sales#90)#186 AS sum(sum_sales)#190, sum(number_sales#91)#187 AS sum(number_sales)#191] +Input [5]: [channel#44, i_brand_id#6, sum#160, isEmpty#161, sum#162] +Keys [2]: [channel#44, i_brand_id#6] +Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] +Aggregate Attributes [2]: [sum(sum_sales#84)#164, sum(number_sales#85)#165] +Results [6]: [channel#44, i_brand_id#6, null AS i_class_id#166, null AS i_category_id#167, sum(sum_sales#84)#164 AS sum(sum_sales)#168, sum(number_sales#85)#165 AS sum(number_sales)#169] (156) Union -Arguments: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] (157) HashAggregate [codegen id : 245] -Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] -Keys [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (158) Exchange -Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] -Arguments: hashpartitioning(channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197, 5), true, [id=#198] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#170] (159) HashAggregate [codegen id : 246] -Input [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] -Keys [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#192, i_brand_id#193, i_class_id#194, i_category_id#195, sum_sales#196, number_sales#197] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (160) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#199, isEmpty#200, count#201] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#171, isEmpty#172, count#173] (161) HashAggregate [codegen id : 272] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#199, isEmpty#200, count#201] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#171, isEmpty#172, count#173] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#202, count(1)#203] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#202 AS sales#39, count(1)#203 AS number_sales#40, 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))#202 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))#204] +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))#174, count(1)#175] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#174 AS sales#39, count(1)#175 AS number_sales#40, 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))#174 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))#176] (162) Filter [codegen id : 272] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#204] -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))#204) 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))#204 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#176] +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))#176) 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))#176 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (163) Project [codegen id : 272] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#204] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#176] (164) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#205, isEmpty#206, count#207] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#177, isEmpty#178, count#179] (165) HashAggregate [codegen id : 298] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#205, isEmpty#206, count#207] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#177, isEmpty#178, count#179] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208, count(1)#209] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sales#56, count(1)#209 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180, count(1)#181] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180 AS sales#56, count(1)#181 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#180 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] (166) Filter [codegen id : 298] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (167) Project [codegen id : 298] -Output [6]: [catalog AS channel#211, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#210] +Output [6]: [catalog AS channel#183, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#182] (168) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#212, isEmpty#213, count#214] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#184, isEmpty#185, count#186] (169) HashAggregate [codegen id : 324] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#212, isEmpty#213, count#214] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#184, isEmpty#185, count#186] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215, count(1)#216] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sales#71, count(1)#216 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187, count(1)#188] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187 AS sales#71, count(1)#188 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#187 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] (170) Filter [codegen id : 324] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (171) Project [codegen id : 324] -Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#217] +Output [6]: [web AS channel#190, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#189] (172) Union -Arguments: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sales#222, number_sales#223] (173) HashAggregate [codegen id : 325] -Input [6]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sales#222, number_sales#223] -Keys [4]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221] -Functions [2]: [partial_sum(sales#222), partial_sum(number_sales#223)] -Aggregate Attributes [3]: [sum#224, isEmpty#225, sum#226] -Results [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#191, isEmpty#192, sum#193] +Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] (174) Exchange -Input [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] -Arguments: hashpartitioning(channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, 5), true, [id=#230] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#197] (175) HashAggregate [codegen id : 326] -Input [7]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221, sum#227, isEmpty#228, sum#229] -Keys [4]: [channel#218, i_brand_id#219, i_class_id#220, i_category_id#221] -Functions [2]: [sum(sales#222), sum(number_sales#223)] -Aggregate Attributes [2]: [sum(sales#222)#231, sum(number_sales#223)#232] -Results [3]: [channel#218, sum(sales#222)#231 AS sum_sales#90, sum(number_sales#223)#232 AS number_sales#91] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#194, isEmpty#195, sum#196] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#198, sum(number_sales#40)#199] +Results [3]: [channel#44, sum(sales#39)#198 AS sum_sales#84, sum(number_sales#40)#199 AS number_sales#85] (176) HashAggregate [codegen id : 326] -Input [3]: [channel#218, sum_sales#90, number_sales#91] -Keys [1]: [channel#218] -Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] -Aggregate Attributes [3]: [sum#233, isEmpty#234, sum#235] -Results [4]: [channel#218, sum#236, isEmpty#237, sum#238] +Input [3]: [channel#44, sum_sales#84, number_sales#85] +Keys [1]: [channel#44] +Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] +Aggregate Attributes [3]: [sum#200, isEmpty#201, sum#202] +Results [4]: [channel#44, sum#203, isEmpty#204, sum#205] (177) Exchange -Input [4]: [channel#218, sum#236, isEmpty#237, sum#238] -Arguments: hashpartitioning(channel#218, 5), true, [id=#239] +Input [4]: [channel#44, sum#203, isEmpty#204, sum#205] +Arguments: hashpartitioning(channel#44, 5), true, [id=#206] (178) HashAggregate [codegen id : 327] -Input [4]: [channel#218, sum#236, isEmpty#237, sum#238] -Keys [1]: [channel#218] -Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] -Aggregate Attributes [2]: [sum(sum_sales#90)#240, sum(number_sales#91)#241] -Results [6]: [channel#218, null AS i_brand_id#242, null AS i_class_id#243, null AS i_category_id#244, sum(sum_sales#90)#240 AS sum(sum_sales)#245, sum(number_sales#91)#241 AS sum(number_sales)#246] +Input [4]: [channel#44, sum#203, isEmpty#204, sum#205] +Keys [1]: [channel#44] +Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] +Aggregate Attributes [2]: [sum(sum_sales#84)#207, sum(number_sales#85)#208] +Results [6]: [channel#44, null AS i_brand_id#209, null AS i_class_id#210, null AS i_category_id#211, sum(sum_sales#84)#207 AS sum(sum_sales)#212, sum(number_sales#85)#208 AS sum(number_sales)#213] (179) Union -Arguments: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] (180) HashAggregate [codegen id : 328] -Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] -Keys [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (181) Exchange -Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] -Arguments: hashpartitioning(channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252, 5), true, [id=#253] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#214] (182) HashAggregate [codegen id : 329] -Input [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] -Keys [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#247, i_brand_id#248, i_class_id#249, i_category_id#250, sum_sales#251, number_sales#252] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (183) ReusedExchange [Reuses operator id: 74] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#254, isEmpty#255, count#256] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#215, isEmpty#216, count#217] (184) HashAggregate [codegen id : 355] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#254, isEmpty#255, count#256] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#215, isEmpty#216, count#217] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] 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))#257, count(1)#258] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#257 AS sales#39, count(1)#258 AS number_sales#40, 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))#257 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))#259] +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))#218, count(1)#219] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, 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))#218 AS sales#39, count(1)#219 AS number_sales#40, 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))#218 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))#220] (185) Filter [codegen id : 355] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#259] -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))#259) 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))#259 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#220] +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))#220) 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))#220 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (186) Project [codegen id : 355] Output [6]: [store AS channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#259] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40, 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))#220] (187) ReusedExchange [Reuses operator id: 90] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#260, isEmpty#261, count#262] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#221, isEmpty#222, count#223] (188) HashAggregate [codegen id : 381] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#260, isEmpty#261, count#262] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#221, isEmpty#222, count#223] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263, count(1)#264] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sales#56, count(1)#264 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224, count(1)#225] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224 AS sales#56, count(1)#225 AS number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#224 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] (189) Filter [codegen id : 381] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (190) Project [codegen id : 381] -Output [6]: [catalog AS channel#266, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#265] +Output [6]: [catalog AS channel#227, i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#56, number_sales#57, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#45 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#46 as decimal(12,2)))), DecimalType(18,2), true))#226] (191) ReusedExchange [Reuses operator id: 106] -Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#267, isEmpty#268, count#269] +Output [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#228, isEmpty#229, count#230] (192) HashAggregate [codegen id : 407] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#267, isEmpty#268, count#269] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum#228, isEmpty#229, count#230] Keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8] Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] -Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270, count(1)#271] -Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sales#71, count(1)#271 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231, count(1)#232] +Results [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231 AS sales#71, count(1)#232 AS number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#231 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] (193) Filter [codegen id : 407] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] -Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#42, [id=#43] as decimal(32,6)))) (194) Project [codegen id : 407] -Output [6]: [web AS channel#74, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] -Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#272] +Output [6]: [web AS channel#234, i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72] +Input [6]: [i_brand_id#6, i_class_id#7, i_category_id#8, sales#71, number_sales#72, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#233] (195) Union -Arguments: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sales#277, number_sales#278] (196) HashAggregate [codegen id : 408] -Input [6]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sales#277, number_sales#278] -Keys [4]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276] -Functions [2]: [partial_sum(sales#277), partial_sum(number_sales#278)] -Aggregate Attributes [3]: [sum#279, isEmpty#280, sum#281] -Results [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sales#39, number_sales#40] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [partial_sum(sales#39), partial_sum(number_sales#40)] +Aggregate Attributes [3]: [sum#235, isEmpty#236, sum#237] +Results [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] (197) Exchange -Input [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] -Arguments: hashpartitioning(channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, 5), true, [id=#285] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, 5), true, [id=#241] (198) HashAggregate [codegen id : 409] -Input [7]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276, sum#282, isEmpty#283, sum#284] -Keys [4]: [channel#273, i_brand_id#274, i_class_id#275, i_category_id#276] -Functions [2]: [sum(sales#277), sum(number_sales#278)] -Aggregate Attributes [2]: [sum(sales#277)#286, sum(number_sales#278)#287] -Results [2]: [sum(sales#277)#286 AS sum_sales#90, sum(number_sales#278)#287 AS number_sales#91] +Input [7]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum#238, isEmpty#239, sum#240] +Keys [4]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8] +Functions [2]: [sum(sales#39), sum(number_sales#40)] +Aggregate Attributes [2]: [sum(sales#39)#242, sum(number_sales#40)#243] +Results [2]: [sum(sales#39)#242 AS sum_sales#84, sum(number_sales#40)#243 AS number_sales#85] (199) HashAggregate [codegen id : 409] -Input [2]: [sum_sales#90, number_sales#91] +Input [2]: [sum_sales#84, number_sales#85] Keys: [] -Functions [2]: [partial_sum(sum_sales#90), partial_sum(number_sales#91)] -Aggregate Attributes [3]: [sum#288, isEmpty#289, sum#290] -Results [3]: [sum#291, isEmpty#292, sum#293] +Functions [2]: [partial_sum(sum_sales#84), partial_sum(number_sales#85)] +Aggregate Attributes [3]: [sum#244, isEmpty#245, sum#246] +Results [3]: [sum#247, isEmpty#248, sum#249] (200) Exchange -Input [3]: [sum#291, isEmpty#292, sum#293] -Arguments: SinglePartition, true, [id=#294] +Input [3]: [sum#247, isEmpty#248, sum#249] +Arguments: SinglePartition, true, [id=#250] (201) HashAggregate [codegen id : 410] -Input [3]: [sum#291, isEmpty#292, sum#293] +Input [3]: [sum#247, isEmpty#248, sum#249] Keys: [] -Functions [2]: [sum(sum_sales#90), sum(number_sales#91)] -Aggregate Attributes [2]: [sum(sum_sales#90)#295, sum(number_sales#91)#296] -Results [6]: [null AS channel#297, null AS i_brand_id#298, null AS i_class_id#299, null AS i_category_id#300, sum(sum_sales#90)#295 AS sum(sum_sales)#301, sum(number_sales#91)#296 AS sum(number_sales)#302] +Functions [2]: [sum(sum_sales#84), sum(number_sales#85)] +Aggregate Attributes [2]: [sum(sum_sales#84)#251, sum(number_sales#85)#252] +Results [6]: [null AS channel#253, null AS i_brand_id#254, null AS i_class_id#255, null AS i_category_id#256, sum(sum_sales#84)#251 AS sum(sum_sales)#257, sum(number_sales#85)#252 AS sum(number_sales)#258] (202) Union -Arguments: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] (203) HashAggregate [codegen id : 411] -Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] -Keys [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (204) Exchange -Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] -Arguments: hashpartitioning(channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308, 5), true, [id=#309] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Arguments: hashpartitioning(channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85, 5), true, [id=#259] (205) HashAggregate [codegen id : 412] -Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] -Keys [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Keys [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] Functions: [] Aggregate Attributes: [] -Results [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Results [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] (206) TakeOrderedAndProject -Input [6]: [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] -Arguments: 100, [channel#303 ASC NULLS FIRST, i_brand_id#304 ASC NULLS FIRST, i_class_id#305 ASC NULLS FIRST, i_category_id#306 ASC NULLS FIRST], [channel#303, i_brand_id#304, i_class_id#305, i_category_id#306, sum_sales#307, number_sales#308] +Input [6]: [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] +Arguments: 100, [channel#44 ASC NULLS FIRST, i_brand_id#6 ASC NULLS FIRST, i_class_id#7 ASC NULLS FIRST, i_category_id#8 ASC NULLS FIRST], [channel#44, i_brand_id#6, i_class_id#7, i_category_id#8, sum_sales#84, number_sales#85] ===== Subqueries ===== @@ -1256,7 +1247,7 @@ Input [2]: [d_date_sk#10, d_year#11] (214) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#310] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#260] (215) BroadcastHashJoin [codegen id : 2] Left keys [1]: [ss_sold_date_sk#1] @@ -1264,7 +1255,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (216) Project [codegen id : 2] -Output [2]: [ss_quantity#3 AS quantity#311, ss_list_price#4 AS list_price#312] +Output [2]: [ss_quantity#3 AS quantity#261, ss_list_price#4 AS list_price#262] Input [4]: [ss_sold_date_sk#1, ss_quantity#3, ss_list_price#4, d_date_sk#10] (217) Scan parquet default.catalog_sales @@ -1301,7 +1292,7 @@ Input [2]: [d_date_sk#10, d_year#11] (224) BroadcastExchange Input [1]: [d_date_sk#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#313] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#263] (225) BroadcastHashJoin [codegen id : 4] Left keys [1]: [cs_sold_date_sk#16] @@ -1309,7 +1300,7 @@ Right keys [1]: [d_date_sk#10] Join condition: None (226) Project [codegen id : 4] -Output [2]: [cs_quantity#45 AS quantity#314, cs_list_price#46 AS list_price#315] +Output [2]: [cs_quantity#45 AS quantity#264, cs_list_price#46 AS list_price#265] Input [4]: [cs_sold_date_sk#16, cs_quantity#45, cs_list_price#46, d_date_sk#10] (227) Scan parquet default.web_sales @@ -1335,29 +1326,28 @@ Right keys [1]: [d_date_sk#10] Join condition: None (232) Project [codegen id : 6] -Output [2]: [ws_quantity#60 AS quantity#316, ws_list_price#61 AS list_price#317] +Output [2]: [ws_quantity#60 AS quantity#266, ws_list_price#61 AS list_price#267] Input [4]: [ws_sold_date_sk#20, ws_quantity#60, ws_list_price#61, d_date_sk#10] (233) Union -Arguments: [quantity#318, list_price#319] (234) HashAggregate [codegen id : 7] -Input [2]: [quantity#318, list_price#319] +Input [2]: [quantity#261, list_price#262] Keys: [] -Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [2]: [sum#320, count#321] -Results [2]: [sum#322, count#323] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#268, count#269] +Results [2]: [sum#270, count#271] (235) Exchange -Input [2]: [sum#322, count#323] -Arguments: SinglePartition, true, [id=#324] +Input [2]: [sum#270, count#271] +Arguments: SinglePartition, true, [id=#272] (236) HashAggregate [codegen id : 8] -Input [2]: [sum#322, count#323] +Input [2]: [sum#270, count#271] Keys: [] -Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))] -Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))#325] -Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#318 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#319 as decimal(12,2)))), DecimalType(18,2), true))#325 AS average_sales#326] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#273] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#273 AS average_sales#274] Subquery:2 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#42, [id=#43] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt index a71be4f6b1253..e96f1d6fed14f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (411) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (329) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (328) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (246) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (245) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (163) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter @@ -30,7 +30,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (162) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + Union WholeStageCodegen (80) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] InputAdapter @@ -38,7 +38,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (79) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (26) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -50,7 +50,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (7) HashAggregate [quantity,list_price] [sum,count,sum,count] InputAdapter - Union [quantity,list_price] + Union WholeStageCodegen (2) Project [ss_quantity,ss_list_price] BroadcastHashJoin [ss_sold_date_sk,d_date_sk] @@ -261,7 +261,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (159) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (106) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -295,7 +295,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (242) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (189) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -329,7 +329,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (325) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (272) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] @@ -363,7 +363,7 @@ TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,num WholeStageCodegen (408) HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] InputAdapter - Union [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + Union WholeStageCodegen (355) Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] 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 dc352b2382fc4..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 @@ -870,9 +870,8 @@ Aggregate Attributes [7]: [avg(agg1#36)#263, avg(agg2#37)#264, avg(agg3#38)#265, Results [11]: [null AS i_item_id#270, null AS ca_country#271, null AS ca_state#272, null AS county#273, avg(agg1#36)#263 AS agg1#274, avg(agg2#37)#264 AS agg2#275, avg(agg3#38)#265 AS agg3#276, avg(agg4#39)#266 AS agg4#277, avg(agg5#40)#267 AS agg5#278, avg(agg6#41)#268 AS agg6#279, avg(agg7#42)#269 AS agg7#280] (159) Union -Arguments: [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] (160) TakeOrderedAndProject -Input [11]: [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] -Arguments: 100, [ca_country#282 ASC NULLS FIRST, ca_state#283 ASC NULLS FIRST, ca_county#284 ASC NULLS FIRST, i_item_id#281 ASC NULLS FIRST], [i_item_id#281, ca_country#282, ca_state#283, ca_county#284, agg1#285, agg2#286, agg3#287, agg4#288, agg5#289, agg6#290, agg7#291] +Input [11]: [i_item_id#19, ca_country#30, ca_state#29, ca_county#28, agg1#79, agg2#80, agg3#81, agg4#82, agg5#83, agg6#84, agg7#85] +Arguments: 100, [ca_country#30 ASC NULLS FIRST, ca_state#29 ASC NULLS FIRST, ca_county#28 ASC NULLS FIRST, i_item_id#19 ASC NULLS FIRST], [i_item_id#19, ca_country#30, ca_state#29, ca_county#28, agg1#79, agg2#80, agg3#81, agg4#82, agg5#83, agg6#84, agg7#85] 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 8990f555b7622..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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] - Union [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + Union WholeStageCodegen (14) HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt index 97c1bbb37fc3b..b9a00214c3a1b 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt @@ -849,9 +849,8 @@ Aggregate Attributes [7]: [avg(agg1#34)#256, avg(agg2#35)#257, avg(agg3#36)#258, Results [11]: [null AS i_item_id#263, null AS ca_country#264, null AS ca_state#265, null AS county#266, avg(agg1#34)#256 AS agg1#267, avg(agg2#35)#257 AS agg2#268, avg(agg3#36)#258 AS agg3#269, avg(agg4#37)#259 AS agg4#270, avg(agg5#38)#260 AS agg5#271, avg(agg6#39)#261 AS agg6#272, avg(agg7#40)#262 AS agg7#273] (156) Union -Arguments: [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] (157) TakeOrderedAndProject -Input [11]: [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] -Arguments: 100, [ca_country#275 ASC NULLS FIRST, ca_state#276 ASC NULLS FIRST, ca_county#277 ASC NULLS FIRST, i_item_id#274 ASC NULLS FIRST], [i_item_id#274, ca_country#275, ca_state#276, ca_county#277, agg1#278, agg2#279, agg3#280, agg4#281, agg5#282, agg6#283, agg7#284] +Input [11]: [i_item_id#32, ca_country#26, ca_state#25, ca_county#24, agg1#77, agg2#78, agg3#79, agg4#80, agg5#81, agg6#82, agg7#83] +Arguments: 100, [ca_country#26 ASC NULLS FIRST, ca_state#25 ASC NULLS FIRST, ca_county#24 ASC NULLS FIRST, i_item_id#32 ASC NULLS FIRST], [i_item_id#32, ca_country#26, ca_state#25, ca_county#24, agg1#77, agg2#78, agg3#79, agg4#80, agg5#81, agg6#82, agg7#83] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt index e1adf35adee9e..49d50714a0940 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] - Union [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + Union WholeStageCodegen (8) HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] InputAdapter 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 508eea8b8a80c..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 @@ -309,9 +309,8 @@ Aggregate Attributes [1]: [avg(qoh#23)#74] Results [5]: [null AS i_product_name#75, null AS i_brand#76, null AS i_class#77, null AS i_category#78, avg(qoh#23)#74 AS qoh#79] (51) Union -Arguments: [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] (52) TakeOrderedAndProject -Input [5]: [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] -Arguments: 100, [qoh#84 ASC NULLS FIRST, i_product_name#80 ASC NULLS FIRST, i_brand#81 ASC NULLS FIRST, i_class#82 ASC NULLS FIRST, i_category#83 ASC NULLS FIRST], [i_product_name#80, i_brand#81, i_class#82, i_category#83, qoh#84] +Input [5]: [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#29] +Arguments: 100, [qoh#29 ASC NULLS FIRST, i_product_name#15 ASC NULLS FIRST, i_brand#12 ASC NULLS FIRST, i_class#13 ASC NULLS FIRST, i_category#14 ASC NULLS FIRST], [i_product_name#15, i_brand#12, i_class#13, i_category#14, qoh#29] 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 7bdedef069bcb..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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] - Union [i_product_name,i_brand,i_class,i_category,qoh] + Union WholeStageCodegen (8) HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt index acae5d4362e96..2a1ca82e1f263 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt @@ -294,9 +294,8 @@ Aggregate Attributes [1]: [avg(qoh#22)#73] Results [5]: [null AS i_product_name#74, null AS i_brand#75, null AS i_class#76, null AS i_category#77, avg(qoh#22)#73 AS qoh#78] (48) Union -Arguments: [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] (49) TakeOrderedAndProject -Input [5]: [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] -Arguments: 100, [qoh#83 ASC NULLS FIRST, i_product_name#79 ASC NULLS FIRST, i_brand#80 ASC NULLS FIRST, i_class#81 ASC NULLS FIRST, i_category#82 ASC NULLS FIRST], [i_product_name#79, i_brand#80, i_class#81, i_category#82, qoh#83] +Input [5]: [i_product_name#12, i_brand#9, i_class#10, i_category#11, qoh#28] +Arguments: 100, [qoh#28 ASC NULLS FIRST, i_product_name#12 ASC NULLS FIRST, i_brand#9 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_category#11 ASC NULLS FIRST], [i_product_name#12, i_brand#9, i_class#10, i_category#11, qoh#28] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt index 4742a7562b08b..616bfc89c0023 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] - Union [i_product_name,i_brand,i_class,i_category,qoh] + Union WholeStageCodegen (5) HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] 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 d27de4225c845..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 @@ -421,9 +421,8 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union -Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] -Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] 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 70ffd62771d8e..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 @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt index bb164f7d94b7d..75e07ce8cd680 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt @@ -421,9 +421,8 @@ Aggregate Attributes [4]: [avg(cast(agg1#23 as bigint))#99, avg(UnscaledValue(ag Results [7]: [null AS i_item_id#103, null AS s_state#104, 1 AS g_state#105, avg(cast(agg1#23 as bigint))#99 AS agg1#106, cast((avg(UnscaledValue(agg2#24))#100 / 100.0) as decimal(11,6)) AS agg2#107, cast((avg(UnscaledValue(agg3#25))#101 / 100.0) as decimal(11,6)) AS agg3#108, cast((avg(UnscaledValue(agg4#26))#102 / 100.0) as decimal(11,6)) AS agg4#109] (76) Union -Arguments: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] (77) TakeOrderedAndProject -Input [7]: [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] -Arguments: 100, [i_item_id#110 ASC NULLS FIRST, s_state#111 ASC NULLS FIRST], [i_item_id#110, s_state#111, g_state#112, agg1#113, agg2#114, agg3#115, agg4#116] +Input [7]: [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#21 ASC NULLS FIRST, s_state#18 ASC NULLS FIRST], [i_item_id#21, s_state#18, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt index fac01f15c9f13..995ed4b432be6 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt @@ -1,5 +1,5 @@ TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] - Union [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union WholeStageCodegen (6) HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(cast(agg1 as bigint)),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt index edf2ea6b68e99..b08d2174e5974 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt @@ -1,60 +1,61 @@ == Physical Plan == -TakeOrderedAndProject (56) -+- * HashAggregate (55) - +- Exchange (54) - +- * HashAggregate (53) - +- * Project (52) - +- BroadcastNestedLoopJoin LeftSemi BuildRight (51) - :- * Project (36) - : +- * SortMergeJoin Inner (35) - : :- * Sort (29) - : : +- Exchange (28) - : : +- * Project (27) - : : +- * SortMergeJoin Inner (26) - : : :- * Sort (20) - : : : +- Exchange (19) - : : : +- 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 (25) - : : +- Exchange (24) - : : +- * Filter (23) - : : +- * ColumnarToRow (22) - : : +- Scan parquet default.customer_address (21) - : +- * Sort (34) - : +- Exchange (33) - : +- * Filter (32) - : +- * ColumnarToRow (31) - : +- Scan parquet default.customer_demographics (30) - +- BroadcastExchange (50) - +- Union (49) - :- * Project (42) - : +- * BroadcastHashJoin Inner BuildRight (41) - : :- * Filter (39) - : : +- * ColumnarToRow (38) - : : +- Scan parquet default.web_sales (37) - : +- ReusedExchange (40) - +- * Project (48) - +- * BroadcastHashJoin Inner BuildRight (47) - :- * Filter (45) - : +- * ColumnarToRow (44) - : +- Scan parquet default.catalog_sales (43) - +- ReusedExchange (46) +TakeOrderedAndProject (57) ++- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * Project (53) + +- * SortMergeJoin Inner (52) + :- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * SortMergeJoin Inner (43) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Project (35) + : : +- SortMergeJoin LeftSemi (34) + : : :- 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 (33) + : : +- Exchange (32) + : : +- Union (31) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (21) + : : : : +- * ColumnarToRow (20) + : : : : +- Scan parquet default.web_sales (19) + : : : +- ReusedExchange (22) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.catalog_sales (25) + : : +- ReusedExchange (28) + : +- * Sort (42) + : +- Exchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer_address (38) + +- * Sort (51) + +- Exchange (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.customer_demographics (47) (1) Scan parquet default.customer @@ -137,168 +138,174 @@ Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(19) Exchange -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: hashpartitioning(c_current_addr_sk#3, 5), true, [id=#12] - -(20) Sort [codegen id : 6] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -Arguments: [c_current_addr_sk#3 ASC NULLS FIRST], false, 0 - -(21) Scan parquet default.customer_address -Output [2]: [ca_address_sk#13, ca_state#14] +(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}/customer_address] -PushedFilters: [IsNotNull(ca_address_sk)] -ReadSchema: struct - -(22) ColumnarToRow [codegen id : 7] -Input [2]: [ca_address_sk#13, ca_state#14] +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(23) Filter [codegen id : 7] -Input [2]: [ca_address_sk#13, ca_state#14] -Condition : isnotnull(ca_address_sk#13) +(20) ColumnarToRow [codegen id : 7] +Input [2]: [ws_sold_date_sk#12, ws_bill_customer_sk#13] -(24) Exchange -Input [2]: [ca_address_sk#13, ca_state#14] -Arguments: hashpartitioning(ca_address_sk#13, 5), true, [id=#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) -(25) Sort [codegen id : 8] -Input [2]: [ca_address_sk#13, ca_state#14] -Arguments: [ca_address_sk#13 ASC NULLS FIRST], false, 0 +(22) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(26) SortMergeJoin [codegen id : 9] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#13] +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ws_sold_date_sk#12] +Right keys [1]: [d_date_sk#7] Join condition: None -(27) Project [codegen id : 9] -Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] -Input [5]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#13, ca_state#14] +(24) Project [codegen id : 7] +Output [1]: [ws_bill_customer_sk#13 AS customsk#14] +Input [3]: [ws_sold_date_sk#12, ws_bill_customer_sk#13, d_date_sk#7] -(28) Exchange -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] -Arguments: hashpartitioning(c_current_cdemo_sk#2, 5), true, [id=#16] - -(29) Sort [codegen id : 10] -Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14] -Arguments: [c_current_cdemo_sk#2 ASC NULLS FIRST], false, 0 - -(30) Scan parquet default.customer_demographics -Output [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(25) 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}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct - -(31) ColumnarToRow [codegen id : 11] -Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(32) Filter [codegen id : 11] -Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Condition : isnotnull(cd_demo_sk#17) +(26) ColumnarToRow [codegen id : 9] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] -(33) Exchange -Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Arguments: hashpartitioning(cd_demo_sk#17, 5), true, [id=#23] +(27) Filter [codegen id : 9] +Input [2]: [cs_sold_date_sk#15, cs_ship_customer_sk#16] +Condition : isnotnull(cs_sold_date_sk#15) -(34) Sort [codegen id : 12] -Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Arguments: [cd_demo_sk#17 ASC NULLS FIRST], false, 0 +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#7] -(35) SortMergeJoin [codegen id : 13] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#17] +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#15] +Right keys [1]: [d_date_sk#7] Join condition: None -(36) Project [codegen id : 13] -Output [7]: [c_customer_sk#1, ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Input [9]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#14, cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] - -(37) Scan parquet default.web_sales -Output [1]: [ws_sold_date_sk#24] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +(30) Project [codegen id : 9] +Output [1]: [cs_ship_customer_sk#16 AS customsk#17] +Input [3]: [cs_sold_date_sk#15, cs_ship_customer_sk#16, d_date_sk#7] -(38) ColumnarToRow [codegen id : 15] -Input [1]: [ws_sold_date_sk#24] +(31) Union -(39) Filter [codegen id : 15] -Input [1]: [ws_sold_date_sk#24] -Condition : isnotnull(ws_sold_date_sk#24) +(32) Exchange +Input [1]: [customsk#14] +Arguments: hashpartitioning(customsk#14, 5), true, [id=#18] -(40) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(33) Sort [codegen id : 10] +Input [1]: [customsk#14] +Arguments: [customsk#14 ASC NULLS FIRST], false, 0 -(41) BroadcastHashJoin [codegen id : 15] -Left keys [1]: [ws_sold_date_sk#24] -Right keys [1]: [d_date_sk#7] +(34) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customsk#14] Join condition: None -(42) Project [codegen id : 15] -Output: [] -Input [2]: [ws_sold_date_sk#24, d_date_sk#7] +(35) Project [codegen id : 11] +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) Exchange +Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_current_addr_sk#3, 5), true, [id=#19] + +(37) Sort [codegen id : 12] +Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_current_addr_sk#3 ASC NULLS FIRST], false, 0 -(43) Scan parquet default.catalog_sales -Output [1]: [cs_sold_date_sk#25] +(38) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct -(44) ColumnarToRow [codegen id : 17] -Input [1]: [cs_sold_date_sk#25] +(39) ColumnarToRow [codegen id : 13] +Input [2]: [ca_address_sk#20, ca_state#21] -(45) Filter [codegen id : 17] -Input [1]: [cs_sold_date_sk#25] -Condition : isnotnull(cs_sold_date_sk#25) +(40) Filter [codegen id : 13] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : isnotnull(ca_address_sk#20) -(46) ReusedExchange [Reuses operator id: 13] -Output [1]: [d_date_sk#7] +(41) Exchange +Input [2]: [ca_address_sk#20, ca_state#21] +Arguments: hashpartitioning(ca_address_sk#20, 5), true, [id=#22] -(47) BroadcastHashJoin [codegen id : 17] -Left keys [1]: [cs_sold_date_sk#25] -Right keys [1]: [d_date_sk#7] +(42) Sort [codegen id : 14] +Input [2]: [ca_address_sk#20, ca_state#21] +Arguments: [ca_address_sk#20 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 15] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#20] Join condition: None -(48) Project [codegen id : 17] -Output: [] -Input [2]: [cs_sold_date_sk#25, d_date_sk#7] +(44) Project [codegen id : 15] +Output [2]: [c_current_cdemo_sk#2, ca_state#21] +Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20, ca_state#21] -(49) Union +(45) Exchange +Input [2]: [c_current_cdemo_sk#2, ca_state#21] +Arguments: hashpartitioning(c_current_cdemo_sk#2, 5), true, [id=#23] -(50) BroadcastExchange -Input: [] -Arguments: IdentityBroadcastMode, [id=#26] +(46) Sort [codegen id : 16] +Input [2]: [c_current_cdemo_sk#2, ca_state#21] +Arguments: [c_current_cdemo_sk#2 ASC NULLS FIRST], false, 0 -(51) BroadcastNestedLoopJoin -Join condition: (customsk#27 = c_customer_sk#1) +(47) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct -(52) Project [codegen id : 18] -Output [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Input [7]: [c_customer_sk#1, ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] +(48) ColumnarToRow [codegen id : 17] +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] -(53) HashAggregate [codegen id : 18] -Input [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Keys [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#20 as bigint)), partial_max(cd_dep_count#20), partial_sum(cast(cd_dep_count#20 as bigint)), partial_avg(cast(cd_dep_employed_count#21 as bigint)), partial_max(cd_dep_employed_count#21), partial_sum(cast(cd_dep_employed_count#21 as bigint)), partial_avg(cast(cd_dep_college_count#22 as bigint)), partial_max(cd_dep_college_count#22), partial_sum(cast(cd_dep_college_count#22 as bigint))] -Aggregate Attributes [13]: [count#28, sum#29, count#30, max#31, sum#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40] -Results [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +(49) Filter [codegen id : 17] +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Condition : isnotnull(cd_demo_sk#24) -(54) Exchange -Input [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] -Arguments: hashpartitioning(ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, 5), true, [id=#54] +(50) Exchange +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Arguments: hashpartitioning(cd_demo_sk#24, 5), true, [id=#30] -(55) HashAggregate [codegen id : 19] -Input [19]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] -Keys [6]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cd_dep_employed_count#21, cd_dep_college_count#22] -Functions [10]: [count(1), avg(cast(cd_dep_count#20 as bigint)), max(cd_dep_count#20), sum(cast(cd_dep_count#20 as bigint)), avg(cast(cd_dep_employed_count#21 as bigint)), max(cd_dep_employed_count#21), sum(cast(cd_dep_employed_count#21 as bigint)), avg(cast(cd_dep_college_count#22 as bigint)), max(cd_dep_college_count#22), sum(cast(cd_dep_college_count#22 as bigint))] -Aggregate Attributes [10]: [count(1)#55, avg(cast(cd_dep_count#20 as bigint))#56, max(cd_dep_count#20)#57, sum(cast(cd_dep_count#20 as bigint))#58, avg(cast(cd_dep_employed_count#21 as bigint))#59, max(cd_dep_employed_count#21)#60, sum(cast(cd_dep_employed_count#21 as bigint))#61, avg(cast(cd_dep_college_count#22 as bigint))#62, max(cd_dep_college_count#22)#63, sum(cast(cd_dep_college_count#22 as bigint))#64] -Results [18]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, count(1)#55 AS cnt1#65, avg(cast(cd_dep_count#20 as bigint))#56 AS avg(cd_dep_count)#66, max(cd_dep_count#20)#57 AS max(cd_dep_count)#67, sum(cast(cd_dep_count#20 as bigint))#58 AS sum(cd_dep_count)#68, cd_dep_employed_count#21, count(1)#55 AS cnt2#69, avg(cast(cd_dep_employed_count#21 as bigint))#59 AS avg(cd_dep_employed_count)#70, max(cd_dep_employed_count#21)#60 AS max(cd_dep_employed_count)#71, sum(cast(cd_dep_employed_count#21 as bigint))#61 AS sum(cd_dep_employed_count)#72, cd_dep_college_count#22, count(1)#55 AS cnt3#73, avg(cast(cd_dep_college_count#22 as bigint))#62 AS avg(cd_dep_college_count)#74, max(cd_dep_college_count#22)#63 AS max(cd_dep_college_count)#75, sum(cast(cd_dep_college_count#22 as bigint))#64 AS sum(cd_dep_college_count)#76] +(51) Sort [codegen id : 18] +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Arguments: [cd_demo_sk#24 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 19] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#24] +Join condition: None -(56) TakeOrderedAndProject -Input [18]: [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#21, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#22, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] -Arguments: 100, [ca_state#14 ASC NULLS FIRST, cd_gender#18 ASC NULLS FIRST, cd_marital_status#19 ASC NULLS FIRST, cd_dep_count#20 ASC NULLS FIRST, cd_dep_employed_count#21 ASC NULLS FIRST, cd_dep_college_count#22 ASC NULLS FIRST], [ca_state#14, cd_gender#18, cd_marital_status#19, cd_dep_count#20, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#21, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#22, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] +(53) Project [codegen id : 19] +Output [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Input [8]: [c_current_cdemo_sk#2, ca_state#21, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] + +(54) HashAggregate [codegen id : 19] +Input [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Keys [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#27 as bigint)), partial_max(cd_dep_count#27), partial_sum(cast(cd_dep_count#27 as bigint)), partial_avg(cast(cd_dep_employed_count#28 as bigint)), partial_max(cd_dep_employed_count#28), partial_sum(cast(cd_dep_employed_count#28 as bigint)), partial_avg(cast(cd_dep_college_count#29 as bigint)), partial_max(cd_dep_college_count#29), partial_sum(cast(cd_dep_college_count#29 as bigint))] +Aggregate Attributes [13]: [count#31, sum#32, count#33, max#34, sum#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43] +Results [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] + +(55) Exchange +Input [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] +Arguments: hashpartitioning(ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, 5), true, [id=#57] + +(56) HashAggregate [codegen id : 20] +Input [19]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] +Keys [6]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Functions [10]: [count(1), avg(cast(cd_dep_count#27 as bigint)), max(cd_dep_count#27), sum(cast(cd_dep_count#27 as bigint)), avg(cast(cd_dep_employed_count#28 as bigint)), max(cd_dep_employed_count#28), sum(cast(cd_dep_employed_count#28 as bigint)), avg(cast(cd_dep_college_count#29 as bigint)), max(cd_dep_college_count#29), sum(cast(cd_dep_college_count#29 as bigint))] +Aggregate Attributes [10]: [count(1)#58, avg(cast(cd_dep_count#27 as bigint))#59, max(cd_dep_count#27)#60, sum(cast(cd_dep_count#27 as bigint))#61, avg(cast(cd_dep_employed_count#28 as bigint))#62, max(cd_dep_employed_count#28)#63, sum(cast(cd_dep_employed_count#28 as bigint))#64, avg(cast(cd_dep_college_count#29 as bigint))#65, max(cd_dep_college_count#29)#66, sum(cast(cd_dep_college_count#29 as bigint))#67] +Results [18]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, count(1)#58 AS cnt1#68, avg(cast(cd_dep_count#27 as bigint))#59 AS avg(cd_dep_count)#69, max(cd_dep_count#27)#60 AS max(cd_dep_count)#70, sum(cast(cd_dep_count#27 as bigint))#61 AS sum(cd_dep_count)#71, cd_dep_employed_count#28, count(1)#58 AS cnt2#72, avg(cast(cd_dep_employed_count#28 as bigint))#62 AS avg(cd_dep_employed_count)#73, max(cd_dep_employed_count#28)#63 AS max(cd_dep_employed_count)#74, sum(cast(cd_dep_employed_count#28 as bigint))#64 AS sum(cd_dep_employed_count)#75, cd_dep_college_count#29, count(1)#58 AS cnt3#76, avg(cast(cd_dep_college_count#29 as bigint))#65 AS avg(cd_dep_college_count)#77, max(cd_dep_college_count#29)#66 AS max(cd_dep_college_count)#78, sum(cast(cd_dep_college_count#29 as bigint))#67 AS sum(cd_dep_college_count)#79] + +(57) TakeOrderedAndProject +Input [18]: [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] +Arguments: 100, [ca_state#21 ASC NULLS FIRST, cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [ca_state#21, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt index 62f940df1331b..b38eeeb527eb4 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt @@ -1,29 +1,29 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] - WholeStageCodegen (19) + WholeStageCodegen (20) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cast(cd_dep_count as bigint)),max(cd_dep_count),sum(cast(cd_dep_count as bigint)),avg(cast(cd_dep_employed_count as bigint)),max(cd_dep_employed_count),sum(cast(cd_dep_employed_count as bigint)),avg(cast(cd_dep_college_count as bigint)),max(cd_dep_college_count),sum(cast(cd_dep_college_count as bigint)),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] InputAdapter Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (18) + WholeStageCodegen (19) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - InputAdapter - BroadcastNestedLoopJoin [customsk,c_customer_sk] - WholeStageCodegen (13) - Project [c_customer_sk,ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] - InputAdapter - WholeStageCodegen (10) - Sort [c_current_cdemo_sk] - InputAdapter - Exchange [c_current_cdemo_sk] #2 - WholeStageCodegen (9) - Project [c_customer_sk,c_current_cdemo_sk,ca_state] - SortMergeJoin [c_current_addr_sk,ca_address_sk] - InputAdapter - WholeStageCodegen (6) - Sort [c_current_addr_sk] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (16) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (15) + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (12) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (11) + Project [c_current_cdemo_sk,c_current_addr_sk] InputAdapter - Exchange [c_current_addr_sk] #3 + SortMergeJoin [c_customer_sk,customsk] SortMergeJoin [c_customer_sk,ss_customer_sk] WholeStageCodegen (2) Sort [c_customer_sk] @@ -53,43 +53,46 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_ ColumnarToRow InputAdapter Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] - InputAdapter - WholeStageCodegen (8) - Sort [ca_address_sk] - InputAdapter - Exchange [ca_address_sk] #7 - WholeStageCodegen (7) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] - InputAdapter - WholeStageCodegen (12) - Sort [cd_demo_sk] - InputAdapter - Exchange [cd_demo_sk] #8 - WholeStageCodegen (11) - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastExchange #9 - Union - WholeStageCodegen (15) - Project - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow + WholeStageCodegen (10) + Sort [customsk] + InputAdapter + Exchange [customsk] #7 + Union + WholeStageCodegen (7) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (9) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #6 InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 - WholeStageCodegen (17) - Project - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] + WholeStageCodegen (14) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #8 + WholeStageCodegen (13) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (18) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #9 + WholeStageCodegen (17) + Filter [cd_demo_sk] ColumnarToRow InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #6 + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt index 3cd406676347e..847b5cf66c3e0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt @@ -4,11 +4,11 @@ TakeOrderedAndProject (47) +- Exchange (45) +- * HashAggregate (44) +- * Project (43) - +- BroadcastNestedLoopJoin LeftSemi BuildRight (42) - :- * Project (27) - : +- * BroadcastHashJoin Inner BuildRight (26) - : :- * Project (21) - : : +- * BroadcastHashJoin Inner BuildRight (20) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Project (31) + : : +- * BroadcastHashJoin LeftSemi BuildRight (30) : : :- * BroadcastHashJoin LeftSemi BuildRight (15) : : : :- * Filter (3) : : : : +- * ColumnarToRow (2) @@ -24,28 +24,28 @@ TakeOrderedAndProject (47) : : : +- * Filter (9) : : : +- * ColumnarToRow (8) : : : +- Scan parquet default.date_dim (7) - : : +- BroadcastExchange (19) - : : +- * Filter (18) - : : +- * ColumnarToRow (17) - : : +- Scan parquet default.customer_address (16) - : +- BroadcastExchange (25) - : +- * Filter (24) - : +- * ColumnarToRow (23) - : +- Scan parquet default.customer_demographics (22) + : : +- BroadcastExchange (29) + : : +- Union (28) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.web_sales (16) + : : : +- ReusedExchange (19) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Filter (24) + : : : +- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (25) + : +- BroadcastExchange (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.customer_address (32) +- BroadcastExchange (41) - +- Union (40) - :- * Project (33) - : +- * BroadcastHashJoin Inner BuildRight (32) - : :- * Filter (30) - : : +- * ColumnarToRow (29) - : : +- Scan parquet default.web_sales (28) - : +- ReusedExchange (31) - +- * Project (39) - +- * BroadcastHashJoin Inner BuildRight (38) - :- * Filter (36) - : +- * ColumnarToRow (35) - : +- Scan parquet default.catalog_sales (34) - +- ReusedExchange (37) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.customer_demographics (38) (1) Scan parquet default.customer @@ -55,10 +55,10 @@ 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 : 5] +(2) ColumnarToRow [codegen id : 9] Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] -(3) Filter [codegen id : 5] +(3) Filter [codegen id : 9] 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)) @@ -111,149 +111,151 @@ Input [3]: [ss_sold_date_sk#4, ss_customer_sk#5, d_date_sk#6] Input [1]: [ss_customer_sk#5] Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] -(15) BroadcastHashJoin [codegen id : 5] +(15) BroadcastHashJoin [codegen id : 9] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#5] Join condition: None -(16) Scan parquet default.customer_address -Output [2]: [ca_address_sk#11, ca_state#12] +(16) Scan parquet default.web_sales +Output [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] 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}/web_sales] +PushedFilters: [IsNotNull(ws_sold_date_sk)] +ReadSchema: struct -(17) ColumnarToRow [codegen id : 3] -Input [2]: [ca_address_sk#11, ca_state#12] +(17) ColumnarToRow [codegen id : 4] +Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] -(18) Filter [codegen id : 3] -Input [2]: [ca_address_sk#11, ca_state#12] -Condition : isnotnull(ca_address_sk#11) +(18) Filter [codegen id : 4] +Input [2]: [ws_sold_date_sk#11, ws_bill_customer_sk#12] +Condition : isnotnull(ws_sold_date_sk#11) -(19) BroadcastExchange -Input [2]: [ca_address_sk#11, ca_state#12] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] +(19) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(20) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_addr_sk#3] -Right keys [1]: [ca_address_sk#11] +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#11] +Right keys [1]: [d_date_sk#6] Join condition: None -(21) Project [codegen id : 5] -Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#12] -Input [5]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#11, ca_state#12] +(21) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#12 AS customsk#13] +Input [3]: [ws_sold_date_sk#11, ws_bill_customer_sk#12, d_date_sk#6] -(22) Scan parquet default.customer_demographics -Output [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +(22) Scan parquet default.catalog_sales +Output [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] Batched: true -Location [not included in comparison]/{warehouse_dir}/customer_demographics] -PushedFilters: [IsNotNull(cd_demo_sk)] -ReadSchema: struct +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_sold_date_sk)] +ReadSchema: struct -(23) ColumnarToRow [codegen id : 4] -Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] -(24) Filter [codegen id : 4] -Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Condition : isnotnull(cd_demo_sk#14) +(24) Filter [codegen id : 6] +Input [2]: [cs_sold_date_sk#14, cs_ship_customer_sk#15] +Condition : isnotnull(cs_sold_date_sk#14) -(25) BroadcastExchange -Input [6]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +(25) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#6] -(26) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [c_current_cdemo_sk#2] -Right keys [1]: [cd_demo_sk#14] +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#14] +Right keys [1]: [d_date_sk#6] Join condition: None -(27) Project [codegen id : 5] -Output [7]: [c_customer_sk#1, ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Input [9]: [c_customer_sk#1, c_current_cdemo_sk#2, ca_state#12, cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +(27) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#15 AS customsk#16] +Input [3]: [cs_sold_date_sk#14, cs_ship_customer_sk#15, d_date_sk#6] -(28) Scan parquet default.web_sales -Output [1]: [ws_sold_date_sk#21] -Batched: true -Location [not included in comparison]/{warehouse_dir}/web_sales] -PushedFilters: [IsNotNull(ws_sold_date_sk)] -ReadSchema: struct +(28) Union -(29) ColumnarToRow [codegen id : 7] -Input [1]: [ws_sold_date_sk#21] +(29) BroadcastExchange +Input [1]: [customsk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] -(30) Filter [codegen id : 7] -Input [1]: [ws_sold_date_sk#21] -Condition : isnotnull(ws_sold_date_sk#21) - -(31) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] - -(32) BroadcastHashJoin [codegen id : 7] -Left keys [1]: [ws_sold_date_sk#21] -Right keys [1]: [d_date_sk#6] +(30) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customsk#13] Join condition: None -(33) Project [codegen id : 7] -Output: [] -Input [2]: [ws_sold_date_sk#21, d_date_sk#6] +(31) Project [codegen id : 9] +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] -(34) Scan parquet default.catalog_sales -Output [1]: [cs_sold_date_sk#22] +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#18, ca_state#19] Batched: true -Location [not included in comparison]/{warehouse_dir}/catalog_sales] -PushedFilters: [IsNotNull(cs_sold_date_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 [1]: [cs_sold_date_sk#22] +(33) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#18, ca_state#19] -(36) Filter [codegen id : 9] -Input [1]: [cs_sold_date_sk#22] -Condition : isnotnull(cs_sold_date_sk#22) +(34) Filter [codegen id : 7] +Input [2]: [ca_address_sk#18, ca_state#19] +Condition : isnotnull(ca_address_sk#18) -(37) ReusedExchange [Reuses operator id: 11] -Output [1]: [d_date_sk#6] +(35) BroadcastExchange +Input [2]: [ca_address_sk#18, ca_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(38) BroadcastHashJoin [codegen id : 9] -Left keys [1]: [cs_sold_date_sk#22] -Right keys [1]: [d_date_sk#6] +(36) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#18] Join condition: None -(39) Project [codegen id : 9] -Output: [] -Input [2]: [cs_sold_date_sk#22, d_date_sk#6] +(37) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, ca_state#19] +Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#18, ca_state#19] + +(38) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 8] +Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -(40) Union +(40) Filter [codegen id : 8] +Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Condition : isnotnull(cd_demo_sk#21) (41) BroadcastExchange -Input: [] -Arguments: IdentityBroadcastMode, [id=#23] +Input [6]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] -(42) BroadcastNestedLoopJoin -Join condition: (customsk#24 = c_customer_sk#1) +(42) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#21] +Join condition: None -(43) Project [codegen id : 10] -Output [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Input [7]: [c_customer_sk#1, ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] +(43) Project [codegen id : 9] +Output [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Input [8]: [c_current_cdemo_sk#2, ca_state#19, cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] -(44) HashAggregate [codegen id : 10] -Input [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Keys [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#17 as bigint)), partial_max(cd_dep_count#17), partial_sum(cast(cd_dep_count#17 as bigint)), partial_avg(cast(cd_dep_employed_count#18 as bigint)), partial_max(cd_dep_employed_count#18), partial_sum(cast(cd_dep_employed_count#18 as bigint)), partial_avg(cast(cd_dep_college_count#19 as bigint)), partial_max(cd_dep_college_count#19), partial_sum(cast(cd_dep_college_count#19 as bigint))] -Aggregate Attributes [13]: [count#25, sum#26, count#27, max#28, sum#29, sum#30, count#31, max#32, sum#33, sum#34, count#35, max#36, sum#37] -Results [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] +(44) HashAggregate [codegen id : 9] +Input [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Keys [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Functions [10]: [partial_count(1), partial_avg(cast(cd_dep_count#24 as bigint)), partial_max(cd_dep_count#24), partial_sum(cast(cd_dep_count#24 as bigint)), partial_avg(cast(cd_dep_employed_count#25 as bigint)), partial_max(cd_dep_employed_count#25), partial_sum(cast(cd_dep_employed_count#25 as bigint)), partial_avg(cast(cd_dep_college_count#26 as bigint)), partial_max(cd_dep_college_count#26), partial_sum(cast(cd_dep_college_count#26 as bigint))] +Aggregate Attributes [13]: [count#28, sum#29, count#30, max#31, sum#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40] +Results [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] (45) Exchange -Input [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] -Arguments: hashpartitioning(ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, 5), true, [id=#51] +Input [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +Arguments: hashpartitioning(ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, 5), true, [id=#54] -(46) HashAggregate [codegen id : 11] -Input [19]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19, count#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46, sum#47, count#48, max#49, sum#50] -Keys [6]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cd_dep_employed_count#18, cd_dep_college_count#19] -Functions [10]: [count(1), avg(cast(cd_dep_count#17 as bigint)), max(cd_dep_count#17), sum(cast(cd_dep_count#17 as bigint)), avg(cast(cd_dep_employed_count#18 as bigint)), max(cd_dep_employed_count#18), sum(cast(cd_dep_employed_count#18 as bigint)), avg(cast(cd_dep_college_count#19 as bigint)), max(cd_dep_college_count#19), sum(cast(cd_dep_college_count#19 as bigint))] -Aggregate Attributes [10]: [count(1)#52, avg(cast(cd_dep_count#17 as bigint))#53, max(cd_dep_count#17)#54, sum(cast(cd_dep_count#17 as bigint))#55, avg(cast(cd_dep_employed_count#18 as bigint))#56, max(cd_dep_employed_count#18)#57, sum(cast(cd_dep_employed_count#18 as bigint))#58, avg(cast(cd_dep_college_count#19 as bigint))#59, max(cd_dep_college_count#19)#60, sum(cast(cd_dep_college_count#19 as bigint))#61] -Results [18]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, count(1)#52 AS cnt1#62, avg(cast(cd_dep_count#17 as bigint))#53 AS avg(cd_dep_count)#63, max(cd_dep_count#17)#54 AS max(cd_dep_count)#64, sum(cast(cd_dep_count#17 as bigint))#55 AS sum(cd_dep_count)#65, cd_dep_employed_count#18, count(1)#52 AS cnt2#66, avg(cast(cd_dep_employed_count#18 as bigint))#56 AS avg(cd_dep_employed_count)#67, max(cd_dep_employed_count#18)#57 AS max(cd_dep_employed_count)#68, sum(cast(cd_dep_employed_count#18 as bigint))#58 AS sum(cd_dep_employed_count)#69, cd_dep_college_count#19, count(1)#52 AS cnt3#70, avg(cast(cd_dep_college_count#19 as bigint))#59 AS avg(cd_dep_college_count)#71, max(cd_dep_college_count#19)#60 AS max(cd_dep_college_count)#72, sum(cast(cd_dep_college_count#19 as bigint))#61 AS sum(cd_dep_college_count)#73] +(46) HashAggregate [codegen id : 10] +Input [19]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#41, sum#42, count#43, max#44, sum#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53] +Keys [6]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26] +Functions [10]: [count(1), avg(cast(cd_dep_count#24 as bigint)), max(cd_dep_count#24), sum(cast(cd_dep_count#24 as bigint)), avg(cast(cd_dep_employed_count#25 as bigint)), max(cd_dep_employed_count#25), sum(cast(cd_dep_employed_count#25 as bigint)), avg(cast(cd_dep_college_count#26 as bigint)), max(cd_dep_college_count#26), sum(cast(cd_dep_college_count#26 as bigint))] +Aggregate Attributes [10]: [count(1)#55, avg(cast(cd_dep_count#24 as bigint))#56, max(cd_dep_count#24)#57, sum(cast(cd_dep_count#24 as bigint))#58, avg(cast(cd_dep_employed_count#25 as bigint))#59, max(cd_dep_employed_count#25)#60, sum(cast(cd_dep_employed_count#25 as bigint))#61, avg(cast(cd_dep_college_count#26 as bigint))#62, max(cd_dep_college_count#26)#63, sum(cast(cd_dep_college_count#26 as bigint))#64] +Results [18]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, count(1)#55 AS cnt1#65, avg(cast(cd_dep_count#24 as bigint))#56 AS avg(cd_dep_count)#66, max(cd_dep_count#24)#57 AS max(cd_dep_count)#67, sum(cast(cd_dep_count#24 as bigint))#58 AS sum(cd_dep_count)#68, cd_dep_employed_count#25, count(1)#55 AS cnt2#69, avg(cast(cd_dep_employed_count#25 as bigint))#59 AS avg(cd_dep_employed_count)#70, max(cd_dep_employed_count#25)#60 AS max(cd_dep_employed_count)#71, sum(cast(cd_dep_employed_count#25 as bigint))#61 AS sum(cd_dep_employed_count)#72, cd_dep_college_count#26, count(1)#55 AS cnt3#73, avg(cast(cd_dep_college_count#26 as bigint))#62 AS avg(cd_dep_college_count)#74, max(cd_dep_college_count#26)#63 AS max(cd_dep_college_count)#75, sum(cast(cd_dep_college_count#26 as bigint))#64 AS sum(cd_dep_college_count)#76] (47) TakeOrderedAndProject -Input [18]: [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cnt1#62, avg(cd_dep_count)#63, max(cd_dep_count)#64, sum(cd_dep_count)#65, cd_dep_employed_count#18, cnt2#66, avg(cd_dep_employed_count)#67, max(cd_dep_employed_count)#68, sum(cd_dep_employed_count)#69, cd_dep_college_count#19, cnt3#70, avg(cd_dep_college_count)#71, max(cd_dep_college_count)#72, sum(cd_dep_college_count)#73] -Arguments: 100, [ca_state#12 ASC NULLS FIRST, cd_gender#15 ASC NULLS FIRST, cd_marital_status#16 ASC NULLS FIRST, cd_dep_count#17 ASC NULLS FIRST, cd_dep_employed_count#18 ASC NULLS FIRST, cd_dep_college_count#19 ASC NULLS FIRST], [ca_state#12, cd_gender#15, cd_marital_status#16, cd_dep_count#17, cnt1#62, avg(cd_dep_count)#63, max(cd_dep_count)#64, sum(cd_dep_count)#65, cd_dep_employed_count#18, cnt2#66, avg(cd_dep_employed_count)#67, max(cd_dep_employed_count)#68, sum(cd_dep_employed_count)#69, cd_dep_college_count#19, cnt3#70, avg(cd_dep_college_count)#71, max(cd_dep_college_count)#72, sum(cd_dep_college_count)#73] +Input [18]: [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#25, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#26, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] +Arguments: 100, [ca_state#19 ASC NULLS FIRST, cd_gender#22 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_dep_count#24 ASC NULLS FIRST, cd_dep_employed_count#25 ASC NULLS FIRST, cd_dep_college_count#26 ASC NULLS FIRST], [ca_state#19, cd_gender#22, cd_marital_status#23, cd_dep_count#24, cnt1#65, avg(cd_dep_count)#66, max(cd_dep_count)#67, sum(cd_dep_count)#68, cd_dep_employed_count#25, cnt2#69, avg(cd_dep_employed_count)#70, max(cd_dep_employed_count)#71, sum(cd_dep_employed_count)#72, cd_dep_college_count#26, cnt3#73, avg(cd_dep_college_count)#74, max(cd_dep_college_count)#75, sum(cd_dep_college_count)#76] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt index b3afbfb65d272..85198feb8e903 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt @@ -1,71 +1,70 @@ TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] - WholeStageCodegen (11) + WholeStageCodegen (10) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cast(cd_dep_count as bigint)),max(cd_dep_count),sum(cast(cd_dep_count as bigint)),avg(cast(cd_dep_employed_count as bigint)),max(cd_dep_employed_count),sum(cast(cd_dep_employed_count as bigint)),avg(cast(cd_dep_college_count as bigint)),max(cd_dep_college_count),sum(cast(cd_dep_college_count as bigint)),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] InputAdapter Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 - WholeStageCodegen (10) + WholeStageCodegen (9) HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - InputAdapter - BroadcastNestedLoopJoin [customsk,c_customer_sk] - WholeStageCodegen (5) - Project [c_customer_sk,ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] - BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] - Project [c_customer_sk,c_current_cdemo_sk,ca_state] - BroadcastHashJoin [c_current_addr_sk,ca_address_sk] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - 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] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,customsk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow InputAdapter - BroadcastExchange #2 - WholeStageCodegen (2) - Project [ss_customer_sk] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Filter [ss_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_sold_date_sk] + ColumnarToRow InputAdapter - BroadcastExchange #3 - WholeStageCodegen (1) - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (3) - Filter [ca_address_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_address [ca_address_sk,ca_state] + Scan parquet default.store_sales [ss_sold_date_sk,ss_customer_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + 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] InputAdapter - BroadcastExchange #5 - WholeStageCodegen (4) - Filter [cd_demo_sk] - ColumnarToRow - InputAdapter - Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastExchange #4 + Union + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_date_sk,ws_bill_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_sold_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_date_sk,cs_ship_customer_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter BroadcastExchange #6 - Union - WholeStageCodegen (7) - Project - BroadcastHashJoin [ws_sold_date_sk,d_date_sk] - Filter [ws_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.web_sales [ws_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 - WholeStageCodegen (9) - Project - BroadcastHashJoin [cs_sold_date_sk,d_date_sk] - Filter [cs_sold_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.catalog_sales [cs_sold_date_sk] - InputAdapter - ReusedExchange [d_date_sk] #3 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] 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 5a4ba4b4db71f..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 @@ -200,92 +200,90 @@ Aggregate Attributes [2]: [sum(ss_net_profit#31)#42, sum(ss_ext_sales_price#32)# Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#42) / promote_precision(sum(ss_ext_sales_price#32)#43)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#44, i_category#14, null AS i_class#45, 0 AS t_category#46, 1 AS t_class#47, 1 AS lochierarchy#48] (32) Union -Arguments: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (33) HashAggregate [codegen id : 12] -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] (34) Exchange -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Arguments: hashpartitioning(gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54, 5), true, [id=#55] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Arguments: hashpartitioning(gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#49] (35) HashAggregate [codegen id : 13] -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] (36) ReusedExchange [Reuses operator id: 25] -Output [4]: [i_category#14, i_class#13, sum#56, sum#57] +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#56, sum#57] +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))#58, sum(UnscaledValue(ss_ext_sales_price#4))#59] -Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#58,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#59,17,2) AS ss_ext_sales_price#32] +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] Keys: [] Functions [2]: [partial_sum(ss_net_profit#31), partial_sum(ss_ext_sales_price#32)] -Aggregate Attributes [4]: [sum#60, isEmpty#61, sum#62, isEmpty#63] -Results [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Aggregate Attributes [4]: [sum#54, isEmpty#55, sum#56, isEmpty#57] +Results [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] (39) Exchange -Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] -Arguments: SinglePartition, true, [id=#68] +Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Arguments: SinglePartition, true, [id=#62] (40) HashAggregate [codegen id : 19] -Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] Keys: [] Functions [2]: [sum(ss_net_profit#31), sum(ss_ext_sales_price#32)] -Aggregate Attributes [2]: [sum(ss_net_profit#31)#69, sum(ss_ext_sales_price#32)#70] -Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#69) / promote_precision(sum(ss_ext_sales_price#32)#70)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#71, null AS i_category#72, null AS i_class#73, 1 AS t_category#74, 1 AS t_class#75, 2 AS lochierarchy#76] +Aggregate Attributes [2]: [sum(ss_net_profit#31)#63, sum(ss_ext_sales_price#32)#64] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#63) / promote_precision(sum(ss_ext_sales_price#32)#64)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#65, null AS i_category#66, null AS i_class#67, 1 AS t_category#68, 1 AS t_class#69, 2 AS lochierarchy#70] (41) Union -Arguments: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (42) HashAggregate [codegen id : 20] -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Results [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] (43) Exchange -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Arguments: hashpartitioning(gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82, 5), true, [id=#83] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Arguments: hashpartitioning(gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#71] (44) HashAggregate [codegen id : 21] -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Input [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#14, i_class#13, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, CASE WHEN (t_class#81 = 0) THEN i_category#78 END AS _w0#84] +Results [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, CASE WHEN (t_class#25 = 0) THEN i_category#14 END AS _w0#72] (45) Exchange -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: hashpartitioning(lochierarchy#82, _w0#84, 5), true, [id=#85] +Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] +Arguments: hashpartitioning(lochierarchy#26, _w0#72, 5), true, [id=#73] (46) Sort [codegen id : 22] -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: [lochierarchy#82 ASC NULLS FIRST, _w0#84 ASC NULLS FIRST, gross_margin#77 ASC NULLS FIRST], false, 0 +Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] +Arguments: [lochierarchy#26 ASC NULLS FIRST, _w0#72 ASC NULLS FIRST, gross_margin#23 ASC NULLS FIRST], false, 0 (47) Window -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: [rank(gross_margin#77) windowspecdefinition(lochierarchy#82, _w0#84, gross_margin#77 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#86], [lochierarchy#82, _w0#84], [gross_margin#77 ASC NULLS FIRST] +Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72] +Arguments: [rank(gross_margin#23) windowspecdefinition(lochierarchy#26, _w0#72, gross_margin#23 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#74], [lochierarchy#26, _w0#72], [gross_margin#23 ASC NULLS FIRST] (48) Project [codegen id : 23] -Output [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] -Input [6]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84, rank_within_parent#86] +Output [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] +Input [6]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, _w0#72, rank_within_parent#74] (49) TakeOrderedAndProject -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] -Arguments: 100, [lochierarchy#82 DESC NULLS LAST, CASE WHEN (lochierarchy#82 = 0) THEN i_category#78 END ASC NULLS FIRST, rank_within_parent#86 ASC NULLS FIRST], [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Input [5]: [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] +Arguments: 100, [lochierarchy#26 DESC NULLS LAST, CASE WHEN (lochierarchy#26 = 0) THEN i_category#14 END ASC NULLS FIRST, rank_within_parent#74 ASC NULLS FIRST], [gross_margin#23, i_category#14, i_class#13, lochierarchy#26, rank_within_parent#74] 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 74bdd4785e115..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 @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (20) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + Union WholeStageCodegen (13) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (12) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + Union WholeStageCodegen (5) HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt index a26fea82c6b4c..0d6dfa6f90a86 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt @@ -200,92 +200,90 @@ Aggregate Attributes [2]: [sum(ss_net_profit#31)#42, sum(ss_ext_sales_price#32)# Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#42) / promote_precision(sum(ss_ext_sales_price#32)#43)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#44, i_category#11, null AS i_class#45, 0 AS t_category#46, 1 AS t_class#47, 1 AS lochierarchy#48] (32) Union -Arguments: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] (33) HashAggregate [codegen id : 12] -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] (34) Exchange -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Arguments: hashpartitioning(gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54, 5), true, [id=#55] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Arguments: hashpartitioning(gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#49] (35) HashAggregate [codegen id : 13] -Input [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] -Keys [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#49, i_category#50, i_class#51, t_category#52, t_class#53, lochierarchy#54] +Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] (36) ReusedExchange [Reuses operator id: 25] -Output [4]: [i_category#11, i_class#10, sum#56, sum#57] +Output [4]: [i_category#11, i_class#10, sum#50, sum#51] (37) HashAggregate [codegen id : 18] -Input [4]: [i_category#11, i_class#10, sum#56, sum#57] +Input [4]: [i_category#11, i_class#10, sum#50, sum#51] Keys [2]: [i_category#11, i_class#10] Functions [2]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(ss_ext_sales_price#4))] -Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#5))#58, sum(UnscaledValue(ss_ext_sales_price#4))#59] -Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#58,17,2) AS ss_net_profit#31, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#59,17,2) AS ss_ext_sales_price#32] +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] Keys: [] Functions [2]: [partial_sum(ss_net_profit#31), partial_sum(ss_ext_sales_price#32)] -Aggregate Attributes [4]: [sum#60, isEmpty#61, sum#62, isEmpty#63] -Results [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Aggregate Attributes [4]: [sum#54, isEmpty#55, sum#56, isEmpty#57] +Results [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] (39) Exchange -Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] -Arguments: SinglePartition, true, [id=#68] +Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] +Arguments: SinglePartition, true, [id=#62] (40) HashAggregate [codegen id : 19] -Input [4]: [sum#64, isEmpty#65, sum#66, isEmpty#67] +Input [4]: [sum#58, isEmpty#59, sum#60, isEmpty#61] Keys: [] Functions [2]: [sum(ss_net_profit#31), sum(ss_ext_sales_price#32)] -Aggregate Attributes [2]: [sum(ss_net_profit#31)#69, sum(ss_ext_sales_price#32)#70] -Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#69) / promote_precision(sum(ss_ext_sales_price#32)#70)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#71, null AS i_category#72, null AS i_class#73, 1 AS t_category#74, 1 AS t_class#75, 2 AS lochierarchy#76] +Aggregate Attributes [2]: [sum(ss_net_profit#31)#63, sum(ss_ext_sales_price#32)#64] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#31)#63) / promote_precision(sum(ss_ext_sales_price#32)#64)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#65, null AS i_category#66, null AS i_class#67, 1 AS t_category#68, 1 AS t_class#69, 2 AS lochierarchy#70] (41) Union -Arguments: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] (42) HashAggregate [codegen id : 20] -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Results [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] (43) Exchange -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Arguments: hashpartitioning(gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82, 5), true, [id=#83] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Arguments: hashpartitioning(gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26, 5), true, [id=#71] (44) HashAggregate [codegen id : 21] -Input [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] -Keys [6]: [gross_margin#77, i_category#78, i_class#79, t_category#80, t_class#81, lochierarchy#82] +Input [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] +Keys [6]: [gross_margin#23, i_category#11, i_class#10, t_category#24, t_class#25, lochierarchy#26] Functions: [] Aggregate Attributes: [] -Results [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, CASE WHEN (t_class#81 = 0) THEN i_category#78 END AS _w0#84] +Results [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, CASE WHEN (t_class#25 = 0) THEN i_category#11 END AS _w0#72] (45) Exchange -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: hashpartitioning(lochierarchy#82, _w0#84, 5), true, [id=#85] +Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] +Arguments: hashpartitioning(lochierarchy#26, _w0#72, 5), true, [id=#73] (46) Sort [codegen id : 22] -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: [lochierarchy#82 ASC NULLS FIRST, _w0#84 ASC NULLS FIRST, gross_margin#77 ASC NULLS FIRST], false, 0 +Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] +Arguments: [lochierarchy#26 ASC NULLS FIRST, _w0#72 ASC NULLS FIRST, gross_margin#23 ASC NULLS FIRST], false, 0 (47) Window -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84] -Arguments: [rank(gross_margin#77) windowspecdefinition(lochierarchy#82, _w0#84, gross_margin#77 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#86], [lochierarchy#82, _w0#84], [gross_margin#77 ASC NULLS FIRST] +Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72] +Arguments: [rank(gross_margin#23) windowspecdefinition(lochierarchy#26, _w0#72, gross_margin#23 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#74], [lochierarchy#26, _w0#72], [gross_margin#23 ASC NULLS FIRST] (48) Project [codegen id : 23] -Output [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] -Input [6]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, _w0#84, rank_within_parent#86] +Output [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] +Input [6]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, _w0#72, rank_within_parent#74] (49) TakeOrderedAndProject -Input [5]: [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] -Arguments: 100, [lochierarchy#82 DESC NULLS LAST, CASE WHEN (lochierarchy#82 = 0) THEN i_category#78 END ASC NULLS FIRST, rank_within_parent#86 ASC NULLS FIRST], [gross_margin#77, i_category#78, i_class#79, lochierarchy#82, rank_within_parent#86] +Input [5]: [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] +Arguments: 100, [lochierarchy#26 DESC NULLS LAST, CASE WHEN (lochierarchy#26 = 0) THEN i_category#11 END ASC NULLS FIRST, rank_within_parent#74 ASC NULLS FIRST], [gross_margin#23, i_category#11, i_class#10, lochierarchy#26, rank_within_parent#74] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt index ced101be7262a..a72781e1da0ed 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (20) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + Union WholeStageCodegen (13) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i WholeStageCodegen (12) HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] InputAdapter - Union [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + Union WholeStageCodegen (5) HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] InputAdapter 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 f4cc2b287f92d..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 @@ -453,27 +453,26 @@ Output [5]: [store AS channel#112, item#106, return_ratio#107, return_rank#110, Input [5]: [item#106, return_ratio#107, currency_ratio#108, return_rank#110, currency_rank#111] (83) Union -Arguments: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] (84) HashAggregate [codegen id : 31] -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] (85) Exchange -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Arguments: hashpartitioning(channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117, 5), true, [id=#118] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Arguments: hashpartitioning(channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39, 5), true, [id=#113] (86) HashAggregate [codegen id : 32] -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Keys [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Keys [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Results [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] (87) TakeOrderedAndProject -Input [5]: [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] -Arguments: 100, [channel#113 ASC NULLS FIRST, return_rank#116 ASC NULLS FIRST, currency_rank#117 ASC NULLS FIRST, item#114 ASC NULLS FIRST], [channel#113, item#114, return_ratio#115, return_rank#116, currency_rank#117] +Input [5]: [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] +Arguments: 100, [channel#40 ASC NULLS FIRST, return_rank#38 ASC NULLS FIRST, currency_rank#39 ASC NULLS FIRST, item#34 ASC NULLS FIRST], [channel#40, item#34, return_ratio#35, return_rank#38, currency_rank#39] 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 d8c5e9679b1cf..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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (31) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union [channel,item,return_ratio,return_rank,currency_rank] + Union WholeStageCodegen (10) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt index 8a6a3942cefed..01dc1047953e3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt @@ -408,27 +408,26 @@ Output [5]: [store AS channel#109, item#103, return_ratio#104, return_rank#107, Input [5]: [item#103, return_ratio#104, currency_ratio#105, return_rank#107, currency_rank#108] (74) Union -Arguments: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] (75) HashAggregate [codegen id : 22] -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] (76) Exchange -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Arguments: hashpartitioning(channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114, 5), true, [id=#115] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Arguments: hashpartitioning(channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38, 5), true, [id=#110] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Keys [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Keys [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Results [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] (78) TakeOrderedAndProject -Input [5]: [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] -Arguments: 100, [channel#110 ASC NULLS FIRST, return_rank#113 ASC NULLS FIRST, currency_rank#114 ASC NULLS FIRST, item#111 ASC NULLS FIRST], [channel#110, item#111, return_ratio#112, return_rank#113, currency_rank#114] +Input [5]: [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] +Arguments: 100, [channel#39 ASC NULLS FIRST, return_rank#37 ASC NULLS FIRST, currency_rank#38 ASC NULLS FIRST, item#33 ASC NULLS FIRST], [channel#39, item#33, return_ratio#34, return_rank#37, currency_rank#38] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt index e156919a29dd1..c15f2394e1a44 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] WholeStageCodegen (22) HashAggregate [channel,item,return_ratio,return_rank,currency_rank] InputAdapter - Union [channel,item,return_ratio,return_rank,currency_rank] + Union WholeStageCodegen (7) Project [item,return_ratio,return_rank,currency_rank] Filter [return_rank,currency_rank] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt index c50ef03d3b8b8..471d38c89e601 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt @@ -135,431 +135,425 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union -Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_date#28] +Output [2]: [d_date_sk#21, d_date#22] 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-08-18), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] +Input [2]: [d_date_sk#21, d_date#22] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] -Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 10442)) AND (d_date#28 <= 10456)) AND isnotnull(d_date_sk#27)) +Input [2]: [d_date_sk#21, d_date#22] +Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10442)) AND (d_date#22 <= 10456)) AND isnotnull(d_date_sk#21)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#27] -Input [2]: [d_date_sk#27, d_date#28] +Output [1]: [d_date_sk#21] +Input [2]: [d_date_sk#21, d_date#22] (14) BroadcastExchange -Input [1]: [d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#22] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#6] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] -Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] +Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] +Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] (17) Scan parquet default.store -Output [2]: [s_store_sk#30, s_store_id#31] +Output [2]: [s_store_sk#24, s_store_id#25] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] +Input [2]: [s_store_sk#24, s_store_id#25] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] -Condition : isnotnull(s_store_sk#30) +Input [2]: [s_store_sk#24, s_store_id#25] +Condition : isnotnull(s_store_sk#24) (20) BroadcastExchange -Input [2]: [s_store_sk#30, s_store_id#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [2]: [s_store_sk#24, s_store_id#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#21] -Right keys [1]: [cast(s_store_sk#30 as bigint)] +Left keys [1]: [store_sk#5] +Right keys [1]: [cast(s_store_sk#24 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] +Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Keys [1]: [s_store_id#31] -Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] -Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Keys [1]: [s_store_id#25] +Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] +Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] (24) Exchange -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Keys [1]: [s_store_id#31] -Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] -Results [5]: [store channel AS channel#46, concat(store, s_store_id#31) AS id#47, MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#48, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS returns#49, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#50] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Keys [1]: [s_store_id#25] +Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] +Results [5]: [store channel AS channel#40, concat(store, s_store_id#25) AS id#41, MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#42, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS returns#43, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#44] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] -Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] -Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (34) Union -Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#72] -Right keys [1]: [d_date_sk#27] +Left keys [1]: [date_sk#50] +Right keys [1]: [d_date_sk#21] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] -Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] +Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] +Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Condition : isnotnull(cp_catalog_page_sk#77) +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Condition : isnotnull(cp_catalog_page_sk#65) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#71] -Right keys [1]: [cp_catalog_page_sk#77] +Left keys [1]: [page_sk#49] +Right keys [1]: [cp_catalog_page_sk#65] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] -Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] +Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] (45) Exchange -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] -Results [5]: [catalog channel AS channel#93, concat(catalog_page, cp_catalog_page_id#78) AS id#94, MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#95, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS returns#96, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#97] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] +Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#66) AS id#82, MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS returns#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] -Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 14] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] (53) Filter [codegen id : 14] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Condition : isnotnull(wr_returned_date_sk#108) +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Condition : isnotnull(wr_returned_date_sk#96) (54) Exchange -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Arguments: hashpartitioning(wr_item_sk#109, wr_order_number#110, 5), true, [id=#113] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Arguments: hashpartitioning(wr_item_sk#97, wr_order_number#98, 5), true, [id=#101] (55) Sort [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Arguments: [wr_item_sk#109 ASC NULLS FIRST, wr_order_number#110 ASC NULLS FIRST], false, 0 +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Arguments: [wr_item_sk#97 ASC NULLS FIRST, wr_order_number#98 ASC NULLS FIRST], false, 0 (56) Scan parquet default.web_sales -Output [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Output [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (57) ColumnarToRow [codegen id : 16] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] (58) Filter [codegen id : 16] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Condition : ((isnotnull(ws_item_sk#114) AND isnotnull(ws_order_number#115)) AND isnotnull(ws_web_site_sk#99)) +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Condition : ((isnotnull(ws_item_sk#102) AND isnotnull(ws_order_number#103)) AND isnotnull(ws_web_site_sk#87)) (59) Exchange -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Arguments: hashpartitioning(cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint), 5), true, [id=#116] +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Arguments: hashpartitioning(cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint), 5), true, [id=#104] (60) Sort [codegen id : 17] -Input [3]: [ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] -Arguments: [cast(ws_item_sk#114 as bigint) ASC NULLS FIRST, cast(ws_order_number#115 as bigint) ASC NULLS FIRST], false, 0 +Input [3]: [ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] +Arguments: [cast(ws_item_sk#102 as bigint) ASC NULLS FIRST, cast(ws_order_number#103 as bigint) ASC NULLS FIRST], false, 0 (61) SortMergeJoin [codegen id : 18] -Left keys [2]: [wr_item_sk#109, wr_order_number#110] -Right keys [2]: [cast(ws_item_sk#114 as bigint), cast(ws_order_number#115 as bigint)] +Left keys [2]: [wr_item_sk#97, wr_order_number#98] +Right keys [2]: [cast(ws_item_sk#102 as bigint), cast(ws_order_number#103 as bigint)] Join condition: None (62) Project [codegen id : 18] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#117, wr_returned_date_sk#108 AS date_sk#118, 0.00 AS sales_price#119, 0.00 AS profit#120, wr_return_amt#111 AS return_amt#121, wr_net_loss#112 AS net_loss#122] -Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#114, ws_web_site_sk#99, ws_order_number#115] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#105, wr_returned_date_sk#96 AS date_sk#106, 0.00 AS sales_price#107, 0.00 AS profit#108, wr_return_amt#99 AS return_amt#109, wr_net_loss#100 AS net_loss#110] +Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#102, ws_web_site_sk#87, ws_order_number#103] (63) Union -Arguments: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128] (64) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (65) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [date_sk#124] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#91] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (66) Project [codegen id : 21] -Output [5]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128] -Input [7]: [wsr_web_site_sk#123, date_sk#124, sales_price#125, profit#126, return_amt#127, net_loss#128, d_date_sk#27] +Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] +Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] (67) Scan parquet default.web_site -Output [2]: [web_site_sk#129, web_site_id#130] +Output [2]: [web_site_sk#111, web_site_id#112] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (68) ColumnarToRow [codegen id : 20] -Input [2]: [web_site_sk#129, web_site_id#130] +Input [2]: [web_site_sk#111, web_site_id#112] (69) Filter [codegen id : 20] -Input [2]: [web_site_sk#129, web_site_id#130] -Condition : isnotnull(web_site_sk#129) +Input [2]: [web_site_sk#111, web_site_id#112] +Condition : isnotnull(web_site_sk#111) (70) BroadcastExchange -Input [2]: [web_site_sk#129, web_site_id#130] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#131] +Input [2]: [web_site_sk#111, web_site_id#112] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#113] (71) BroadcastHashJoin [codegen id : 21] -Left keys [1]: [wsr_web_site_sk#123] -Right keys [1]: [web_site_sk#129] +Left keys [1]: [wsr_web_site_sk#90] +Right keys [1]: [web_site_sk#111] Join condition: None (72) Project [codegen id : 21] -Output [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] -Input [7]: [wsr_web_site_sk#123, sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_sk#129, web_site_id#130] +Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] +Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#111, web_site_id#112] (73) HashAggregate [codegen id : 21] -Input [5]: [sales_price#125, profit#126, return_amt#127, net_loss#128, web_site_id#130] -Keys [1]: [web_site_id#130] -Functions [4]: [partial_sum(UnscaledValue(sales_price#125)), partial_sum(UnscaledValue(return_amt#127)), partial_sum(UnscaledValue(profit#126)), partial_sum(UnscaledValue(net_loss#128))] -Aggregate Attributes [4]: [sum#132, sum#133, sum#134, sum#135] -Results [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] +Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#112] +Keys [1]: [web_site_id#112] +Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum#114, sum#115, sum#116, sum#117] +Results [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] (74) Exchange -Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] -Arguments: hashpartitioning(web_site_id#130, 5), true, [id=#140] +Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Arguments: hashpartitioning(web_site_id#112, 5), true, [id=#122] (75) HashAggregate [codegen id : 22] -Input [5]: [web_site_id#130, sum#136, sum#137, sum#138, sum#139] -Keys [1]: [web_site_id#130] -Functions [4]: [sum(UnscaledValue(sales_price#125)), sum(UnscaledValue(return_amt#127)), sum(UnscaledValue(profit#126)), sum(UnscaledValue(net_loss#128))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#125))#141, sum(UnscaledValue(return_amt#127))#142, sum(UnscaledValue(profit#126))#143, sum(UnscaledValue(net_loss#128))#144] -Results [5]: [web channel AS channel#145, concat(web_site, web_site_id#130) AS id#146, MakeDecimal(sum(UnscaledValue(sales_price#125))#141,17,2) AS sales#147, MakeDecimal(sum(UnscaledValue(return_amt#127))#142,17,2) AS returns#148, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#126))#143,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#128))#144,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#149] +Input [5]: [web_site_id#112, sum#118, sum#119, sum#120, sum#121] +Keys [1]: [web_site_id#112] +Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#123, sum(UnscaledValue(return_amt#94))#124, sum(UnscaledValue(profit#93))#125, sum(UnscaledValue(net_loss#95))#126] +Results [5]: [web channel AS channel#127, concat(web_site, web_site_id#112) AS id#128, MakeDecimal(sum(UnscaledValue(sales_price#92))#123,17,2) AS sales#129, MakeDecimal(sum(UnscaledValue(return_amt#94))#124,17,2) AS returns#130, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#125,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#126,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#131] (76) Union -Arguments: [channel#150, id#151, sales#152, returns#153, profit#154] (77) HashAggregate [codegen id : 23] -Input [5]: [channel#150, id#151, sales#152, returns#153, profit#154] -Keys [2]: [channel#150, id#151] -Functions [3]: [partial_sum(sales#152), partial_sum(returns#153), partial_sum(profit#154)] -Aggregate Attributes [6]: [sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] -Results [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] +Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] +Keys [2]: [channel#40, id#41] +Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] +Aggregate Attributes [6]: [sum#132, isEmpty#133, sum#134, isEmpty#135, sum#136, isEmpty#137] +Results [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] (78) Exchange -Input [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] -Arguments: hashpartitioning(channel#150, id#151, 5), true, [id=#167] +Input [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#144] (79) HashAggregate [codegen id : 24] -Input [8]: [channel#150, id#151, sum#161, isEmpty#162, sum#163, isEmpty#164, sum#165, isEmpty#166] -Keys [2]: [channel#150, id#151] -Functions [3]: [sum(sales#152), sum(returns#153), sum(profit#154)] -Aggregate Attributes [3]: [sum(sales#152)#168, sum(returns#153)#169, sum(profit#154)#170] -Results [5]: [channel#150, id#151, cast(sum(sales#152)#168 as decimal(37,2)) AS sales#171, cast(sum(returns#153)#169 as decimal(37,2)) AS returns#172, cast(sum(profit#154)#170 as decimal(38,2)) AS profit#173] +Input [8]: [channel#40, id#41, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#145, sum(returns#43)#146, sum(profit#44)#147] +Results [5]: [channel#40, id#41, cast(sum(sales#42)#145 as decimal(37,2)) AS sales#148, cast(sum(returns#43)#146 as decimal(37,2)) AS returns#149, cast(sum(profit#44)#147 as decimal(38,2)) AS profit#150] (80) ReusedExchange [Reuses operator id: 78] -Output [8]: [channel#174, id#175, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Output [8]: [channel#40, id#41, sum#151, isEmpty#152, sum#153, isEmpty#154, sum#155, isEmpty#156] (81) HashAggregate [codegen id : 48] -Input [8]: [channel#174, id#175, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] -Keys [2]: [channel#174, id#175] -Functions [3]: [sum(sales#182), sum(returns#183), sum(profit#184)] -Aggregate Attributes [3]: [sum(sales#182)#185, sum(returns#183)#186, sum(profit#184)#187] -Results [4]: [channel#174, sum(sales#182)#185 AS sales#188, sum(returns#183)#186 AS returns#189, sum(profit#184)#187 AS profit#190] +Input [8]: [channel#40, id#41, sum#151, isEmpty#152, sum#153, isEmpty#154, sum#155, isEmpty#156] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#157)] +Aggregate Attributes [3]: [sum(sales#42)#158, sum(returns#43)#159, sum(profit#157)#160] +Results [4]: [channel#40, sum(sales#42)#158 AS sales#161, sum(returns#43)#159 AS returns#162, sum(profit#157)#160 AS profit#163] (82) HashAggregate [codegen id : 48] -Input [4]: [channel#174, sales#188, returns#189, profit#190] -Keys [1]: [channel#174] -Functions [3]: [partial_sum(sales#188), partial_sum(returns#189), partial_sum(profit#190)] -Aggregate Attributes [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] -Results [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] +Input [4]: [channel#40, sales#161, returns#162, profit#163] +Keys [1]: [channel#40] +Functions [3]: [partial_sum(sales#161), partial_sum(returns#162), partial_sum(profit#163)] +Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Results [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] (83) Exchange -Input [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] -Arguments: hashpartitioning(channel#174, 5), true, [id=#203] +Input [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Arguments: hashpartitioning(channel#40, 5), true, [id=#176] (84) HashAggregate [codegen id : 49] -Input [7]: [channel#174, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] -Keys [1]: [channel#174] -Functions [3]: [sum(sales#188), sum(returns#189), sum(profit#190)] -Aggregate Attributes [3]: [sum(sales#188)#204, sum(returns#189)#205, sum(profit#190)#206] -Results [5]: [channel#174, null AS id#207, sum(sales#188)#204 AS sum(sales)#208, sum(returns#189)#205 AS sum(returns)#209, sum(profit#190)#206 AS sum(profit)#210] +Input [7]: [channel#40, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Keys [1]: [channel#40] +Functions [3]: [sum(sales#161), sum(returns#162), sum(profit#163)] +Aggregate Attributes [3]: [sum(sales#161)#177, sum(returns#162)#178, sum(profit#163)#179] +Results [5]: [channel#40, null AS id#180, sum(sales#161)#177 AS sum(sales)#181, sum(returns#162)#178 AS sum(returns)#182, sum(profit#163)#179 AS sum(profit)#183] (85) Union -Arguments: [channel#211, id#212, sales#213, returns#214, profit#215] (86) HashAggregate [codegen id : 50] -Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] -Keys [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] (87) Exchange -Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] -Arguments: hashpartitioning(channel#211, id#212, sales#213, returns#214, profit#215, 5), true, [id=#216] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Arguments: hashpartitioning(channel#40, id#41, sales#148, returns#149, profit#150, 5), true, [id=#184] (88) HashAggregate [codegen id : 51] -Input [5]: [channel#211, id#212, sales#213, returns#214, profit#215] -Keys [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#211, id#212, sales#213, returns#214, profit#215] +Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] (89) ReusedExchange [Reuses operator id: 78] -Output [8]: [channel#217, id#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224] +Output [8]: [channel#40, id#41, sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] (90) HashAggregate [codegen id : 75] -Input [8]: [channel#217, id#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224] -Keys [2]: [channel#217, id#218] -Functions [3]: [sum(sales#225), sum(returns#226), sum(profit#227)] -Aggregate Attributes [3]: [sum(sales#225)#228, sum(returns#226)#229, sum(profit#227)#230] -Results [3]: [sum(sales#225)#228 AS sales#188, sum(returns#226)#229 AS returns#189, sum(profit#227)#230 AS profit#190] +Input [8]: [channel#40, id#41, sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#191)] +Aggregate Attributes [3]: [sum(sales#42)#192, sum(returns#43)#193, sum(profit#191)#194] +Results [3]: [sum(sales#42)#192 AS sales#161, sum(returns#43)#193 AS returns#162, sum(profit#191)#194 AS profit#163] (91) HashAggregate [codegen id : 75] -Input [3]: [sales#188, returns#189, profit#190] +Input [3]: [sales#161, returns#162, profit#163] Keys: [] -Functions [3]: [partial_sum(sales#188), partial_sum(returns#189), partial_sum(profit#190)] -Aggregate Attributes [6]: [sum#231, isEmpty#232, sum#233, isEmpty#234, sum#235, isEmpty#236] -Results [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] +Functions [3]: [partial_sum(sales#161), partial_sum(returns#162), partial_sum(profit#163)] +Aggregate Attributes [6]: [sum#195, isEmpty#196, sum#197, isEmpty#198, sum#199, isEmpty#200] +Results [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] (92) Exchange -Input [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] -Arguments: SinglePartition, true, [id=#243] +Input [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] +Arguments: SinglePartition, true, [id=#207] (93) HashAggregate [codegen id : 76] -Input [6]: [sum#237, isEmpty#238, sum#239, isEmpty#240, sum#241, isEmpty#242] +Input [6]: [sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206] Keys: [] -Functions [3]: [sum(sales#188), sum(returns#189), sum(profit#190)] -Aggregate Attributes [3]: [sum(sales#188)#244, sum(returns#189)#245, sum(profit#190)#246] -Results [5]: [null AS channel#247, null AS id#248, sum(sales#188)#244 AS sum(sales)#249, sum(returns#189)#245 AS sum(returns)#250, sum(profit#190)#246 AS sum(profit)#251] +Functions [3]: [sum(sales#161), sum(returns#162), sum(profit#163)] +Aggregate Attributes [3]: [sum(sales#161)#208, sum(returns#162)#209, sum(profit#163)#210] +Results [5]: [null AS channel#211, null AS id#212, sum(sales#161)#208 AS sum(sales)#213, sum(returns#162)#209 AS sum(returns)#214, sum(profit#163)#210 AS sum(profit)#215] (94) Union -Arguments: [channel#252, id#253, sales#254, returns#255, profit#256] (95) HashAggregate [codegen id : 77] -Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] -Keys [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] (96) Exchange -Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] -Arguments: hashpartitioning(channel#252, id#253, sales#254, returns#255, profit#256, 5), true, [id=#257] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Arguments: hashpartitioning(channel#40, id#41, sales#148, returns#149, profit#150, 5), true, [id=#216] (97) HashAggregate [codegen id : 78] -Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] -Keys [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Keys [5]: [channel#40, id#41, sales#148, returns#149, profit#150] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#252, id#253, sales#254, returns#255, profit#256] +Results [5]: [channel#40, id#41, sales#148, returns#149, profit#150] (98) TakeOrderedAndProject -Input [5]: [channel#252, id#253, sales#254, returns#255, profit#256] -Arguments: 100, [channel#252 ASC NULLS FIRST, id#253 ASC NULLS FIRST], [channel#252, id#253, sales#254, returns#255, profit#256] +Input [5]: [channel#40, id#41, sales#148, returns#149, profit#150] +Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#148, returns#149, profit#150] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt index ccdf442569fb0..81b4178b7a9ca 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (77) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (51) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (50) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (24) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (23) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] InputAdapter @@ -34,7 +34,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -73,7 +73,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -106,7 +106,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt index 2c5c5212e2004..fa2435de73e02 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt @@ -132,419 +132,413 @@ Output [6]: [sr_store_sk#12 AS store_sk#15, sr_returned_date_sk#11 AS date_sk#16 Input [4]: [sr_returned_date_sk#11, sr_store_sk#12, sr_return_amt#13, sr_net_loss#14] (9) Union -Arguments: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26] (10) Scan parquet default.date_dim -Output [2]: [d_date_sk#27, d_date#28] +Output [2]: [d_date_sk#21, d_date#22] 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-08-18), IsNotNull(d_date_sk)] ReadSchema: struct (11) ColumnarToRow [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] +Input [2]: [d_date_sk#21, d_date#22] (12) Filter [codegen id : 3] -Input [2]: [d_date_sk#27, d_date#28] -Condition : (((isnotnull(d_date#28) AND (d_date#28 >= 10442)) AND (d_date#28 <= 10456)) AND isnotnull(d_date_sk#27)) +Input [2]: [d_date_sk#21, d_date#22] +Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10442)) AND (d_date#22 <= 10456)) AND isnotnull(d_date_sk#21)) (13) Project [codegen id : 3] -Output [1]: [d_date_sk#27] -Input [2]: [d_date_sk#27, d_date#28] +Output [1]: [d_date_sk#21] +Input [2]: [d_date_sk#21, d_date#22] (14) BroadcastExchange -Input [1]: [d_date_sk#27] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] (15) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [date_sk#22] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#6] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (16) Project [codegen id : 5] -Output [5]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26] -Input [7]: [store_sk#21, date_sk#22, sales_price#23, profit#24, return_amt#25, net_loss#26, d_date_sk#27] +Output [5]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10] +Input [7]: [store_sk#5, date_sk#6, sales_price#7, profit#8, return_amt#9, net_loss#10, d_date_sk#21] (17) Scan parquet default.store -Output [2]: [s_store_sk#30, s_store_id#31] +Output [2]: [s_store_sk#24, s_store_id#25] Batched: true Location [not included in comparison]/{warehouse_dir}/store] PushedFilters: [IsNotNull(s_store_sk)] ReadSchema: struct (18) ColumnarToRow [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] +Input [2]: [s_store_sk#24, s_store_id#25] (19) Filter [codegen id : 4] -Input [2]: [s_store_sk#30, s_store_id#31] -Condition : isnotnull(s_store_sk#30) +Input [2]: [s_store_sk#24, s_store_id#25] +Condition : isnotnull(s_store_sk#24) (20) BroadcastExchange -Input [2]: [s_store_sk#30, s_store_id#31] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] +Input [2]: [s_store_sk#24, s_store_id#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] (21) BroadcastHashJoin [codegen id : 5] -Left keys [1]: [store_sk#21] -Right keys [1]: [cast(s_store_sk#30 as bigint)] +Left keys [1]: [store_sk#5] +Right keys [1]: [cast(s_store_sk#24 as bigint)] Join condition: None (22) Project [codegen id : 5] -Output [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Input [7]: [store_sk#21, sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_sk#30, s_store_id#31] +Output [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Input [7]: [store_sk#5, sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_sk#24, s_store_id#25] (23) HashAggregate [codegen id : 5] -Input [5]: [sales_price#23, profit#24, return_amt#25, net_loss#26, s_store_id#31] -Keys [1]: [s_store_id#31] -Functions [4]: [partial_sum(UnscaledValue(sales_price#23)), partial_sum(UnscaledValue(return_amt#25)), partial_sum(UnscaledValue(profit#24)), partial_sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum#33, sum#34, sum#35, sum#36] -Results [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] +Input [5]: [sales_price#7, profit#8, return_amt#9, net_loss#10, s_store_id#25] +Keys [1]: [s_store_id#25] +Functions [4]: [partial_sum(UnscaledValue(sales_price#7)), partial_sum(UnscaledValue(return_amt#9)), partial_sum(UnscaledValue(profit#8)), partial_sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum#27, sum#28, sum#29, sum#30] +Results [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] (24) Exchange -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Arguments: hashpartitioning(s_store_id#31, 5), true, [id=#41] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Arguments: hashpartitioning(s_store_id#25, 5), true, [id=#35] (25) HashAggregate [codegen id : 6] -Input [5]: [s_store_id#31, sum#37, sum#38, sum#39, sum#40] -Keys [1]: [s_store_id#31] -Functions [4]: [sum(UnscaledValue(sales_price#23)), sum(UnscaledValue(return_amt#25)), sum(UnscaledValue(profit#24)), sum(UnscaledValue(net_loss#26))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#23))#42, sum(UnscaledValue(return_amt#25))#43, sum(UnscaledValue(profit#24))#44, sum(UnscaledValue(net_loss#26))#45] -Results [5]: [store channel AS channel#46, concat(store, s_store_id#31) AS id#47, MakeDecimal(sum(UnscaledValue(sales_price#23))#42,17,2) AS sales#48, MakeDecimal(sum(UnscaledValue(return_amt#25))#43,17,2) AS returns#49, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#24))#44,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#26))#45,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#50] +Input [5]: [s_store_id#25, sum#31, sum#32, sum#33, sum#34] +Keys [1]: [s_store_id#25] +Functions [4]: [sum(UnscaledValue(sales_price#7)), sum(UnscaledValue(return_amt#9)), sum(UnscaledValue(profit#8)), sum(UnscaledValue(net_loss#10))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#7))#36, sum(UnscaledValue(return_amt#9))#37, sum(UnscaledValue(profit#8))#38, sum(UnscaledValue(net_loss#10))#39] +Results [5]: [store channel AS channel#40, concat(store, s_store_id#25) AS id#41, MakeDecimal(sum(UnscaledValue(sales_price#7))#36,17,2) AS sales#42, MakeDecimal(sum(UnscaledValue(return_amt#9))#37,17,2) AS returns#43, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#8))#38,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#10))#39,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#44] (26) Scan parquet default.catalog_sales -Output [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_sales] PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_catalog_page_sk)] ReadSchema: struct (27) ColumnarToRow [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (28) Filter [codegen id : 7] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] -Condition : (isnotnull(cs_sold_date_sk#51) AND isnotnull(cs_catalog_page_sk#52)) +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] +Condition : (isnotnull(cs_sold_date_sk#45) AND isnotnull(cs_catalog_page_sk#46)) (29) Project [codegen id : 7] -Output [6]: [cs_catalog_page_sk#52 AS page_sk#55, cs_sold_date_sk#51 AS date_sk#56, cs_ext_sales_price#53 AS sales_price#57, cs_net_profit#54 AS profit#58, 0.00 AS return_amt#59, 0.00 AS net_loss#60] -Input [4]: [cs_sold_date_sk#51, cs_catalog_page_sk#52, cs_ext_sales_price#53, cs_net_profit#54] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#49, cs_sold_date_sk#45 AS date_sk#50, cs_ext_sales_price#47 AS sales_price#51, cs_net_profit#48 AS profit#52, 0.00 AS return_amt#53, 0.00 AS net_loss#54] +Input [4]: [cs_sold_date_sk#45, cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48] (30) Scan parquet default.catalog_returns -Output [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_returns] PushedFilters: [IsNotNull(cr_returned_date_sk), IsNotNull(cr_catalog_page_sk)] ReadSchema: struct (31) ColumnarToRow [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (32) Filter [codegen id : 8] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] -Condition : (isnotnull(cr_returned_date_sk#61) AND isnotnull(cr_catalog_page_sk#62)) +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] +Condition : (isnotnull(cr_returned_date_sk#55) AND isnotnull(cr_catalog_page_sk#56)) (33) Project [codegen id : 8] -Output [6]: [cr_catalog_page_sk#62 AS page_sk#65, cr_returned_date_sk#61 AS date_sk#66, 0.00 AS sales_price#67, 0.00 AS profit#68, cr_return_amount#63 AS return_amt#69, cr_net_loss#64 AS net_loss#70] -Input [4]: [cr_returned_date_sk#61, cr_catalog_page_sk#62, cr_return_amount#63, cr_net_loss#64] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#59, cr_returned_date_sk#55 AS date_sk#60, 0.00 AS sales_price#61, 0.00 AS profit#62, cr_return_amount#57 AS return_amt#63, cr_net_loss#58 AS net_loss#64] +Input [4]: [cr_returned_date_sk#55, cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58] (34) Union -Arguments: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76] (35) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (36) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [date_sk#72] -Right keys [1]: [d_date_sk#27] +Left keys [1]: [date_sk#50] +Right keys [1]: [d_date_sk#21] Join condition: None (37) Project [codegen id : 11] -Output [5]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76] -Input [7]: [page_sk#71, date_sk#72, sales_price#73, profit#74, return_amt#75, net_loss#76, d_date_sk#27] +Output [5]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54] +Input [7]: [page_sk#49, date_sk#50, sales_price#51, profit#52, return_amt#53, net_loss#54, d_date_sk#21] (38) Scan parquet default.catalog_page -Output [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] Batched: true Location [not included in comparison]/{warehouse_dir}/catalog_page] PushedFilters: [IsNotNull(cp_catalog_page_sk)] ReadSchema: struct (39) ColumnarToRow [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] (40) Filter [codegen id : 10] -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Condition : isnotnull(cp_catalog_page_sk#77) +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Condition : isnotnull(cp_catalog_page_sk#65) (41) BroadcastExchange -Input [2]: [cp_catalog_page_sk#77, cp_catalog_page_id#78] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#79] +Input [2]: [cp_catalog_page_sk#65, cp_catalog_page_id#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] (42) BroadcastHashJoin [codegen id : 11] -Left keys [1]: [page_sk#71] -Right keys [1]: [cp_catalog_page_sk#77] +Left keys [1]: [page_sk#49] +Right keys [1]: [cp_catalog_page_sk#65] Join condition: None (43) Project [codegen id : 11] -Output [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Input [7]: [page_sk#71, sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_sk#77, cp_catalog_page_id#78] +Output [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Input [7]: [page_sk#49, sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_sk#65, cp_catalog_page_id#66] (44) HashAggregate [codegen id : 11] -Input [5]: [sales_price#73, profit#74, return_amt#75, net_loss#76, cp_catalog_page_id#78] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [partial_sum(UnscaledValue(sales_price#73)), partial_sum(UnscaledValue(return_amt#75)), partial_sum(UnscaledValue(profit#74)), partial_sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum#80, sum#81, sum#82, sum#83] -Results [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] +Input [5]: [sales_price#51, profit#52, return_amt#53, net_loss#54, cp_catalog_page_id#66] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [partial_sum(UnscaledValue(sales_price#51)), partial_sum(UnscaledValue(return_amt#53)), partial_sum(UnscaledValue(profit#52)), partial_sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71] +Results [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] (45) Exchange -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Arguments: hashpartitioning(cp_catalog_page_id#78, 5), true, [id=#88] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Arguments: hashpartitioning(cp_catalog_page_id#66, 5), true, [id=#76] (46) HashAggregate [codegen id : 12] -Input [5]: [cp_catalog_page_id#78, sum#84, sum#85, sum#86, sum#87] -Keys [1]: [cp_catalog_page_id#78] -Functions [4]: [sum(UnscaledValue(sales_price#73)), sum(UnscaledValue(return_amt#75)), sum(UnscaledValue(profit#74)), sum(UnscaledValue(net_loss#76))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#73))#89, sum(UnscaledValue(return_amt#75))#90, sum(UnscaledValue(profit#74))#91, sum(UnscaledValue(net_loss#76))#92] -Results [5]: [catalog channel AS channel#93, concat(catalog_page, cp_catalog_page_id#78) AS id#94, MakeDecimal(sum(UnscaledValue(sales_price#73))#89,17,2) AS sales#95, MakeDecimal(sum(UnscaledValue(return_amt#75))#90,17,2) AS returns#96, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#74))#91,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#76))#92,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#97] +Input [5]: [cp_catalog_page_id#66, sum#72, sum#73, sum#74, sum#75] +Keys [1]: [cp_catalog_page_id#66] +Functions [4]: [sum(UnscaledValue(sales_price#51)), sum(UnscaledValue(return_amt#53)), sum(UnscaledValue(profit#52)), sum(UnscaledValue(net_loss#54))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#51))#77, sum(UnscaledValue(return_amt#53))#78, sum(UnscaledValue(profit#52))#79, sum(UnscaledValue(net_loss#54))#80] +Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#66) AS id#82, MakeDecimal(sum(UnscaledValue(sales_price#51))#77,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#53))#78,17,2) AS returns#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#52))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#54))#80,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85] (47) Scan parquet default.web_sales -Output [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_web_site_sk)] ReadSchema: struct (48) ColumnarToRow [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (49) Filter [codegen id : 13] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] -Condition : (isnotnull(cast(ws_sold_date_sk#98 as bigint)) AND isnotnull(ws_web_site_sk#99)) +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] +Condition : (isnotnull(cast(ws_sold_date_sk#86 as bigint)) AND isnotnull(ws_web_site_sk#87)) (50) Project [codegen id : 13] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#102, cast(ws_sold_date_sk#98 as bigint) AS date_sk#103, ws_ext_sales_price#100 AS sales_price#104, ws_net_profit#101 AS profit#105, 0.00 AS return_amt#106, 0.00 AS net_loss#107] -Input [4]: [ws_sold_date_sk#98, ws_web_site_sk#99, ws_ext_sales_price#100, ws_net_profit#101] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#90, cast(ws_sold_date_sk#86 as bigint) AS date_sk#91, ws_ext_sales_price#88 AS sales_price#92, ws_net_profit#89 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95] +Input [4]: [ws_sold_date_sk#86, ws_web_site_sk#87, ws_ext_sales_price#88, ws_net_profit#89] (51) Scan parquet default.web_returns -Output [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Output [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_returned_date_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] (53) Filter [codegen id : 15] -Input [5]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112] -Condition : isnotnull(wr_returned_date_sk#108) +Input [5]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100] +Condition : isnotnull(wr_returned_date_sk#96) (54) Scan parquet default.web_sales -Output [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Output [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] ReadSchema: struct (55) ColumnarToRow [codegen id : 14] -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] (56) Filter [codegen id : 14] -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] -Condition : ((isnotnull(ws_item_sk#113) AND isnotnull(ws_order_number#114)) AND isnotnull(ws_web_site_sk#99)) +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Condition : ((isnotnull(ws_item_sk#101) AND isnotnull(ws_order_number#102)) AND isnotnull(ws_web_site_sk#87)) (57) BroadcastExchange -Input [3]: [ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#115] +Input [3]: [ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint), cast(input[2, int, false] as bigint)),false), [id=#103] (58) BroadcastHashJoin [codegen id : 15] -Left keys [2]: [wr_item_sk#109, wr_order_number#110] -Right keys [2]: [cast(ws_item_sk#113 as bigint), cast(ws_order_number#114 as bigint)] +Left keys [2]: [wr_item_sk#97, wr_order_number#98] +Right keys [2]: [cast(ws_item_sk#101 as bigint), cast(ws_order_number#102 as bigint)] Join condition: None (59) Project [codegen id : 15] -Output [6]: [ws_web_site_sk#99 AS wsr_web_site_sk#116, wr_returned_date_sk#108 AS date_sk#117, 0.00 AS sales_price#118, 0.00 AS profit#119, wr_return_amt#111 AS return_amt#120, wr_net_loss#112 AS net_loss#121] -Input [8]: [wr_returned_date_sk#108, wr_item_sk#109, wr_order_number#110, wr_return_amt#111, wr_net_loss#112, ws_item_sk#113, ws_web_site_sk#99, ws_order_number#114] +Output [6]: [ws_web_site_sk#87 AS wsr_web_site_sk#104, wr_returned_date_sk#96 AS date_sk#105, 0.00 AS sales_price#106, 0.00 AS profit#107, wr_return_amt#99 AS return_amt#108, wr_net_loss#100 AS net_loss#109] +Input [8]: [wr_returned_date_sk#96, wr_item_sk#97, wr_order_number#98, wr_return_amt#99, wr_net_loss#100, ws_item_sk#101, ws_web_site_sk#87, ws_order_number#102] (60) Union -Arguments: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127] (61) ReusedExchange [Reuses operator id: 14] -Output [1]: [d_date_sk#27] +Output [1]: [d_date_sk#21] (62) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [date_sk#123] -Right keys [1]: [cast(d_date_sk#27 as bigint)] +Left keys [1]: [date_sk#91] +Right keys [1]: [cast(d_date_sk#21 as bigint)] Join condition: None (63) Project [codegen id : 18] -Output [5]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127] -Input [7]: [wsr_web_site_sk#122, date_sk#123, sales_price#124, profit#125, return_amt#126, net_loss#127, d_date_sk#27] +Output [5]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95] +Input [7]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, d_date_sk#21] (64) Scan parquet default.web_site -Output [2]: [web_site_sk#128, web_site_id#129] +Output [2]: [web_site_sk#110, web_site_id#111] Batched: true Location [not included in comparison]/{warehouse_dir}/web_site] PushedFilters: [IsNotNull(web_site_sk)] ReadSchema: struct (65) ColumnarToRow [codegen id : 17] -Input [2]: [web_site_sk#128, web_site_id#129] +Input [2]: [web_site_sk#110, web_site_id#111] (66) Filter [codegen id : 17] -Input [2]: [web_site_sk#128, web_site_id#129] -Condition : isnotnull(web_site_sk#128) +Input [2]: [web_site_sk#110, web_site_id#111] +Condition : isnotnull(web_site_sk#110) (67) BroadcastExchange -Input [2]: [web_site_sk#128, web_site_id#129] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#130] +Input [2]: [web_site_sk#110, web_site_id#111] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#112] (68) BroadcastHashJoin [codegen id : 18] -Left keys [1]: [wsr_web_site_sk#122] -Right keys [1]: [web_site_sk#128] +Left keys [1]: [wsr_web_site_sk#90] +Right keys [1]: [web_site_sk#110] Join condition: None (69) Project [codegen id : 18] -Output [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] -Input [7]: [wsr_web_site_sk#122, sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_sk#128, web_site_id#129] +Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] +Input [7]: [wsr_web_site_sk#90, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#110, web_site_id#111] (70) HashAggregate [codegen id : 18] -Input [5]: [sales_price#124, profit#125, return_amt#126, net_loss#127, web_site_id#129] -Keys [1]: [web_site_id#129] -Functions [4]: [partial_sum(UnscaledValue(sales_price#124)), partial_sum(UnscaledValue(return_amt#126)), partial_sum(UnscaledValue(profit#125)), partial_sum(UnscaledValue(net_loss#127))] -Aggregate Attributes [4]: [sum#131, sum#132, sum#133, sum#134] -Results [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] +Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#111] +Keys [1]: [web_site_id#111] +Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum#113, sum#114, sum#115, sum#116] +Results [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] (71) Exchange -Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] -Arguments: hashpartitioning(web_site_id#129, 5), true, [id=#139] +Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Arguments: hashpartitioning(web_site_id#111, 5), true, [id=#121] (72) HashAggregate [codegen id : 19] -Input [5]: [web_site_id#129, sum#135, sum#136, sum#137, sum#138] -Keys [1]: [web_site_id#129] -Functions [4]: [sum(UnscaledValue(sales_price#124)), sum(UnscaledValue(return_amt#126)), sum(UnscaledValue(profit#125)), sum(UnscaledValue(net_loss#127))] -Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#124))#140, sum(UnscaledValue(return_amt#126))#141, sum(UnscaledValue(profit#125))#142, sum(UnscaledValue(net_loss#127))#143] -Results [5]: [web channel AS channel#144, concat(web_site, web_site_id#129) AS id#145, MakeDecimal(sum(UnscaledValue(sales_price#124))#140,17,2) AS sales#146, MakeDecimal(sum(UnscaledValue(return_amt#126))#141,17,2) AS returns#147, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#125))#142,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#127))#143,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#148] +Input [5]: [web_site_id#111, sum#117, sum#118, sum#119, sum#120] +Keys [1]: [web_site_id#111] +Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#122, sum(UnscaledValue(return_amt#94))#123, sum(UnscaledValue(profit#93))#124, sum(UnscaledValue(net_loss#95))#125] +Results [5]: [web channel AS channel#126, concat(web_site, web_site_id#111) AS id#127, MakeDecimal(sum(UnscaledValue(sales_price#92))#122,17,2) AS sales#128, MakeDecimal(sum(UnscaledValue(return_amt#94))#123,17,2) AS returns#129, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#124,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#125,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#130] (73) Union -Arguments: [channel#149, id#150, sales#151, returns#152, profit#153] (74) HashAggregate [codegen id : 20] -Input [5]: [channel#149, id#150, sales#151, returns#152, profit#153] -Keys [2]: [channel#149, id#150] -Functions [3]: [partial_sum(sales#151), partial_sum(returns#152), partial_sum(profit#153)] -Aggregate Attributes [6]: [sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] -Results [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] +Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] +Keys [2]: [channel#40, id#41] +Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] +Aggregate Attributes [6]: [sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Results [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] (75) Exchange -Input [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] -Arguments: hashpartitioning(channel#149, id#150, 5), true, [id=#166] +Input [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] +Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#143] (76) HashAggregate [codegen id : 21] -Input [8]: [channel#149, id#150, sum#160, isEmpty#161, sum#162, isEmpty#163, sum#164, isEmpty#165] -Keys [2]: [channel#149, id#150] -Functions [3]: [sum(sales#151), sum(returns#152), sum(profit#153)] -Aggregate Attributes [3]: [sum(sales#151)#167, sum(returns#152)#168, sum(profit#153)#169] -Results [5]: [channel#149, id#150, cast(sum(sales#151)#167 as decimal(37,2)) AS sales#170, cast(sum(returns#152)#168 as decimal(37,2)) AS returns#171, cast(sum(profit#153)#169 as decimal(38,2)) AS profit#172] +Input [8]: [channel#40, id#41, sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#144, sum(returns#43)#145, sum(profit#44)#146] +Results [5]: [channel#40, id#41, cast(sum(sales#42)#144 as decimal(37,2)) AS sales#147, cast(sum(returns#43)#145 as decimal(37,2)) AS returns#148, cast(sum(profit#44)#146 as decimal(38,2)) AS profit#149] (77) ReusedExchange [Reuses operator id: 75] -Output [8]: [channel#173, id#174, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] +Output [8]: [channel#40, id#41, sum#150, isEmpty#151, sum#152, isEmpty#153, sum#154, isEmpty#155] (78) HashAggregate [codegen id : 42] -Input [8]: [channel#173, id#174, sum#175, isEmpty#176, sum#177, isEmpty#178, sum#179, isEmpty#180] -Keys [2]: [channel#173, id#174] -Functions [3]: [sum(sales#181), sum(returns#182), sum(profit#183)] -Aggregate Attributes [3]: [sum(sales#181)#184, sum(returns#182)#185, sum(profit#183)#186] -Results [4]: [channel#173, sum(sales#181)#184 AS sales#187, sum(returns#182)#185 AS returns#188, sum(profit#183)#186 AS profit#189] +Input [8]: [channel#40, id#41, sum#150, isEmpty#151, sum#152, isEmpty#153, sum#154, isEmpty#155] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#156)] +Aggregate Attributes [3]: [sum(sales#42)#157, sum(returns#43)#158, sum(profit#156)#159] +Results [4]: [channel#40, sum(sales#42)#157 AS sales#160, sum(returns#43)#158 AS returns#161, sum(profit#156)#159 AS profit#162] (79) HashAggregate [codegen id : 42] -Input [4]: [channel#173, sales#187, returns#188, profit#189] -Keys [1]: [channel#173] -Functions [3]: [partial_sum(sales#187), partial_sum(returns#188), partial_sum(profit#189)] -Aggregate Attributes [6]: [sum#190, isEmpty#191, sum#192, isEmpty#193, sum#194, isEmpty#195] -Results [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Input [4]: [channel#40, sales#160, returns#161, profit#162] +Keys [1]: [channel#40] +Functions [3]: [partial_sum(sales#160), partial_sum(returns#161), partial_sum(profit#162)] +Aggregate Attributes [6]: [sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168] +Results [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] (80) Exchange -Input [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] -Arguments: hashpartitioning(channel#173, 5), true, [id=#202] +Input [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] +Arguments: hashpartitioning(channel#40, 5), true, [id=#175] (81) HashAggregate [codegen id : 43] -Input [7]: [channel#173, sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] -Keys [1]: [channel#173] -Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] -Aggregate Attributes [3]: [sum(sales#187)#203, sum(returns#188)#204, sum(profit#189)#205] -Results [5]: [channel#173, null AS id#206, sum(sales#187)#203 AS sum(sales)#207, sum(returns#188)#204 AS sum(returns)#208, sum(profit#189)#205 AS sum(profit)#209] +Input [7]: [channel#40, sum#169, isEmpty#170, sum#171, isEmpty#172, sum#173, isEmpty#174] +Keys [1]: [channel#40] +Functions [3]: [sum(sales#160), sum(returns#161), sum(profit#162)] +Aggregate Attributes [3]: [sum(sales#160)#176, sum(returns#161)#177, sum(profit#162)#178] +Results [5]: [channel#40, null AS id#179, sum(sales#160)#176 AS sum(sales)#180, sum(returns#161)#177 AS sum(returns)#181, sum(profit#162)#178 AS sum(profit)#182] (82) Union -Arguments: [channel#210, id#211, sales#212, returns#213, profit#214] (83) HashAggregate [codegen id : 44] -Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] -Keys [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] (84) Exchange -Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] -Arguments: hashpartitioning(channel#210, id#211, sales#212, returns#213, profit#214, 5), true, [id=#215] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Arguments: hashpartitioning(channel#40, id#41, sales#147, returns#148, profit#149, 5), true, [id=#183] (85) HashAggregate [codegen id : 45] -Input [5]: [channel#210, id#211, sales#212, returns#213, profit#214] -Keys [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#210, id#211, sales#212, returns#213, profit#214] +Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] (86) ReusedExchange [Reuses operator id: 75] -Output [8]: [channel#216, id#217, sum#218, isEmpty#219, sum#220, isEmpty#221, sum#222, isEmpty#223] +Output [8]: [channel#40, id#41, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] (87) HashAggregate [codegen id : 66] -Input [8]: [channel#216, id#217, sum#218, isEmpty#219, sum#220, isEmpty#221, sum#222, isEmpty#223] -Keys [2]: [channel#216, id#217] -Functions [3]: [sum(sales#224), sum(returns#225), sum(profit#226)] -Aggregate Attributes [3]: [sum(sales#224)#227, sum(returns#225)#228, sum(profit#226)#229] -Results [3]: [sum(sales#224)#227 AS sales#187, sum(returns#225)#228 AS returns#188, sum(profit#226)#229 AS profit#189] +Input [8]: [channel#40, id#41, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#190)] +Aggregate Attributes [3]: [sum(sales#42)#191, sum(returns#43)#192, sum(profit#190)#193] +Results [3]: [sum(sales#42)#191 AS sales#160, sum(returns#43)#192 AS returns#161, sum(profit#190)#193 AS profit#162] (88) HashAggregate [codegen id : 66] -Input [3]: [sales#187, returns#188, profit#189] +Input [3]: [sales#160, returns#161, profit#162] Keys: [] -Functions [3]: [partial_sum(sales#187), partial_sum(returns#188), partial_sum(profit#189)] -Aggregate Attributes [6]: [sum#230, isEmpty#231, sum#232, isEmpty#233, sum#234, isEmpty#235] -Results [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] +Functions [3]: [partial_sum(sales#160), partial_sum(returns#161), partial_sum(profit#162)] +Aggregate Attributes [6]: [sum#194, isEmpty#195, sum#196, isEmpty#197, sum#198, isEmpty#199] +Results [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] (89) Exchange -Input [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] -Arguments: SinglePartition, true, [id=#242] +Input [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] +Arguments: SinglePartition, true, [id=#206] (90) HashAggregate [codegen id : 67] -Input [6]: [sum#236, isEmpty#237, sum#238, isEmpty#239, sum#240, isEmpty#241] +Input [6]: [sum#200, isEmpty#201, sum#202, isEmpty#203, sum#204, isEmpty#205] Keys: [] -Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] -Aggregate Attributes [3]: [sum(sales#187)#243, sum(returns#188)#244, sum(profit#189)#245] -Results [5]: [null AS channel#246, null AS id#247, sum(sales#187)#243 AS sum(sales)#248, sum(returns#188)#244 AS sum(returns)#249, sum(profit#189)#245 AS sum(profit)#250] +Functions [3]: [sum(sales#160), sum(returns#161), sum(profit#162)] +Aggregate Attributes [3]: [sum(sales#160)#207, sum(returns#161)#208, sum(profit#162)#209] +Results [5]: [null AS channel#210, null AS id#211, sum(sales#160)#207 AS sum(sales)#212, sum(returns#161)#208 AS sum(returns)#213, sum(profit#162)#209 AS sum(profit)#214] (91) Union -Arguments: [channel#251, id#252, sales#253, returns#254, profit#255] (92) HashAggregate [codegen id : 68] -Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] -Keys [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] (93) Exchange -Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] -Arguments: hashpartitioning(channel#251, id#252, sales#253, returns#254, profit#255, 5), true, [id=#256] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Arguments: hashpartitioning(channel#40, id#41, sales#147, returns#148, profit#149, 5), true, [id=#215] (94) HashAggregate [codegen id : 69] -Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] -Keys [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Keys [5]: [channel#40, id#41, sales#147, returns#148, profit#149] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#251, id#252, sales#253, returns#254, profit#255] +Results [5]: [channel#40, id#41, sales#147, returns#148, profit#149] (95) TakeOrderedAndProject -Input [5]: [channel#251, id#252, sales#253, returns#254, profit#255] -Arguments: 100, [channel#251 ASC NULLS FIRST, id#252 ASC NULLS FIRST], [channel#251, id#252, sales#253, returns#254, profit#255] +Input [5]: [channel#40, id#41, sales#147, returns#148, profit#149] +Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#147, returns#148, profit#149] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt index 12be2a8321f1f..6bb223e2f4488 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (68) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (45) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (44) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (21) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (20) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (6) HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] InputAdapter @@ -34,7 +34,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [store_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [store_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (1) Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] Filter [ss_sold_date_sk,ss_store_sk] @@ -73,7 +73,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [page_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [page_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (7) Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] Filter [cs_sold_date_sk,cs_catalog_page_sk] @@ -106,7 +106,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] BroadcastHashJoin [date_sk,d_date_sk] InputAdapter - Union [wsr_web_site_sk,date_sk,sales_price,profit,return_amt,net_loss] + Union WholeStageCodegen (13) Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] Filter [ws_sold_date_sk,ws_web_site_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt index 3437a41143c3e..3d0d49fff876a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt @@ -429,25 +429,24 @@ Aggregate Attributes [1]: [sum(sumsales#32)#136] Results [9]: [null AS i_category#137, null AS i_class#138, null AS i_brand#139, null AS i_product_name#140, null AS d_year#141, null AS d_qoy#142, null AS d_moy#143, null AS s_store_id#144, sum(sumsales#32)#136 AS sumsales#145] (69) Union -Arguments: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] (70) Exchange -Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] -Arguments: hashpartitioning(i_category#146, 5), true, [id=#155] +Input [9]: [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, sumsales#28] +Arguments: hashpartitioning(i_category#19, 5), true, [id=#146] (71) Sort [codegen id : 81] -Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] -Arguments: [i_category#146 ASC NULLS FIRST, sumsales#154 DESC NULLS LAST], false, 0 +Input [9]: [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, sumsales#28] +Arguments: [i_category#19 ASC NULLS FIRST, sumsales#28 DESC NULLS LAST], false, 0 (72) Window -Input [9]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154] -Arguments: [rank(sumsales#154) windowspecdefinition(i_category#146, sumsales#154 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#156], [i_category#146], [sumsales#154 DESC NULLS LAST] +Input [9]: [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, sumsales#28] +Arguments: [rank(sumsales#28) windowspecdefinition(i_category#19, sumsales#28 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#147], [i_category#19], [sumsales#28 DESC NULLS LAST] (73) Filter [codegen id : 82] -Input [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] -Condition : (isnotnull(rk#156) AND (rk#156 <= 100)) +Input [10]: [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, sumsales#28, rk#147] +Condition : (isnotnull(rk#147) AND (rk#147 <= 100)) (74) TakeOrderedAndProject -Input [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] -Arguments: 100, [i_category#146 ASC NULLS FIRST, i_class#147 ASC NULLS FIRST, i_brand#148 ASC NULLS FIRST, i_product_name#149 ASC NULLS FIRST, d_year#150 ASC NULLS FIRST, d_qoy#151 ASC NULLS FIRST, d_moy#152 ASC NULLS FIRST, s_store_id#153 ASC NULLS FIRST, sumsales#154 ASC NULLS FIRST, rk#156 ASC NULLS FIRST], [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sumsales#154, rk#156] +Input [10]: [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, sumsales#28, rk#147] +Arguments: 100, [i_category#19 ASC NULLS FIRST, i_class#18 ASC NULLS FIRST, i_brand#17 ASC NULLS FIRST, i_product_name#20 ASC NULLS FIRST, d_year#8 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, d_moy#9 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, sumsales#28 ASC NULLS FIRST, rk#147 ASC NULLS FIRST], [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, sumsales#28, rk#147] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt index 0944d22b3b200..277f3a8edd022 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ Sort [i_category,sumsales] InputAdapter Exchange [i_category] #1 - Union [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales] + Union WholeStageCodegen (8) HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt index 3b61e47d69e27..38a768bd3dec0 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt @@ -414,25 +414,24 @@ Aggregate Attributes [1]: [sum(sumsales#31)#135] Results [9]: [null AS i_category#136, null AS i_class#137, null AS i_brand#138, null AS i_product_name#139, null AS d_year#140, null AS d_qoy#141, null AS d_moy#142, null AS s_store_id#143, sum(sumsales#31)#135 AS sumsales#144] (66) Union -Arguments: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] (67) Exchange -Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] -Arguments: hashpartitioning(i_category#145, 5), true, [id=#154] +Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] +Arguments: hashpartitioning(i_category#18, 5), true, [id=#145] (68) Sort [codegen id : 54] -Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] -Arguments: [i_category#145 ASC NULLS FIRST, sumsales#153 DESC NULLS LAST], false, 0 +Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] +Arguments: [i_category#18 ASC NULLS FIRST, sumsales#27 DESC NULLS LAST], false, 0 (69) Window -Input [9]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153] -Arguments: [rank(sumsales#153) windowspecdefinition(i_category#145, sumsales#153 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#155], [i_category#145], [sumsales#153 DESC NULLS LAST] +Input [9]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27] +Arguments: [rank(sumsales#27) windowspecdefinition(i_category#18, sumsales#27 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#146], [i_category#18], [sumsales#27 DESC NULLS LAST] (70) Filter [codegen id : 55] -Input [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] -Condition : (isnotnull(rk#155) AND (rk#155 <= 100)) +Input [10]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] +Condition : (isnotnull(rk#146) AND (rk#146 <= 100)) (71) TakeOrderedAndProject -Input [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] -Arguments: 100, [i_category#145 ASC NULLS FIRST, i_class#146 ASC NULLS FIRST, i_brand#147 ASC NULLS FIRST, i_product_name#148 ASC NULLS FIRST, d_year#149 ASC NULLS FIRST, d_qoy#150 ASC NULLS FIRST, d_moy#151 ASC NULLS FIRST, s_store_id#152 ASC NULLS FIRST, sumsales#153 ASC NULLS FIRST, rk#155 ASC NULLS FIRST], [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sumsales#153, rk#155] +Input [10]: [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] +Arguments: 100, [i_category#18 ASC NULLS FIRST, i_class#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, i_product_name#19 ASC NULLS FIRST, d_year#8 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, d_moy#9 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, sumsales#27 ASC NULLS FIRST, rk#146 ASC NULLS FIRST], [i_category#18, i_class#17, i_brand#16, i_product_name#19, d_year#8, d_qoy#10, d_moy#9, s_store_id#13, sumsales#27, rk#146] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt index 7804a43808ab6..3581b5b7b436c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt @@ -7,7 +7,7 @@ TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_ Sort [i_category,sumsales] InputAdapter Exchange [i_category] #1 - Union [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales] + Union WholeStageCodegen (5) HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt index 6a963a354ee3c..628ca0ad4711c 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt @@ -284,92 +284,90 @@ Aggregate Attributes [1]: [sum(total_sum#31)#37] Results [6]: [sum(total_sum#31)#37 AS total_sum#38, s_state#9, null AS s_county#39, 0 AS g_state#40, 1 AS g_county#41, 1 AS lochierarchy#42] (47) Union -Arguments: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (48) HashAggregate [codegen id : 22] -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (49) Exchange -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Arguments: hashpartitioning(total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48, 5), true, [id=#49] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#43] (50) HashAggregate [codegen id : 23] -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (51) ReusedExchange [Reuses operator id: 40] -Output [3]: [s_state#9, s_county#8, sum#50] +Output [3]: [s_state#9, s_county#8, sum#44] (52) HashAggregate [codegen id : 33] -Input [3]: [s_state#9, s_county#8, sum#50] +Input [3]: [s_state#9, s_county#8, sum#44] Keys [2]: [s_state#9, s_county#8] Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#51] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#51,17,2) AS total_sum#31] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#45] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#45,17,2) AS total_sum#31] (53) HashAggregate [codegen id : 33] Input [1]: [total_sum#31] Keys: [] Functions [1]: [partial_sum(total_sum#31)] -Aggregate Attributes [2]: [sum#52, isEmpty#53] -Results [2]: [sum#54, isEmpty#55] +Aggregate Attributes [2]: [sum#46, isEmpty#47] +Results [2]: [sum#48, isEmpty#49] (54) Exchange -Input [2]: [sum#54, isEmpty#55] -Arguments: SinglePartition, true, [id=#56] +Input [2]: [sum#48, isEmpty#49] +Arguments: SinglePartition, true, [id=#50] (55) HashAggregate [codegen id : 34] -Input [2]: [sum#54, isEmpty#55] +Input [2]: [sum#48, isEmpty#49] Keys: [] Functions [1]: [sum(total_sum#31)] -Aggregate Attributes [1]: [sum(total_sum#31)#57] -Results [6]: [sum(total_sum#31)#57 AS total_sum#58, null AS s_state#59, null AS s_county#60, 1 AS g_state#61, 1 AS g_county#62, 2 AS lochierarchy#63] +Aggregate Attributes [1]: [sum(total_sum#31)#51] +Results [6]: [sum(total_sum#31)#51 AS total_sum#52, null AS s_state#53, null AS s_county#54, 1 AS g_state#55, 1 AS g_county#56, 2 AS lochierarchy#57] (56) Union -Arguments: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (57) HashAggregate [codegen id : 35] -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (58) Exchange -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Arguments: hashpartitioning(total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69, 5), true, [id=#70] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#58] (59) HashAggregate [codegen id : 36] -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, CASE WHEN (g_county#68 = 0) THEN s_state#65 END AS _w0#71] +Results [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, CASE WHEN (g_county#27 = 0) THEN s_state#9 END AS _w0#59] (60) Exchange -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: hashpartitioning(lochierarchy#69, _w0#71, 5), true, [id=#72] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: hashpartitioning(lochierarchy#28, _w0#59, 5), true, [id=#60] (61) Sort [codegen id : 37] -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: [lochierarchy#69 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#64 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: [lochierarchy#28 ASC NULLS FIRST, _w0#59 ASC NULLS FIRST, total_sum#25 DESC NULLS LAST], false, 0 (62) Window -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: [rank(total_sum#64) windowspecdefinition(lochierarchy#69, _w0#71, total_sum#64 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#69, _w0#71], [total_sum#64 DESC NULLS LAST] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: [rank(total_sum#25) windowspecdefinition(lochierarchy#28, _w0#59, total_sum#25 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#61], [lochierarchy#28, _w0#59], [total_sum#25 DESC NULLS LAST] (63) Project [codegen id : 38] -Output [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] -Input [6]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71, rank_within_parent#73] +Output [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Input [6]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59, rank_within_parent#61] (64) TakeOrderedAndProject -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] -Arguments: 100, [lochierarchy#69 DESC NULLS LAST, CASE WHEN (lochierarchy#69 = 0) THEN s_state#65 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN s_state#9 END ASC NULLS FIRST, rank_within_parent#61 ASC NULLS FIRST], [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt index a6f021f3acb45..b3dbc1612539a 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (35) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + Union WholeStageCodegen (23) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (22) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + Union WholeStageCodegen (10) HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt index 36e80e405d3a3..705d1b3f91342 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt @@ -284,92 +284,90 @@ Aggregate Attributes [1]: [sum(total_sum#31)#37] Results [6]: [sum(total_sum#31)#37 AS total_sum#38, s_state#9, null AS s_county#39, 0 AS g_state#40, 1 AS g_county#41, 1 AS lochierarchy#42] (47) Union -Arguments: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] (48) HashAggregate [codegen id : 22] -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (49) Exchange -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Arguments: hashpartitioning(total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48, 5), true, [id=#49] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#43] (50) HashAggregate [codegen id : 23] -Input [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] -Keys [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#43, s_state#44, s_county#45, g_state#46, g_county#47, lochierarchy#48] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (51) ReusedExchange [Reuses operator id: 40] -Output [3]: [s_state#9, s_county#8, sum#50] +Output [3]: [s_state#9, s_county#8, sum#44] (52) HashAggregate [codegen id : 33] -Input [3]: [s_state#9, s_county#8, sum#50] +Input [3]: [s_state#9, s_county#8, sum#44] Keys [2]: [s_state#9, s_county#8] Functions [1]: [sum(UnscaledValue(ss_net_profit#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#51] -Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#51,17,2) AS total_sum#31] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#3))#45] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#45,17,2) AS total_sum#31] (53) HashAggregate [codegen id : 33] Input [1]: [total_sum#31] Keys: [] Functions [1]: [partial_sum(total_sum#31)] -Aggregate Attributes [2]: [sum#52, isEmpty#53] -Results [2]: [sum#54, isEmpty#55] +Aggregate Attributes [2]: [sum#46, isEmpty#47] +Results [2]: [sum#48, isEmpty#49] (54) Exchange -Input [2]: [sum#54, isEmpty#55] -Arguments: SinglePartition, true, [id=#56] +Input [2]: [sum#48, isEmpty#49] +Arguments: SinglePartition, true, [id=#50] (55) HashAggregate [codegen id : 34] -Input [2]: [sum#54, isEmpty#55] +Input [2]: [sum#48, isEmpty#49] Keys: [] Functions [1]: [sum(total_sum#31)] -Aggregate Attributes [1]: [sum(total_sum#31)#57] -Results [6]: [sum(total_sum#31)#57 AS total_sum#58, null AS s_state#59, null AS s_county#60, 1 AS g_state#61, 1 AS g_county#62, 2 AS lochierarchy#63] +Aggregate Attributes [1]: [sum(total_sum#31)#51] +Results [6]: [sum(total_sum#31)#51 AS total_sum#52, null AS s_state#53, null AS s_county#54, 1 AS g_state#55, 1 AS g_county#56, 2 AS lochierarchy#57] (56) Union -Arguments: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] (57) HashAggregate [codegen id : 35] -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Results [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] (58) Exchange -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Arguments: hashpartitioning(total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69, 5), true, [id=#70] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Arguments: hashpartitioning(total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28, 5), true, [id=#58] (59) HashAggregate [codegen id : 36] -Input [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] -Keys [6]: [total_sum#64, s_state#65, s_county#66, g_state#67, g_county#68, lochierarchy#69] +Input [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] +Keys [6]: [total_sum#25, s_state#9, s_county#8, g_state#26, g_county#27, lochierarchy#28] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, CASE WHEN (g_county#68 = 0) THEN s_state#65 END AS _w0#71] +Results [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, CASE WHEN (g_county#27 = 0) THEN s_state#9 END AS _w0#59] (60) Exchange -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: hashpartitioning(lochierarchy#69, _w0#71, 5), true, [id=#72] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: hashpartitioning(lochierarchy#28, _w0#59, 5), true, [id=#60] (61) Sort [codegen id : 37] -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: [lochierarchy#69 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#64 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: [lochierarchy#28 ASC NULLS FIRST, _w0#59 ASC NULLS FIRST, total_sum#25 DESC NULLS LAST], false, 0 (62) Window -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71] -Arguments: [rank(total_sum#64) windowspecdefinition(lochierarchy#69, _w0#71, total_sum#64 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#69, _w0#71], [total_sum#64 DESC NULLS LAST] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59] +Arguments: [rank(total_sum#25) windowspecdefinition(lochierarchy#28, _w0#59, total_sum#25 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#61], [lochierarchy#28, _w0#59], [total_sum#25 DESC NULLS LAST] (63) Project [codegen id : 38] -Output [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] -Input [6]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, _w0#71, rank_within_parent#73] +Output [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Input [6]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, _w0#59, rank_within_parent#61] (64) TakeOrderedAndProject -Input [5]: [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] -Arguments: 100, [lochierarchy#69 DESC NULLS LAST, CASE WHEN (lochierarchy#69 = 0) THEN s_state#65 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#64, s_state#65, s_county#66, lochierarchy#69, rank_within_parent#73] +Input [5]: [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] +Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN s_state#9 END ASC NULLS FIRST, rank_within_parent#61 ASC NULLS FIRST], [total_sum#25, s_state#9, s_county#8, lochierarchy#28, rank_within_parent#61] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt index 371b63dd4368a..bd0bd7e87251f 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (35) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + Union WholeStageCodegen (23) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_count WholeStageCodegen (22) HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] InputAdapter - Union [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + Union WholeStageCodegen (10) HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] InputAdapter 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 1b9373773d3b8..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 @@ -1,91 +1,90 @@ == Physical Plan == -TakeOrderedAndProject (87) -+- * Project (86) - +- * SortMergeJoin Inner (85) - :- * Project (67) - : +- * SortMergeJoin Inner (66) - : :- * SortMergeJoin Inner (46) - : : :- * Sort (25) - : : : +- Exchange (24) - : : : +- * Project (23) - : : : +- * Filter (22) - : : : +- * 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 (12) - : : +- * Sort (45) - : : +- Exchange (44) - : : +- * HashAggregate (43) - : : +- Exchange (42) - : : +- * HashAggregate (41) - : : +- * Project (40) - : : +- * SortMergeJoin Inner (39) - : : :- * Sort (36) - : : : +- Exchange (35) - : : : +- * Project (34) - : : : +- * BroadcastHashJoin Inner BuildRight (33) - : : : :- * Filter (28) - : : : : +- * ColumnarToRow (27) - : : : : +- Scan parquet default.store_sales (26) - : : : +- BroadcastExchange (32) - : : : +- * Filter (31) - : : : +- * ColumnarToRow (30) - : : : +- Scan parquet default.date_dim (29) - : : +- * Sort (38) - : : +- ReusedExchange (37) - : +- * Sort (65) - : +- Exchange (64) - : +- * Project (63) - : +- * Filter (62) - : +- * HashAggregate (61) - : +- Exchange (60) - : +- * HashAggregate (59) - : +- * Project (58) - : +- * SortMergeJoin Inner (57) - : :- * Sort (54) - : : +- Exchange (53) - : : +- * Project (52) - : : +- * BroadcastHashJoin Inner BuildRight (51) - : : :- * Filter (49) - : : : +- * ColumnarToRow (48) - : : : +- Scan parquet default.web_sales (47) - : : +- ReusedExchange (50) - : +- * Sort (56) - : +- ReusedExchange (55) - +- * Sort (84) - +- Exchange (83) - +- * HashAggregate (82) - +- Exchange (81) - +- * HashAggregate (80) - +- * Project (79) - +- * SortMergeJoin Inner (78) - :- * Sort (75) - : +- Exchange (74) - : +- * Project (73) - : +- * BroadcastHashJoin Inner BuildRight (72) - : :- * Filter (70) - : : +- * ColumnarToRow (69) - : : +- Scan parquet default.web_sales (68) - : +- ReusedExchange (71) - +- * Sort (77) - +- ReusedExchange (76) +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * 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 (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * 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) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) (1) Scan parquet default.store_sales @@ -190,293 +189,289 @@ Results [2]: [c_customer_id#9 AS customer_id#17, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#17, year_total#18] Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) -(23) Project [codegen id : 7] -Output [2]: [customer_id#17 AS customer_id#19, year_total#18 AS year_total#20] +(23) Exchange Input [2]: [customer_id#17, year_total#18] +Arguments: hashpartitioning(customer_id#17, 5), true, [id=#19] -(24) Exchange -Input [2]: [customer_id#19, year_total#20] -Arguments: hashpartitioning(customer_id#19, 5), true, [id=#21] - -(25) Sort [codegen id : 8] -Input [2]: [customer_id#19, year_total#20] -Arguments: [customer_id#19 ASC NULLS FIRST], false, 0 +(24) Sort [codegen id : 8] +Input [2]: [customer_id#17, year_total#18] +Arguments: [customer_id#17 ASC NULLS FIRST], false, 0 -(26) Scan parquet default.store_sales +(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 -(27) ColumnarToRow [codegen id : 10] +(26) ColumnarToRow [codegen id : 10] Input [3]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_net_paid#3] -(28) Filter [codegen id : 10] +(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)) -(29) Scan parquet default.date_dim +(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 -(30) ColumnarToRow [codegen id : 9] +(29) ColumnarToRow [codegen id : 9] Input [2]: [d_date_sk#4, d_year#5] -(31) Filter [codegen id : 9] +(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)) -(32) BroadcastExchange +(31) BroadcastExchange Input [2]: [d_date_sk#4, d_year#5] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] -(33) BroadcastHashJoin [codegen id : 10] +(32) BroadcastHashJoin [codegen id : 10] Left keys [1]: [ss_sold_date_sk#1] Right keys [1]: [d_date_sk#4] Join condition: None -(34) Project [codegen id : 10] +(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] -(35) Exchange +(34) Exchange Input [3]: [ss_customer_sk#2, ss_net_paid#3, d_year#5] -Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#23] +Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#21] -(36) Sort [codegen id : 11] +(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 -(37) ReusedExchange [Reuses operator id: 15] +(36) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(38) Sort [codegen id : 13] +(37) Sort [codegen id : 13] 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 -(39) SortMergeJoin [codegen id : 14] +(38) SortMergeJoin [codegen id : 14] Left keys [1]: [ss_customer_sk#2] Right keys [1]: [c_customer_sk#8] Join condition: None -(40) Project [codegen id : 14] +(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] -(41) HashAggregate [codegen id : 14] +(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))] -Aggregate Attributes [1]: [sum#24] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +Aggregate Attributes [1]: [sum#22] +Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#23] -(42) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#26] +(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] -(43) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#25] +(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))#27] -Results [4]: [c_customer_id#9 AS customer_id#28, c_first_name#10 AS customer_first_name#29, c_last_name#11 AS customer_last_name#30, MakeDecimal(sum(UnscaledValue(ss_net_paid#3))#27,17,2) AS year_total#31] +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] -(44) Exchange -Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] -Arguments: hashpartitioning(customer_id#28, 5), true, [id=#32] +(43) Exchange +Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] +Arguments: hashpartitioning(customer_id#26, 5), true, [id=#30] -(45) Sort [codegen id : 16] -Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31] -Arguments: [customer_id#28 ASC NULLS FIRST], false, 0 +(44) Sort [codegen id : 16] +Input [4]: [customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29] +Arguments: [customer_id#26 ASC NULLS FIRST], false, 0 -(46) SortMergeJoin [codegen id : 17] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#28] +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#26] Join condition: None -(47) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(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 [codegen id : 19] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(47) ColumnarToRow [codegen id : 19] +Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(49) Filter [codegen id : 19] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) +(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)) -(50) ReusedExchange [Reuses operator id: 7] +(49) ReusedExchange [Reuses operator id: 7] Output [2]: [d_date_sk#4, d_year#5] -(51) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#33] +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#31] Right keys [1]: [d_date_sk#4] Join condition: None -(52) Project [codegen id : 19] -Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] +(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] -(53) Exchange -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#36] +(52) Exchange +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] -(54) Sort [codegen id : 20] -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 +(53) Sort [codegen id : 20] +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 -(55) ReusedExchange [Reuses operator id: 15] +(54) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(56) Sort [codegen id : 22] +(55) Sort [codegen id : 22] 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 -(57) SortMergeJoin [codegen id : 23] -Left keys [1]: [ws_bill_customer_sk#34] +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#32] Right keys [1]: [c_customer_sk#8] Join condition: None -(58) Project [codegen id : 23] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] -Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +(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] -(59) HashAggregate [codegen id : 23] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +(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] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum#37] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +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] -(60) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#39] +(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] -(61) HashAggregate [codegen id : 24] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#38] +(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] -Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#40] -Results [2]: [c_customer_id#9 AS customer_id#41, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#40,17,2) AS year_total#42] +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] -(62) Filter [codegen id : 24] -Input [2]: [customer_id#41, year_total#42] -Condition : (isnotnull(year_total#42) AND (year_total#42 > 0.00)) +(61) Filter [codegen id : 24] +Input [2]: [customer_id#39, year_total#40] +Condition : (isnotnull(year_total#40) AND (year_total#40 > 0.00)) -(63) Project [codegen id : 24] -Output [2]: [customer_id#41 AS customer_id#43, year_total#42 AS year_total#44] -Input [2]: [customer_id#41, year_total#42] +(62) Project [codegen id : 24] +Output [2]: [customer_id#39 AS customer_id#41, year_total#40 AS year_total#42] +Input [2]: [customer_id#39, year_total#40] -(64) Exchange -Input [2]: [customer_id#43, year_total#44] -Arguments: hashpartitioning(customer_id#43, 5), true, [id=#45] +(63) Exchange +Input [2]: [customer_id#41, year_total#42] +Arguments: hashpartitioning(customer_id#41, 5), true, [id=#43] -(65) Sort [codegen id : 25] -Input [2]: [customer_id#43, year_total#44] -Arguments: [customer_id#43 ASC NULLS FIRST], false, 0 +(64) Sort [codegen id : 25] +Input [2]: [customer_id#41, year_total#42] +Arguments: [customer_id#41 ASC NULLS FIRST], false, 0 -(66) SortMergeJoin [codegen id : 26] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#43] +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#41] Join condition: None -(67) Project [codegen id : 26] -Output [7]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44] -Input [8]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, customer_id#43, year_total#44] +(66) Project [codegen id : 26] +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] -(68) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(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 [codegen id : 28] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] +(68) ColumnarToRow [codegen id : 28] +Input [3]: [ws_sold_date_sk#31, ws_bill_customer_sk#32, ws_net_paid#33] -(70) Filter [codegen id : 28] -Input [3]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35] -Condition : (isnotnull(ws_bill_customer_sk#34) AND isnotnull(ws_sold_date_sk#33)) +(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)) -(71) ReusedExchange [Reuses operator id: 32] +(70) ReusedExchange [Reuses operator id: 31] Output [2]: [d_date_sk#4, d_year#5] -(72) BroadcastHashJoin [codegen id : 28] -Left keys [1]: [ws_sold_date_sk#33] +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#31] Right keys [1]: [d_date_sk#4] Join condition: None -(73) Project [codegen id : 28] -Output [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Input [5]: [ws_sold_date_sk#33, ws_bill_customer_sk#34, ws_net_paid#35, d_date_sk#4, d_year#5] +(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] -(74) Exchange -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: hashpartitioning(ws_bill_customer_sk#34, 5), true, [id=#46] +(73) Exchange +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] -(75) Sort [codegen id : 29] -Input [3]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5] -Arguments: [ws_bill_customer_sk#34 ASC NULLS FIRST], false, 0 +(74) Sort [codegen id : 29] +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 -(76) ReusedExchange [Reuses operator id: 15] +(75) ReusedExchange [Reuses operator id: 15] Output [4]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] -(77) Sort [codegen id : 31] +(76) Sort [codegen id : 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 -(78) SortMergeJoin [codegen id : 32] -Left keys [1]: [ws_bill_customer_sk#34] +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#32] Right keys [1]: [c_customer_sk#8] Join condition: None -(79) Project [codegen id : 32] -Output [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] -Input [7]: [ws_bill_customer_sk#34, ws_net_paid#35, d_year#5, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11] +(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] -(80) HashAggregate [codegen id : 32] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, ws_net_paid#35, d_year#5] +(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] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum#47] -Results [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +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] -(81) Exchange -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] -Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, 5), true, [id=#49] +(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] -(82) HashAggregate [codegen id : 33] -Input [5]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#5, sum#48] +(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] -Functions [1]: [sum(UnscaledValue(ws_net_paid#35))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#35))#50] -Results [2]: [c_customer_id#9 AS customer_id#51, MakeDecimal(sum(UnscaledValue(ws_net_paid#35))#50,17,2) AS year_total#52] - -(83) Exchange -Input [2]: [customer_id#51, year_total#52] -Arguments: hashpartitioning(customer_id#51, 5), true, [id=#53] - -(84) Sort [codegen id : 34] -Input [2]: [customer_id#51, year_total#52] -Arguments: [customer_id#51 ASC NULLS FIRST], false, 0 - -(85) SortMergeJoin [codegen id : 35] -Left keys [1]: [customer_id#19] -Right keys [1]: [customer_id#51] -Join condition: (CASE WHEN (year_total#44 > 0.00) THEN CheckOverflow((promote_precision(year_total#52) / promote_precision(year_total#44)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#20 > 0.00) THEN CheckOverflow((promote_precision(year_total#31) / promote_precision(year_total#20)), DecimalType(37,20), true) ELSE null END) - -(86) Project [codegen id : 35] -Output [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] -Input [9]: [customer_id#19, year_total#20, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#44, customer_id#51, year_total#52] - -(87) TakeOrderedAndProject -Input [3]: [customer_id#28, customer_first_name#29, customer_last_name#30] -Arguments: 100, [customer_first_name#29 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST, customer_last_name#30 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30] +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] + +(82) Exchange +Input [2]: [customer_id#49, year_total#50] +Arguments: hashpartitioning(customer_id#49, 5), true, [id=#51] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#49, year_total#50] +Arguments: [customer_id#49 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#49] +Join condition: (CASE WHEN (year_total#42 > 0.00) THEN CheckOverflow((promote_precision(year_total#50) / promote_precision(year_total#42)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#29) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) + +(85) Project [codegen id : 35] +Output [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] +Input [9]: [customer_id#17, year_total#18, customer_id#26, customer_first_name#27, customer_last_name#28, year_total#29, year_total#42, customer_id#49, year_total#50] + +(86) TakeOrderedAndProject +Input [3]: [customer_id#26, customer_first_name#27, customer_last_name#28] +Arguments: 100, [customer_first_name#27 ASC NULLS FIRST, customer_id#26 ASC NULLS FIRST, customer_last_name#28 ASC NULLS FIRST], [customer_id#26, customer_first_name#27, customer_last_name#28] 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 7fd17c0e67a49..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 @@ -15,44 +15,43 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] InputAdapter Exchange [customer_id] #1 WholeStageCodegen (7) - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 - WholeStageCodegen (6) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - SortMergeJoin [ss_customer_sk,c_customer_sk] - InputAdapter - WholeStageCodegen (3) - Sort [ss_customer_sk] - 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] - InputAdapter - BroadcastExchange #4 - WholeStageCodegen (1) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] - InputAdapter - WholeStageCodegen (5) - Sort [c_customer_sk] - InputAdapter - Exchange [c_customer_sk] #5 - WholeStageCodegen (4) - Filter [c_customer_sk,c_customer_id] - ColumnarToRow - InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + 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] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] InputAdapter WholeStageCodegen (16) Sort [customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt index da00998242ef1..f58fb1343a186 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt @@ -1,77 +1,76 @@ == Physical Plan == -TakeOrderedAndProject (73) -+- * Project (72) - +- * BroadcastHashJoin Inner BuildRight (71) - :- * Project (57) - : +- * BroadcastHashJoin Inner BuildRight (56) - : :- * BroadcastHashJoin Inner BuildRight (37) - : : :- * Project (20) - : : : +- * Filter (19) - : : : +- * HashAggregate (18) - : : : +- Exchange (17) - : : : +- * HashAggregate (16) - : : : +- * Project (15) - : : : +- * BroadcastHashJoin Inner BuildRight (14) - : : : :- * Project (9) - : : : : +- * BroadcastHashJoin Inner BuildRight (8) - : : : : :- * Filter (3) - : : : : : +- * ColumnarToRow (2) - : : : : : +- Scan parquet default.customer (1) - : : : : +- BroadcastExchange (7) - : : : : +- * Filter (6) - : : : : +- * ColumnarToRow (5) - : : : : +- Scan parquet default.store_sales (4) - : : : +- BroadcastExchange (13) - : : : +- * Filter (12) - : : : +- * ColumnarToRow (11) - : : : +- Scan parquet default.date_dim (10) - : : +- BroadcastExchange (36) - : : +- * HashAggregate (35) - : : +- Exchange (34) - : : +- * HashAggregate (33) - : : +- * Project (32) - : : +- * BroadcastHashJoin Inner BuildRight (31) - : : :- * Project (26) - : : : +- * BroadcastHashJoin Inner BuildRight (25) - : : : :- * Filter (23) - : : : : +- * ColumnarToRow (22) - : : : : +- Scan parquet default.customer (21) - : : : +- ReusedExchange (24) - : : +- BroadcastExchange (30) - : : +- * Filter (29) - : : +- * ColumnarToRow (28) - : : +- Scan parquet default.date_dim (27) - : +- BroadcastExchange (55) - : +- * Project (54) - : +- * Filter (53) - : +- * HashAggregate (52) - : +- Exchange (51) - : +- * HashAggregate (50) - : +- * Project (49) - : +- * BroadcastHashJoin Inner BuildRight (48) - : :- * Project (46) - : : +- * BroadcastHashJoin Inner BuildRight (45) - : : :- * Filter (40) - : : : +- * ColumnarToRow (39) - : : : +- Scan parquet default.customer (38) - : : +- BroadcastExchange (44) - : : +- * Filter (43) - : : +- * ColumnarToRow (42) - : : +- Scan parquet default.web_sales (41) - : +- ReusedExchange (47) - +- BroadcastExchange (70) - +- * HashAggregate (69) - +- Exchange (68) - +- * HashAggregate (67) - +- * Project (66) - +- * BroadcastHashJoin Inner BuildRight (65) - :- * Project (63) - : +- * BroadcastHashJoin Inner BuildRight (62) - : :- * Filter (60) - : : +- * ColumnarToRow (59) - : : +- Scan parquet default.customer (58) - : +- ReusedExchange (61) - +- ReusedExchange (64) +TakeOrderedAndProject (72) ++- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (35) + : : +- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- ReusedExchange (23) + : : +- BroadcastExchange (29) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.date_dim (26) + : +- BroadcastExchange (54) + : +- * Project (53) + : +- * Filter (52) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * Project (45) + : : +- * BroadcastHashJoin Inner BuildRight (44) + : : :- * Filter (39) + : : : +- * ColumnarToRow (38) + : : : +- Scan parquet default.customer (37) + : : +- BroadcastExchange (43) + : : +- * Filter (42) + : : +- * ColumnarToRow (41) + : : +- Scan parquet default.web_sales (40) + : +- ReusedExchange (46) + +- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * BroadcastHashJoin Inner BuildRight (61) + : :- * Filter (59) + : : +- * ColumnarToRow (58) + : : +- Scan parquet default.customer (57) + : +- ReusedExchange (60) + +- ReusedExchange (63) (1) Scan parquet default.customer @@ -164,252 +163,248 @@ Results [2]: [c_customer_id#2 AS customer_id#16, MakeDecimal(sum(UnscaledValue(s Input [2]: [customer_id#16, year_total#17] Condition : (isnotnull(year_total#17) AND (year_total#17 > 0.00)) -(20) Project [codegen id : 16] -Output [2]: [customer_id#16 AS customer_id#18, year_total#17 AS year_total#19] -Input [2]: [customer_id#16, year_total#17] - -(21) Scan parquet default.customer +(20) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(22) ColumnarToRow [codegen id : 6] +(21) ColumnarToRow [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(23) Filter [codegen id : 6] +(22) Filter [codegen id : 6] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(24) ReusedExchange [Reuses operator id: 7] +(23) ReusedExchange [Reuses operator id: 7] Output [3]: [ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(25) BroadcastHashJoin [codegen id : 6] +(24) BroadcastHashJoin [codegen id : 6] Left keys [1]: [c_customer_sk#1] Right keys [1]: [ss_customer_sk#6] Join condition: None -(26) Project [codegen id : 6] +(25) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7] Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_customer_sk#6, ss_net_paid#7] -(27) Scan parquet default.date_dim +(26) 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,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] ReadSchema: struct -(28) ColumnarToRow [codegen id : 5] +(27) ColumnarToRow [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] -(29) Filter [codegen id : 5] +(28) Filter [codegen id : 5] Input [2]: [d_date_sk#9, d_year#10] Condition : (((isnotnull(d_year#10) AND (d_year#10 = 2002)) AND d_year#10 IN (2001,2002)) AND isnotnull(d_date_sk#9)) -(30) BroadcastExchange +(29) BroadcastExchange Input [2]: [d_date_sk#9, d_year#10] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] -(31) BroadcastHashJoin [codegen id : 6] +(30) BroadcastHashJoin [codegen id : 6] Left keys [1]: [ss_sold_date_sk#5] Right keys [1]: [d_date_sk#9] Join condition: None -(32) Project [codegen id : 6] +(31) Project [codegen id : 6] Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_sold_date_sk#5, ss_net_paid#7, d_date_sk#9, d_year#10] -(33) HashAggregate [codegen id : 6] +(32) HashAggregate [codegen id : 6] Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#7, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum#21] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +Aggregate Attributes [1]: [sum#19] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] -(34) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#23] +(33) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#21] -(35) HashAggregate [codegen id : 7] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#22] +(34) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#20] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] Functions [1]: [sum(UnscaledValue(ss_net_paid#7))] -Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#24] -Results [4]: [c_customer_id#2 AS customer_id#25, c_first_name#3 AS customer_first_name#26, c_last_name#4 AS customer_last_name#27, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#24,17,2) AS year_total#28] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#7))#22] +Results [4]: [c_customer_id#2 AS customer_id#23, c_first_name#3 AS customer_first_name#24, c_last_name#4 AS customer_last_name#25, MakeDecimal(sum(UnscaledValue(ss_net_paid#7))#22,17,2) AS year_total#26] -(36) BroadcastExchange -Input [4]: [customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#29] +(35) BroadcastExchange +Input [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#27] -(37) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#25] +(36) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#23] Join condition: None -(38) Scan parquet default.customer +(37) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(39) ColumnarToRow [codegen id : 10] +(38) ColumnarToRow [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(40) Filter [codegen id : 10] +(39) Filter [codegen id : 10] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(41) Scan parquet default.web_sales -Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(40) Scan parquet default.web_sales +Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct -(42) ColumnarToRow [codegen id : 8] -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(41) ColumnarToRow [codegen id : 8] +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(43) Filter [codegen id : 8] -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -Condition : (isnotnull(ws_bill_customer_sk#31) AND isnotnull(ws_sold_date_sk#30)) +(42) Filter [codegen id : 8] +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +Condition : (isnotnull(ws_bill_customer_sk#29) AND isnotnull(ws_sold_date_sk#28)) -(44) BroadcastExchange -Input [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] -Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#33] +(43) BroadcastExchange +Input [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#31] -(45) BroadcastHashJoin [codegen id : 10] +(44) BroadcastHashJoin [codegen id : 10] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#31] +Right keys [1]: [ws_bill_customer_sk#29] Join condition: None -(46) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(45) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(47) ReusedExchange [Reuses operator id: 13] +(46) ReusedExchange [Reuses operator id: 13] Output [2]: [d_date_sk#9, d_year#10] -(48) BroadcastHashJoin [codegen id : 10] -Left keys [1]: [ws_sold_date_sk#30] +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#28] Right keys [1]: [d_date_sk#9] Join condition: None -(49) Project [codegen id : 10] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] +(48) Project [codegen id : 10] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] -(50) HashAggregate [codegen id : 10] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +(49) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum#34] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum#32] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] -(51) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#36] +(50) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#34] -(52) HashAggregate [codegen id : 11] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#35] +(51) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#33] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#37] -Results [2]: [c_customer_id#2 AS customer_id#38, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#37,17,2) AS year_total#39] +Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#35] +Results [2]: [c_customer_id#2 AS customer_id#36, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#35,17,2) AS year_total#37] -(53) Filter [codegen id : 11] -Input [2]: [customer_id#38, year_total#39] -Condition : (isnotnull(year_total#39) AND (year_total#39 > 0.00)) +(52) Filter [codegen id : 11] +Input [2]: [customer_id#36, year_total#37] +Condition : (isnotnull(year_total#37) AND (year_total#37 > 0.00)) -(54) Project [codegen id : 11] -Output [2]: [customer_id#38 AS customer_id#40, year_total#39 AS year_total#41] -Input [2]: [customer_id#38, year_total#39] +(53) Project [codegen id : 11] +Output [2]: [customer_id#36 AS customer_id#38, year_total#37 AS year_total#39] +Input [2]: [customer_id#36, year_total#37] -(55) BroadcastExchange -Input [2]: [customer_id#40, year_total#41] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#42] +(54) BroadcastExchange +Input [2]: [customer_id#38, year_total#39] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#40] -(56) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#40] +(55) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#38] Join condition: None -(57) Project [codegen id : 16] -Output [7]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41] -Input [8]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, customer_id#40, year_total#41] +(56) Project [codegen id : 16] +Output [7]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39] +Input [8]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, customer_id#38, year_total#39] -(58) Scan parquet default.customer +(57) Scan parquet default.customer Output [4]: [c_customer_sk#1, c_customer_id#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_customer_id)] ReadSchema: struct -(59) ColumnarToRow [codegen id : 14] +(58) ColumnarToRow [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] -(60) Filter [codegen id : 14] +(59) Filter [codegen id : 14] Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) -(61) ReusedExchange [Reuses operator id: 44] -Output [3]: [ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(60) ReusedExchange [Reuses operator id: 43] +Output [3]: [ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(62) BroadcastHashJoin [codegen id : 14] +(61) BroadcastHashJoin [codegen id : 14] Left keys [1]: [c_customer_sk#1] -Right keys [1]: [ws_bill_customer_sk#31] +Right keys [1]: [ws_bill_customer_sk#29] Join condition: None -(63) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32] -Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_bill_customer_sk#31, ws_net_paid#32] +(62) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_bill_customer_sk#29, ws_net_paid#30] -(64) ReusedExchange [Reuses operator id: 30] +(63) ReusedExchange [Reuses operator id: 29] Output [2]: [d_date_sk#9, d_year#10] -(65) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#30] +(64) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#28] Right keys [1]: [d_date_sk#9] Join condition: None -(66) Project [codegen id : 14] -Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] -Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#30, ws_net_paid#32, d_date_sk#9, d_year#10] +(65) Project [codegen id : 14] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_sold_date_sk#28, ws_net_paid#30, d_date_sk#9, d_year#10] -(67) HashAggregate [codegen id : 14] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#32, d_year#10] +(66) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ws_net_paid#30, d_year#10] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum#43] -Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum#41] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] -(68) Exchange -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] -Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#45] +(67) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), true, [id=#43] -(69) HashAggregate [codegen id : 15] -Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#44] +(68) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#42] Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10] -Functions [1]: [sum(UnscaledValue(ws_net_paid#32))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#32))#46] -Results [2]: [c_customer_id#2 AS customer_id#47, MakeDecimal(sum(UnscaledValue(ws_net_paid#32))#46,17,2) AS year_total#48] - -(70) BroadcastExchange -Input [2]: [customer_id#47, year_total#48] -Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#49] - -(71) BroadcastHashJoin [codegen id : 16] -Left keys [1]: [customer_id#18] -Right keys [1]: [customer_id#47] -Join condition: (CASE WHEN (year_total#41 > 0.00) THEN CheckOverflow((promote_precision(year_total#48) / promote_precision(year_total#41)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#28) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) - -(72) Project [codegen id : 16] -Output [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] -Input [9]: [customer_id#18, year_total#19, customer_id#25, customer_first_name#26, customer_last_name#27, year_total#28, year_total#41, customer_id#47, year_total#48] - -(73) TakeOrderedAndProject -Input [3]: [customer_id#25, customer_first_name#26, customer_last_name#27] -Arguments: 100, [customer_first_name#26 ASC NULLS FIRST, customer_id#25 ASC NULLS FIRST, customer_last_name#27 ASC NULLS FIRST], [customer_id#25, customer_first_name#26, customer_last_name#27] +Functions [1]: [sum(UnscaledValue(ws_net_paid#30))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#30))#44] +Results [2]: [c_customer_id#2 AS customer_id#45, MakeDecimal(sum(UnscaledValue(ws_net_paid#30))#44,17,2) AS year_total#46] + +(69) BroadcastExchange +Input [2]: [customer_id#45, year_total#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] + +(70) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#16] +Right keys [1]: [customer_id#45] +Join condition: (CASE WHEN (year_total#39 > 0.00) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#39)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#17 > 0.00) THEN CheckOverflow((promote_precision(year_total#26) / promote_precision(year_total#17)), DecimalType(37,20), true) ELSE null END) + +(71) Project [codegen id : 16] +Output [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] +Input [9]: [customer_id#16, year_total#17, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#39, customer_id#45, year_total#46] + +(72) TakeOrderedAndProject +Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25] +Arguments: 100, [customer_first_name#24 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST, customer_last_name#25 ASC NULLS FIRST], [customer_id#23, customer_first_name#24, customer_last_name#25] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt index 10cef74f6f82c..205fb6ac974a2 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt @@ -5,35 +5,34 @@ TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] BroadcastHashJoin [customer_id,customer_id] BroadcastHashJoin [customer_id,customer_id] - Project [customer_id,year_total] - Filter [year_total] - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] - InputAdapter - Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 - WholeStageCodegen (3) - HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] - Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] - BroadcastHashJoin [ss_sold_date_sk,d_date_sk] - Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] - BroadcastHashJoin [c_customer_sk,ss_customer_sk] - Filter [c_customer_sk,c_customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_sold_date_sk,ss_net_paid] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + 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 #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] ColumnarToRow InputAdapter - Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] - InputAdapter - BroadcastExchange #2 - WholeStageCodegen (1) - 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 #3 - WholeStageCodegen (2) - Filter [d_year,d_date_sk] - ColumnarToRow - InputAdapter - Scan parquet default.date_dim [d_date_sk,d_year] + Scan parquet default.date_dim [d_date_sk,d_year] InputAdapter BroadcastExchange #4 WholeStageCodegen (7) 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 052ecd661288c..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 @@ -328,149 +328,147 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ 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 -Arguments: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] (45) HashAggregate [codegen id : 15] -Input [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Arguments: hashpartitioning(d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43, 5), true, [id=#44] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] -Keys [7]: [d_year#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#37, i_brand_id#38, i_class_id#39, i_category_id#40, i_manufact_id#41, sales_cnt#42, sales_amt#43] +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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (49) ColumnarToRow [codegen id : 19] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] (50) Filter [codegen id : 19] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] -Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) +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] (52) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_item_sk#46] +Left keys [1]: [ws_item_sk#39] Right keys [1]: [i_item_sk#6] Join condition: None (53) Project [codegen id : 19] -Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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] (55) BroadcastHashJoin [codegen id : 19] -Left keys [1]: [ws_sold_date_sk#45] +Left keys [1]: [ws_sold_date_sk#38] Right keys [1]: [d_date_sk#13] Join condition: None (56) Project [codegen id : 19] -Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#50] +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#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 +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 -Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (60) ColumnarToRow [codegen id : 21] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (61) Filter [codegen id : 21] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Condition : (isnotnull(wr_order_number#52) AND isnotnull(wr_item_sk#51)) +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Condition : (isnotnull(wr_order_number#45) AND isnotnull(wr_item_sk#44)) (62) Exchange -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: hashpartitioning(wr_order_number#52, wr_item_sk#51, 5), true, [id=#55] +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: hashpartitioning(wr_order_number#45, wr_item_sk#44, 5), true, [id=#48] (63) Sort [codegen id : 22] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 (64) SortMergeJoin -Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] -Right keys [2]: [wr_order_number#52, wr_item_sk#51] +Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] +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#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#57] -Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +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 -Arguments: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] (67) HashAggregate [codegen id : 24] -Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64, 5), true, [id=#65] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#63, sales_amt#64] -Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [partial_sum(cast(sales_cnt#63 as bigint)), partial_sum(UnscaledValue(sales_amt#64))] -Aggregate Attributes [2]: [sum#66, sum#67] -Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] +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#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#54, sum#55] (71) Exchange -Input [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] -Arguments: hashpartitioning(d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#70] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#68, sum#69] -Keys [5]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Functions [2]: [sum(cast(sales_cnt#63 as bigint)), sum(UnscaledValue(sales_amt#64))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#63 as bigint))#71, sum(UnscaledValue(sales_amt#64))#72] -Results [7]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#63 as bigint))#71 AS sales_cnt#73, MakeDecimal(sum(UnscaledValue(sales_amt#64))#72,18,2) AS sales_amt#74] +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#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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] -Arguments: hashpartitioning(i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#75] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74] -Arguments: [i_brand_id#59 ASC NULLS FIRST, i_class_id#60 ASC NULLS FIRST, i_category_id#61 ASC NULLS FIRST, i_manufact_id#62 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) 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] @@ -487,50 +485,50 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (78) 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] +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]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#62] 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#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]: [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#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] 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 (82) ColumnarToRow [codegen id : 29] -Input [2]: [d_date_sk#13, d_year#14] +Input [2]: [d_date_sk#67, d_year#68] (83) Filter [codegen id : 29] -Input [2]: [d_date_sk#13, d_year#14] -Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) +Input [2]: [d_date_sk#67, d_year#68] +Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2001)) AND isnotnull(d_date_sk#67)) (84) BroadcastExchange -Input [2]: [d_date_sk#13, d_year#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] +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] -Right keys [1]: [d_date_sk#13] +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#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#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#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=#77] +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#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 [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] @@ -546,8 +544,8 @@ Right keys [2]: [cr_order_number#18, cr_item_sk#17] Join condition: None (92) Project [codegen id : 34] -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#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] @@ -564,35 +562,35 @@ Input [5]: [ss_sold_date_sk#24, ss_item_sk#25, ss_ticket_number#26, ss_quantity# Condition : (isnotnull(ss_item_sk#25) AND isnotnull(ss_sold_date_sk#24)) (96) 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] +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] Left keys [1]: [ss_item_sk#25] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#62] Join condition: None (98) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (99) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] (100) BroadcastHashJoin [codegen id : 37] Left keys [1]: [ss_sold_date_sk#24] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#67] Join condition: None (101) Project [codegen id : 37] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] (102) 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] -Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#78] +Input [9]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cast(ss_ticket_number#26 as bigint), cast(ss_item_sk#25 as bigint), 5), true, [id=#71] (103) Sort [codegen id : 38] -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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] Arguments: [cast(ss_ticket_number#26 as bigint) ASC NULLS FIRST, cast(ss_item_sk#25 as bigint) ASC NULLS FIRST], false, 0 (104) ReusedExchange [Reuses operator id: 40] @@ -608,149 +606,147 @@ Right keys [2]: [sr_ticket_number#31, sr_item_sk#30] Join condition: None (107) Project [codegen id : 41] -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#79, 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#80] -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#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ss_quantity#27 - coalesce(sr_return_quantity#32, 0)) AS sales_cnt#72, 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#73] +Input [13]: [ss_item_sk#25, ss_ticket_number#26, ss_quantity#27, ss_ext_sales_price#28, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, sr_item_sk#30, sr_ticket_number#31, sr_return_quantity#32, sr_return_amt#33] (108) Union -Arguments: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] (109) HashAggregate [codegen id : 42] -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (110) Exchange -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Arguments: hashpartitioning(d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87, 5), true, [id=#88] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#74] (111) HashAggregate [codegen id : 43] -Input [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] -Keys [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#81, i_brand_id#82, i_class_id#83, i_category_id#84, i_manufact_id#85, sales_cnt#86, sales_amt#87] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (112) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Output [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (113) ColumnarToRow [codegen id : 46] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] +Input [5]: [ws_sold_date_sk#38, ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42] (114) Filter [codegen id : 46] -Input [5]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49] -Condition : (isnotnull(ws_item_sk#46) AND isnotnull(ws_sold_date_sk#45)) +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] -Output [5]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +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] -Left keys [1]: [ws_item_sk#46] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ws_item_sk#39] +Right keys [1]: [i_item_sk#62] Join condition: None (117) Project [codegen id : 46] -Output [9]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +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#62, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] (118) ReusedExchange [Reuses operator id: 84] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#67, d_year#68] (119) BroadcastHashJoin [codegen id : 46] -Left keys [1]: [ws_sold_date_sk#45] -Right keys [1]: [d_date_sk#13] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#67] Join condition: None (120) Project [codegen id : 46] -Output [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#45, ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +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#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_date_sk#67, d_year#68] (121) Exchange -Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, 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#47 as bigint), cast(ws_item_sk#46 as bigint), 5), true, [id=#89] +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: hashpartitioning(cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint), 5), true, [id=#75] (122) Sort [codegen id : 47] -Input [9]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14] -Arguments: [cast(ws_order_number#47 as bigint) ASC NULLS FIRST, cast(ws_item_sk#46 as bigint) ASC NULLS FIRST], false, 0 +Input [9]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68] +Arguments: [cast(ws_order_number#40 as bigint) ASC NULLS FIRST, cast(ws_item_sk#39 as bigint) ASC NULLS FIRST], false, 0 (123) ReusedExchange [Reuses operator id: 62] -Output [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (124) Sort [codegen id : 49] -Input [4]: [wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] -Arguments: [wr_order_number#52 ASC NULLS FIRST, wr_item_sk#51 ASC NULLS FIRST], false, 0 +Input [4]: [wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] +Arguments: [wr_order_number#45 ASC NULLS FIRST, wr_item_sk#44 ASC NULLS FIRST], false, 0 (125) SortMergeJoin -Left keys [2]: [cast(ws_order_number#47 as bigint), cast(ws_item_sk#46 as bigint)] -Right keys [2]: [wr_order_number#52, wr_item_sk#51] +Left keys [2]: [cast(ws_order_number#40 as bigint), cast(ws_item_sk#39 as bigint)] +Right keys [2]: [wr_order_number#45, wr_item_sk#44] Join condition: None (126) Project [codegen id : 50] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#48 - coalesce(wr_return_quantity#53, 0)) AS sales_cnt#56, CheckOverflow((promote_precision(cast(ws_ext_sales_price#49 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#54, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#90] -Input [13]: [ws_item_sk#46, ws_order_number#47, ws_quantity#48, ws_ext_sales_price#49, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#51, wr_order_number#52, wr_return_quantity#53, wr_return_amt#54] +Output [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, (ws_quantity#41 - coalesce(wr_return_quantity#46, 0)) AS sales_cnt#76, 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#77] +Input [13]: [ws_item_sk#39, ws_order_number#40, ws_quantity#41, ws_ext_sales_price#42, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, d_year#68, wr_item_sk#44, wr_order_number#45, wr_return_quantity#46, wr_return_amt#47] (127) Union -Arguments: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] (128) HashAggregate [codegen id : 51] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (129) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97, 5), true, [id=#98] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23, 5), true, [id=#78] (130) HashAggregate [codegen id : 52] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] (131) HashAggregate [codegen id : 52] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#96, sales_amt#97] -Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Functions [2]: [partial_sum(cast(sales_cnt#96 as bigint)), partial_sum(UnscaledValue(sales_amt#97))] -Aggregate Attributes [2]: [sum#99, sum#100] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sales_cnt#22, sales_amt#23] +Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Functions [2]: [partial_sum(cast(sales_cnt#22 as bigint)), partial_sum(UnscaledValue(sales_amt#23))] +Aggregate Attributes [2]: [sum#79, sum#80] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] (132) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] -Arguments: hashpartitioning(d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#103] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Arguments: hashpartitioning(d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#83] (133) HashAggregate [codegen id : 53] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum#101, sum#102] -Keys [5]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Functions [2]: [sum(cast(sales_cnt#96 as bigint)), sum(UnscaledValue(sales_amt#97))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#96 as bigint))#104, sum(UnscaledValue(sales_amt#97))#105] -Results [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sum(cast(sales_cnt#96 as bigint))#104 AS sales_cnt#106, MakeDecimal(sum(UnscaledValue(sales_amt#97))#105,18,2) AS sales_amt#107] +Input [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum#81, sum#82] +Keys [5]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66] +Functions [2]: [sum(cast(sales_cnt#22 as bigint)), sum(UnscaledValue(sales_amt#23))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#22 as bigint))#84, sum(UnscaledValue(sales_amt#23))#85] +Results [7]: [d_year#68, i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, sum(cast(sales_cnt#22 as bigint))#84 AS sales_cnt#86, MakeDecimal(sum(UnscaledValue(sales_amt#23))#85,18,2) AS sales_amt#87] (134) Exchange -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] -Arguments: hashpartitioning(i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, 5), true, [id=#108] +Input [7]: [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] +Arguments: hashpartitioning(i_brand_id#63, i_class_id#64, i_category_id#65, i_manufact_id#66, 5), true, [id=#88] (135) Sort [codegen id : 54] -Input [7]: [d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] -Arguments: [i_brand_id#92 ASC NULLS FIRST, i_class_id#93 ASC NULLS FIRST, i_category_id#94 ASC NULLS FIRST, i_manufact_id#95 ASC NULLS FIRST], false, 0 +Input [7]: [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] +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] -Right keys [4]: [i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#73 as decimal(17,2))) / promote_precision(cast(sales_cnt#106 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +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#91 AS prev_year#109, d_year#58 AS year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#106 AS prev_yr_cnt#111, sales_cnt#73 AS curr_yr_cnt#112, (sales_cnt#73 - sales_cnt#106) AS sales_cnt_diff#113, CheckOverflow((promote_precision(cast(sales_amt#74 as decimal(19,2))) - promote_precision(cast(sales_amt#107 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#114] -Input [14]: [d_year#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#73, sales_amt#74, d_year#91, i_brand_id#92, i_class_id#93, i_category_id#94, i_manufact_id#95, sales_cnt#106, sales_amt#107] +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#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] -Arguments: 100, [sales_cnt_diff#113 ASC NULLS FIRST, sales_amt_diff#114 ASC NULLS FIRST], [prev_year#109, year#110, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, prev_yr_cnt#111, curr_yr_cnt#112, sales_cnt_diff#113, sales_amt_diff#114] +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 16a1a49c8da9f..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 @@ -19,7 +19,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (24) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (16) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -27,7 +27,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (7) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter @@ -146,7 +146,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (51) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (43) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -154,7 +154,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (42) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (34) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt index 38fb3c61543ac..1d8aab417f188 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt @@ -283,129 +283,127 @@ Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_ Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (38) Union -Arguments: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] (39) HashAggregate [codegen id : 9] -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (40) Exchange -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Arguments: hashpartitioning(d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41, 5), true, [id=#42] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#35] (41) HashAggregate [codegen id : 10] -Input [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] -Keys [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#35, i_brand_id#36, i_class_id#37, i_category_id#38, i_manufact_id#39, sales_cnt#40, sales_amt#41] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (42) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] 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 : 14] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] (44) Filter [codegen id : 14] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] -Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) (45) 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] (46) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_item_sk#44] +Left keys [1]: [ws_item_sk#37] Right keys [1]: [i_item_sk#6] Join condition: None (47) Project [codegen id : 14] -Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] +Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] (48) ReusedExchange [Reuses operator id: 14] Output [2]: [d_date_sk#13, d_year#14] (49) BroadcastHashJoin [codegen id : 14] -Left keys [1]: [ws_sold_date_sk#43] +Left keys [1]: [ws_sold_date_sk#36] Right keys [1]: [d_date_sk#13] Join condition: None (50) Project [codegen id : 14] -Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_date_sk#13, d_year#14] (51) Scan parquet default.web_returns -Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] Batched: true Location [not included in comparison]/{warehouse_dir}/web_returns] PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] ReadSchema: struct (52) ColumnarToRow [codegen id : 13] -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (53) Filter [codegen id : 13] -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] -Condition : (isnotnull(wr_order_number#49) AND isnotnull(wr_item_sk#48)) +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Condition : (isnotnull(wr_order_number#42) AND isnotnull(wr_item_sk#41)) (54) BroadcastExchange -Input [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] -Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#52] +Input [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] +Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#45] (55) BroadcastHashJoin [codegen id : 14] -Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] -Right keys [2]: [wr_order_number#49, wr_item_sk#48] +Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] +Right keys [2]: [wr_order_number#42, wr_item_sk#41] Join condition: None (56) 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, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#54] -Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#46, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#47] +Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (57) Union -Arguments: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] (58) HashAggregate [codegen id : 15] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (59) Exchange -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61, 5), true, [id=#62] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22, 5), true, [id=#48] (60) HashAggregate [codegen id : 16] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] (61) HashAggregate [codegen id : 16] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#60, sales_amt#61] -Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Functions [2]: [partial_sum(cast(sales_cnt#60 as bigint)), partial_sum(UnscaledValue(sales_amt#61))] -Aggregate Attributes [2]: [sum#63, sum#64] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#21, sales_amt#22] +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#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum#49, sum#50] +Results [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] (62) Exchange -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] -Arguments: hashpartitioning(d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, 5), true, [id=#67] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +Arguments: hashpartitioning(d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, 5), true, [id=#53] (63) HashAggregate [codegen id : 34] -Input [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum#65, sum#66] -Keys [5]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Functions [2]: [sum(cast(sales_cnt#60 as bigint)), sum(UnscaledValue(sales_amt#61))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#60 as bigint))#68, sum(UnscaledValue(sales_amt#61))#69] -Results [7]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sum(cast(sales_cnt#60 as bigint))#68 AS sales_cnt#70, MakeDecimal(sum(UnscaledValue(sales_amt#61))#69,18,2) AS sales_amt#71] +Input [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sum#51, sum#52] +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#21 as bigint)), sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#54, sum(UnscaledValue(sales_amt#22))#55] +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#21 as bigint))#54 AS sales_cnt#56, MakeDecimal(sum(UnscaledValue(sales_amt#22))#55,18,2) AS sales_amt#57] (64) 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] @@ -422,43 +420,43 @@ Input [5]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, c Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_sold_date_sk#1)) (67) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (68) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_item_sk#2] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#58] Join condition: None (69) Project [codegen id : 20] -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]: [cs_sold_date_sk#1, cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +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#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (70) Scan parquet default.date_dim -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] 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 (71) ColumnarToRow [codegen id : 18] -Input [2]: [d_date_sk#13, d_year#14] +Input [2]: [d_date_sk#63, d_year#64] (72) Filter [codegen id : 18] -Input [2]: [d_date_sk#13, d_year#14] -Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13)) +Input [2]: [d_date_sk#63, d_year#64] +Condition : ((isnotnull(d_year#64) AND (d_year#64 = 2001)) AND isnotnull(d_date_sk#63)) (73) BroadcastExchange -Input [2]: [d_date_sk#13, d_year#14] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] +Input [2]: [d_date_sk#63, d_year#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#65] (74) BroadcastHashJoin [codegen id : 20] Left keys [1]: [cs_sold_date_sk#1] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#63] Join condition: None (75) Project [codegen id : 20] -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#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (76) ReusedExchange [Reuses operator id: 20] Output [4]: [cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] @@ -469,8 +467,8 @@ Right keys [2]: [cr_order_number#17, cr_item_sk#16] Join condition: None (78) Project [codegen id : 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#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] -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#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (cs_quantity#4 - coalesce(cr_return_quantity#18, 0)) AS sales_cnt#21, CheckOverflow((promote_precision(cast(cs_ext_sales_price#5 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#19, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#22] +Input [13]: [cs_item_sk#2, cs_order_number#3, cs_quantity#4, cs_ext_sales_price#5, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, cr_item_sk#16, cr_order_number#17, cr_return_quantity#18, cr_return_amount#19] (79) Scan parquet default.store_sales Output [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27] @@ -487,28 +485,28 @@ Input [5]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity# Condition : (isnotnull(ss_item_sk#24) AND isnotnull(ss_sold_date_sk#23)) (82) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (83) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_item_sk#24] -Right keys [1]: [i_item_sk#6] +Right keys [1]: [i_item_sk#58] Join condition: None (84) Project [codegen id : 24] -Output [9]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Input [10]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (85) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] (86) BroadcastHashJoin [codegen id : 24] Left keys [1]: [ss_sold_date_sk#23] -Right keys [1]: [d_date_sk#13] +Right keys [1]: [d_date_sk#63] Join condition: None (87) Project [codegen id : 24] -Output [9]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, 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#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +Input [11]: [ss_sold_date_sk#23, ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (88) ReusedExchange [Reuses operator id: 35] Output [4]: [sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] @@ -519,133 +517,131 @@ Right keys [2]: [sr_ticket_number#29, sr_item_sk#28] Join condition: None (90) Project [codegen id : 24] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#73, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#74] -Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ss_quantity#26 - coalesce(sr_return_quantity#30, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ss_ext_sales_price#27 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#31, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ss_item_sk#24, ss_ticket_number#25, ss_quantity#26, ss_ext_sales_price#27, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, sr_item_sk#28, sr_ticket_number#29, sr_return_quantity#30, sr_return_amt#31] (91) Union -Arguments: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] (92) HashAggregate [codegen id : 25] -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (93) Exchange -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Arguments: hashpartitioning(d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81, 5), true, [id=#82] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#68] (94) HashAggregate [codegen id : 26] -Input [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] -Keys [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#75, i_brand_id#76, i_class_id#77, i_category_id#78, i_manufact_id#79, sales_cnt#80, sales_amt#81] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (95) Scan parquet default.web_sales -Output [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Output [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] Batched: true Location [not included in comparison]/{warehouse_dir}/web_sales] PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_date_sk)] ReadSchema: struct (96) ColumnarToRow [codegen id : 30] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] (97) Filter [codegen id : 30] -Input [5]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47] -Condition : (isnotnull(ws_item_sk#44) AND isnotnull(ws_sold_date_sk#43)) +Input [5]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40] +Condition : (isnotnull(ws_item_sk#37) AND isnotnull(ws_sold_date_sk#36)) (98) 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] +Output [5]: [i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (99) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_item_sk#44] -Right keys [1]: [i_item_sk#6] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#58] Join condition: None (100) Project [codegen id : 30] -Output [9]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11] -Input [10]: [ws_sold_date_sk#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Input [10]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_item_sk#58, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] (101) ReusedExchange [Reuses operator id: 73] -Output [2]: [d_date_sk#13, d_year#14] +Output [2]: [d_date_sk#63, d_year#64] (102) BroadcastHashJoin [codegen id : 30] -Left keys [1]: [ws_sold_date_sk#43] -Right keys [1]: [d_date_sk#13] +Left keys [1]: [ws_sold_date_sk#36] +Right keys [1]: [d_date_sk#63] Join condition: None (103) Project [codegen id : 30] -Output [9]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#43, ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, 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#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64] +Input [11]: [ws_sold_date_sk#36, ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_date_sk#63, d_year#64] (104) ReusedExchange [Reuses operator id: 54] -Output [4]: [wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [4]: [wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (105) BroadcastHashJoin [codegen id : 30] -Left keys [2]: [cast(ws_order_number#45 as bigint), cast(ws_item_sk#44 as bigint)] -Right keys [2]: [wr_order_number#49, wr_item_sk#48] +Left keys [2]: [cast(ws_order_number#38 as bigint), cast(ws_item_sk#37 as bigint)] +Right keys [2]: [wr_order_number#42, wr_item_sk#41] Join condition: None (106) Project [codegen id : 30] -Output [7]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, (ws_quantity#46 - coalesce(wr_return_quantity#50, 0)) AS sales_cnt#53, CheckOverflow((promote_precision(cast(ws_ext_sales_price#47 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#51, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#83] -Input [13]: [ws_item_sk#44, ws_order_number#45, ws_quantity#46, ws_ext_sales_price#47, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, d_year#14, wr_item_sk#48, wr_order_number#49, wr_return_quantity#50, wr_return_amt#51] +Output [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, (ws_quantity#39 - coalesce(wr_return_quantity#43, 0)) AS sales_cnt#69, CheckOverflow((promote_precision(cast(ws_ext_sales_price#40 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#44, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#70] +Input [13]: [ws_item_sk#37, ws_order_number#38, ws_quantity#39, ws_ext_sales_price#40, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, d_year#64, wr_item_sk#41, wr_order_number#42, wr_return_quantity#43, wr_return_amt#44] (107) Union -Arguments: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] (108) HashAggregate [codegen id : 31] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (109) Exchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90, 5), true, [id=#91] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22, 5), true, [id=#71] (110) HashAggregate [codegen id : 32] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] Functions: [] Aggregate Attributes: [] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] (111) HashAggregate [codegen id : 32] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#89, sales_amt#90] -Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Functions [2]: [partial_sum(cast(sales_cnt#89 as bigint)), partial_sum(UnscaledValue(sales_amt#90))] -Aggregate Attributes [2]: [sum#92, sum#93] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#21, sales_amt#22] +Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [partial_sum(cast(sales_cnt#21 as bigint)), partial_sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum#72, sum#73] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] (112) Exchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] -Arguments: hashpartitioning(d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, 5), true, [id=#96] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Arguments: hashpartitioning(d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, 5), true, [id=#76] (113) HashAggregate [codegen id : 33] -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum#94, sum#95] -Keys [5]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Functions [2]: [sum(cast(sales_cnt#89 as bigint)), sum(UnscaledValue(sales_amt#90))] -Aggregate Attributes [2]: [sum(cast(sales_cnt#89 as bigint))#97, sum(UnscaledValue(sales_amt#90))#98] -Results [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sum(cast(sales_cnt#89 as bigint))#97 AS sales_cnt#99, MakeDecimal(sum(UnscaledValue(sales_amt#90))#98,18,2) AS sales_amt#100] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum#74, sum#75] +Keys [5]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Functions [2]: [sum(cast(sales_cnt#21 as bigint)), sum(UnscaledValue(sales_amt#22))] +Aggregate Attributes [2]: [sum(cast(sales_cnt#21 as bigint))#77, sum(UnscaledValue(sales_amt#22))#78] +Results [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sum(cast(sales_cnt#21 as bigint))#77 AS sales_cnt#79, MakeDecimal(sum(UnscaledValue(sales_amt#22))#78,18,2) AS sales_amt#80] (114) BroadcastExchange -Input [7]: [d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] -Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#101] +Input [7]: [d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true], input[4, int, true]),false), [id=#81] (115) BroadcastHashJoin [codegen id : 34] -Left keys [4]: [i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59] -Right keys [4]: [i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88] -Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#70 as decimal(17,2))) / promote_precision(cast(sales_cnt#99 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) +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#59, i_class_id#60, i_category_id#61, i_manufact_id#62] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#56 as decimal(17,2))) / promote_precision(cast(sales_cnt#79 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) (116) Project [codegen id : 34] -Output [10]: [d_year#84 AS prev_year#102, d_year#55 AS year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#99 AS prev_yr_cnt#104, sales_cnt#70 AS curr_yr_cnt#105, (sales_cnt#70 - sales_cnt#99) AS sales_cnt_diff#106, CheckOverflow((promote_precision(cast(sales_amt#71 as decimal(19,2))) - promote_precision(cast(sales_amt#100 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#107] -Input [14]: [d_year#55, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, sales_cnt#70, sales_amt#71, d_year#84, i_brand_id#85, i_class_id#86, i_category_id#87, i_manufact_id#88, sales_cnt#99, sales_amt#100] +Output [10]: [d_year#64 AS prev_year#82, d_year#14 AS year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#79 AS prev_yr_cnt#84, sales_cnt#56 AS curr_yr_cnt#85, (sales_cnt#56 - sales_cnt#79) AS sales_cnt_diff#86, CheckOverflow((promote_precision(cast(sales_amt#57 as decimal(19,2))) - promote_precision(cast(sales_amt#80 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#87] +Input [14]: [d_year#14, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, sales_cnt#56, sales_amt#57, d_year#64, i_brand_id#59, i_class_id#60, i_category_id#61, i_manufact_id#62, sales_cnt#79, sales_amt#80] (117) TakeOrderedAndProject -Input [10]: [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] -Arguments: 100, [sales_cnt_diff#106 ASC NULLS FIRST, sales_amt_diff#107 ASC NULLS FIRST], [prev_year#102, year#103, i_brand_id#56, i_class_id#57, i_category_id#58, i_manufact_id#59, prev_yr_cnt#104, curr_yr_cnt#105, sales_cnt_diff#106, sales_amt_diff#107] +Input [10]: [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] +Arguments: 100, [sales_cnt_diff#86 ASC NULLS FIRST, sales_amt_diff#87 ASC NULLS FIRST], [prev_year#82, year#83, i_brand_id#7, i_class_id#8, i_category_id#9, i_manufact_id#11, prev_yr_cnt#84, curr_yr_cnt#85, sales_cnt_diff#86, sales_amt_diff#87] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt index 8f1d4a5ceae58..d1c20801ec5fd 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt @@ -13,7 +13,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (15) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (10) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -21,7 +21,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (9) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (4) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] @@ -113,7 +113,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (31) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (26) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter @@ -121,7 +121,7 @@ TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i WholeStageCodegen (25) HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] InputAdapter - Union [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + Union WholeStageCodegen (20) Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt index 0231877c04994..ac49cc0548c08 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt @@ -508,125 +508,122 @@ Output [5]: [web channel AS channel#97, wp_web_page_sk#71 AS id#98, sales#80, co Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union -Arguments: [channel#101, id#102, sales#103, returns#104, profit#105] (87) HashAggregate [codegen id : 24] -Input [5]: [channel#101, id#102, sales#103, returns#104, profit#105] -Keys [2]: [channel#101, id#102] -Functions [3]: [partial_sum(sales#103), partial_sum(returns#104), partial_sum(profit#105)] -Aggregate Attributes [6]: [sum#106, isEmpty#107, sum#108, isEmpty#109, sum#110, isEmpty#111] -Results [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Input [5]: [channel#34, id#35, sales#17, returns#36, profit#37] +Keys [2]: [channel#34, id#35] +Functions [3]: [partial_sum(sales#17), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Results [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] (88) Exchange -Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] -Arguments: hashpartitioning(channel#101, id#102, 5), true, [id=#118] +Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Arguments: hashpartitioning(channel#34, id#35, 5), true, [id=#113] (89) HashAggregate [codegen id : 25] -Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] -Keys [2]: [channel#101, id#102] -Functions [3]: [sum(sales#103), sum(returns#104), sum(profit#105)] -Aggregate Attributes [3]: [sum(sales#103)#119, sum(returns#104)#120, sum(profit#105)#121] -Results [5]: [channel#101, id#102, cast(sum(sales#103)#119 as decimal(37,2)) AS sales#122, cast(sum(returns#104)#120 as decimal(37,2)) AS returns#123, cast(sum(profit#105)#121 as decimal(38,2)) AS profit#124] +Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#17)#114, sum(returns#36)#115, sum(profit#37)#116] +Results [5]: [channel#34, id#35, cast(sum(sales#17)#114 as decimal(37,2)) AS sales#117, cast(sum(returns#36)#115 as decimal(37,2)) AS returns#118, cast(sum(profit#37)#116 as decimal(38,2)) AS profit#119] (90) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Output [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] (91) HashAggregate [codegen id : 50] -Input [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] -Keys [2]: [channel#125, id#126] -Functions [3]: [sum(sales#133), sum(returns#134), sum(profit#135)] -Aggregate Attributes [3]: [sum(sales#133)#136, sum(returns#134)#137, sum(profit#135)#138] -Results [4]: [channel#125, sum(sales#133)#136 AS sales#139, sum(returns#134)#137 AS returns#140, sum(profit#135)#138 AS profit#141] +Input [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#126)] +Aggregate Attributes [3]: [sum(sales#17)#127, sum(returns#36)#128, sum(profit#126)#129] +Results [4]: [channel#34, sum(sales#17)#127 AS sales#130, sum(returns#36)#128 AS returns#131, sum(profit#126)#129 AS profit#132] (92) HashAggregate [codegen id : 50] -Input [4]: [channel#125, sales#139, returns#140, profit#141] -Keys [1]: [channel#125] -Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] -Aggregate Attributes [6]: [sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] -Results [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Input [4]: [channel#34, sales#130, returns#131, profit#132] +Keys [1]: [channel#34] +Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] +Aggregate Attributes [6]: [sum#133, isEmpty#134, sum#135, isEmpty#136, sum#137, isEmpty#138] +Results [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] (93) Exchange -Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] -Arguments: hashpartitioning(channel#125, 5), true, [id=#154] +Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Arguments: hashpartitioning(channel#34, 5), true, [id=#145] (94) HashAggregate [codegen id : 51] -Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] -Keys [1]: [channel#125] -Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] -Aggregate Attributes [3]: [sum(sales#139)#155, sum(returns#140)#156, sum(profit#141)#157] -Results [5]: [channel#125, null AS id#158, sum(sales#139)#155 AS sales#159, sum(returns#140)#156 AS returns#160, sum(profit#141)#157 AS profit#161] +Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Keys [1]: [channel#34] +Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#130)#146, sum(returns#131)#147, sum(profit#132)#148] +Results [5]: [channel#34, null AS id#149, sum(sales#130)#146 AS sales#150, sum(returns#131)#147 AS returns#151, sum(profit#132)#148 AS profit#152] (95) Union -Arguments: [channel#162, id#163, sales#164, returns#165, profit#166] (96) HashAggregate [codegen id : 52] -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (97) Exchange -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Arguments: hashpartitioning(channel#162, id#163, sales#164, returns#165, profit#166, 5), true, [id=#167] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#153] (98) HashAggregate [codegen id : 53] -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (99) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Output [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] (100) HashAggregate [codegen id : 78] -Input [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Keys [2]: [channel#168, id#169] -Functions [3]: [sum(sales#176), sum(returns#177), sum(profit#178)] -Aggregate Attributes [3]: [sum(sales#176)#179, sum(returns#177)#180, sum(profit#178)#181] -Results [3]: [sum(sales#176)#179 AS sales#139, sum(returns#177)#180 AS returns#140, sum(profit#178)#181 AS profit#141] +Input [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#160)] +Aggregate Attributes [3]: [sum(sales#17)#161, sum(returns#36)#162, sum(profit#160)#163] +Results [3]: [sum(sales#17)#161 AS sales#130, sum(returns#36)#162 AS returns#131, sum(profit#160)#163 AS profit#132] (101) HashAggregate [codegen id : 78] -Input [3]: [sales#139, returns#140, profit#141] +Input [3]: [sales#130, returns#131, profit#132] Keys: [] -Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] -Aggregate Attributes [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] -Results [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] +Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Results [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] (102) Exchange -Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] -Arguments: SinglePartition, true, [id=#194] +Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Arguments: SinglePartition, true, [id=#176] (103) HashAggregate [codegen id : 79] -Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] Keys: [] -Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] -Aggregate Attributes [3]: [sum(sales#139)#195, sum(returns#140)#196, sum(profit#141)#197] -Results [5]: [null AS channel#198, null AS id#199, sum(sales#139)#195 AS sales#200, sum(returns#140)#196 AS returns#201, sum(profit#141)#197 AS profit#202] +Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#130)#177, sum(returns#131)#178, sum(profit#132)#179] +Results [5]: [null AS channel#180, null AS id#181, sum(sales#130)#177 AS sales#182, sum(returns#131)#178 AS returns#183, sum(profit#132)#179 AS profit#184] (104) Union -Arguments: [channel#203, id#204, sales#205, returns#206, profit#207] (105) HashAggregate [codegen id : 80] -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (106) Exchange -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Arguments: hashpartitioning(channel#203, id#204, sales#205, returns#206, profit#207, 5), true, [id=#208] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#185] (107) HashAggregate [codegen id : 81] -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (108) TakeOrderedAndProject -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Arguments: 100, [channel#203 ASC NULLS FIRST, id#204 ASC NULLS FIRST], [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: 100, [channel#34 ASC NULLS FIRST, id#35 ASC NULLS FIRST], [channel#34, id#35, sales#117, returns#118, profit#119] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt index 1dd163c1d9c57..92c25891f940e 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (80) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (53) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (52) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (25) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (24) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (8) Project [s_store_sk,sales,returns,profit,profit_loss] BroadcastHashJoin [s_store_sk,s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt index 4d5e17399bdcc..c18698ebc5b45 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt @@ -508,125 +508,122 @@ Output [5]: [web channel AS channel#97, wp_web_page_sk#71 AS id#98, sales#80, co Input [6]: [wp_web_page_sk#71, sales#80, profit#81, wp_web_page_sk#86, returns#94, profit_loss#95] (86) Union -Arguments: [channel#101, id#102, sales#103, returns#104, profit#105] (87) HashAggregate [codegen id : 24] -Input [5]: [channel#101, id#102, sales#103, returns#104, profit#105] -Keys [2]: [channel#101, id#102] -Functions [3]: [partial_sum(sales#103), partial_sum(returns#104), partial_sum(profit#105)] -Aggregate Attributes [6]: [sum#106, isEmpty#107, sum#108, isEmpty#109, sum#110, isEmpty#111] -Results [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Input [5]: [channel#34, id#35, sales#17, returns#36, profit#37] +Keys [2]: [channel#34, id#35] +Functions [3]: [partial_sum(sales#17), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Results [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] (88) Exchange -Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] -Arguments: hashpartitioning(channel#101, id#102, 5), true, [id=#118] +Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Arguments: hashpartitioning(channel#34, id#35, 5), true, [id=#113] (89) HashAggregate [codegen id : 25] -Input [8]: [channel#101, id#102, sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] -Keys [2]: [channel#101, id#102] -Functions [3]: [sum(sales#103), sum(returns#104), sum(profit#105)] -Aggregate Attributes [3]: [sum(sales#103)#119, sum(returns#104)#120, sum(profit#105)#121] -Results [5]: [channel#101, id#102, cast(sum(sales#103)#119 as decimal(37,2)) AS sales#122, cast(sum(returns#104)#120 as decimal(37,2)) AS returns#123, cast(sum(profit#105)#121 as decimal(38,2)) AS profit#124] +Input [8]: [channel#34, id#35, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#17)#114, sum(returns#36)#115, sum(profit#37)#116] +Results [5]: [channel#34, id#35, cast(sum(sales#17)#114 as decimal(37,2)) AS sales#117, cast(sum(returns#36)#115 as decimal(37,2)) AS returns#118, cast(sum(profit#37)#116 as decimal(38,2)) AS profit#119] (90) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] +Output [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] (91) HashAggregate [codegen id : 50] -Input [8]: [channel#125, id#126, sum#127, isEmpty#128, sum#129, isEmpty#130, sum#131, isEmpty#132] -Keys [2]: [channel#125, id#126] -Functions [3]: [sum(sales#133), sum(returns#134), sum(profit#135)] -Aggregate Attributes [3]: [sum(sales#133)#136, sum(returns#134)#137, sum(profit#135)#138] -Results [4]: [channel#125, sum(sales#133)#136 AS sales#139, sum(returns#134)#137 AS returns#140, sum(profit#135)#138 AS profit#141] +Input [8]: [channel#34, id#35, sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#126)] +Aggregate Attributes [3]: [sum(sales#17)#127, sum(returns#36)#128, sum(profit#126)#129] +Results [4]: [channel#34, sum(sales#17)#127 AS sales#130, sum(returns#36)#128 AS returns#131, sum(profit#126)#129 AS profit#132] (92) HashAggregate [codegen id : 50] -Input [4]: [channel#125, sales#139, returns#140, profit#141] -Keys [1]: [channel#125] -Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] -Aggregate Attributes [6]: [sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] -Results [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] +Input [4]: [channel#34, sales#130, returns#131, profit#132] +Keys [1]: [channel#34] +Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] +Aggregate Attributes [6]: [sum#133, isEmpty#134, sum#135, isEmpty#136, sum#137, isEmpty#138] +Results [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] (93) Exchange -Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] -Arguments: hashpartitioning(channel#125, 5), true, [id=#154] +Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Arguments: hashpartitioning(channel#34, 5), true, [id=#145] (94) HashAggregate [codegen id : 51] -Input [7]: [channel#125, sum#148, isEmpty#149, sum#150, isEmpty#151, sum#152, isEmpty#153] -Keys [1]: [channel#125] -Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] -Aggregate Attributes [3]: [sum(sales#139)#155, sum(returns#140)#156, sum(profit#141)#157] -Results [5]: [channel#125, null AS id#158, sum(sales#139)#155 AS sales#159, sum(returns#140)#156 AS returns#160, sum(profit#141)#157 AS profit#161] +Input [7]: [channel#34, sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Keys [1]: [channel#34] +Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#130)#146, sum(returns#131)#147, sum(profit#132)#148] +Results [5]: [channel#34, null AS id#149, sum(sales#130)#146 AS sales#150, sum(returns#131)#147 AS returns#151, sum(profit#132)#148 AS profit#152] (95) Union -Arguments: [channel#162, id#163, sales#164, returns#165, profit#166] (96) HashAggregate [codegen id : 52] -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (97) Exchange -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Arguments: hashpartitioning(channel#162, id#163, sales#164, returns#165, profit#166, 5), true, [id=#167] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#153] (98) HashAggregate [codegen id : 53] -Input [5]: [channel#162, id#163, sales#164, returns#165, profit#166] -Keys [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#162, id#163, sales#164, returns#165, profit#166] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (99) ReusedExchange [Reuses operator id: 88] -Output [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Output [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] (100) HashAggregate [codegen id : 78] -Input [8]: [channel#168, id#169, sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] -Keys [2]: [channel#168, id#169] -Functions [3]: [sum(sales#176), sum(returns#177), sum(profit#178)] -Aggregate Attributes [3]: [sum(sales#176)#179, sum(returns#177)#180, sum(profit#178)#181] -Results [3]: [sum(sales#176)#179 AS sales#139, sum(returns#177)#180 AS returns#140, sum(profit#178)#181 AS profit#141] +Input [8]: [channel#34, id#35, sum#154, isEmpty#155, sum#156, isEmpty#157, sum#158, isEmpty#159] +Keys [2]: [channel#34, id#35] +Functions [3]: [sum(sales#17), sum(returns#36), sum(profit#160)] +Aggregate Attributes [3]: [sum(sales#17)#161, sum(returns#36)#162, sum(profit#160)#163] +Results [3]: [sum(sales#17)#161 AS sales#130, sum(returns#36)#162 AS returns#131, sum(profit#160)#163 AS profit#132] (101) HashAggregate [codegen id : 78] -Input [3]: [sales#139, returns#140, profit#141] +Input [3]: [sales#130, returns#131, profit#132] Keys: [] -Functions [3]: [partial_sum(sales#139), partial_sum(returns#140), partial_sum(profit#141)] -Aggregate Attributes [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] -Results [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Functions [3]: [partial_sum(sales#130), partial_sum(returns#131), partial_sum(profit#132)] +Aggregate Attributes [6]: [sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Results [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] (102) Exchange -Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] -Arguments: SinglePartition, true, [id=#194] +Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] +Arguments: SinglePartition, true, [id=#176] (103) HashAggregate [codegen id : 79] -Input [6]: [sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Input [6]: [sum#170, isEmpty#171, sum#172, isEmpty#173, sum#174, isEmpty#175] Keys: [] -Functions [3]: [sum(sales#139), sum(returns#140), sum(profit#141)] -Aggregate Attributes [3]: [sum(sales#139)#195, sum(returns#140)#196, sum(profit#141)#197] -Results [5]: [null AS channel#198, null AS id#199, sum(sales#139)#195 AS sales#200, sum(returns#140)#196 AS returns#201, sum(profit#141)#197 AS profit#202] +Functions [3]: [sum(sales#130), sum(returns#131), sum(profit#132)] +Aggregate Attributes [3]: [sum(sales#130)#177, sum(returns#131)#178, sum(profit#132)#179] +Results [5]: [null AS channel#180, null AS id#181, sum(sales#130)#177 AS sales#182, sum(returns#131)#178 AS returns#183, sum(profit#132)#179 AS profit#184] (104) Union -Arguments: [channel#203, id#204, sales#205, returns#206, profit#207] (105) HashAggregate [codegen id : 80] -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (106) Exchange -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Arguments: hashpartitioning(channel#203, id#204, sales#205, returns#206, profit#207, 5), true, [id=#208] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: hashpartitioning(channel#34, id#35, sales#117, returns#118, profit#119, 5), true, [id=#185] (107) HashAggregate [codegen id : 81] -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Keys [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Keys [5]: [channel#34, id#35, sales#117, returns#118, profit#119] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#203, id#204, sales#205, returns#206, profit#207] +Results [5]: [channel#34, id#35, sales#117, returns#118, profit#119] (108) TakeOrderedAndProject -Input [5]: [channel#203, id#204, sales#205, returns#206, profit#207] -Arguments: 100, [channel#203 ASC NULLS FIRST, id#204 ASC NULLS FIRST], [channel#203, id#204, sales#205, returns#206, profit#207] +Input [5]: [channel#34, id#35, sales#117, returns#118, profit#119] +Arguments: 100, [channel#34 ASC NULLS FIRST, id#35 ASC NULLS FIRST], [channel#34, id#35, sales#117, returns#118, profit#119] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt index 7d9082dce4b6c..864039e512231 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (80) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (53) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (52) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (25) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (24) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (8) Project [s_store_sk,sales,returns,profit,profit_loss] BroadcastHashJoin [s_store_sk,s_store_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 156e82828a56a..025e5a6f94741 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 @@ -586,125 +586,122 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#85))#107, sum(co Results [5]: [web channel AS channel#110, concat(web_site, web_site_id#94) AS id#111, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#85))#107,17,2) AS sales#112, sum(coalesce(cast(wr_return_amt#90 as decimal(12,2)), 0.00))#108 AS returns#113, sum(CheckOverflow((promote_precision(cast(ws_net_profit#86 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#91 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#109 AS profit#114] (103) Union -Arguments: [channel#115, id#116, sales#117, returns#118, profit#119] (104) HashAggregate [codegen id : 31] -Input [5]: [channel#115, id#116, sales#117, returns#118, profit#119] -Keys [2]: [channel#115, id#116] -Functions [3]: [partial_sum(sales#117), partial_sum(returns#118), partial_sum(profit#119)] -Aggregate Attributes [6]: [sum#120, isEmpty#121, sum#122, isEmpty#123, sum#124, isEmpty#125] -Results [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Input [5]: [channel#40, id#41, sales#42, returns#43, profit#44] +Keys [2]: [channel#40, id#41] +Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] +Aggregate Attributes [6]: [sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120] +Results [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] (105) Exchange -Input [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] -Arguments: hashpartitioning(channel#115, id#116, 5), true, [id=#132] +Input [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Arguments: hashpartitioning(channel#40, id#41, 5), true, [id=#127] (106) HashAggregate [codegen id : 32] -Input [8]: [channel#115, id#116, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] -Keys [2]: [channel#115, id#116] -Functions [3]: [sum(sales#117), sum(returns#118), sum(profit#119)] -Aggregate Attributes [3]: [sum(sales#117)#133, sum(returns#118)#134, sum(profit#119)#135] -Results [5]: [channel#115, id#116, cast(sum(sales#117)#133 as decimal(37,2)) AS sales#136, cast(sum(returns#118)#134 as decimal(38,2)) AS returns#137, cast(sum(profit#119)#135 as decimal(38,2)) AS profit#138] +Input [8]: [channel#40, id#41, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#128, sum(returns#43)#129, sum(profit#44)#130] +Results [5]: [channel#40, id#41, cast(sum(sales#42)#128 as decimal(37,2)) AS sales#131, cast(sum(returns#43)#129 as decimal(38,2)) AS returns#132, cast(sum(profit#44)#130 as decimal(38,2)) AS profit#133] (107) ReusedExchange [Reuses operator id: 105] -Output [8]: [channel#139, id#140, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] +Output [8]: [channel#40, id#41, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] (108) HashAggregate [codegen id : 64] -Input [8]: [channel#139, id#140, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146] -Keys [2]: [channel#139, id#140] -Functions [3]: [sum(sales#147), sum(returns#148), sum(profit#149)] -Aggregate Attributes [3]: [sum(sales#147)#150, sum(returns#148)#151, sum(profit#149)#152] -Results [4]: [channel#139, sum(sales#147)#150 AS sales#153, sum(returns#148)#151 AS returns#154, sum(profit#149)#152 AS profit#155] +Input [8]: [channel#40, id#41, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#140, sum(returns#43)#141, sum(profit#44)#142] +Results [4]: [channel#40, sum(sales#42)#140 AS sales#143, sum(returns#43)#141 AS returns#144, sum(profit#44)#142 AS profit#145] (109) HashAggregate [codegen id : 64] -Input [4]: [channel#139, sales#153, returns#154, profit#155] -Keys [1]: [channel#139] -Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] -Aggregate Attributes [6]: [sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] -Results [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Input [4]: [channel#40, sales#143, returns#144, profit#145] +Keys [1]: [channel#40] +Functions [3]: [partial_sum(sales#143), partial_sum(returns#144), partial_sum(profit#145)] +Aggregate Attributes [6]: [sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Results [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] (110) Exchange -Input [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] -Arguments: hashpartitioning(channel#139, 5), true, [id=#168] +Input [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] +Arguments: hashpartitioning(channel#40, 5), true, [id=#158] (111) HashAggregate [codegen id : 65] -Input [7]: [channel#139, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] -Keys [1]: [channel#139] -Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] -Aggregate Attributes [3]: [sum(sales#153)#169, sum(returns#154)#170, sum(profit#155)#171] -Results [5]: [channel#139, null AS id#172, sum(sales#153)#169 AS sales#173, sum(returns#154)#170 AS returns#174, sum(profit#155)#171 AS profit#175] +Input [7]: [channel#40, sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157] +Keys [1]: [channel#40] +Functions [3]: [sum(sales#143), sum(returns#144), sum(profit#145)] +Aggregate Attributes [3]: [sum(sales#143)#159, sum(returns#144)#160, sum(profit#145)#161] +Results [5]: [channel#40, null AS id#162, sum(sales#143)#159 AS sales#163, sum(returns#144)#160 AS returns#164, sum(profit#145)#161 AS profit#165] (112) Union -Arguments: [channel#176, id#177, sales#178, returns#179, profit#180] (113) HashAggregate [codegen id : 66] -Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] -Keys [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] (114) Exchange -Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] -Arguments: hashpartitioning(channel#176, id#177, sales#178, returns#179, profit#180, 5), true, [id=#181] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Arguments: hashpartitioning(channel#40, id#41, sales#131, returns#132, profit#133, 5), true, [id=#166] (115) HashAggregate [codegen id : 67] -Input [5]: [channel#176, id#177, sales#178, returns#179, profit#180] -Keys [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#176, id#177, sales#178, returns#179, profit#180] +Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] (116) ReusedExchange [Reuses operator id: 105] -Output [8]: [channel#182, id#183, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] +Output [8]: [channel#40, id#41, sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] (117) HashAggregate [codegen id : 99] -Input [8]: [channel#182, id#183, sum#184, isEmpty#185, sum#186, isEmpty#187, sum#188, isEmpty#189] -Keys [2]: [channel#182, id#183] -Functions [3]: [sum(sales#190), sum(returns#191), sum(profit#192)] -Aggregate Attributes [3]: [sum(sales#190)#193, sum(returns#191)#194, sum(profit#192)#195] -Results [3]: [sum(sales#190)#193 AS sales#153, sum(returns#191)#194 AS returns#154, sum(profit#192)#195 AS profit#155] +Input [8]: [channel#40, id#41, sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Keys [2]: [channel#40, id#41] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#173, sum(returns#43)#174, sum(profit#44)#175] +Results [3]: [sum(sales#42)#173 AS sales#143, sum(returns#43)#174 AS returns#144, sum(profit#44)#175 AS profit#145] (118) HashAggregate [codegen id : 99] -Input [3]: [sales#153, returns#154, profit#155] +Input [3]: [sales#143, returns#144, profit#145] Keys: [] -Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] -Aggregate Attributes [6]: [sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] -Results [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Functions [3]: [partial_sum(sales#143), partial_sum(returns#144), partial_sum(profit#145)] +Aggregate Attributes [6]: [sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Results [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] (119) Exchange -Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] -Arguments: SinglePartition, true, [id=#208] +Input [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] +Arguments: SinglePartition, true, [id=#188] (120) HashAggregate [codegen id : 100] -Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Input [6]: [sum#182, isEmpty#183, sum#184, isEmpty#185, sum#186, isEmpty#187] Keys: [] -Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] -Aggregate Attributes [3]: [sum(sales#153)#209, sum(returns#154)#210, sum(profit#155)#211] -Results [5]: [null AS channel#212, null AS id#213, sum(sales#153)#209 AS sales#214, sum(returns#154)#210 AS returns#215, sum(profit#155)#211 AS profit#216] +Functions [3]: [sum(sales#143), sum(returns#144), sum(profit#145)] +Aggregate Attributes [3]: [sum(sales#143)#189, sum(returns#144)#190, sum(profit#145)#191] +Results [5]: [null AS channel#192, null AS id#193, sum(sales#143)#189 AS sales#194, sum(returns#144)#190 AS returns#195, sum(profit#145)#191 AS profit#196] (121) Union -Arguments: [channel#217, id#218, sales#219, returns#220, profit#221] (122) HashAggregate [codegen id : 101] -Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] -Keys [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] (123) Exchange -Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] -Arguments: hashpartitioning(channel#217, id#218, sales#219, returns#220, profit#221, 5), true, [id=#222] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Arguments: hashpartitioning(channel#40, id#41, sales#131, returns#132, profit#133, 5), true, [id=#197] (124) HashAggregate [codegen id : 102] -Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] -Keys [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Keys [5]: [channel#40, id#41, sales#131, returns#132, profit#133] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#217, id#218, sales#219, returns#220, profit#221] +Results [5]: [channel#40, id#41, sales#131, returns#132, profit#133] (125) TakeOrderedAndProject -Input [5]: [channel#217, id#218, sales#219, returns#220, profit#221] -Arguments: 100, [channel#217 ASC NULLS FIRST, id#218 ASC NULLS FIRST], [channel#217, id#218, sales#219, returns#220, profit#221] +Input [5]: [channel#40, id#41, sales#131, returns#132, profit#133] +Arguments: 100, [channel#40 ASC NULLS FIRST, id#41 ASC NULLS FIRST], [channel#40, id#41, sales#131, returns#132, profit#133] 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 999f36d7d0284..ad59968740aaa 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 @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (101) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (67) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (66) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (32) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (31) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + 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 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt index 987fa90dbcddf..ddfdeadcf8eb3 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt @@ -541,125 +541,122 @@ Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#83))#104, sum(co Results [5]: [web channel AS channel#107, concat(web_site, web_site_id#91) AS id#108, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#83))#104,17,2) AS sales#109, sum(coalesce(cast(wr_return_amt#87 as decimal(12,2)), 0.00))#105 AS returns#110, sum(CheckOverflow((promote_precision(cast(ws_net_profit#84 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#88 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#106 AS profit#111] (94) Union -Arguments: [channel#112, id#113, sales#114, returns#115, profit#116] (95) HashAggregate [codegen id : 22] -Input [5]: [channel#112, id#113, sales#114, returns#115, profit#116] -Keys [2]: [channel#112, id#113] -Functions [3]: [partial_sum(sales#114), partial_sum(returns#115), partial_sum(profit#116)] -Aggregate Attributes [6]: [sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] -Results [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] +Input [5]: [channel#39, id#40, sales#41, returns#42, profit#43] +Keys [2]: [channel#39, id#40] +Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] +Aggregate Attributes [6]: [sum#112, isEmpty#113, sum#114, isEmpty#115, sum#116, isEmpty#117] +Results [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] (96) Exchange -Input [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] -Arguments: hashpartitioning(channel#112, id#113, 5), true, [id=#129] +Input [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] +Arguments: hashpartitioning(channel#39, id#40, 5), true, [id=#124] (97) HashAggregate [codegen id : 23] -Input [8]: [channel#112, id#113, sum#123, isEmpty#124, sum#125, isEmpty#126, sum#127, isEmpty#128] -Keys [2]: [channel#112, id#113] -Functions [3]: [sum(sales#114), sum(returns#115), sum(profit#116)] -Aggregate Attributes [3]: [sum(sales#114)#130, sum(returns#115)#131, sum(profit#116)#132] -Results [5]: [channel#112, id#113, cast(sum(sales#114)#130 as decimal(37,2)) AS sales#133, cast(sum(returns#115)#131 as decimal(38,2)) AS returns#134, cast(sum(profit#116)#132 as decimal(38,2)) AS profit#135] +Input [8]: [channel#39, id#40, sum#118, isEmpty#119, sum#120, isEmpty#121, sum#122, isEmpty#123] +Keys [2]: [channel#39, id#40] +Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] +Aggregate Attributes [3]: [sum(sales#41)#125, sum(returns#42)#126, sum(profit#43)#127] +Results [5]: [channel#39, id#40, cast(sum(sales#41)#125 as decimal(37,2)) AS sales#128, cast(sum(returns#42)#126 as decimal(38,2)) AS returns#129, cast(sum(profit#43)#127 as decimal(38,2)) AS profit#130] (98) ReusedExchange [Reuses operator id: 96] -Output [8]: [channel#136, id#137, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Output [8]: [channel#39, id#40, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] (99) HashAggregate [codegen id : 46] -Input [8]: [channel#136, id#137, sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] -Keys [2]: [channel#136, id#137] -Functions [3]: [sum(sales#144), sum(returns#145), sum(profit#146)] -Aggregate Attributes [3]: [sum(sales#144)#147, sum(returns#145)#148, sum(profit#146)#149] -Results [4]: [channel#136, sum(sales#144)#147 AS sales#150, sum(returns#145)#148 AS returns#151, sum(profit#146)#149 AS profit#152] +Input [8]: [channel#39, id#40, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Keys [2]: [channel#39, id#40] +Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] +Aggregate Attributes [3]: [sum(sales#41)#137, sum(returns#42)#138, sum(profit#43)#139] +Results [4]: [channel#39, sum(sales#41)#137 AS sales#140, sum(returns#42)#138 AS returns#141, sum(profit#43)#139 AS profit#142] (100) HashAggregate [codegen id : 46] -Input [4]: [channel#136, sales#150, returns#151, profit#152] -Keys [1]: [channel#136] -Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] -Aggregate Attributes [6]: [sum#153, isEmpty#154, sum#155, isEmpty#156, sum#157, isEmpty#158] -Results [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] +Input [4]: [channel#39, sales#140, returns#141, profit#142] +Keys [1]: [channel#39] +Functions [3]: [partial_sum(sales#140), partial_sum(returns#141), partial_sum(profit#142)] +Aggregate Attributes [6]: [sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Results [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] (101) Exchange -Input [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] -Arguments: hashpartitioning(channel#136, 5), true, [id=#165] +Input [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] +Arguments: hashpartitioning(channel#39, 5), true, [id=#155] (102) HashAggregate [codegen id : 47] -Input [7]: [channel#136, sum#159, isEmpty#160, sum#161, isEmpty#162, sum#163, isEmpty#164] -Keys [1]: [channel#136] -Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] -Aggregate Attributes [3]: [sum(sales#150)#166, sum(returns#151)#167, sum(profit#152)#168] -Results [5]: [channel#136, null AS id#169, sum(sales#150)#166 AS sales#170, sum(returns#151)#167 AS returns#171, sum(profit#152)#168 AS profit#172] +Input [7]: [channel#39, sum#149, isEmpty#150, sum#151, isEmpty#152, sum#153, isEmpty#154] +Keys [1]: [channel#39] +Functions [3]: [sum(sales#140), sum(returns#141), sum(profit#142)] +Aggregate Attributes [3]: [sum(sales#140)#156, sum(returns#141)#157, sum(profit#142)#158] +Results [5]: [channel#39, null AS id#159, sum(sales#140)#156 AS sales#160, sum(returns#141)#157 AS returns#161, sum(profit#142)#158 AS profit#162] (103) Union -Arguments: [channel#173, id#174, sales#175, returns#176, profit#177] (104) HashAggregate [codegen id : 48] -Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] -Keys [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] (105) Exchange -Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] -Arguments: hashpartitioning(channel#173, id#174, sales#175, returns#176, profit#177, 5), true, [id=#178] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Arguments: hashpartitioning(channel#39, id#40, sales#128, returns#129, profit#130, 5), true, [id=#163] (106) HashAggregate [codegen id : 49] -Input [5]: [channel#173, id#174, sales#175, returns#176, profit#177] -Keys [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#173, id#174, sales#175, returns#176, profit#177] +Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] (107) ReusedExchange [Reuses operator id: 96] -Output [8]: [channel#179, id#180, sum#181, isEmpty#182, sum#183, isEmpty#184, sum#185, isEmpty#186] +Output [8]: [channel#39, id#40, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] (108) HashAggregate [codegen id : 72] -Input [8]: [channel#179, id#180, sum#181, isEmpty#182, sum#183, isEmpty#184, sum#185, isEmpty#186] -Keys [2]: [channel#179, id#180] -Functions [3]: [sum(sales#187), sum(returns#188), sum(profit#189)] -Aggregate Attributes [3]: [sum(sales#187)#190, sum(returns#188)#191, sum(profit#189)#192] -Results [3]: [sum(sales#187)#190 AS sales#150, sum(returns#188)#191 AS returns#151, sum(profit#189)#192 AS profit#152] +Input [8]: [channel#39, id#40, sum#164, isEmpty#165, sum#166, isEmpty#167, sum#168, isEmpty#169] +Keys [2]: [channel#39, id#40] +Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] +Aggregate Attributes [3]: [sum(sales#41)#170, sum(returns#42)#171, sum(profit#43)#172] +Results [3]: [sum(sales#41)#170 AS sales#140, sum(returns#42)#171 AS returns#141, sum(profit#43)#172 AS profit#142] (109) HashAggregate [codegen id : 72] -Input [3]: [sales#150, returns#151, profit#152] +Input [3]: [sales#140, returns#141, profit#142] Keys: [] -Functions [3]: [partial_sum(sales#150), partial_sum(returns#151), partial_sum(profit#152)] -Aggregate Attributes [6]: [sum#193, isEmpty#194, sum#195, isEmpty#196, sum#197, isEmpty#198] -Results [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] +Functions [3]: [partial_sum(sales#140), partial_sum(returns#141), partial_sum(profit#142)] +Aggregate Attributes [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Results [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] (110) Exchange -Input [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] -Arguments: SinglePartition, true, [id=#205] +Input [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] +Arguments: SinglePartition, true, [id=#185] (111) HashAggregate [codegen id : 73] -Input [6]: [sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204] +Input [6]: [sum#179, isEmpty#180, sum#181, isEmpty#182, sum#183, isEmpty#184] Keys: [] -Functions [3]: [sum(sales#150), sum(returns#151), sum(profit#152)] -Aggregate Attributes [3]: [sum(sales#150)#206, sum(returns#151)#207, sum(profit#152)#208] -Results [5]: [null AS channel#209, null AS id#210, sum(sales#150)#206 AS sales#211, sum(returns#151)#207 AS returns#212, sum(profit#152)#208 AS profit#213] +Functions [3]: [sum(sales#140), sum(returns#141), sum(profit#142)] +Aggregate Attributes [3]: [sum(sales#140)#186, sum(returns#141)#187, sum(profit#142)#188] +Results [5]: [null AS channel#189, null AS id#190, sum(sales#140)#186 AS sales#191, sum(returns#141)#187 AS returns#192, sum(profit#142)#188 AS profit#193] (112) Union -Arguments: [channel#214, id#215, sales#216, returns#217, profit#218] (113) HashAggregate [codegen id : 74] -Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] -Keys [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] (114) Exchange -Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] -Arguments: hashpartitioning(channel#214, id#215, sales#216, returns#217, profit#218, 5), true, [id=#219] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Arguments: hashpartitioning(channel#39, id#40, sales#128, returns#129, profit#130, 5), true, [id=#194] (115) HashAggregate [codegen id : 75] -Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] -Keys [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Keys [5]: [channel#39, id#40, sales#128, returns#129, profit#130] Functions: [] Aggregate Attributes: [] -Results [5]: [channel#214, id#215, sales#216, returns#217, profit#218] +Results [5]: [channel#39, id#40, sales#128, returns#129, profit#130] (116) TakeOrderedAndProject -Input [5]: [channel#214, id#215, sales#216, returns#217, profit#218] -Arguments: 100, [channel#214 ASC NULLS FIRST, id#215 ASC NULLS FIRST], [channel#214, id#215, sales#216, returns#217, profit#218] +Input [5]: [channel#39, id#40, sales#128, returns#129, profit#130] +Arguments: 100, [channel#39 ASC NULLS FIRST, id#40 ASC NULLS FIRST], [channel#39, id#40, sales#128, returns#129, profit#130] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt index 3142f75ea2698..602a670a49116 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt @@ -6,7 +6,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (74) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (49) HashAggregate [channel,id,sales,returns,profit] InputAdapter @@ -14,7 +14,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (48) HashAggregate [channel,id,sales,returns,profit] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (23) HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [channel,id,sales,returns,profit] WholeStageCodegen (22) HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] InputAdapter - Union [channel,id,sales,returns,profit] + Union WholeStageCodegen (7) 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 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt index e5b049f6d33b2..f61c214640e33 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt @@ -162,92 +162,90 @@ Aggregate Attributes [1]: [sum(total_sum#21)#27] Results [6]: [sum(total_sum#21)#27 AS total_sum#28, i_category#9, null AS i_class#29, 0 AS g_category#30, 1 AS g_class#31, 1 AS lochierarchy#32] (25) Union -Arguments: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (26) HashAggregate [codegen id : 10] -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (27) Exchange -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Arguments: hashpartitioning(total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38, 5), true, [id=#39] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#33] (28) HashAggregate [codegen id : 11] -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (29) ReusedExchange [Reuses operator id: 18] -Output [3]: [i_category#9, i_class#8, sum#40] +Output [3]: [i_category#9, i_class#8, sum#34] (30) HashAggregate [codegen id : 15] -Input [3]: [i_category#9, i_class#8, sum#40] +Input [3]: [i_category#9, i_class#8, sum#34] Keys [2]: [i_category#9, i_class#8] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#41] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#41,17,2) AS total_sum#21] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#35] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#35,17,2) AS total_sum#21] (31) HashAggregate [codegen id : 15] Input [1]: [total_sum#21] Keys: [] Functions [1]: [partial_sum(total_sum#21)] -Aggregate Attributes [2]: [sum#42, isEmpty#43] -Results [2]: [sum#44, isEmpty#45] +Aggregate Attributes [2]: [sum#36, isEmpty#37] +Results [2]: [sum#38, isEmpty#39] (32) Exchange -Input [2]: [sum#44, isEmpty#45] -Arguments: SinglePartition, true, [id=#46] +Input [2]: [sum#38, isEmpty#39] +Arguments: SinglePartition, true, [id=#40] (33) HashAggregate [codegen id : 16] -Input [2]: [sum#44, isEmpty#45] +Input [2]: [sum#38, isEmpty#39] Keys: [] Functions [1]: [sum(total_sum#21)] -Aggregate Attributes [1]: [sum(total_sum#21)#47] -Results [6]: [sum(total_sum#21)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] +Aggregate Attributes [1]: [sum(total_sum#21)#41] +Results [6]: [sum(total_sum#21)#41 AS total_sum#42, null AS i_category#43, null AS i_class#44, 1 AS g_category#45, 1 AS g_class#46, 2 AS lochierarchy#47] (34) Union -Arguments: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (35) HashAggregate [codegen id : 17] -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (36) Exchange -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Arguments: hashpartitioning(total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59, 5), true, [id=#60] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#48] (37) HashAggregate [codegen id : 18] -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, CASE WHEN (g_class#58 = 0) THEN i_category#55 END AS _w0#61] +Results [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, CASE WHEN (g_class#17 = 0) THEN i_category#9 END AS _w0#49] (38) Exchange -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: hashpartitioning(lochierarchy#59, _w0#61, 5), true, [id=#62] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: hashpartitioning(lochierarchy#18, _w0#49, 5), true, [id=#50] (39) Sort [codegen id : 19] -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: [lochierarchy#59 ASC NULLS FIRST, _w0#61 ASC NULLS FIRST, total_sum#54 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: [lochierarchy#18 ASC NULLS FIRST, _w0#49 ASC NULLS FIRST, total_sum#15 DESC NULLS LAST], false, 0 (40) Window -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: [rank(total_sum#54) windowspecdefinition(lochierarchy#59, _w0#61, total_sum#54 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#63], [lochierarchy#59, _w0#61], [total_sum#54 DESC NULLS LAST] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: [rank(total_sum#15) windowspecdefinition(lochierarchy#18, _w0#49, total_sum#15 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#51], [lochierarchy#18, _w0#49], [total_sum#15 DESC NULLS LAST] (41) Project [codegen id : 20] -Output [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] -Input [6]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61, rank_within_parent#63] +Output [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Input [6]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49, rank_within_parent#51] (42) TakeOrderedAndProject -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] -Arguments: 100, [lochierarchy#59 DESC NULLS LAST, CASE WHEN (lochierarchy#59 = 0) THEN i_category#55 END ASC NULLS FIRST, rank_within_parent#63 ASC NULLS FIRST], [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Arguments: 100, [lochierarchy#18 DESC NULLS LAST, CASE WHEN (lochierarchy#18 = 0) THEN i_category#9 END ASC NULLS FIRST, rank_within_parent#51 ASC NULLS FIRST], [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt index ad22a0b734e73..2bd128100f527 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (17) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + Union WholeStageCodegen (11) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (10) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + Union WholeStageCodegen (4) HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt index e5b049f6d33b2..f61c214640e33 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt @@ -162,92 +162,90 @@ Aggregate Attributes [1]: [sum(total_sum#21)#27] Results [6]: [sum(total_sum#21)#27 AS total_sum#28, i_category#9, null AS i_class#29, 0 AS g_category#30, 1 AS g_class#31, 1 AS lochierarchy#32] (25) Union -Arguments: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] (26) HashAggregate [codegen id : 10] -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (27) Exchange -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Arguments: hashpartitioning(total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38, 5), true, [id=#39] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#33] (28) HashAggregate [codegen id : 11] -Input [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] -Keys [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#33, i_category#34, i_class#35, g_category#36, g_class#37, lochierarchy#38] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (29) ReusedExchange [Reuses operator id: 18] -Output [3]: [i_category#9, i_class#8, sum#40] +Output [3]: [i_category#9, i_class#8, sum#34] (30) HashAggregate [codegen id : 15] -Input [3]: [i_category#9, i_class#8, sum#40] +Input [3]: [i_category#9, i_class#8, sum#34] Keys [2]: [i_category#9, i_class#8] Functions [1]: [sum(UnscaledValue(ws_net_paid#3))] -Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#41] -Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#41,17,2) AS total_sum#21] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#3))#35] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#3))#35,17,2) AS total_sum#21] (31) HashAggregate [codegen id : 15] Input [1]: [total_sum#21] Keys: [] Functions [1]: [partial_sum(total_sum#21)] -Aggregate Attributes [2]: [sum#42, isEmpty#43] -Results [2]: [sum#44, isEmpty#45] +Aggregate Attributes [2]: [sum#36, isEmpty#37] +Results [2]: [sum#38, isEmpty#39] (32) Exchange -Input [2]: [sum#44, isEmpty#45] -Arguments: SinglePartition, true, [id=#46] +Input [2]: [sum#38, isEmpty#39] +Arguments: SinglePartition, true, [id=#40] (33) HashAggregate [codegen id : 16] -Input [2]: [sum#44, isEmpty#45] +Input [2]: [sum#38, isEmpty#39] Keys: [] Functions [1]: [sum(total_sum#21)] -Aggregate Attributes [1]: [sum(total_sum#21)#47] -Results [6]: [sum(total_sum#21)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] +Aggregate Attributes [1]: [sum(total_sum#21)#41] +Results [6]: [sum(total_sum#21)#41 AS total_sum#42, null AS i_category#43, null AS i_class#44, 1 AS g_category#45, 1 AS g_class#46, 2 AS lochierarchy#47] (34) Union -Arguments: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] (35) HashAggregate [codegen id : 17] -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Results [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] (36) Exchange -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Arguments: hashpartitioning(total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59, 5), true, [id=#60] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Arguments: hashpartitioning(total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18, 5), true, [id=#48] (37) HashAggregate [codegen id : 18] -Input [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] -Keys [6]: [total_sum#54, i_category#55, i_class#56, g_category#57, g_class#58, lochierarchy#59] +Input [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] +Keys [6]: [total_sum#15, i_category#9, i_class#8, g_category#16, g_class#17, lochierarchy#18] Functions: [] Aggregate Attributes: [] -Results [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, CASE WHEN (g_class#58 = 0) THEN i_category#55 END AS _w0#61] +Results [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, CASE WHEN (g_class#17 = 0) THEN i_category#9 END AS _w0#49] (38) Exchange -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: hashpartitioning(lochierarchy#59, _w0#61, 5), true, [id=#62] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: hashpartitioning(lochierarchy#18, _w0#49, 5), true, [id=#50] (39) Sort [codegen id : 19] -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: [lochierarchy#59 ASC NULLS FIRST, _w0#61 ASC NULLS FIRST, total_sum#54 DESC NULLS LAST], false, 0 +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: [lochierarchy#18 ASC NULLS FIRST, _w0#49 ASC NULLS FIRST, total_sum#15 DESC NULLS LAST], false, 0 (40) Window -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61] -Arguments: [rank(total_sum#54) windowspecdefinition(lochierarchy#59, _w0#61, total_sum#54 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#63], [lochierarchy#59, _w0#61], [total_sum#54 DESC NULLS LAST] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49] +Arguments: [rank(total_sum#15) windowspecdefinition(lochierarchy#18, _w0#49, total_sum#15 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#51], [lochierarchy#18, _w0#49], [total_sum#15 DESC NULLS LAST] (41) Project [codegen id : 20] -Output [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] -Input [6]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, _w0#61, rank_within_parent#63] +Output [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Input [6]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, _w0#49, rank_within_parent#51] (42) TakeOrderedAndProject -Input [5]: [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] -Arguments: 100, [lochierarchy#59 DESC NULLS LAST, CASE WHEN (lochierarchy#59 = 0) THEN i_category#55 END ASC NULLS FIRST, rank_within_parent#63 ASC NULLS FIRST], [total_sum#54, i_category#55, i_class#56, lochierarchy#59, rank_within_parent#63] +Input [5]: [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] +Arguments: 100, [lochierarchy#18 DESC NULLS LAST, CASE WHEN (lochierarchy#18 = 0) THEN i_category#9 END ASC NULLS FIRST, rank_within_parent#51 ASC NULLS FIRST], [total_sum#15, i_category#9, i_class#8, lochierarchy#18, rank_within_parent#51] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt index ad22a0b734e73..2bd128100f527 100644 --- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt @@ -14,7 +14,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (17) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + Union WholeStageCodegen (11) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter @@ -22,7 +22,7 @@ TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_cl WholeStageCodegen (10) HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] InputAdapter - Union [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + Union WholeStageCodegen (4) HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] InputAdapter diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala index 2f0d7bebed200..ca52e51c87ea7 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala @@ -20,7 +20,6 @@ package org.apache.spark.sql.execution import org.apache.spark.rdd.RDD import org.apache.spark.sql.{execution, DataFrame, Row} import org.apache.spark.sql.catalyst.InternalRow -import org.apache.spark.sql.catalyst.analysis.ResolveUnion import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans._ import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Range, Repartition, Sort, Union} @@ -817,10 +816,8 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { test("SPARK-26812: wrong nullability for complex datatypes in union") { def testUnionOutputType(input1: DataType, input2: DataType, output: DataType): Unit = { - val left = LocalRelation(StructField("a", input1)) - val right = LocalRelation(StructField("a", input2)) - val unionOutput = ResolveUnion.makeUnionOutput(Seq(left, right)) - val query = Union(left, right, unionOutput) + val query = Union( + LocalRelation(StructField("a", input1)), LocalRelation(StructField("a", input2))) assert(query.output.head.dataType == output) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala index 09c9c5f94ba9f..4ba25db374147 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala @@ -39,7 +39,7 @@ class SparkPlannerSuite extends SharedSparkSession { planLater(child) :: planLater(NeverPlanned) :: Nil case u: Union => planned += 1 - UnionExec(u.children.map(planLater), u.unionOutput.get) :: planLater(NeverPlanned) :: Nil + UnionExec(u.children.map(planLater), u.unionOutput) :: planLater(NeverPlanned) :: Nil case LocalRelation(output, data, _) => planned += 1 LocalTableScanExec(output, data) :: planLater(NeverPlanned) :: Nil From 2c6ba20d3de8f6397a1167b64a359b59f3d8c89f Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 20:59:47 +0900 Subject: [PATCH 14/16] Revert "Update" This reverts commit 8b86bcfde3f7f78cf38007b991d623fcc6127988. --- .../sql/catalyst/analysis/Analyzer.scala | 2 +- .../sql/catalyst/analysis/ResolveUnion.scala | 5 +- .../sql/catalyst/optimizer/Optimizer.scala | 78 ++++++++----------- .../spark/sql/catalyst/plans/QueryPlan.scala | 10 +-- .../plans/logical/basicLogicalOperators.scala | 16 +++- .../execution/basicPhysicalOperators.scala | 6 +- 6 files changed, 55 insertions(+), 62 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index 77a6631b250e8..f07f0fcf2b3f8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -2760,7 +2760,7 @@ class Analyzer( val windowOps = groupedWindowExpressions.foldLeft(child) { case (last, ((partitionSpec, orderSpec, _), windowExpressions)) => - Window(windowExpressions.toSeq, partitionSpec, orderSpec, last) + Window(windowExpressions, partitionSpec, orderSpec, last) } // Finally, we create a Project to output windowOps's output diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index afd27b6e26a82..efbd7101d6915 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -36,12 +36,11 @@ object ResolveUnion extends Rule[LogicalPlan] { val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) val newDt = attrs.map(_.dataType).reduce(StructType.merge) - val newExprId = NamedExpression.newExprId if (firstAttr.dataType == newDt) { - firstAttr.withExprId(newExprId).withNullability(nullable) + firstAttr.withNullability(nullable) } else { AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - newExprId, firstAttr.qualifier) + NamedExpression.newExprId, firstAttr.qualifier) } } } 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 e43799645a8e9..507381699642f 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 @@ -563,10 +563,11 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper } /** - * Rewrites an expression so that it can be pushed to the left/right side of a - * Union or Except operator. + * Rewrites an expression so that it can be pushed to the right side of a + * Union or Except operator. This method relies on the fact that the output attributes + * of a union/intersect/except are always equal to the left child's output. */ - private def rewriteExprs[A <: Expression](e: A, rewrites: AttributeMap[Attribute]) = { + private def pushToRight[A <: Expression](e: A, rewrites: AttributeMap[Attribute]) = { val result = e transform { case a: Attribute => rewrites(a) } match { @@ -580,28 +581,21 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper result.asInstanceOf[A] } - def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { + def apply(plan: LogicalPlan): LogicalPlan = plan transform { // Push down deterministic projection through UNION ALL case p @ Project(projectList, u: Union) => assert(u.children.nonEmpty) if (projectList.forall(_.deterministic)) { - val firstRewrites = buildRewrites(u, u.children.head) - val newFirstChild = Project( - projectList.map(rewriteExprs(_, firstRewrites)), u.children.head) + val newFirstChild = Project(projectList, u.children.head) val newOtherChildren = u.children.tail.map { child => - val otherRewrites = buildRewrites(u, child) - Project(projectList.map(rewriteExprs(_, otherRewrites)), child) + val rewrites = buildRewrites(u.children.head, child) + Project(projectList.map(pushToRight(_, rewrites)), child) } val newChildren = newFirstChild +: newOtherChildren - val newOutput = ResolveUnion.makeUnionOutput(newChildren) - val newPlan = u.copy(children = newChildren, unionOutput = newOutput) - val attrMapping = p.output.zip(newPlan.output).filter { - case (a1, a2) => a1.exprId != a2.exprId - } - newPlan -> attrMapping + u.copy(children = newChildren, unionOutput = ResolveUnion.makeUnionOutput(newChildren)) } else { - p -> Nil + p } } } @@ -672,9 +666,7 @@ object ColumnPruning extends Rule[LogicalPlan] { case p @ Project(_, u: Union) => if (!u.outputSet.subsetOf(p.references)) { val firstChild = u.children.head - val firstRewrites = AttributeMap(u.output.zip(firstChild.output)) - val projRefs = AttributeSet(p.references.map(firstRewrites).toSeq) - val newOutput = prunedChild(firstChild, projRefs).output + val newOutput = prunedChild(firstChild, p.references).output // pruning the columns of all children based on the pruned first child. val newChildren = u.children.map { p => val selected = p.output.zipWithIndex.filter { case (a, i) => @@ -682,8 +674,7 @@ object ColumnPruning extends Rule[LogicalPlan] { }.map(_._1) Project(selected, p) } - val prunedUnionOutput = u.output.filter(p.references.contains) - p.copy(child = u.copy(children = newChildren, unionOutput = prunedUnionOutput)) + p.copy(child = u.withNewChildren(newChildren)) } else { p } @@ -987,7 +978,10 @@ object CombineUnions extends Rule[LogicalPlan] { flattened += child } } - union.copy(children = flattened.toSeq) + union.copy( + children = flattened, + unionOutput = ResolveUnion.makeUnionOutput(flattened) + ) } } @@ -1691,8 +1685,8 @@ object ReplaceExceptWithAntiJoin extends Rule[LogicalPlan] { */ object RewriteExceptAll extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { - case e @ Except(left, right, true) => + def apply(plan: LogicalPlan): LogicalPlan = plan transform { + case Except(left, right, true) => assert(left.output.size == right.output.size) val newColumnLeft = Alias(Literal(1L), "vcol")() @@ -1703,23 +1697,18 @@ object RewriteExceptAll extends Rule[LogicalPlan] { val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan, output = unionOutput) val aggSumCol = Alias(AggregateExpression(Sum(unionPlan.output.head.toAttribute), Complete, false), "sum")() - val newLeftOutput = unionPlan.output.drop(1) - val aggOutputColumns = newLeftOutput ++ Seq(aggSumCol) - val aggregatePlan = Aggregate(newLeftOutput, aggOutputColumns, unionPlan) + val aggOutputColumns = left.output ++ Seq(aggSumCol) + val aggregatePlan = Aggregate(left.output, aggOutputColumns, unionPlan) val filteredAggPlan = Filter(GreaterThan(aggSumCol.toAttribute, Literal(0L)), aggregatePlan) val genRowPlan = Generate( - ReplicateRows(Seq(aggSumCol.toAttribute) ++ newLeftOutput), + ReplicateRows(Seq(aggSumCol.toAttribute) ++ left.output), unrequiredChildIndex = Nil, outer = false, qualifier = None, - newLeftOutput, + left.output, filteredAggPlan ) - val newPlan = Project(newLeftOutput, genRowPlan) - val attrMapping = e.output.zip(newPlan.output).filter { - case (a1, a2) => a1.exprId != a2.exprId - } - newPlan -> attrMapping + Project(left.output, genRowPlan) } } @@ -1754,8 +1743,8 @@ object RewriteExceptAll extends Rule[LogicalPlan] { * }}} */ object RewriteIntersectAll extends Rule[LogicalPlan] { - def apply(plan: LogicalPlan): LogicalPlan = plan transformUpWithNewOutput { - case i @ Intersect(left, right, true) => + def apply(plan: LogicalPlan): LogicalPlan = plan transform { + case Intersect(left, right, true) => assert(left.output.size == right.output.size) val trueVcol1 = Alias(Literal(true), "vcol1")() @@ -1787,27 +1776,22 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { vCol1AggrExpr.toAttribute ), "min_count")() - val newLeftOutput = unionPlan.output.drop(2) - val aggregatePlan = Aggregate(newLeftOutput, - Seq(vCol1AggrExpr, vCol2AggrExpr) ++ newLeftOutput, unionPlan) + val aggregatePlan = Aggregate(left.output, + Seq(vCol1AggrExpr, vCol2AggrExpr) ++ left.output, unionPlan) val filterPlan = Filter(And(GreaterThanOrEqual(vCol1AggrExpr.toAttribute, Literal(1L)), GreaterThanOrEqual(vCol2AggrExpr.toAttribute, Literal(1L))), aggregatePlan) - val projectMinPlan = Project(newLeftOutput ++ Seq(ifExpression), filterPlan) + val projectMinPlan = Project(left.output ++ Seq(ifExpression), filterPlan) // Apply the replicator to replicate rows based on min_count val genRowPlan = Generate( - ReplicateRows(Seq(ifExpression.toAttribute) ++ newLeftOutput), + ReplicateRows(Seq(ifExpression.toAttribute) ++ left.output), unrequiredChildIndex = Nil, outer = false, qualifier = None, - newLeftOutput, + left.output, projectMinPlan ) - val newPlan = Project(newLeftOutput, genRowPlan) - val attrMapping = i.output.zip(newPlan.output).filter { - case (a1, a2) => a1.exprId != a2.exprId - } - newPlan -> attrMapping + Project(left.output, genRowPlan) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala index b08e8fabb9c6a..a89f055e2ac80 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala @@ -201,6 +201,11 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT case (oldAttr, _) => plan.references.contains(oldAttr) } + val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { + rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) + } + newPlan = planAfterRule + if (attrMappingForCurrentPlan.nonEmpty) { assert(!attrMappingForCurrentPlan.groupBy(_._1.exprId) .exists(_._2.map(_._2.exprId).distinct.length > 1), @@ -217,11 +222,6 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT } } - val (planAfterRule, newAttrMapping) = CurrentOrigin.withOrigin(origin) { - rule.applyOrElse(newPlan, (plan: PlanType) => plan -> Nil) - } - newPlan = planAfterRule - attrMapping ++= newAttrMapping.filter { case (a1, a2) => a1.exprId != a2.exprId } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index d7cb86e6b8042..b301b9e37b649 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -262,7 +262,19 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - override def producedAttributes: AttributeSet = AttributeSet(unionOutput) + private def makeUnionOutput(): Seq[Attribute] = { + children.map(_.output).transpose.map { attrs => + val firstAttr = attrs.head + val nullable = attrs.exists(_.nullable) + val newDt = attrs.map(_.dataType).reduce(StructType.merge) + if (firstAttr.dataType == newDt) { + firstAttr.withNullability(nullable) + } else { + AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( + NamedExpression.newExprId, firstAttr.qualifier) + } + } + } // updating nullability to make all the children consistent override def output: Seq[Attribute] = { @@ -270,7 +282,7 @@ case class Union( unionOutput } - lazy val allChildrenCompatible: Boolean = { + def allChildrenCompatible: Boolean = { // allChildrenCompatible needs to be evaluated after childrenResolved childrenResolved && children.tail.forall { child => // compare the attribute number with the first child diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 6bc775cf26b81..740564f120e1a 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -634,11 +634,9 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) * If we change how this is implemented physically, we'd need to update * [[org.apache.spark.sql.catalyst.plans.logical.Union.maxRowsPerPartition]]. */ -case class UnionExec(children: Seq[SparkPlan], output: Seq[Attribute]) extends SparkPlan { +case class UnionExec(children: Seq[SparkPlan], unionOutput: Seq[Attribute]) extends SparkPlan { - assert(output.nonEmpty, "Union should have at least a single column") - - override def producedAttributes: AttributeSet = AttributeSet(output) + override def output: Seq[Attribute] = unionOutput protected override def doExecute(): RDD[InternalRow] = sparkContext.union(children.map(_.execute())) From d98b9154f47b4bae38b3892dee81aa2776fcc5af Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 21:00:24 +0900 Subject: [PATCH 15/16] Revert "Fix" This reverts commit c78e517874562fed5a1cf1fbabe268de1a36ece2. --- .../sql/catalyst/analysis/ResolveUnion.scala | 29 ++------------- .../sql/catalyst/analysis/TypeCoercion.scala | 3 +- .../sql/catalyst/optimizer/Optimizer.scala | 22 +++-------- .../sql/catalyst/optimizer/subquery.scala | 5 ++- .../catalyst/plans/logical/LogicalPlan.scala | 15 ++++---- .../plans/logical/basicLogicalOperators.scala | 37 ++++++------------- .../analysis/DecimalPrecisionSuite.scala | 2 +- .../catalyst/analysis/ResolveUnionSuite.scala | 9 ++--- .../scala/org/apache/spark/sql/Dataset.scala | 2 +- .../spark/sql/execution/SparkStrategies.scala | 2 +- .../execution/basicPhysicalOperators.scala | 18 +++++++-- .../sql/execution/SparkPlannerSuite.scala | 2 +- 12 files changed, 56 insertions(+), 90 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala index efbd7101d6915..693a5a4e75443 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala @@ -18,33 +18,17 @@ package org.apache.spark.sql.catalyst.analysis import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, AttributeReference, Literal, NamedExpression} +import org.apache.spark.sql.catalyst.expressions.{Alias, Literal} import org.apache.spark.sql.catalyst.optimizer.CombineUnions import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, Union} import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.SchemaUtils /** * Resolves different children of Union to a common set of columns. */ object ResolveUnion extends Rule[LogicalPlan] { - - private[catalyst] def makeUnionOutput(children: Seq[LogicalPlan]): Seq[Attribute] = { - children.map(_.output).transpose.map { attrs => - val firstAttr = attrs.head - val nullable = attrs.exists(_.nullable) - val newDt = attrs.map(_.dataType).reduce(StructType.merge) - if (firstAttr.dataType == newDt) { - firstAttr.withNullability(nullable) - } else { - AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - NamedExpression.newExprId, firstAttr.qualifier) - } - } - } - private def unionTwoSides( left: LogicalPlan, right: LogicalPlan, @@ -84,8 +68,7 @@ object ResolveUnion extends Rule[LogicalPlan] { } else { left } - val unionOutput = makeUnionOutput(Seq(leftChild, rightChild)) - Union(leftChild, rightChild, unionOutput) + Union(leftChild, rightChild) } // Check column name duplication @@ -105,17 +88,13 @@ object ResolveUnion extends Rule[LogicalPlan] { } def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsUp { - case p if !p.childrenResolved => p + case e if !e.childrenResolved => e - case Union(children, byName, allowMissingCol, _) if byName => + case Union(children, byName, allowMissingCol) if byName => val union = children.reduceLeft { (left, right) => checkColumnNames(left, right) unionTwoSides(left, right, allowMissingCol) } CombineUnions(union) - - case u @ Union(children, _, _, unionOutput) - if u.allChildrenCompatible && unionOutput.isEmpty => - u.copy(unionOutput = makeUnionOutput(children)) } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index f71e2c5a3c505..deaa49bf423b1 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -359,8 +359,7 @@ object TypeCoercion { s -> Nil } else { val attrMapping = s.children.head.output.zip(newChildren.head.output) - val newOutput = ResolveUnion.makeUnionOutput(newChildren) - s.copy(children = newChildren, unionOutput = newOutput) -> attrMapping + s.copy(children = newChildren) -> attrMapping } } } 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 507381699642f..f27c5a26741d4 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 @@ -592,8 +592,7 @@ object PushProjectionThroughUnion extends Rule[LogicalPlan] with PredicateHelper val rewrites = buildRewrites(u.children.head, child) Project(projectList.map(pushToRight(_, rewrites)), child) } - val newChildren = newFirstChild +: newOtherChildren - u.copy(children = newChildren, unionOutput = ResolveUnion.makeUnionOutput(newChildren)) + u.copy(children = newFirstChild +: newOtherChildren) } else { p } @@ -968,20 +967,17 @@ object CombineUnions extends Rule[LogicalPlan] { // rules (by position and by name) could cause incorrect results. while (stack.nonEmpty) { stack.pop() match { - case Distinct(Union(children, byName, allowMissingCol, _)) + case Distinct(Union(children, byName, allowMissingCol)) if flattenDistinct && byName == topByName && allowMissingCol == topAllowMissingCol => stack.pushAll(children.reverse) - case Union(children, byName, allowMissingCol, _) + case Union(children, byName, allowMissingCol) if byName == topByName && allowMissingCol == topAllowMissingCol => stack.pushAll(children.reverse) case child => flattened += child } } - union.copy( - children = flattened, - unionOutput = ResolveUnion.makeUnionOutput(flattened) - ) + union.copy(children = flattened.toSeq) } } @@ -1693,8 +1689,7 @@ object RewriteExceptAll extends Rule[LogicalPlan] { val newColumnRight = Alias(Literal(-1L), "vcol")() val modifiedLeftPlan = Project(Seq(newColumnLeft) ++ left.output, left) val modifiedRightPlan = Project(Seq(newColumnRight) ++ right.output, right) - val unionOutput = ResolveUnion.makeUnionOutput(Seq(modifiedLeftPlan, modifiedRightPlan)) - val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan, output = unionOutput) + val unionPlan = Union(modifiedLeftPlan, modifiedRightPlan) val aggSumCol = Alias(AggregateExpression(Sum(unionPlan.output.head.toAttribute), Complete, false), "sum")() val aggOutputColumns = left.output ++ Seq(aggSumCol) @@ -1758,12 +1753,7 @@ object RewriteIntersectAll extends Rule[LogicalPlan] { val leftPlanWithAddedVirtualCols = Project(Seq(trueVcol1, nullVcol2) ++ left.output, left) val rightPlanWithAddedVirtualCols = Project(Seq(nullVcol1, trueVcol2) ++ right.output, right) - val unionOutput = ResolveUnion.makeUnionOutput( - Seq(leftPlanWithAddedVirtualCols, rightPlanWithAddedVirtualCols)) - val unionPlan = Union( - leftPlanWithAddedVirtualCols, - rightPlanWithAddedVirtualCols, - output = unionOutput) + val unionPlan = Union(leftPlanWithAddedVirtualCols, rightPlanWithAddedVirtualCols) // Expressions to compute count and minimum of both the counts. val vCol1AggrExpr = diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index a168dcd7a83f5..9173b2d8032b5 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -463,7 +463,10 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { sys.error(s"Unexpected operator in scalar subquery: $lp") } - val resultMap = evalPlan(plan) + val resultMap = evalPlan(plan).mapValues { _.transform { + case a: Alias => a.newInstance() // Assigns a new `ExprId` + } + } // By convention, the scalar subquery result is the leftmost field. resultMap.get(plan.output.head.exprId) match { diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index eee9fb7cff5a6..cefc97a95d223 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -218,18 +218,19 @@ object LogicalPlanIntegrity { /** * Since some logical plans (e.g., `Union`) can build `AttributeReference`s in their `output`, - * this method checks if the same `ExprId` refers to attributes having the same data type - * in plan output. + * this method checks if the same `ExprId` refers to a semantically-equal attribute + * in a plan output. */ def hasUniqueExprIdsForOutput(plan: LogicalPlan): Boolean = { - val exprIds = plan.collect { case p if canGetOutputAttrs(p) => + val allOutputAttrs = plan.collect { case p if canGetOutputAttrs(p) => // NOTE: we still need to filter resolved expressions here because the output of // some resolved logical plans can have unresolved references, // e.g., outer references in `ExistenceJoin`. - p.output.filter(_.resolved).map { a => (a.exprId, a.dataType) } - }.flatten - val groupedDataTypesByExprId = exprIds.groupBy(_._1).values.map(_.distinct) - groupedDataTypesByExprId.forall(_.length == 1) + p.output.filter(_.resolved).map(_.canonicalized.asInstanceOf[Attribute]) + } + val groupedAttrsByExprId = allOutputAttrs + .flatten.groupBy(_.exprId).values.map(_.distinct) + groupedAttrsByExprId.forall(_.length == 1) } /** diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index b301b9e37b649..01f6f96437d39 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -213,13 +213,8 @@ case class Except( /** Factory for constructing new `Union` nodes. */ object Union { - - def apply(left: LogicalPlan, right: LogicalPlan, output: Seq[Attribute]): Union = { - Union(left :: right :: Nil, unionOutput = output) - } - def apply(left: LogicalPlan, right: LogicalPlan): Union = { - Union(left :: right :: Nil) + Union (left :: right :: Nil) } } @@ -234,8 +229,7 @@ object Union { case class Union( children: Seq[LogicalPlan], byName: Boolean = false, - allowMissingCol: Boolean = false, - unionOutput: Seq[Attribute] = Seq.empty) extends LogicalPlan { + allowMissingCol: Boolean = false) extends LogicalPlan { assert(!allowMissingCol || byName, "`allowMissingCol` can be true only if `byName` is true.") override def maxRows: Option[Long] = { @@ -262,7 +256,8 @@ case class Union( AttributeSet.fromAttributeSets(children.map(_.outputSet)).size } - private def makeUnionOutput(): Seq[Attribute] = { + // updating nullability to make all the children consistent + override def output: Seq[Attribute] = { children.map(_.output).transpose.map { attrs => val firstAttr = attrs.head val nullable = attrs.exists(_.nullable) @@ -276,27 +271,17 @@ case class Union( } } - // updating nullability to make all the children consistent - override def output: Seq[Attribute] = { - assert(unionOutput.nonEmpty, "Union should have at least a single column") - unionOutput - } - - def allChildrenCompatible: Boolean = { + override lazy val resolved: Boolean = { // allChildrenCompatible needs to be evaluated after childrenResolved - childrenResolved && children.tail.forall { child => - // compare the attribute number with the first child - child.output.length == children.head.output.length && + def allChildrenCompatible: Boolean = + children.tail.forall( child => + // compare the attribute number with the first child + child.output.length == children.head.output.length && // compare the data types with the first child child.output.zip(children.head.output).forall { case (l, r) => l.dataType.sameType(r.dataType) - } - } - } - - override lazy val resolved: Boolean = { - children.length > 1 && !(byName || allowMissingCol) && allChildrenCompatible && - unionOutput.nonEmpty + }) + children.length > 1 && !(byName || allowMissingCol) && childrenResolved && allChildrenCompatible } /** diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala index 2351523f8f41c..d5991ff10ce6c 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala @@ -73,7 +73,7 @@ class DecimalPrecisionSuite extends AnalysisTest with BeforeAndAfter { Union(Project(Seq(Alias(left, "l")()), relation), Project(Seq(Alias(right, "r")()), relation)) val (l, r) = analyzer.execute(plan).collect { - case Union(Seq(child1, child2), _, _, _) => (child1.output.head, child2.output.head) + case Union(Seq(child1, child2), _, _) => (child1.output.head, child2.output.head) }.head assert(l.dataType === expectedType) assert(r.dataType === expectedType) diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala index 42bd4012b0a63..5c7ad0067a456 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnionSuite.scala @@ -16,8 +16,6 @@ */ package org.apache.spark.sql.catalyst.analysis -import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules.RuleExecutor @@ -53,8 +51,7 @@ class ResolveUnionSuite extends AnalysisTest { val analyzed1 = analyzer.execute(union1) val projected1 = Project(Seq(table2.output(3), table2.output(0), table2.output(1), table2.output(2)), table2) - val expectedOutput = Seq('i.int, 'u.decimal, 'b.byte, 'd.double) - val expected1 = Union(table1 :: projected1 :: Nil, unionOutput = expectedOutput) + val expected1 = Union(table1 :: projected1 :: Nil) comparePlans(analyzed1, expected1) // Allow missing column @@ -63,7 +60,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr1 = Alias(Literal(null, ByteType), "b")() val projected2 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, table2.output(2)), table3) - val expected2 = Union(table1 :: projected2 :: Nil, unionOutput = expectedOutput) + val expected2 = Union(table1 :: projected2 :: Nil) comparePlans(analyzed2, expected2) // Allow missing column + Allow missing column @@ -72,7 +69,7 @@ class ResolveUnionSuite extends AnalysisTest { val nullAttr2 = Alias(Literal(null, DoubleType), "d")() val projected3 = Project(Seq(table2.output(3), table2.output(0), nullAttr1, nullAttr2), table4) - val expected3 = Union(table1 :: projected2 :: projected3 :: Nil, unionOutput = expectedOutput) + val expected3 = Union(table1 :: projected2 :: projected3 :: Nil) comparePlans(analyzed3, expected3) } } diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala index 0c4b5dc5a73cf..87b9aea80c823 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala @@ -227,7 +227,7 @@ class Dataset[T] private[sql]( val plan = queryExecution.analyzed match { case c: Command => LocalRelation(c.output, withAction("command", queryExecution)(_.executeCollect())) - case u @ Union(children, _, _, _) if children.forall(_.isInstanceOf[Command]) => + case u @ Union(children, _, _) if children.forall(_.isInstanceOf[Command]) => LocalRelation(u.output, withAction("command", queryExecution)(_.executeCollect())) case _ => queryExecution.analyzed diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala index abea4a7a8eaff..ba3d83714c302 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala @@ -692,7 +692,7 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { case logical.GlobalLimit(IntegerLiteral(limit), child) => execution.GlobalLimitExec(limit, planLater(child)) :: Nil case union: logical.Union => - execution.UnionExec(union.children.map(planLater), union.unionOutput) :: Nil + execution.UnionExec(union.children.map(planLater)) :: Nil case g @ logical.Generate(generator, _, outer, _, _, child) => execution.GenerateExec( generator, g.requiredChildOutput, outer, diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala index 740564f120e1a..1f70fde3f7654 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala @@ -634,9 +634,21 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range) * If we change how this is implemented physically, we'd need to update * [[org.apache.spark.sql.catalyst.plans.logical.Union.maxRowsPerPartition]]. */ -case class UnionExec(children: Seq[SparkPlan], unionOutput: Seq[Attribute]) extends SparkPlan { - - override def output: Seq[Attribute] = unionOutput +case class UnionExec(children: Seq[SparkPlan]) extends SparkPlan { + // updating nullability to make all the children consistent + override def output: Seq[Attribute] = { + children.map(_.output).transpose.map { attrs => + val firstAttr = attrs.head + val nullable = attrs.exists(_.nullable) + val newDt = attrs.map(_.dataType).reduce(StructType.merge) + if (firstAttr.dataType == newDt) { + firstAttr.withNullability(nullable) + } else { + AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( + firstAttr.exprId, firstAttr.qualifier) + } + } + } protected override def doExecute(): RDD[InternalRow] = sparkContext.union(children.map(_.execute())) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala index 4ba25db374147..b4cb7e3fce3cf 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala @@ -39,7 +39,7 @@ class SparkPlannerSuite extends SharedSparkSession { planLater(child) :: planLater(NeverPlanned) :: Nil case u: Union => planned += 1 - UnionExec(u.children.map(planLater), u.unionOutput) :: planLater(NeverPlanned) :: Nil + UnionExec(u.children.map(planLater)) :: planLater(NeverPlanned) :: Nil case LocalRelation(output, data, _) => planned += 1 LocalTableScanExec(output, data) :: planLater(NeverPlanned) :: Nil From e3c87429e7e6f463c4e7740c7a42e8b2def528b0 Mon Sep 17 00:00:00 2001 From: Takeshi Yamamuro Date: Tue, 29 Sep 2020 21:28:15 +0900 Subject: [PATCH 16/16] revert --- .../sql/catalyst/analysis/Analyzer.scala | 2 +- .../sql/catalyst/optimizer/subquery.scala | 5 +--- .../catalyst/plans/logical/LogicalPlan.scala | 27 +++++++++++++------ .../plans/logical/basicLogicalOperators.scala | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala index f07f0fcf2b3f8..77a6631b250e8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala @@ -2760,7 +2760,7 @@ class Analyzer( val windowOps = groupedWindowExpressions.foldLeft(child) { case (last, ((partitionSpec, orderSpec, _), windowExpressions)) => - Window(windowExpressions, partitionSpec, orderSpec, last) + Window(windowExpressions.toSeq, partitionSpec, orderSpec, last) } // Finally, we create a Project to output windowOps's output diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala index 9173b2d8032b5..a168dcd7a83f5 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala @@ -463,10 +463,7 @@ object RewriteCorrelatedScalarSubquery extends Rule[LogicalPlan] { sys.error(s"Unexpected operator in scalar subquery: $lp") } - val resultMap = evalPlan(plan).mapValues { _.transform { - case a: Alias => a.newInstance() // Assigns a new `ExprId` - } - } + val resultMap = evalPlan(plan) // By convention, the scalar subquery result is the leftmost field. resultMap.get(plan.output.head.exprId) match { diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala index cefc97a95d223..48dfc5fd57e63 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala @@ -218,19 +218,30 @@ object LogicalPlanIntegrity { /** * Since some logical plans (e.g., `Union`) can build `AttributeReference`s in their `output`, - * this method checks if the same `ExprId` refers to a semantically-equal attribute - * in a plan output. + * this method checks if the same `ExprId` refers to attributes having the same data type + * in plan output. */ def hasUniqueExprIdsForOutput(plan: LogicalPlan): Boolean = { - val allOutputAttrs = plan.collect { case p if canGetOutputAttrs(p) => + val exprIds = plan.collect { case p if canGetOutputAttrs(p) => // NOTE: we still need to filter resolved expressions here because the output of // some resolved logical plans can have unresolved references, // e.g., outer references in `ExistenceJoin`. - p.output.filter(_.resolved).map(_.canonicalized.asInstanceOf[Attribute]) - } - val groupedAttrsByExprId = allOutputAttrs - .flatten.groupBy(_.exprId).values.map(_.distinct) - groupedAttrsByExprId.forall(_.length == 1) + p.output.filter(_.resolved).map { a => (a.exprId, a.dataType) } + }.flatten + + val ignoredExprIds = plan.collect { + // NOTE: `Union` currently reuses input `ExprId`s for output references, but we cannot + // simply modify the code for assigning new `ExprId`s in `Union#output` because + // the modification will make breaking changes (See SPARK-32741(#29585)). + // So, this check just ignores the `exprId`s of `Union` output. + case u: Union if u.resolved => u.output.map(_.exprId) + }.flatten.toSet + + val groupedDataTypesByExprId = exprIds.filterNot { case (exprId, _) => + ignoredExprIds.contains(exprId) + }.groupBy(_._1).values.map(_.distinct) + + groupedDataTypesByExprId.forall(_.length == 1) } /** diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala index 01f6f96437d39..223ef652d2f80 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala @@ -266,7 +266,7 @@ case class Union( firstAttr.withNullability(nullable) } else { AttributeReference(firstAttr.name, newDt, nullable, firstAttr.metadata)( - NamedExpression.newExprId, firstAttr.qualifier) + firstAttr.exprId, firstAttr.qualifier) } } }