- Apache Pig Tutorial
- Apache Pig - Home
- Apache Pig Introduction
- Apache Pig - Overview
- Apache Pig - Architecture
- Apache Pig Environment
- Apache Pig - Installation
- Apache Pig - Execution
- Apache Pig - Grunt Shell
- Pig Latin
- Pig Latin - Basics
- Load & Store Operators
- Apache Pig - Reading Data
- Apache Pig - Storing Data
- Diagnostic Operators
- Apache Pig - Diagnostic Operator
- Apache Pig - Describe Operator
- Apache Pig - Explain Operator
- Apache Pig - Illustrate Operator
- Grouping & Joining
- Apache Pig - Group Operator
- Apache Pig - Cogroup Operator
- Apache Pig - Join Operator
- Apache Pig - Cross Operator
- Combining & Splitting
- Apache Pig - Union Operator
- Apache Pig - Split Operator
- Pig Latin Built-In Functions
- Apache Pig - Eval Functions
- Load & Store Functions
- Apache Pig - Bag & Tuple Functions
- Apache Pig - String Functions
- Apache Pig - date-time Functions
- Apache Pig - Math Functions
- Other Modes Of Execution
- Apache Pig - User-Defined Functions
- Apache Pig - Running Scripts
- Apache Pig Useful Resources
- Apache Pig - Quick Guide
- Apache Pig - Useful Resources
- Apache Pig - Discussion
Apache Pig - Eval Functions
Apache Pig provides various built-in functions namely eval, load, store, math, string, bag and tuple functions.
Eval Functions
Given below is the list of eval functions provided by Apache Pig.
S.N. | Function & Description |
---|---|
1 | AVG()
To compute the average of the numerical values within a bag. |
2 | BagToString()
To concatenate the elements of a bag into a string. While concatenating, we can place a delimiter between these values (optional). |
3 | CONCAT()
To concatenate two or more expressions of same type. |
4 | COUNT()
To get the number of elements in a bag, while counting the number of tuples in a bag. |
5 | COUNT_STAR()
It is similar to the COUNT() function. It is used to get the number of elements in a bag. |
6 | DIFF()
To compare two bags (fields) in a tuple. |
7 | IsEmpty()
To check if a bag or map is empty. |
8 | MAX()
To calculate the highest value for a column (numeric values or chararrays) in a single-column bag. |
9 | MIN()
To get the minimum (lowest) value (numeric or chararray) for a certain column in a single-column bag. |
10 | PluckTuple()
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. |
11 | SIZE()
To compute the number of elements based on any Pig data type. |
12 | SUBTRACT()
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. |
13 | SUM()
To get the total of the numeric values of a column in a single-column bag. |
14 | TOKENIZE()
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. |