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

Switch to Threaded View
Pig, mail # user - Storing field in a bag


Copy link to this message
-
Re: Storing field in a bag
Alan Gates 2012-09-11, 00:19
You can achieve equivalent functionality by saying:

page = foreach b generate page;
store page into '/flume_vol/flume/input/page.dat';
network = foreach b generate network;
store network into '/flume_vol/flume/input/network.dat';

Alan.
On Sep 10, 2012, at 4:05 PM, Ruslan Al-Fakikh wrote:

> Hi, Mohit,
>
> http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#STORE
> I guess you can only STORE relations, not fields, etc
>
> Ruslan
>
> On Mon, Sep 10, 2012 at 9:53 PM, Mohit Anchlia <[EMAIL PROTECTED]> wrote:
>> I am trying to store field in a bag command but it fails with
>>
>> store b.page into '/flume_vol/flume/input/page.dat';
>> store b.network into '/flume_vol/flume/input/network.dat';
>>
>> B: {b: {(page: chararray,network: chararray,sysinfo:
>> chararray,trafficsource: chararray,search: chararray)}}
>> 2012-09-10 10:45:54,293 [main] ERROR org.apache.pig.tools.grunt.Grunt -
>> ERROR 1200: <file script5_snappy.pig, line 24, column 7>  mismatched input
>> '.' expecting INTO
>> Details at logfile: /root/.mohit/pigtest/pig_1347299107910.log
>>
>> --
>>
>> Can I do this without using foreach?