1.1 - Installing UDFs - Teradata Vantage

Teradata Vantage™ User Guide

Teradata Vantage
May 2020
User Guide
  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:
  9. [Optional] Create a function alias for your UDF.