Example: I have a class relationship, with a student bag in it:
class: {teacher_name: chararray,students: {(firstname: chararray, lastname: chararray)}
I want to perform an operation for each student, leaving the global structure untouched, i.e. receive:
class: {teacher_name: chararray,students: {(fullname: chararray)}
where for each student, fullname = CONCAT (first name, last name)
My understanding is that a nested FOREACH will not be my solution here, as it still only generates 1 entry per input tuple, while I want something to be applied in every element of the bag.
Pretty easy to do with UDF, but wondered if this is possible in pure Piglatin.
source share