Since UDFs provide the means for submitting and running arbitrary executable code on the server, they are disabled by default. When enabled, it is recommended that user authorization also be enabled, to ensure that UDFs are run only by trusted users. To this end, Kinetica only allows access to UDF functionality for users with administrative access. UDFs are also run under an OS user that is separate from the primary Kinetica user, to provide greater containment of UDF system access.
Kinetica v5.4 or later
UDFs enabled in /opt/gpudb/core/etc/gpudb.conf
:
enable_procs = true
User authorization enabled (recommended); see Security Configuration section for details
Kinetica UDF APIs; these come packaged with the default Kinetica installation, but can be downloaded separately, if developing UDFs without a local Kinetica instance installed
The Kinetica UDF APIs are located in these directories, in a default Kinetica installation:
API | Directory |
---|---|
C++ | /opt/gpudb/udf/api/cpp |
Java | /opt/gpudb/udf/api/java |
Python | /opt/gpudb/udf/api/python |
If developing UDFs without a local Kinetica installation, the APIs can be downloaded from here:
API | GitHub Link |
---|---|
C++ | https://github.com/kineticadb/kinetica-udf-api-cpp.git |
Java | https://github.com/kineticadb/kinetica-udf-api-java.git |
Python | https://github.com/kineticadb/kinetica-udf-api-python.git |
After downloading, see the README.md
in the UDF API directory created
for further setup instructions.
Calling the /create/proc endpoint will deploy the specified UDF to the Kinetica execution environment, to every server in the cluster. The endpoint takes the following parameters:
Note
For convenience, the native Python API can be used for deploying UDFs written in any language. All of the UDF examples given here will use the Python API for deployment.
Calling the /execute/proc endpoint will execute the specified UDF within the targeted Kinetica execution environment. The endpoint takes the following parameters:
The call is asynchronous and will return immediately with a run_id
, which is
a string that can be used in subsequent checks of the execution status.
Note
For convenience, the native Python API can also be used for executing UDFs written in any language. All of the UDF examples given here will use the Python API for execution.
The status of a running UDF can be checked, by run_id
, using the
/show/proc/status endpoint. It will return whether the UDF is
still running, has completed, or has exited with an error, along with any
processed results.
Other UDF management endpoints include:
run_id
Note
The Kinetica Administration Application can be used to perform all of these actions via the Advanced Query Tool, under .