Parameters in Java routines
Parameter declaration in Java™ routines must conform to the requirements of one of the supported parameter styles.
- PARAMETER STYLE JAVA
- PARAMETER STYLE DB2GENERAL
- PARAMETER STYLE HIVE
It is strongly recommended that you specify the PARAMETER STYLE JAVA clause in the routine CREATE statement. With PARAMETER STYLE JAVA, a routine uses a parameter passing convention that conforms to the Java language and SQLJ Routines specification.
- Table functions
- Scratchpads in functions
- Access to the DBINFO structure in functions
- The ability to make a FINAL CALL (and a separate first call) to a function or method
If you migrate your user-defined function (UDF) from Hive, specify PARAMETER STYLE HIVE in the CREATE statement to reduce the need to rewrite your routine implementation. By using PARAMETER STYLE HIVE, a routine can use the parameter passing convention that conforms to the Apache Hive mechanism for invoking UDFs. The Apache Hive mechanism extends the org.apache.hadoop.hive.ql.exec.UDF class.
- org.apache.hadoop.io.*
- org.apache.hadoop.hive.ql.*
- All of the JAR files in $HIVE_HOME/lib
- $HADOOP_HOME/hadoop-core.jar
- Table functions
- Scratchpads in functions
- Access to the DBINFO structure in functions
- The ability to make a FINAL CALL (and a separate first call) to a function or method
- READS SQL DATA or CONTAINS SQL
- EXTERNAL ACTION
- NOT DETERMINISTIC
- DISALLOW PARALLEL