Creating a user-defined function in Cloudera Data Warehouse Public Cloud

You can call a built-in Hive function to run one of a wide-range of operations instead of performing multiple steps. You can create a user-defined function (UDF) when a built-in is not available to do what you need.

Assuming you have installed Java and a Java integrated development environment (IDE) tool, such as IntelliJ, you can create the UDF offline. For example, you can create the UDF on your laptop. You export a user-defined function (UDF) to a JAR from a Hadoop- and Hive-compatible Java project and store the JAR on the object store. Using Hive commands, you register the UDF based on the JAR, and call the UDF from a Hive query.