Test your function by running it.
- Run ACT and log in as an SQL user who has the EXECUTE privilege on the function.
-
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.
-
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.