Using User-Defined Functions (UDFs) with HiveServer2
Important: HiveQL's ADD
JAR operation does not work with
HiveServer2 and the Beeline client when Beeline runs on a different host. As an
alterntive to ADD JAR, Hive auxiliary path functionality should be used as
described below.
To use custom user-defined functions (UDFs) with Hive, do the following:
- Copy the UDF JAR files to the host on which HiveServer2 is running. Save the JARs to any directory you choose, and make a note of the path.
- In the Cloudera Manager Admin Console, go to the Hive service.
- Click the Configuration tab.
- Expand the categories
- Configure the Hive Auxiliary Jars Directory property with the path from the first step.
- Click Save Changes. The JARs are added to HIVE_AUX_JARS_PATH environment variable.
- Redeploy the Hive client configuration.
- In the Cloudera Manager Admin Console, go to the Hive service.
- From the Actions menu at the top right of the service page, select Deploy Client Configuration.
- Click Deploy Client Configuration.
- Restart the Hive service. If the Hive Auxiliary Jars Directory property is configured but the directory does not exist, HiveServer2 will not start.
<< Hive Table Statistics | The Hue Service >> | |