Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

system.user_defined_functions

説明

ユーザー定義関数 (UDF) の読み込みステータス、エラー情報、および設定メタデータが含まれます。

カラム

  • 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)) — 引数の型の Array (例: ['String'、'UInt64']) 。
  • argument_names (Array(String)) — 引数名の Array。名前のない引数には空文字列を使用します。
  • max_command_execution_time (UInt64) — データ block を処理する最大時間 (Seconds) 。'executable_pool' タイプの場合のみ。
  • command_termination_timeout (UInt64) — コマンドプロセスに SIGTERM を送信するまでの時間 (Seconds) 。
  • command_read_timeout (UInt64) — コマンドの stdout からの読み取りに使用する時間 (Milliseconds) 。
  • command_write_timeout (UInt64) — コマンドの stdin への書き込みに使用する時間 (Milliseconds) 。
  • pool_size (UInt64) — コマンドプロセスのインスタンス数。'executable_pool' タイプの場合のみ。
  • send_chunk_header (UInt8) — 各データ chunk の前に行数を送信するかどうか (ブール値) 。
  • execute_direct (UInt8) — コマンドを直接実行するか (1) 、/bin/bash 経由で実行するか (0) 。
  • lifetime (UInt64) — 再読み込みの間隔 (Seconds) 。0 は再読み込みが無効であることを意味します。
  • deterministic (UInt8) — 同じ引数に対して関数が常に同じ結果を返すかどうか (ブール値) 。

すべてのUDFとその読み込み状況を表示します。

SELECT
    name,
    load_status,
    type,
    command,
    return_type,
    argument_types
FROM system.user_defined_functions
FORMAT Vertical;
Row 1:
──────
name:           my_sum_udf
load_status:    Success
type:           executable
command:        /var/lib/clickhouse/user_scripts/sum.py
return_type:    UInt64
argument_types: ['UInt64','UInt64']

失敗したUDFを見つける:

SELECT
    name,
    loading_error_message
FROM system.user_defined_functions
WHERE load_status = 'Failed';

関連項目

Navigation