メインコンテンツへスキップ
メインコンテンツへスキップ

system.user_defined_functions

User-Defined Functions (UDFs) の読み込みステータス、エラー情報、および設定メタデータを含みます。

カラム:

読み込みステータス

  • name (String) — UDF 名。
  • load_status (Enum8) — 読み込みステータス: Success (UDF が読み込まれて使用可能)、Failed (UDF の読み込みに失敗)。
  • loading_error_message (String) — 読み込みに失敗した場合の詳細なエラーメッセージ。正常に読み込まれた場合は空。
  • last_successful_update_time (Nullable(DateTime)) — 最後に正常に読み込まれた時刻のタイムスタンプ。一度も成功していない場合は NULL
  • loading_duration_ms (UInt64) — UDF の読み込みに要した時間 (ミリ秒)。

UDF 設定

  • type (Enum8) — UDF の種類: executable (ブロックごとに単一プロセス) または executable_pool (永続プロセスプール)。
  • command (String) — 引数を含む実行用スクリプトまたはコマンド。
  • format (String) — I/O のデータフォーマット (例: TabSeparated, JSONEachRow)。
  • return_type (String) — 関数の戻り値の型 (例: String, UInt64)。
  • return_name (String) — オプションの戻り値識別子。設定されていない場合は空。
  • argument_types (Array(String)) — 引数型の配列。
  • 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) — 各データ chunk の前に行数を送信するかどうか (1 = true, 0 = false)。
  • execute_direct (UInt8) — コマンドを直接実行するか (1)、/bin/bash 経由で実行するか (0)。
  • lifetime (UInt64) — 再読み込み間隔 (秒)。0 の場合、再読み込みは無効。
  • deterministic (UInt8) — 同じ引数に対して常に同じ結果を返す関数かどうか (1 = true, 0 = false)。

すべての 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';

関連項目