You compile the UDF code into a JAR and place the JAR on the cluster. You choose one
of several methods of configuring the cluster so Hive can find the JAR.
In this task, you choose one of several methods for configuring the cluster to find
the JAR:
- Direct reference
Straight-forward, but recommended for development only.
- Hive aux library directory method
Prevents accidental overwriting of files or
functions. Recommended for tested, stable UDFs to prevent accidental
overwriting of files or functions.
- Reloadable aux JAR Avoids HiveServer restarts.
Recommended if you anticipate
making frequent changes to the UDF logic.
-
Build the IntelliJ project.
...
[INFO] Building jar: /Users/max/IdeaProjects/hiveudf/target/TypeOf-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.820 s
[INFO] Finished at: 2019-04-03T16:53:04-07:00
[INFO] Final Memory: 26M/397M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
-
Navigate to the JAR in the /target directory of the project.
-
Configure the cluster so Hive can find the JAR using one of the following
methods.