> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ユーザー定義関数（UDF）の読み込みステータスと設定メタデータを格納するシステムテーブル。

# system.user_defined_functions

<div id="description">
  ## 説明
</div>

[ユーザー定義関数 (UDF) ](/ja/reference/functions/regular-functions/udf) の読み込みステータス、エラー情報、および設定メタデータが含まれます。

<div id="columns">
  ## カラム
</div>

* `name` ([String](/ja/reference/data-types)) — UDF 名。
* `load_status` ([Enum8('Success' = 0, 'Failed' = 1)](/ja/reference/data-types)) — 読み込み状態。設定可能な値:
  * **Success** — UDF が読み込まれ、使用可能な状態
  * **Failed** — UDF の読み込みに失敗 (詳細はフィールド 'loading\_error\_message' を参照) 。
* `loading_error_message` ([String](/ja/reference/data-types)) — 読み込みに失敗した場合の詳細なエラーメッセージ。正常に読み込まれた場合は空です。
* `last_successful_update_time` ([Nullable(DateTime)](/ja/reference/data-types)) — 最後に正常に更新された時刻のタイムスタンプ。一度も成功していない場合は NULL。
* `loading_duration_ms` ([UInt64](/ja/reference/data-types)) — UDF の読み込みに要した時間 (ミリ秒) 。
* `type` ([Enum8('実行可能' = 0, 'executable\_pool' = 1)](/ja/reference/data-types)) — UDF のタイプ: '実行可能' (単一プロセス) または 'executable\_pool' (プロセスプール) 。
* `command` ([String](/ja/reference/data-types)) — この UDF で実行するスクリプトまたはコマンド。
* `format` ([String](/ja/reference/data-types)) — I/O のデータフォーマット (例: 'TabSeparated'、'JSONEachRow') 。
* `return_type` ([String](/ja/reference/data-types)) — 関数の戻り値の型 (例: 'String'、'UInt64') 。
* `return_name` ([String](/ja/reference/data-types)) — 任意の戻り値識別子。設定されていない場合は空です。
* `argument_types` ([Array(String)](/ja/reference/data-types)) — 引数の型の Array (例: \['String', 'UInt64']) 。
* `argument_names` ([Array(String)](/ja/reference/data-types)) — 引数名の Array。名前のない引数には空文字列が入ります。
* `max_command_execution_time` ([UInt64](/ja/reference/data-types)) — データブロックの処理に許可される最大秒数。'executable\_pool' タイプでのみ有効です。
* `command_termination_timeout` ([UInt64](/ja/reference/data-types)) — コマンドプロセスに SIGTERM を送信するまでの秒数。
* `command_read_timeout` ([UInt64](/ja/reference/data-types)) — コマンドの stdout から読み取るためのミリ秒数。
* `command_write_timeout` ([UInt64](/ja/reference/data-types)) — コマンドの stdin に書き込むためのミリ秒数。
* `pool_size` ([UInt64](/ja/reference/data-types)) — コマンドプロセスのインスタンス数。'executable\_pool' タイプでのみ有効です。
* `send_chunk_header` ([UInt8](/ja/reference/data-types)) — 各データ chunk の前に行数を送信するかどうか (ブール値) 。
* `execute_direct` ([UInt8](/ja/reference/data-types)) — コマンドを直接実行するか (1) 、/bin/bash 経由で実行するか (0) 。
* `lifetime` ([UInt64](/ja/reference/data-types)) — 秒単位の再読み込み間隔。0 は再読み込みが無効であることを意味します。
* `deterministic` ([UInt8](/ja/reference/data-types)) — 同じ引数に対して関数が常に同じ結果を返すかどうか (ブール値) 。

<div id="example">
  ## 例
</div>

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

```sql theme={null}
SELECT
    name,
    load_status,
    type,
    command,
    return_type,
    argument_types
FROM system.user_defined_functions
FORMAT Vertical;
```

```response theme={null}
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を見つける:

```sql theme={null}
SELECT
    name,
    loading_error_message
FROM system.user_defined_functions
WHERE load_status = 'Failed';
```

<div id="see-also">
  ## 関連項目
</div>

* [ユーザー定義関数](/ja/reference/functions/regular-functions/udf) — UDFs の作成方法と設定方法。
