You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Kevin LION <ke...@capptain.com> on 2012/04/10 18:08:14 UTC

PigDump not available anymore ?

Hi,

I would like load content from somewhere and store result in a CSV file.
According to the doc here (
http://pig.apache.org/docs/r0.9.2/func.html#pigdump), I can use PigDump().
I've also this script :

test = LOAD 'test.csv' USING org.apache.pig.builtin.PigStorage(',') AS
> (key:chararray, value:chararray);
> test = FOREACH test GENERATE FLATTEN(bag(STRSPLIT(value, ' '))) AS
> word:chararray;
> STORE test INTO 'test2.csv' USING org.apache.pig.builtin.PigDump();
>

But this gives me an error :

ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve
> PigDump using imports: [, org.apache.pig.builtin.,
> org.apache.pig.impl.builtin.
>

I've looked into Pig code and didn't found the file PigDump.java into the
org/apache/pig/impl/builtin directory. Does the PigDump function was
removed ? What can I use to have the same behaviour ?

Regards,
Kevin

Re: PigDump not available anymore ?

Posted by Norbert Burger <no...@gmail.com>.
Have you taken a look already at CSVExcelStorage from the piggybank?
 PigDump may work ok for basic datatypes, but seems like you'd quickly run
into issues with quoted strings and more complex types.

http://pig.apache.org/docs/r0.9.1/api/org/apache/pig/piggybank/storage/CSVExcelStorage.html

Norbert

On Tue, Apr 10, 2012 at 12:08 PM, Kevin LION <ke...@capptain.com>wrote:

> Hi,
>
> I would like load content from somewhere and store result in a CSV file.
> According to the doc here (
> http://pig.apache.org/docs/r0.9.2/func.html#pigdump), I can use PigDump().
> I've also this script :
>
> test = LOAD 'test.csv' USING org.apache.pig.builtin.PigStorage(',') AS
> > (key:chararray, value:chararray);
> > test = FOREACH test GENERATE FLATTEN(bag(STRSPLIT(value, ' '))) AS
> > word:chararray;
> > STORE test INTO 'test2.csv' USING org.apache.pig.builtin.PigDump();
> >
>
> But this gives me an error :
>
> ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve
> > PigDump using imports: [, org.apache.pig.builtin.,
> > org.apache.pig.impl.builtin.
> >
>
> I've looked into Pig code and didn't found the file PigDump.java into the
> org/apache/pig/impl/builtin directory. Does the PigDump function was
> removed ? What can I use to have the same behaviour ?
>
> Regards,
> Kevin
>