Javatpoint Logo
Javatpoint Logo

Apache Pig MIN Function

The Apache Pig MIN function is used to find out the minimum of the numeric values or chararrays in a single-column bag. It requires a preceding GROUP ALL statement for global minimums and a GROUP BY statement for group minimums. However, it ignores the NULL values.

Syntax

Here,

exp - It is an expression with data types like chararray, int, float, long, etc.

Example of MIN Function

In this example, we will find out the minimum of the given values.

Steps to execute MIN Function

  • Create a text file in your local machine and insert the list of tuples.
Apache Pig MIN Function
  • Check the tuples inserted in the text files.
Apache Pig MIN 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 MIN Function
  • Let's group the data on the basis of 'a1' field.
Apache Pig MIN Function
  • Let's return the minimum of given numeric values.
Apache Pig MIN Function

Here, we got the desired output.

Next TopicSIZE 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