Installing the Sample Function - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software
  1. Connect to the Aster instance with the ACT client. Use a user account that has rights to install functions in the schema and rights to grant permissions to those functions. In this example well use a schema called textanalysis.
    $ act -h queen-ip -d databasename -U username -w password
  2. Install the user defined function using ACT’s \install command. (For a list of such commands, see Manage Functions and Files in an Aster Instance.)

    Here, we assume:

    • The files tax.so and top.kth.jar are local to the directory where you invoked ACT.
    • You can install user defined functions in the PUBLIC schema.
      \install tax.so
      \install top_kth.jar

      [Optional] If you like, you can enclose the \install command and subsequent calls to it in a transaction so that you can roll it back later to remove the user defined function from your cluster. (In this example we do an ABORT to remove our test function from the system.)

      Optional usage:

      BEGIN;
      \install tax.so
      \install top_kth.jar
      SELECT ... -- queries that use the installed functions
      ABORT;

      You can type \dF+ or \dF *.* to check which schema a function belongs to. When you call the function, Teradata recommends that you include its schema name.Type \dF+ function_name to check which schema the function belongs to.

  3. Use the GRANT command to give the EXECUTE privilege to users who will run the function. For this example, let's assume we want user "beehive" to be able to run the function.

    In most ACT commands for managing functions, when you type the function name, you do not type its suffix (like .jar in this example). The syntax is:

    GRANT EXECUTE ON FUNCTION top_kth TO mjones;

    Repeat the above step for the rest of your users and functions. Alternatively, you can grant EXECUTE rights at the group level by replacing the user name with a group name in the GRANT EXECUTE statement.

Now the function is installed and usable by all users to whom you have granted EXECUTE rights.