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.


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


Assume we have a file named employee_details.txt in the HDFS directory /pig_data/, with the following content.
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.
You can verify the contents of the totuple schema using the Dump operator as shown below.

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

Apache Pig Topics