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

    https://github.com/apache/spark/pull/6647#discussion_r31784183
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -130,13 +130,29 @@ class Analyzer(
         }
       }
     
    -  /**
    -   * Removes no-op Alias expressions from the plan.
    -   */
    -  object TrimGroupingAliases extends Rule[LogicalPlan] {
    -    def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    -      case Aggregate(groups, aggs, child) =>
    -        Aggregate(groups.map(_.transform { case Alias(c, _) => c }), aggs, 
child)
    +  object ResolveAliases extends Rule[LogicalPlan] {
    +    private def assignAliases(exprs: Seq[Expression]) = {
    +      var i = -1
    +      exprs.map(_ transformDown {
    --- End diff --
    
    `exprs.map` should be enough? We should just resolve the `Alias` for the 
root of a given expression tree, right?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to