Installing UDFs on Machine Learning Engine | Teradata Vantage - Installing UDFs - Teradata Vantage

Machine Learning User Guide

Product
Teradata Vantage
Release Number
9.01
1.3
Published
August 2020
Language
English (United States)
Last Update
2020-10-02
dita:mapPath
dci1595445931473.ditamap
dita:ditavalPath
dqp1599597541027.ditaval
dita:id
B700-4004
lifecycle
previous
Product Category
Teradata Vantage™
  1. Copy your UDF file to /etc/opt/teradata/tdconfig/Teradata/tdbs_udf/usr on Teradata MPP-1 node.
  2. Make your zip file executable.
  3. Register your UDF file and install it in Teradata nodes database file system.
    The recommended and easiest way to do this is to use Teradata Studio. Log on as an authorized Advanced SQL Engine user and call sysuif.install_file.
    See Teradata Studio™ User Guide, B035-2041.
  4. Install your UDF file in Advanced SQL Engine:
    CALL SYSUIF.INSTALL_FILE ('sql_identifier', 'udf_file_name.zip', 'sb!udf_file_name.zip');
    When given this call, the stored procedure sysuif.install_file registers and copies your UDF file from /etc/opt/teradata/tdconfig/Teradata/tdbs_udf/usr on Teradata MPP-1 node to all database nodes of your target Teradata system. See Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.
  5. Verify the registered files:
    SELECT databasename, tablename, version FROM dbc.tables WHERE tablekind = 'Z';
  6. Install your UDF in ML Engine in the default schema:
    CALL PM.INSTALL_AFUNCTION ('sql_identifier');
    The default schema is the private schema with the same name as the current Advanced SQL Engine user. For example, if the current user is alice, the default schema on ML Engine is the private schema alice. If the ML Engine schema and user do not exist, the system creates them.
  7. Verify the installed functions:
    HELP FOREIGN SCHEMA default_schema@coprocessor;
    For example:
    HELP FOREIGN SCHEMA alice@coprocessor;
    For more details on installed functions, run the HELP FOREIGN FUNCTION command. See Help Foreign Function Command and Help Foreign Schema Command.
  8. [Optional] Install your UDF in public schema:
    CALL PM.INSTALL_AFUNCTION_TO_PUBLIC ('sql_identifier');
    CALL PM.INSTALL_AFUNCTION_TO_PUBLIC ('new_kmeans_uif');
  9. [Optional] Create a function alias for your UDF.