spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] AngersZhuuuu commented on a change in pull request #28490: [SPARK-31670][SQL]Resolve Struct Field in Grouping Aggregate with same ExprId
Date Tue, 01 Sep 2020 06:10:21 GMT

AngersZhuuuu commented on a change in pull request #28490:
URL: https://github.com/apache/spark/pull/28490#discussion_r480858783



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1325,24 +1325,43 @@ class Analyzer(
      *
      * Note : In this routine, the unresolved attributes are resolved from the input plan's
      * children attributes.
+     *
+     * @param e the expression need to be resolved.
+     * @param q the LogicalPlan whose children are used to resolve expression's attribute.
+     * @param trimAlias whether need to trim alias of Struct field. When true, we will trim
+     *                  Struct field alias. When isTopLevel = true, we won't trim top-level
+     *                  Struct field alias.
+     * @param isTopLevel whether need to trim top-level alias of Struct field. this param
is

Review comment:
       > how about hiding this parameter from the caller side
   > 
   > ```
   > def resolveExpressionTopDown(e: Expression, q: LogicalPlan, trimAlias: Boolean = false)
= {
   >   if (e.resolved) return e
   >   def innerResolve(expr: Expression, isTopLevel: Boolean) = expr match {
   >     case ...
   >     ...
   >   }
   >   innerResolve(e, isTopLevel = true)
   > }
   > ```
   
   Hide this method is more safe, but we need to contain `if (e.resolved) return e` in `innerResolve`




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

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


Mime
View raw message