tdextroutine UDF Subcommands/Options | VantageCloud Lake - tdextroutine UDF Subcommands and Options - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
The External Routine Installation Tool (tdextroutine) provides subcommands to create or manage C/C++ and Java UDFs in VantageCloud Lake:
  • Create a new UDF
  • Replace an existing UDF
  • List existing UDFs
  • Get details about a UDF
  • Delete a UDF JAR file
  • Redistribute a UDF JAR file
  • Drop a UDF
You must have the required privileges to run the subcommands. See Creating a C or C++ UDF and Using UDFs.

You can specify the tdextroutine subcommand options in two ways:

  • Use double dashes and the option name.

    Example: --database

  • Use a single dash and the character for the option.

    Example: -d

The following sections provide details about the subcommands and their options.

udf create Options function_name

Creates a new UDF.

function_name is required and defines the UDF name used in queries to call the function.

Use tdextroutine udf create --help to display the available options for the udf create subcommand. These options are listed in the following table.

You must choose one of the following options to identify where tdextroutine can find the UDF manifest.json file and the UDF source or object file.
  • -s source_directory
  • -a artifact_zipfile_path
  • -i artifact_ID
Option Type Description
--database, -d TEXT

Creates the UDF in the specified database.

If this option is omitted, the default database of the user is used.

--specific_name, -n TEXT

The specific name for the function is mandatory for overloaded function names.

Unlike function_name, the specific name must be unique within its database to avoid name clashes.

You must follow the identifier naming conventions of the C or C++ language.

If this option is omitted, function_name is used.

--source_path, -s DIRPATH
Path to the directory containing the following:
  • UDF manifest.json file
  • UDF source files or object file
--artifact_path, -a FILEPATH

Path to the artifact .zip file.

XRMigrationTool creates the artifact .zip file based on the UDF manifest file and places the file in the XRMigrationTool output directory.

--artifact_id, -i TEXT Artifact ID of the previously uploaded artifact file.

udf replace Options function_name

Creates a new UDF or replaces an existing UDF.

The options for udf replace are the same as for udf create.

udf list

Lists the existing UDFs in an environment.

udf fetch udf_id

Gets details about the UDF specified by udf_id.

The udf_id is returned by the udf create subcommand or the udf list subcommand.

If udf_id includes a slash (/) character, you must specify %2F to encode it. Slash is a reserved character.

For example, if udf_id is AAA/DgAA, then the command is as follows:
tdextroutine udf fetch AAA%2FDgAA

udf remove-jar Options function_name

Deletes the JAR file associated with a Java UDF from the database.

function_name is required and specifies the name of the JAR file provided in the UDF manifest file.
Option Type Description
--database, -d TEXT

If this option is omitted, the default database of the user is used.

udf redistribute-jar Options function_name

Redistributes a Java UDF JAR file that was previously registered with the database.

function_name is required and specifies the name of the JAR file provided in the UDF manifest file.
Option Type Description
--database, -d TEXT

If this option is omitted, the default database of the user is used.

udf drop {Options | udf_id}

Drops the specified UDF.

Option Type Description
-f function_name [-d database_name] TEXT If database_name is omitted, the default database of the user is used.
-n specific_name [-d database_name] TEXT If database_name is omitted, the default database of the user is used.

The udf_id is returned by the udf create subcommand or the udf list subcommand.

If udf_id includes a slash (/) character, you must specify %2F to encode it. Slash is a reserved character.

For example, if udf_id is AAA/DgAA, then the command is as follows:
tdextroutine udf drop AAA%2FDgAA