Build and Package the Java API 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

To prepare a Java function for use in SQL-Analytics, compile it into a class file (build it on your workstation) and install it in you Aster instance using the ACT client’s \install command. Be sure to also install any other classes that your function depends on, as we'll explain below.

You must package your SQL-Analytic functions in one of the following ways:

  • as a single .class file for the function,
  • as a .jar file containing the function class and other classes, or
  • as a .zip file containing the function's .jar and other (possibly third-party) .jar files.

The name of the file must match the name of the function. For example, a function named foo must be compiled as Foo.class, and you can install the class on its own or as part of foo.jar, or, finally, as part of foo.zip which contains foo.jar with its Foo.class.

The advantage of a .zip-packaged function is that you can include external .jar files unmodified. For example, you might write a .zip-packaged function with the following structure:

Example structure of an SQL-Analytics function bundle to be installed


In this example, the primary SQL-Analytics function we care about is "foo," so we package it in an archive called foo.zip, which in turn must contain foo.jar, which in turn must somewhere contain a file Foo.class (path and case are not significant). By using a .zip file, we can contain other classes that our foo function relies on. In this case, the package also contains another class in foo.jar (OtherClass.class) and also another, third-party .jar file (otherjar.jar) with a class that foo relies on, called Useful.class.