Programming Pig
Pig Latin comes with a number of built-in functions (the eval, load/store, math, string, bag, and tuple functions) and a number of scalar and complex data types. Additionally, Pig allows function and data-type extension by means of UDFs and dynamic invocation of Java methods.
Pig data types
Pig supports the following scalar data types:
int
: a signed 32-bit integerlong
: a signed 64-bit integerfloat
: a 32-bit floating pointdouble
: a 64-bit floating pointchararray
: a character array (string) in Unicode UTF-8 formatbytearray
: a byte array (blob)boolean
: a booleandatetime
: a datetimebiginteger
: a Java BigIntegerbigdecimal
: a Java BigDecimal
Pig supports the following complex data types:
map
: an associative array enclosed by[]
, with the key and value separated by#
, and items separated by,
tuple
: an ordered list of data, where elements can be of any scalar or complex type enclosed by()
, with items separated by,
bag
: an unordered collection of tuples enclosed by{}
and...