Database Reference
In-Depth Information
ger relation. The STORE statement should be used when the size of the output is more
than a few lines, as it writes to a file rather than to the console.
Table 16-2. Pig Latin diagnostic operators
Operator (Shortcut) Description
DESCRIBE ( \de ) Prints a relation's schema
EXPLAIN ( \e )
Prints the logical and physical plans
ILLUSTRATE ( \i ) Shows a sample execution of the logical plan, using a generated subset of the input
Pig Latin also provides three statements — REGISTER , DEFINE , and IMPORT — that
make it possible to incorporate macros and user-defined functions into Pig scripts (see
Table 16-3 ).
Table 16-3. Pig Latin macro and UDF statements
Statement Description
REGISTER Registers a JAR file with the Pig runtime
DEFINE Creates an alias for a macro, UDF, streaming script, or command specification
IMPORT Imports macros defined in a separate file into a script
Because they do not process relations, commands are not added to the logical plan; in-
stead, they are executed immediately. Pig provides commands to interact with Hadoop
filesystems (which are very handy for moving data around before or after processing with
Pig) and MapReduce, as well as a few utility commands (described in Table 16-4 ).
Search WWH ::




Custom Search