Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5798#discussion_r30010033
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
 ---
    @@ -159,18 +170,16 @@ object PartialAggregation {
                 // Should trim aliases around `GetField`s. These aliases are 
introduced while
                 // resolving struct field accesses, because `GetField` is not 
a `NamedExpression`.
                 // (Should we just turn `GetField` into a `NamedExpression`?)
    -            namedGroupingExpressions
    +            namedGroupingMap
                   .get(e.transform { case Alias(g: ExtractValue, _) => g })
                   .map(_.toAttribute)
                   .getOrElse(e)
             }).asInstanceOf[Seq[NamedExpression]]
     
             val partialComputation =
    -          (namedGroupingExpressions.values ++
    +          (partialGroupingExprs ++
                 partialEvaluations.values.flatMap(_.partialEvaluations)).toSeq
     
    -        val namedGroupingAttributes = 
namedGroupingExpressions.values.map(_.toAttribute).toSeq
    --- End diff --
    
    `namedGroupingExpressions.values` probably come with arbitrary order, which 
is not right compare to the `groupingExpressions`. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to