Apache Pig Data Types: A Comprehensive Guide
Learn about the various data types supported by Apache Pig, including scalar, complex, and relational types. This comprehensive guide provides descriptions and examples for each data type, essential for effective data processing in Pig.
Apache Pig Data Types
Understanding Pig Data Types
Apache Pig supports a variety of data types for storing and manipulating data. Below is a list of common Pig data types, their descriptions, and examples.
List of Pig Data Types
Type | Description | Example |
---|---|---|
int |
Signed 32-bit integer | 2 |
long |
Signed 64-bit integer | 15L or 15l |
float |
32-bit floating-point number | 2.5f or 2.5F |
double |
64-bit floating-point number | 1.5 or 1.5e2 or 1.5E2 |
chararray |
Character array (string) | hello javatpoint |
bytearray |
BLOB (Binary Large Object) - Byte array | (Example would require binary data representation) |
tuple |
Ordered set of fields | (12,43) |
bag |
Collection of tuples | {(12,43),(54,28)} |
map |
Collection of key-value pairs (tuples) | [open#apache] |
This table summarizes the key data types available in Apache Pig. Understanding these types is crucial for effective data processing within the Pig environment.