Community Articles
Find and share helpful community-sourced technical articles
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (2)
New Contributor

This article explains how to run a hive query using a UDF jar in Hive View 2.0.

  1. Upload the UDF jar to HDFS folder using Ambari Files view

Screen Shot 2017-09-20 at 9.45.43 AM.png

2. Navigate to Hive View 2.0 and go to UDF tabs. Click on New UDF Button to add the UDF jar.

Screen Shot 2017-09-20 at 9.54.11 AM.png

3. Click on File Resources to add new UDF. Enter the UDF path and resource nameScreen Shot 2017-09-20 at 9.56.08 AM.png

4. Enter Resource Name and Resource Path. Resource Path is the path to HDFS folder where the jar has been uploaded.

Path takes the format hdfs://<namenode_host>/<hdfs_path_to_jar>

Screen Shot 2017-09-20 at 10.00.59 AM.png

5. Once the UDF is added, It shows up as follows in the list of UDFs created. UDFs can also be edited or removed

Screen Shot 2017-09-20 at 10.01.08 AM.png

6. To write a hive query using the udf, go to Query Tab on Hive view. Select a worksheet and click on ‘Insert UDF’ button.

Screen Shot 2017-09-20 at 10.01.15 AM.png

7. The UDF details are added to the worksheet on selecting the udf. You can go ahead and write your query using the UDF function.

Screen Shot 2017-09-20 at 10.02.10 AM.png

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎09-20-2017 05:08 AM
Updated by:
Top Kudoed Authors