Appendix A. Built-in User Defined Functions and Piggybank
This appendix covers UDFs that come as part of the Pig distribution, including built-in UDFs and user-contributed UDFs in Piggybank.
Built-in UDFs
Pig comes prepackaged with many UDFs that can be used
directly in Pig without using register or
define. These include load, store, evaluation, and filter
functions.
Built-in Load and Store Functions
Pig’s built-in load functions are listed in Table A-1; Table A-2 lists the store functions.
Table A-1. Load functions
| Function | Location String indicates | Constructor arguments | Description |
|---|---|---|---|
HBaseStorage | HBase table | The first argument is a string describing column family and column to Pig field mapping. The second is an option string (optional). | Load data from HBase (see HBase). |
PigStorage | HDFS file | The first argument is a field separator (optional; defaults to Tab). | Load text data from HDFS (see Load). |
TextLoader | HDFS file | None. | Reads lines of text, each line as a tuple with one chararray field. |
Table A-2. Store functions
| Function | Location String indicates | Constructor arguments | Description |
|---|---|---|---|
HBaseStorage | HBase table | The first argument is a string describing Pig field to HBase column family and column mapping. The second is an option string (optional). | Store data to HBase (see HBase). |
PigStorage | HDFS file | The first argument is a field separator (optional; defaults to Tab). | Store text to HDFS in text format (see Store). |
Built-in Evaluation and Filter Functions
The evaluation functions can be divided into math functions that ...