UDF functions are executed using Script table operator (STO) or Apply table operator (Open Analytics Framework).
- For STO setup, refer to Apply SET Operations on teradataml DataFrames.
UDF functions support all Vantage platforms where the appropriate table operator is supported.
Analytics Database supports STO
- Make sure the script table operator setup is completed on the database.
- Make sure your administrator provides the standard permissions required by STO to the database <user>.
- Analytics Database supports multiple versions of Teradata In-nodes Python packages.
If v1.0.x is installed, the Python executable is present in /opt/teradata/languages/Python/. Tell teradataml to invoke the interpreter by specifying the option:
from teradataml import configure configure.indb_install_location = "/opt/teradata/languages/Python/"
If v.2.0.0 is installed, the Python executable is present in /var/opt/teradata. teradataml uses this by default. If Analytics Database raises Python interpreter file not found exception, tell teradataml to invoke the interpreter by specifying the option:
from teradataml import configure configure.indb_install_location = "/var/opt/teradata/languages/sles12sp3/Python/"
Analytics Database supports Apply Table Operator (Open Analytics Framework)
- Once you create the environment, configure it to be used by teradataml UDF functions.
from teradataml import configure configure.openml_user_env = <Object of UserEnv class>
- If you don't specify a configuration option, teradataml UDF uses default openml_env, an Open Analytics Framework environment for execution. This default environment has the latest Python supported by Open Analytics Framework at the time of creating the environment.
- Required modules/packages to run the user defined function must be installed in a remote user environment while executing teradataml UDF on VantageCloud Lake.
- While working on date and time data types, you must format these to the supported formats.