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/12/04 19:15:34 UTC

[GitHub] [spark] planga82 commented on a change in pull request #26667: [SPARK-29922][SQL] SHOW FUNCTIONS should do multi-catalog resolution

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

 ##########
 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:
   It is not exactly the same message 
   $sql is only supported with v1 **tables**.
   vs
   SHOW FUNCTIONS is only supported in v1 **catalog**
   Here we don't have tables so this is the reason the message is different.

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