Running 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

Test your function by running it.

  1. Run ACT and log in as an SQL user who has the EXECUTE privilege on the function.
  2. Invoke the function in a statement such as a SELECT or other data-retrieval statement. Make sure you schema-qualify the function’s name, or have its schema in your schema search path.

    This example nests a call to the function tokenize inside a call to the function counttokens:

    SELECT token, count
    FROM textanalysis.counttokens
         (
           ON (SELECT token, count
               FROM textanalysis.tokenize
                    (
                      ON documents)
              )
           PARTITION BY token
         )
    ;

    Here, the function name is an all-lowercase name, so we did not have to surround the name in double quotes. If your function name contains uppercase letters, your SELECT statement must enclose it in double quotes.

  3. Invoke another SQL-MapReduce function. We add this example to show that the following code is equivalent to the example you just typed:
    SELECT token,
           sum(count)
    FROM textanalysis.tokenize
         (
           ON documents)
    GROUP BY token
    ORDER BY sum(count)
    ;

    See Manage Functions and Files in Aster Database for more information.