...

Big Data - Apache Pig

Back to Course

Lesson Description


Lession - #475 Apache pig Eval Functions


Eval Functions is the first kinds of Pig Built in Functions.

Apache Pig gives different build in functions to be specific eval, load, store, math, string, bag and tuple functions.

Different EVAL Functions

  • AVG Function
  • CONCAT Function
  • COUNT Function
  • IN Function
  • MAX Function
  • MIN Function
  • SIZE Function
  • SUM Function
  • TOKENIZE Function

    AVG Function

    The Apache Pig AVG work is utilized to find the normal of given numeric values in a single column bag. It requires a previous GROUP ALL statement for global averages and a GROUP BY statement for group averages , it ignores the NULL values.

    CONCAT Function

    The Apache Pig CONCAT work is utilized to connect at least two expressions. The produced output of expression should have indentical types. However assuming that any sub-expression is null, the created expression is also null

    COUNT Function

    The Apache Pig COUNT function is used to count the number of elements in a bag. It requires a preceding GROUP ALL statement for global counts and a GROUP BY statement for group counts. It ignores the null values.

    IN Function

    The Apache Pig IN function is used to reduce the requirement for multiple OR conditions. It facilitates to check if the current expression matches with any value exist in a list.

    MAX Function

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

    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.

    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.

    SUM Function

    The Apache Pig SUM function is used to find the sum of the numeric values in a single-column bag. It requires a preceding GROUP ALL statement for global sums and a GROUP BY statement for group sums. It ignores the null values.

    TOKENIZE Function

    The Apache Pig TOKENIZE function is used to splits the existing string and generates a bag of words in a result.