Pig Data Types

Pig Latin – Data types

Given below table describes the Pig Latin data types.

S.N.

Data Type

Description & Example

1

int

Represents a signed 32-bit integer.

Example : 8

2

long

Represents a signed 64-bit integer.

Example : 5L

3

float

Represents a signed 32-bit floating point.

Example : 5.5F

4

double

Represents a 64-bit floating point.

Example : 10.5

5

chararray

Represents a character array (string) in Unicode UTF-8 format.

Example : ‘tutorials point’

6

Bytearray

Represents a Byte array (blob).

7

Boolean

Represents a Boolean value.

Example : true/ false.

8

Datetime

Represents a date-time.

Example : 1970-01-01T00:00:00.000+00:00

9

Biginteger

Represents a Java BigInteger.

Example : 60708090709

10

Bigdecimal

Represents a Java BigDecimal

Example : 185.98376256272893883

Complex Types

11

Tuple

A tuple is an ordered set of fields.

Example : (raja, 30)

12

Bag

A bag is a collection of tuples.

Example : {(raju,30),(Mohhammad,45)}

13

Map

A Map is a set of key-value pairs.

Example : [ ‘name’#’Raju’, ‘age’#30]

 

Student_data = LOAD 'student_data.txt' USING PigStorage(',')as 
   ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );

 


Comments

Popular posts from this blog

Problem Statement Of Real Estate Use Cases

Problem Statement Of Bank Marketing analysis

Hadoop