|
Alan Gates |
at Oct 27, 2010 at 10:47 pm
|
⇧ |
| |
The easiest way to do this might be to have your loader return a
single tuple that contains bag, with all of the tuples you want to
return in that bag. Then your next statement can be a foreach with a
flatten to turn each of those into its own record.
A = load 'foo' as (b:bag{});
B = foreach A generate flatten(b);
This way you do not have to modify Pig's internal code to make your
use case work.
Alan.
On Oct 27, 2010, at 3:00 PM, John Hui wrote:
Hi Pig Users,
I am currently writing a UDF loader. In one of my use case, one
line in the
input stream results in multiple tuples. Has anyone encounter or
solve this
issue on their end.
The current structure of the code getNext method only return tuple
but I
want it to return a List<tuple>. Let me know if there's use case
out there
like mine, I am coding it up to return List<tuple> which is more more
flexible than return only one tuple.
Thanks,
John