Apache Pig – Bag&Tuple-TOTUPLE() - Apache Pig

What is TOTUPLE() function?

The TOTUPLE() function is used convert one or more expressions to the data type tuple.

Syntax

Given below is the syntax of the TOTUPLE() function.

Example

Assume we have a file named employee_details.txt in the HDFS directory /pig_data/, with the following content.
employee_details.txt
We have loaded this file into Pig with the relation name emp_data as shown below.
Let us now convert the id, name and age of each student (record) into a tuple.
Verification
You can verify the contents of the totuple schema using the Dump operator as shown below.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Apache Pig Topics