cloud-fan commented on code in PR #53437:
URL: https://github.com/apache/spark/pull/53437#discussion_r2647875205
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/DescribeProcedureCommand.scala:
##########
@@ -45,34 +43,70 @@ case class DescribeProcedureCommand(
override def run(sparkSession: SparkSession): Seq[Row] = {
child match {
- case ResolvedIdentifier(catalog, ident) =>
- val procedure = load(catalog.asProcedureCatalog, ident)
+ case ResolvedProcedure(catalog, ident, procedure: UnboundProcedure) =>
describeV2Procedure(procedure)
case _ =>
throw SparkException.internalError(s"Invalid procedure identifier:
${child.getClass}")
}
}
- private def load(catalog: ProcedureCatalog, ident: Identifier):
UnboundProcedure = {
- try {
- catalog.loadProcedure(ident)
- } catch {
- case e: Exception if !e.isInstanceOf[SparkThrowable] =>
- val nameParts = catalog.name +: ident.asMultipartIdentifier
- throw QueryCompilationErrors.failedToLoadRoutineError(nameParts, e)
- }
- }
private def describeV2Procedure(procedure: UnboundProcedure): Seq[Row] = {
val buffer = new ArrayBuffer[(String, String)]
append(buffer, "Procedure:", procedure.name())
append(buffer, "Description:", procedure.description())
+ try {
+ val bound = procedure.bind(new StructType())
Review Comment:
We can support `SimpleProcedure` only, added in
https://github.com/apache/spark/pull/53595
--
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]