User-Defined Functions
Monday, February 28, 2011
1:15 PM
Several kinds of user-defined functions:
Filter functions: input a Pig value, return a boolean value to be used in conditions. 
Eval functions: input a Pig value, return a Pig result. 
Algebraic functions: full map/reduce operation on an (inner) input bag. 
Kinds of functions differ in how they are used: 
Filter functions are intended as logical conditions in a FILTER statement. 
Eval functions transform Pig values that are Tuples in a FOREACH-GENERATE statement. 
Algebraic functions act scalably on inner bags in a FOREACH-GENERATE statement.