teradataml UDF Prerequisites | Teradata Package for Python - teradataml UDF Prerequisites - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage
UDF functions are executed using Script table operator (STO) or Apply table operator (Open Analytics Framework).

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.