SHOW-FUNCTIONS

Name

SHOW FUNCTIONS

Description

查看数据库下所有的自定义(系统提供)的函数。如果用户指定了数据库,那么查看对应数据库的,否则直接查询当前会话所在数据库

需要对这个数据库拥有 SHOW 权限

语法

1. SHOW [FULL] [BUILTIN] FUNCTIONS [IN|FROM db] [LIKE 'function_pattern']

Parameters

full:表示显示函数的详细信息 builtin:表示显示系统提供的函数 db: 要查询的数据库名字 function_pattern: 用来过滤函数名称的参数

语法

1. SHOW GLOBAL [FULL] FUNCTIONS [LIKE 'function_pattern']

Parameters

global:表示要展示的是全局函数 full:表示显示函数的详细信息 function_pattern: 用来过滤函数名称的参数

注意: “global”关键字在v2.0版本及以后才可用

Example

1. mysql> show full functions in testDb\G
2. *************************** 1. row ***************************
3. Signature: my_add(INT,INT)
4. Return Type: INT
5. Function Type: Scalar
6. Intermediate Type: NULL
7. Properties: {"symbol":"_ZN9doris_udf6AddUdfEPNS_15FunctionContextERKNS_6IntValES4_","object_file":"http://host:port/libudfsample.so","md5":"cfe7a362d10f3aaf6c49974ee0f1f878"}
8. *************************** 2. row ***************************
9. Signature: my_count(BIGINT)
10. Return Type: BIGINT
11. Function Type: Aggregate
12. Intermediate Type: NULL
13. Properties: {"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"}
14. *************************** 3. row ***************************
15. Signature: id_masking(BIGINT)
16. Return Type: VARCHAR
17. Function Type: Alias
18. Intermediate Type: NULL
19. Properties: {"parameter":"id","origin_function":"concat(left(`id`, 3), `****`, right(`id`, 4))"}

21. 3 rows in set (0.00 sec)
22. mysql> show builtin functions in testDb like 'year%';
23. +---------------+
24. | Function Name |
25. +---------------+
26. | year          |
27. | years_add     |
28. | years_diff    |
29. | years_sub     |
30. +---------------+
31. 2 rows in set (0.00 sec)

33. mysql> show global full functions\G;
34. *************************** 1. row ***************************
35. Signature: decimal(ALL, INT, INT)
36. Return Type: VARCHAR
37. Function Type: Alias
38. Intermediate Type: NULL
39. Properties: {"parameter":"col, precision, scale","origin_function":"CAST(`col` AS decimal(`precision`, `scale`))"}
40. *************************** 2. row ***************************
41. Signature: id_masking(BIGINT)
42. Return Type: VARCHAR
43. Function Type: Alias
44. Intermediate Type: NULL
45. Properties: {"parameter":"id","origin_function":"concat(left(`id`, 3), `****`, right(`id`, 4))"}
46. 2 rows in set (0.00 sec)

48. mysql> show global functions ;
49. +---------------+
50. | Function Name |
51. +---------------+
52. | decimal       |
53. | id_masking    |
54. +---------------+
55. 2 rows in set (0.00 sec)

Keywords

1. SHOW, FUNCTIONS

Best Practice