Built-in functions
These are functions that are already available in Hive. First, we have to check the application requirement, and then we can use these built-in functions in our applications. We can call these functions directly in our application. The syntax and types are mentioned in the following section. Types of Built-in Functions in HIVE
Collection Functions Date Functions Mathematical Functions Conditional Functions String Functions Misc. Functions
Collection Functions:
These functions are used for collections. Collections mean the grouping of elements and returning single or array of elements depends on return type mentioned in function name.
Date Functions:
These are used to perform Date Manipulations and Conversion of Date types from one type to another type:
Mathematical Functions:
These functions are used for Mathematical Operations. Instead of creatingUDFs , we have some inbuilt mathematical functions in Hive. MONTH/MON/MM, YEAR/YYYY/YY.
Conditional Functions:
These functions used for conditional values checks.
String Functions:
String manipulations and string operations these functions can be called.
UDFs (User Defined Functions):
In Hive, the users can define own functions to meet certain client requirements. These are known as UDFs in Hive. User Defined Functions written in Java for specific modules. Some of UDFs are specifically designed for the reusability of code in application frameworks. The developer will develop these functions in Java and integrate those UDFs with the Hive. During the Query execution, the developer can directly use the code, and UDFs will return outputs according to the user-defined tasks. It will provide high performance in terms of coding and execution. For example, for string stemming we don’t have any predefined function in Hive. For this, we can write stem UDF in Java. Wherever we require Stem functionality, we can directly call this Stem UDF in Hive. Here stem functionality means deriving words from its root words. It is like stemming algorithm reduces the words “wishing”, “wished”, and “wishes” to the root word “wish.” For performing this type of functionality, we can write UDF in Java and integrate it with Hive. Depending on the use cases, the UDFs can be written. It will accept and produce different numbers of input and output values. The general type of UDF will accept a single input value and produce a single output value. If the UDF is used in the query, then UDF will be called once for each row in the result data set. In the other way, it can accept a group of values as input and return a single output value as well.