pig tutorial - apache pig tutorial - Apache Pig - IsEmpty() Function - pig latin - apache pig - pig hadoop
What is IsEmpty() function in Apache Pig ?
- The IsEmpty() function used in Apache Pig is to check if a bag or map is empty.
- The IsEmpty() function is used to filter the data.
- The IsEmpty() returns a Boolean value is indicating whether a variable has been initialized.
- The IsEmpty() function will only return the meaningful information for the variants.
- The IsEmpty() function expresses the argument which is most often uses a single variable name.
Learn apache pig - apache pig tutorial - isempty() in apache pig - apache pig examples - apache pig programs
Syntax
Example
We can assume that we have two files namely wikitechy_employee_sales.txt and wikitechy_employee_bonus.txt which is given in the HDFS directory /pig_data/ which is given below:
wikitechy_employee_sales.txt
wikitechy_employee_bonus.txt
- We have loaded the files into Pig, with the relation names which are called employee_sales and employee_bonus.
employee_sales
employee_bonus
Verify the relation cogroup_data by using the DUMP operator which is given below.
We need to list some empty bags from the employee_sales relation which is given in the group by using the IsEmpty() function.