Skip to Content
Programming Pig
book

Programming Pig

by Alan Gates
October 2011
Intermediate to advanced content levelIntermediate to advanced
220 pages
6h 25m
English
O'Reilly Media, Inc.
Content preview from Programming Pig

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

FunctionLocation String indicatesConstructor argumentsDescription
HBaseStorageHBase 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).
PigStorageHDFS fileThe first argument is a field separator (optional; defaults to Tab).Load text data from HDFS (see Load).
TextLoaderHDFS fileNone.Reads lines of text, each line as a tuple with one chararray field.

Table A-2. Store functions

FunctionLocation String indicatesConstructor argumentsDescription
HBaseStorageHBase 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).
PigStorageHDFS fileThe 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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Pig, 2nd Edition

Programming Pig, 2nd Edition

Alan Gates, Daniel Dai
Pig Design Patterns

Pig Design Patterns

Pradeep Pasupuleti
Apache Hadoop™ YARN: Moving beyond MapReduce and Batch Processing with Apache Hadoop™ 2

Apache Hadoop™ YARN: Moving beyond MapReduce and Batch Processing with Apache Hadoop™ 2

Arun C. Murthy, Vinod Kumar Vavilapalli, Doug Eadline, Joseph Niemiec, Jeff Markham

Publisher Resources

ISBN: 9781449317881Errata Page