cloud-fan commented on a change in pull request #34274:
URL: https://github.com/apache/spark/pull/34274#discussion_r728579739



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -523,9 +523,11 @@ class SparkSqlAstBuilder extends AstBuilder {
         ctx.EXISTS != null,
         ctx.REPLACE != null)
     } else {
-      // Temporary function names should not contain database prefix like 
"database.function"
-      val database = if (functionIdentifier.length != 1) {
+      if (functionIdentifier.length > 2) {
         throw 
QueryCompilationErrors.unsupportedFunctionNameError(functionIdentifier.quoted)
+      } else if (functionIdentifier.length == 2) {
+        // Temporary function names should not contain database prefix like 
"database.function"
+        throw 
QueryCompilationErrors.specifyingDBInCreateTempFuncError(functionIdentifier.head)

Review comment:
       looks good. shall we do the same for temp views to make them consistent?




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

To unsubscribe, e-mail: [email protected]

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