When creating or replacing a UDF in VantageCloud Lake, the External Routine Installation Tool tdextroutine uses the UDF manifest file manifest.json to define the programming language properties and file details of the UDF.
The manifest.json file has the following schema:
{ "manifest_version": string, "source_language": string, "is_deterministic": boolean, "parameter_spec": string, "return_spec": string, "function_class": string, "parameter_style": string, "null_call": boolean, "execute_on": "string", "routine_kind": string, "interim_size": int, "glop_set_name": string, "files": [ { "type": string, "filepath": string, "name_on_server": string, "location": string, "entry_point": string, "jar_sql_id": string, "replace_jar": boolean } ] }
Manifest File Property Details
Property | Description |
---|---|
manifest_version | Required The value must be "v1" for the manifest schema version. |
source_language | Required The programming language in which the UDF is written. Allowed values for C, C++, and Java:
|
is_deterministic | Whether or not the UDF returns a deterministic result. If true, the UDF always returns the same results if given the same input. If false, the UDF may return different results even when given the same input. Default: false |
parameter_spec | List of input parameters for the UDF in the format: "ParmName1 Data_Type, ParmName2 Data_Type,…" |
return_spec | Required The data type of the value returned by the UDF. |
function_class | The class of the UDF. Allowed values: "SCALAR", "AGGREGATE", or "TABLE" Default: "SCALAR" |
parameter_style | How parameters are passed to the UDF. Allowed values:
Default: "SQL" |
null_call | Whether or not the UDF is called when input values are null. If true, the function is evaluated whether or not the input parameters are null. If parameter_style is "TD_GENERAL", nulls generate an exception condition. If false, the function is not evaluated and a null result is returned if any of the parameters are null. You cannot specify this option for aggregate functions. Default: true |
routine_kind | Specifies if the UDF is used for algorithmic compression of data. Allowed values: "REGULAR_FUNCTION", "COMPRESS_UDF", or "DECOMPRESS_UDF" Default: "REGULAR_FUNCTION" |
interim_size | Number of bytes to use for aggregate UDF context. Default: 0 |
glop_set_name | Name of the GLOP set this function is associated with. |
execute_on | Specifies whether the UDF runs on the primary cluster, compute cluster, or both. Allowed values: "COMPUTE", "PRIMARY", or "ALL". Default: "ALL" execute_on is currently not supported for UDFs running on Azure. C/C++ UDFs can run on both the compute cluster and the primary cluster on Azure.
|
files[n].type | Required Type of file. Allowed values: "SOURCE", "INCLUDE", "OBJECT", "PACKAGE", "LIBRARY", "JAR". |
files[n].filepath | The relative filepath (including filename) of a file within the .zip file that contains the files related to the UDF. |
files[n].name_on_server | Required The filename (without file path or file extension) to use when copying the file to the server’s compilation working directory. |
files[n].location | Whether the file is located on the server or on the client. Allowed values: "SERVER" or "CLIENT" Default: "SERVER" |
files[n].entry_point | Name of the function within the source file that is the sole entry point for the UDF. |
files[n].jar_sql_id | Name of the SQL identifier for the Java UDF JAR file. |
files[n].replace_jar | Default: false Set to true if a Java UDF JAR file is already installed and needs to be replaced. |