As mentioned in the Using Hive built-in functions recipe, Hive supports many built-in functions for data manipulation and analysis. Hive also allows us to write our own customized functions to be used with the Hive queries. These functions are called user-defined functions, and this recipe will show you how to write a simple User-defined Function (UDF) for Hive. Hive UDFs allow us to extend the capabilities of Hive for our customized requirements, without having to resort to implementing Java MapReduce programs from scratch.
This recipe assumes that the earlier recipe has been performed. Install Hive and follow the earlier recipe if you have not done already.
Make sure you have Apache Ant installed in your system.