Updated on 2026-11-09 GMT+08:00

Python UDF

This section describes GUC parameters for Python UDFs.

Parameter Description

Table 1 Python UDF parameters

Parameter

Type

Description

python_udf_spec_options

String

Definition: Specifies the default values of common parameters in WITH ARGUMENTS during Python UDF execution. If a parameter is not specified in WITH ARGUMENTS, the GUC value set by python_udf_spec_options is used by default. The priority of parameters explicitly specified in WITH ARGUMENTS is higher than that of the GUC value.

  • set python_udf_spec_options = '(key1:value1),(key2:value2)' indicates that the value of a specified key is added or updated based on the existing settings. If a key already exists, the value of the key is overwritten. If the key does not exist, the key is added.
  • set python_udf_spec_options = '' or reset python_udf_spec_options indicates that all existing settings are cleared.

Range: A string, in the format of comma-separated (key:value) pairs. Currently, six parameters are supported: timeout, cpu, memory, arch, apu, and concurrency. For details, see WITH ARGUMENTS Syntax.

Default Value: Empty ('').

enable_udf_global_actor_pool

Boolean

Definition: Specifies whether to enable the global Python UDF actor pool. After this function is enabled, Python UDF actors are managed by the global CN instead of each DN.

You need to enable udf_split first (by setting sql_opt_options='on(udf_split)'). Otherwise, this parameter does not take effect.

Range: Boolean (on/off).

Default Value: off.

enable_udf_scheduler

Boolean

Definition: Specifies whether to enable the global dynamic scheduling policy for Python UDFs. After this function is enabled, the system dynamically schedules Python UDF actors based on the running time of different Python UDFs in statements, reducing the execution bottleneck of a single UDF.

This parameter takes effect only when udf_split (by setting sql_opt_options='on(udf_split)') and enable_udf_global_actor_pool are enabled and the statement does not contain multi-branch operations such as JOIN.

Range: Boolean (on/off).

Default Value: off.

enable_udf_log_trace

Boolean

Definition: Specifies whether to enable the Python UDF log traceability function. After this function is enabled, the system automatically injects the SESSIONID/STATEMENTID tag to all logs generated during UDF execution (print, logging, loguru, and warnings).

Range: Boolean (on/off).

Default Value: on.