Github user watermen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5290#discussion_r31687776
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -364,11 +364,24 @@ class Analyzer(
     
             val (resolvedOrdering, missing) = resolveAndFindMissing(ordering, 
a, groupingRelation)
     
    -        if (missing.nonEmpty) {
    +        val addForAlias = new ArrayBuffer[NamedExpression]()
    +        val aliasedOrdering = resolvedOrdering.zipWithIndex.map {
    +          case (o, i) => {
    +            o transform {
    +              case aggOrSub @ (_: AggregateExpression | _: Substring) =>
    --- End diff --
    
    @cloud-fan Because `Substring` has the same problem as `Aggregation`.
    I think we need to add another rule to solve your 2st commit, because 
there're many sqls like `select key, sum(value), sum(value) from src group by 
key` have the same problem.


---
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