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 Threaded View
Pig >> mail # user >> Reading a grouped file


Copy link to this message
-
Re: Reading a grouped file
What I rather wanted to write is

a = load 'group.txt' as (b1: bag {t1: tuple(id: int, points: int,
type: chararray)});
dump a;

because what you simply want to read is a bag with three-field tuple.

Best,
Adam

2012/10/23 Adam Kawa <[EMAIL PROTECTED]>:
> You may run something like:
>
> a = load 'bag.dat' as (b1: bag {t1: tuple(id: int, points: int, type:
> chararray)}, b2: bag {t: tuple(id: int, points: int, type:
> chararray)});
> dump a;
>
> 2012/10/23 jamal sasha <[EMAIL PROTECTED]>:
>> Hi I have a file in format
>> {(1,123,score) ,(1,124,score)}
>> {(2,356,score),(2,678,score)}
>> etc
>>
>> I  am guessing the person who was working on this forgot to flatten this in
>> last step?
>> How do I read and flatten this ?
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