Complex data types in Pig

Pig has primitive data types such as int, long, float, double, chararray, and bytearray. In addition, Pig also supports complex data types. Inputs and outputs to Pig's relational operators are specified using these complex data types. In some cases, the behavior of the operators depends on the complex data type used. These complex data types are as follows:

  • Map: This data type should not be confused with the map function of MapReduce. The Map data type is an associative array data type that stores a chararray key and its associated value. There is no restriction on the data type of the value in a map. It can be a complex type too. If the type of the value cannot be determined, Pig defaults to the bytearray data type. The ...

Get Mastering Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.