Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

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


+
yonghu 2012-06-11, 16:07
+
Russell Jurney 2012-06-11, 17:33
Copy link to this message
-
Re: How can I use load function to load bag field?
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 2012-06-11, 18:56
+
yonghu 2012-06-11, 19:07
+
Jonathan Coveney 2012-06-11, 20:15
+
Russell Jurney 2012-06-11, 20:32
+
yonghu 2012-06-13, 08:02
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB