Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> How can I use load function to load bag field?


Copy link to this message
-
Re: How can I use load function to load bag field?
High five! o/\o

On Mon, Jun 11, 2012 at 11:51 AM, yonghu <[EMAIL PROTECTED]> wrote:

> Dear Russell,
>
> Thanks for your response.
>
> Yong
>
> On Mon, Jun 11, 2012 at 7:33 PM, Russell Jurney <[EMAIL PROTECTED]
> >wrote:
>
> > 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
> >
>

--
Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com