You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/04 03:02:27 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #37334: [SPARK-39887][SQL] RemoveRedundantAliases should keep aliases that make the output of projection nodes unique

cloud-fan commented on code in PR #37334:
URL: https://github.com/apache/spark/pull/37334#discussion_r937305193


##########
sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala:
##########
@@ -596,11 +597,13 @@ class RelationalGroupedDataset protected[sql](
       s"The returnType of the udf must be a ${StructType.simpleString}")
 
     val leftGroupingNamedExpressions = groupingExprs.map {
+      case a: Attribute => Alias(a, a.name)()
       case ne: NamedExpression => ne
       case other => Alias(other, other.toString)()
     }
 
     val rightGroupingNamedExpressions = r.groupingExprs.map {
+      case a: Attribute => Alias(a, a.name)()

Review Comment:
   hmmm, does it mean it's legitimate to have conflicting attribute IDs within one operator? This looks totally fine in `FlatMapCoGroupsInPandas`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org