Apache Pig - Eval Functions
Apache Pig provides various built-in functions namely eval, load, store, math, string, bag and tuple functions.
Given below is the list of eval functions provided by Apache Pig.
|S.N.||Function & Description|
To compute the average of the numerical values within a bag.
To concatenate the elements of a bag into a string. While concatenating, we can place a delimiter between these values (optional).
To concatenate two or more expressions of same type.
To get the number of elements in a bag, while counting the number of tuples in a bag.
It is similar to the COUNT() function. It is used to get the number of elements in a bag.
To compare two bags (fields) in a tuple.
To check if a bag or map is empty.
To calculate the highest value for a column (numeric values or chararrays) in a single-column bag.
To get the minimum (lowest) value (numeric or chararray) for a certain column in a single-column bag.
Using the Pig Latin PluckTuple() function, we can define a string Prefix and filter the columns in a relation that begin with the given prefix.
To compute the number of elements based on any Pig data type.
To subtract two bags. It takes two bags as inputs and returns a bag which contains the tuples of the first bag that are not in the second bag.
To get the total of the numeric values of a column in a single-column bag.
To split a string (which contains a group of words) in a single tuple and return a bag which contains the output of the split operation.