[Solved-1 Solution] Pig Conditional Operators ?
What is foreach
- The FOREACH operator is used to generate specified data transformations based on the column data.
Syntax
- Given below is the syntax of FOREACH operator.
Problem :
Consider the below relation
Is there a way to achieve the following Consider the below relation
Solution 1:
- We can do a FOREACH and use the ternary operator as follows.