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:
[email protected]



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

Reply via email to