diff --git a/gluten-core/src/main/scala/io/glutenproject/execution/BasicPhysicalOperatorTransformer.scala b/gluten-core/src/main/scala/io/glutenproject/execution/BasicPhysicalOperatorTransformer.scala index 6d200997705f..7c8e496eb3bf 100644 --- a/gluten-core/src/main/scala/io/glutenproject/execution/BasicPhysicalOperatorTransformer.scala +++ b/gluten-core/src/main/scala/io/glutenproject/execution/BasicPhysicalOperatorTransformer.scala @@ -48,7 +48,7 @@ abstract class FilterExecTransformerBase(val cond: Expression, val input: SparkP extends UnaryExecNode with TransformSupport with PredicateHelper - with AliasAwareOutputExpression + with AliasAwareOutputPartitioning with Logging { // Note: "metrics" is made transient to avoid sending driver-side metrics to tasks. @@ -220,7 +220,7 @@ case class ProjectExecTransformer private (projectList: Seq[NamedExpression], ch extends UnaryExecNode with TransformSupport with PredicateHelper - with AliasAwareOutputExpression + with AliasAwareOutputPartitioning with Logging { // Note: "metrics" is made transient to avoid sending driver-side metrics to tasks. diff --git a/shims/spark34/src/main/scala/org/apache/spark/sql/execution/AliasAwareOutputExpression.scala b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/AliasAwareOutputExpression.scala index 91f7e592b6ed..2a21af5980f2 100644 --- a/shims/spark34/src/main/scala/org/apache/spark/sql/execution/AliasAwareOutputExpression.scala +++ b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/AliasAwareOutputExpression.scala @@ -16,19 +16,10 @@ */ package org.apache.spark.sql.execution -import org.apache.spark.sql.catalyst.expressions.{Alias, AttributeMap, AttributeReference, Expression, NamedExpression} +import org.apache.spark.sql.catalyst.plans.AliasAwareOutputExpression -/** A trait that provides functionality to handle aliases in the `outputExpressions`. */ -trait AliasAwareOutputExpression extends UnaryExecNode { - protected def outputExpressions: Seq[NamedExpression] - - private lazy val aliasMap = AttributeMap(outputExpressions.collect { - case a @ Alias(child: AttributeReference, _) => (child, a.toAttribute) - }) - - protected def hasAlias: Boolean = aliasMap.nonEmpty - - protected def normalizeExpression(exp: Expression): Expression = { - exp.transform { case attr: AttributeReference => aliasMap.getOrElse(attr, attr) } - } -} +/** + * A trait that handles aliases in the `outputExpressions` to produce `outputPartitioning` that + * satisfies distribution requirements. + */ +trait AliasAwareOutputPartitioning extends AliasAwareOutputExpression {}