Apache Pig Filter operator - Apache Pig

Why Apache Pig Filter operator option is used?

The FILTER operator is used to select the required tuples from a relation based on a condition.


Here’s the syntax of the FILTER operator.


Let’s see that we have a file named student_details.txt in the HDFS directory /pig_data/ as discussed below:
And we have loaded this file into Pig with the relation name student_details as shown below.
Now apply the Filter operator to get the student details from the city Chennai.


Let’s verify the relation filter_data using the DUMP operator as shown below.


It will deliver the below mentioned final output by displaying the contents of the relation filter_data.

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

Apache Pig Topics