system.user_defined_functions
描述
包含 用户自定义函数 (UDFs) 的加载状态、错误信息和配置元数据。
列
name(String) — UDF 名称。load_status(Enum8('Success' = 0, 'Failed' = 1)) — 加载状态。可能的值:- Success — UDF 已加载并可供使用
- Failed — UDF 加载失败 (详见字段 'loading_error_message') 。
loading_error_message(String) — 加载失败时的详细错误信息。加载成功时为空。last_successful_update_time(Nullable(DateTime)) — 上次成功更新的时间戳。如果从未成功,则为 NULL。loading_duration_ms(UInt64) — 加载 UDF 所花费的时间,单位为毫秒。type(Enum8('executable' = 0, 'executable_pool' = 1)) — UDF 类型:'executable' (单进程) 或 'executable_pool' (进程池) 。command(String) — 为此 UDF 执行的脚本或命令。format(String) — I/O 的数据格式 (例如 'TabSeparated'、'JSONEachRow') 。return_type(String) — 函数返回类型 (例如 'String'、'UInt64') 。return_name(String) — 可选的返回值标识符。未配置时为空。argument_types(Array(String)) — 参数类型数组 (例如 ['String', 'UInt64']) 。argument_names(Array(String)) — 参数名称数组。未命名的参数对应空字符串。max_command_execution_time(UInt64) — 处理一个数据块的最大时长 (秒) 。仅适用于 'executable_pool' 类型。command_termination_timeout(UInt64) — 向命令进程发送 SIGTERM 前等待的秒数。command_read_timeout(UInt64) — 从命令 stdout 读取时的超时时间 (毫秒) 。command_write_timeout(UInt64) — 向命令 stdin 写入时的超时时间 (毫秒) 。pool_size(UInt64) — 命令进程实例的数量。仅适用于 'executable_pool' 类型。send_chunk_header(UInt8) — 是否在每个数据块前发送行数 (布尔值) 。execute_direct(UInt8) — 是否直接执行命令 (1) ,还是通过 /bin/bash 执行 (0) 。lifetime(UInt64) — 重新加载间隔,单位为秒。0 表示禁用重新加载。deterministic(UInt8) — 函数是否对相同参数返回相同结果 (布尔值) 。
示例
查看所有 UDF 及其加载状态:
定位失败的 UDF:
另请参阅
- 用户自定义函数 — 如何创建和配置 UDF (用户定义函数) 。