imback82 commented on a change in pull request #29198:
URL: https://github.com/apache/spark/pull/29198#discussion_r460225678



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -3650,12 +3652,24 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
       }
     }
 
-    val functionIdentifier = visitMultipartIdentifier(ctx.multipartIdentifier)
-    CreateFunctionStatement(
-      functionIdentifier,
+    val nameParts = visitMultipartIdentifier(ctx.multipartIdentifier)
+    val isTemp = ctx.TEMPORARY != null
+    val func: LogicalPlan = if (isTemp) {
+      import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
+      // temp func doesn't belong to any catalog and we shouldn't resolve 
catalog in the name.
+      if (nameParts.length > 2) {
+        throw new AnalysisException(s"Unsupported function name 
'${nameParts.quoted}'")
+      }
+      ResolvedFunc(nameParts.asIdentifier)
+    } else {
+      UnresolvedFunc(nameParts)
+    }
+
+    CreateFunction(
+      func,

Review comment:
       Ok. Will revert this change.




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