viirya commented on a change in pull request #26667: [SPARK-29922][SQL] SHOW 
FUNCTIONS should do multi-catalog resolution
URL: https://github.com/apache/spark/pull/26667#discussion_r351986877
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
 ##########
 @@ -455,6 +455,23 @@ class ResolveSessionCatalog(
       ShowTablePropertiesCommand(
         tableName.asTableIdentifier,
         propertyKey)
+
+    case ShowFunctionsStatement(userScope, systemScope, pattern, fun) =>
+      val (database, function) = fun match {
+        case Some(CatalogAndIdentifierParts(catalog, functionName)) =>
+          if (isSessionCatalog(catalog)) {
+            functionName match {
+              case Seq(db, fn) => (Some(db), Some(fn))
+              case Seq(fn) => (None, Some(fn))
+              case _ =>
+                throw new AnalysisException(s"Unsupported function name 
'${functionName.quoted}'")
+            }
+          } else {
+            throw new AnalysisException (s"SHOW FUNCTIONS is only supported in 
v1 catalog")
 
 Review comment:
   this part is duplicate to parseV1Table.

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


With regards,
Apache Git Services

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

Reply via email to