system.user_defined_functions 시스템 테이블
system.user_defined_functions 시스템 테이블
system.user_defined_functions 는 User-Defined Functions (UDFs) 의 로딩 상태, 오류 정보, 구성 메타데이터를 담고 있어요.
출처: 문서
본문
Description
User-Defined Functions (UDFs) 의 로딩 상태, 오류 정보, 구성 메타데이터를 포함해요.
Columns
-
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) — 함수가 같은 인자에 대해 같은 결과를 반환하는지 여부(불리언)예요.
Example
모든 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';
See Also
- User-Defined Functions — UDF를 만들고 구성하는 방법.