SHOW FUNCTIONS
更新时间:2025-10-15
描述
查看数据库下所有的自定义与系统提供的函数。
语法
SQL
1SHOW [ FULL ] [ BUILTIN ] FUNCTIONS [ { IN | FROM } <db> ] [ LIKE '<function_pattern>' ]
变种语法
SQL
1SHOW GLOBAL [ FULL ] FUNCTIONS [ LIKE '<function_pattern>' ]
必选参数
1. <function_pattern>
用来过滤函数名称的匹配模式规则
可选参数
1. FULL
FULL 为选填项
若填写表示显示函数的详细信息。
2. BUILTIN
BUILTIN 为选填项
若填写表示需要显示系统提供的函数
3. <db>
db 为选填项
若填写表示在指定的数据库下查询
返回值
列名 | 说明 |
---|---|
Signature | 函数名与参数类型 |
Return Type | 函数返回值的数据类型 |
Function Type | 函数的类型 |
Intermediate Type | 中间结果类型 |
Properties | 函数的详细属性 |
权限控制
执行此 SQL 命令的用户必须至少具有以下权限:
权限(Privilege) | 对象(Object) | 说明(Notes) |
---|---|---|
SHOW_PRIV | 函数 | 需要对该函数有 show 权限 |
示例
SQL
1show full functions in testDb
Text
1*************************** 1. row ***************************
2Signature: my_add(INT,INT)
3Return Type: INT
4Function Type: Scalar
5Intermediate Type: NULL
6Properties: {"symbol":"_ZN9doris_udf6AddUdfEPNS_15FunctionContextERKNS_6IntValES4_","object_file":"http://host:port/libudfsample.so","md5":"cfe7a362d10f3aaf6c49974ee0f1f878"}
7*************************** 2. row ***************************
8Signature: my_count(BIGINT)
9Return Type: BIGINT
10Function Type: Aggregate
11Intermediate Type: NULL
12Properties: {"object_file":"http://host:port/libudasample.so","finalize_fn":"_ZN9doris_udf13CountFinalizeEPNS_15FunctionContextERKNS_9BigIntValE","init_fn":"_ZN9doris_udf9CountInitEPNS_15FunctionContextEPNS_9BigIntValE","merge_fn":"_ZN9doris_udf10CountMergeEPNS_15FunctionContextERKNS_9BigIntValEPS2_","md5":"37d185f80f95569e2676da3d5b5b9d2f","update_fn":"_ZN9doris_udf11CountUpdateEPNS_15FunctionContextERKNS_6IntValEPNS_9BigIntValE"}
13*************************** 3. row ***************************
14Signature: id_masking(BIGINT)
15Return Type: VARCHAR
16Function Type: Alias
17Intermediate Type: NULL
18Properties: {"parameter":"id","origin_function":"concat(left(`id`, 3), `****`, right(`id`, 4))"}
SQL
1show builtin functions in testDb like 'year%';
Text
1+---------------+
2| Function Name |
3+---------------+
4| year |
5| years_add |
6| years_diff |
7| years_sub |
8+---------------+
SQL
1show global full functions
Text
1*************************** 1. row ***************************
2 Signature: decimal(ALL, INT, INT)
3 Return Type: VARCHAR
4 Function Type: Alias
5Intermediate Type: NULL
6 Properties: {"parameter":"col, precision, scale","origin_function":"CAST(`col` AS decimal(`precision`, `scale`))"}
7*************************** 2. row ***************************
8 Signature: id_masking(BIGINT)
9 Return Type: VARCHAR
10 Function Type: Alias
11Intermediate Type: NULL
12 Properties: {"parameter":"id","origin_function":"concat(left(`id`, 3), `****`, right(`id`, 4))"}
SQL
1show global functions
Text
1+---------------+
2| Function Name |
3+---------------+
4| decimal |
5| id_masking |
6+---------------+