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

Development Notes

Operating Environment: Requirements

  • UDFs can be programmed only in Python.
  • The Python version of the UDF runtime environment supports only the 3.10 and 3.11 series. Version 3.11.9 is recommended.
  • When using Cloudpickle to serialize the main function, ensure that the local Python version is 3.11.9 and the Cloudpickle version is 3.0.0. Otherwise, the function body may fail to be parsed due to version inconsistency in the Aura running environment.

Function Definition Constraints

  • Default values cannot be set for UDF parameters. Additionally, if a function is created with precision specified for its parameters or return value, no precision validation will be performed.
  • Function overloading is not supported.

Function and Code Package Requirements

  • You must define either the function body or the code package archive path.
  • For complex business scenarios involving extensive UDF code, it is recommended to register the function as a file archive: Archive all code files required by the UDF into a single compressed package, upload the package to OBS, and specify the storage path of the package when creating the function. The requirements for the compressed package are as follows:
    • The package must contain the {FUNCTION_NAME}_source.py file. This file is treated as the main entry point for the function, and its content must be serialized into hexadecimal format using Cloudpickle.
    • The code files for modules imported by the main function must be correctly organized.
    • Only zip format is supported for the compressed package.

      An example of the compressed package is as follows:

      my_udf.zip/
      ├── my_udf_source.py
      ├── my_helper.py
      └── other/
              └── utils.py

Recommended Registration Method

Aura provides three methods for registering UDFs: Explicit registration using the ibis-aura SDK, implicit registration, and DDL registration using SQL. Explicit registration using the ibis-aura SDK is recommended because it offers the following advantages:
  • The registration interface provided by the SDK fully adheres to the Aura DDL specifications. By correctly invoking this interface, you can avoid issues where UDFs fail due to constraint violations.
  • The SDK provides additional constraint checks, such as Python version detection and automatic organization of UDF code packages.

Dependency Management

  • The third-party dependency package list for Python UDF must ensure compatibility among libs, and you are advised to explicitly specify stable versions for all dependencies.
  • When debugging UDFs locally, you are advised to use third-party packages from Huawei sources to set up the debugging environment. This prevents issues such as installation failures or version incompatibilities that may arise during UDF execution in Aura but not in the local environment.

Storage and Permissions

You can only use buckets of the OBS parallel file system to store UDF code compressed packages, and you must grant read permissions to IAM users on LakeFormation.