You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/11/29 16:15:17 UTC

[GitHub] [spark] amanomer commented on a change in pull request #26712: [SPARK-29883][SQL] Improve error messages when function name is an alias

amanomer commented on a change in pull request #26712: [SPARK-29883][SQL] Improve error messages when function name is an alias
URL: https://github.com/apache/spark/pull/26712#discussion_r352193751
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
 ##########
 @@ -118,7 +118,7 @@ class SimpleFunctionRegistry extends FunctionRegistry with Logging {
         throw new AnalysisException(s"undefined function $name")
       }
     }
-    func(children)
+    func(children).setFuncName(name.funcName)
 
 Review comment:
   > do functions not already have names somewhere to use, that can already be set differently per alias?
   
   I think, No? Currently, when we use alias of bool_and (i.e, every), it will be resolved as a constructor of `BoolAnd` using `FunctionRegistry#expressions`, which sets `bool_and' as a nodeName.
   https://github.com/apache/spark/blob/9351e3e76fb11e9fdaf39aef5aea86fdeccd6f28/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/UnevaluableAggs.scala#L55-L57

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


With regards,
Apache Git Services

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