Chapter 10 in Alan Gates' excellent book "Programmin Pig" discusses this
issue.

Robert Yerex
Data Scientist
Civitas Leaning

On Mon, Aug 13, 2012 at 3:43 PM, Danfeng Li <[email protected]> wrote:

> I have a big, e.g. A: {(name: chararray,age: int)}, I wrote a udf which
> adds 1 more field in the tuple inside the bag. E.g. B: {(name:
> chararray,age: int, rank:int)}. Because the number of fields in the
> original bag is not fixed, e.g I can have one more field such as gender:int.
>
> In my udf, in order to generate the correct output schema, I need to get
> the input schema first. I tried to find some examples but couldn't, could
> someone show me how to do it?
>
> Thanks.
> Dan
>
>


-- 
Robert Yerex
Data Scientist
Civitas Learning
www.civitaslearning.com

Reply via email to