120
Apache Pig SIZE Function
The Apache Pig SIZE function is used to find the number of elements based on any Pig data type. It includes NULL values in size computation. Here, the size is not algebraic.
Example of SIZE Function
In this example, we compute the number of characters present in the first field of each tuple.
Steps to execute SIZE Function
- Create a text file in your local machine and insert the list of tuples.
- Check the tuples inserted in the text files.
- Upload the text files on HDFS in the specific directory.
- Open the pig MapReduce run mode.
- Load the file that contains the data.
- Now, execute and verify the data.
- Let’s return the size of the first field of each tuple.
Here, we got the desired output.
Next TopicSUM Function