You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by Apache Wiki <wi...@apache.org> on 2008/10/07 19:35:14 UTC

[Pig Wiki] Trivial Update of "WriteFunctions" by CorinneC

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Pig Wiki" for change notification.

The following page has been changed by CorinneC:
http://wiki.apache.org/pig/WriteFunctions

------------------------------------------------------------------------------
  [[Anchor(Writing_your_own_Pig_functions)]]
- == Writing your own user defined Pig functions ==
+ == Pig User Defined Functions ==
  
- Pig has a number of built-in functions for loading, filtering, aggregating, etc. (A complete list is available at PigBuiltins.) However, if you want to do something specialized you may need to write your own user defined function (UDF). This page will walk you through how to do this.
+ Pig has a number of built-in functions for loading, filtering, aggregating data (for a complete list, see PigBuiltins.) However, if you want to do something specialized, you may need to write your own Pig user defined function (UDF). This page walks you through the process.
  
  [[Anchor(Types_of_functions)]]
  === Types of functions ===
+ 
+ '''Eval Function'''
+ 
- The most important type and commonly used type of functions are EvalFunction. Eval functions consume a tuple, do some computation, and produce some data 
+ The most important and commonly used type of functions are EvalFunction. Eval functions consume a tuple, do some computation, and produce some data. 
  
  Eval functions are very flexible, e.g. they can mimic "map" and "reduce" style functions:
        * ''"Map" behavior:'' The output type of an Eval Function is one of: a single value, a tuple, or a bag of tuples (a Map/Reduce "map" function produces a bag of tuples).
        * ''"Reduce" behavior:'' Recall that in the Pig data model, a tuple may contain fields of type ''bag''. Hence an Eval Function may perform aggregation or "reducing" by iterating over a bag of tuples nested within the input tuple. This is how the built-in aggregation function SUM(...) works, for example.   
-    
- The other types of functions are:
-    * '''Load Function:''' controls reading of tuples from files
-    * '''Store Function:''' controls storing of tuples to files
+ 
+ '''Load Function'''
+  
+ Controls reading of tuples from files.
+ 
+ '''Store Function'''
+  
+ Controls storing of tuples to files.
  
  [[Anchor(Example)]]
  ==== Example ====