Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/12885#discussion_r62130890
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/functions.scala
---
@@ -129,7 +129,16 @@ case class DescribeFunction(
result
}
- case None => Seq(Row(s"Function: $functionName not found."))
+ case None =>
+ val currentDb =
sparkSession.sessionState.catalog.getCurrentDatabase
+ if (sparkSession.externalCatalog.functionExists(currentDb,
functionName)) {
+ val catalogFunction =
sparkSession.externalCatalog.getFunction(currentDb, functionName)
+ Row(s"Function: ${catalogFunction.identifier}") ::
+ Row(s"Class: ${catalogFunction.className}") ::
+ Row(s"Usage: N/A") :: Nil
+ } else {
+ Seq(Row(s"Function: $functionName not found."))
+ }
--- End diff --
Looks like we only need to change
https://github.com/apache/spark/pull/12885/files#diff-d2a203f08c862bd762e6740c16e972f7R118
to `sparkSession.sessionState.catalog.lookupFunctionInfo`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]