Doesn't need a UDF (if it's PigStorage or something else supported), just a
cast.

foo = LOAD 'location' as B:bag{T2:tuple(t1:float,t2:float)};

Pulled from the docs: http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html

A = LOAD 'mydata' AS (T1:tuple(f1:int, f2:int),
B:bag{T2:tuple(t1:float,t2:float)}, M:map[] );

A = LOAD 'mydata' AS (T1:(f1:int, f2:int), B:{T2:(t1:float,t2:float)}, M:[] );


Russell Jurney
twitter.com/rjurney
[email protected]
datasyndrome.com

On Jun 11, 2012, at 9:07 AM, yonghu <[email protected]> wrote:

Dear All,

How can I define UDF load function to load the bag field? Such as A = LOAD
'location' as (filed_name : bag {}). Can anyone show me an example code?

Regards!

Yong

Reply via email to