Help Center/ DataArts Fabric/ Developer Guide/ Function Reference/ UDFs/ UDF Development (Python)/ Organization Structure of the Code Archive Package
Updated on 2025-09-18 GMT+08:00

Organization Structure of the Code Archive Package

When your service scenario is complex and the UDF involves a significant amount of code, you are advised to register the function in the form of a compressed file package. All related code files dependent on the UDF should be uniformly archived into a compressed package, uploaded to OBS, and then the storage path of the compressed package should be specified during function creation. The code file structure within the compressed package must adhere to the following requirements:

  • Must include the file {FUNCTION_NAME}_source.py, which is considered the main entry file of the function. Additionally, the file content must be serialized into hexadecimal using CLOUDPICKLE.
  • The code files belonging to modules that the main function imports 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