Pig Data Types

Pig Data Types: It includes the data types of pig and how they handle concepts such as missing data.

It also helps us to explain the data to a pig.

The data types of Pig can be divided into two categories:

  • Scalar Data Types
  • Complex Data Types

Scalar Data Types

Pig scalar types are simple types that appear in most programming languages.

Data Types Description Example
Int It is a singed 32-bit integer value 2
long It is a singed 64-bit integer value 15L or 15I
Float It is a 32-bit floating point value 4.5F or 4.5.5f or 4.5e2f or 4.5E2F
double It is a 64-bit floating point value 08.5 or 08.5e2 or 08.5E2
Boolean Boolean represents true or false values true/false
charArray It is a Character array Hello tutorialandexample
byteArray The default datatype in pig is a ByteArray  
bigInteger It displays the BigInteger 70204096223145
bigDecimal It displays the BigDecimal 198.789654123133211

Complex Data Types

Pig has several complex data types, such as tuples, bags, and maps. All of these types contain data of each type, including other complex types. It is therefore possible to have a map where the value field is a bag containing a tuple. Here, one of the fields is a map.

Data Types Description Example
Map It has Key and value pair data [websitename# tutorialandexample.com]
Tuple It’s a collection of one or more fields (12,56)
Bag It is a collection of one or more tuples {(12,56),(54,78)}