Apache Pig SPLIT Operator
The Apache Pig SPLIT operator breaks the relation into two or more relations according to the provided expression. Here, a tuple may or may not be assigned to one or more than one relation.
Example of SPLIT Operator
In this example, we split the provided relation into two relations.
Steps to execute SPLIT Operator
- Create a text file in your local machine and provide some values to it.
- Check the values written in the text files.
- Upload the text files on HDFS in the specific directory.
- Open the pig MapReduce run mode.
- Load the file that contains the data.
- Now, execute and verify the data.
- Let's provide the expression to split the relation.
- Now, execute and verify the data of the first relation.
- Now, execute and verify the data of the second relation.
Here, we got the desired output.