Java language simple table function conversion

The code from the Java language scalar function can be reused as a simple table function by making minor modifications to the registration.

Code

The code is the same as found in the Java language scalar function section.

Compilation

Compilation is the same as the one performed in local or remote modes.
$NZ_EXPORT_DIR/ae/utilities/bin/compile_ae --language java --template \
compile TestJavaInterface.java --version 3

Registration

Register the executables by using the modified command, which changes --template, --return and --class to be appropriate for a table function:
$NZ_EXPORT_DIR/ae/utilities/bin/register_ae \
-–sig "tapplyop_java(varargs)" \
--return "table(d double)" --class AeUdtf --language java \
--template udtf --define "java_class=TestJavaInterface" --version 3

Running

The AE can now be run in SQL:
SELECT * FROM TABLE WITH FINAL(tapplyop_java('+', 4,5,1.1,10));
D
------
20.1
(1 row)