DESCRIBE FUNCTION (Snowpark Container Services)

描述指定的 服务功能,包括签名(参数)、返回值、语言和正文( Snowpark Container Services 服务的路径)。

另请参阅:

服务函数CREATE FUNCTIONALTER FUNCTIONDROP FUNCTION

语法

{ DESC | DESCRIBE } FUNCTION [ IF EXISTS ] <name> ( [ <arg_data_type> ] [ , ... ] )
Copy

必填参数

name

指定要描述的服务函数的标识符。如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。

( [ arg_name arg_data_type ] [ , ... ] )

指定服务函数的实参/输入。这些实参应该与服务所期望的实参相对应。

如果没有实参,则包括不带任何实参名称和数据类型的括号。

访问控制要求

用于执行此操作的 角色 必须至少具有以下 权限

权限

对象

备注

USAGE

服务函数

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.

有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色

有关对 安全对象 执行 SQL 操作的相应角色和权限授予的一般信息,请参阅 访问控制概述

使用说明

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

示例

教程 1 中,您可以创建一个服务函数 (my_echo_udf)。以下 DESC FUNCTION 命令返回了服务函数描述:

DESC FUNCTION my_echo_udf(VARCHAR);
Copy

输出示例:

+--------------------+----------------------+
| property           | value                |
|--------------------+----------------------|
| signature          | (INPUTTEXT VARCHAR)  |
| returns            | VARCHAR              |
| language           | NULL                 |
| null handling      | CALLED ON NULL INPUT |
| volatility         | VOLATILE             |
| body               | /echo                |
| headers            | null                 |
| context_headers    | null                 |
| max_batch_rows     | not set              |
| service            | ECHO_SERVICE         |
| service_endpoint   | echoendpoint         |
| max_batch_retries  | 3                    |
| on_batch_failure   | ABORT                |
| batch_timeout_secs | not set              |
+--------------------+----------------------+
语言: 中文