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

    https://github.com/apache/spark/pull/20795#discussion_r173662663
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -1192,10 +1193,18 @@ class Analyzer(
        * @see https://issues.apache.org/jira/browse/SPARK-19737
        */
       object LookupFunctions extends Rule[LogicalPlan] {
    -    override def apply(plan: LogicalPlan): LogicalPlan = 
plan.transformAllExpressions {
    -      case f: UnresolvedFunction if !catalog.functionExists(f.name) =>
    -        withPosition(f) {
    -          throw new 
NoSuchFunctionException(f.name.database.getOrElse("default"), f.name.funcName)
    +    override def apply(plan: LogicalPlan): LogicalPlan = {
    +      val catalogFunctionNameSet = new 
mutable.HashSet[FunctionIdentifier]()
    +        plan.transformAllExpressions {
    +          case f: UnresolvedFunction if 
catalogFunctionNameSet.contains(f.name) => f
    +          case f: UnresolvedFunction if catalog.functionExists(f.name) =>
    +            catalogFunctionNameSet.add(f.name)
    --- End diff --
    
    sure, I will do that. Thanks.



---

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

Reply via email to