Javatpoint Logo
Javatpoint Logo

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.
Apache Pig SIZE Function
  • Check the tuples inserted in the text files.
Apache Pig SIZE Function
  • 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.
Apache Pig SIZE Function
  • Let's return the size of the first field of each tuple.
Apache Pig SIZE Function

Here, we got the desired output.

Next TopicSUM Function





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA