Problem resolved. We figure out the error happen because we import wrong
SequenceFileLoader class, `ElephantBird` has its own SequenceFileLoader.
The following command works well:

A = LOAD '/tmp/part-m-00000' USING
com.twitter.elephantbird.pig.load.SequenceFileLoader ( '-c
com.twitter.elephantbird.pig.util.TextConverter', '-c
com.twitter.elephantbird.pig.util.TextConverter' ) AS (key:chararray,
value:chararray);



On Fri, May 17, 2013 at 1:10 PM, Ho Duc Ha <hodu...@gmail.com> wrote:

> We're trying to use the SequenceFileLoader, but get an error when we try
> to define the converter classes as so:
>
> A = LOAD '/tmp/part-m-00000' using
> org.apache.pig.piggybank.storage.SequenceFileLoader ( '-c
> com.twitter.elephantbird.pig.util.TextConverter', '-c
> com.twitter.elephantbird.pig.util.TextConverter' ) AS (key:chararray,
> value:chararray);
>
> The exception:
>
> Failed to parse: Pig script failed to parse:
> <line 1, column 4> pig script failed to validate:
> java.lang.RuntimeException: could not instantiate
> 'org.apache.pig.piggybank.storage.SequenceFileLoader' with arguments '[-c
> com.twitter.elephantbird.pig.util.TextConverter, -c
> com.twitter.elephantbird.pig.util.TextConverter]'
>         at
> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:191)
>         at
> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1571)
>
> ...<cut>...
>
> Caused by: java.lang.NoSuchMethodException:
> org.apache.pig.piggybank.storage.SequenceFileLoader.<init>([Ljava.lang.String;)
>         at java.lang.Class.getConstructor0(Class.java:2706)
>         at java.lang.Class.getConstructor(Class.java:1657)
>         at
> org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:594)
>         ... 22 more
>
> It seems that the exception occurs because there's only 1 parameter passed
> to the constructor (SequenceFileLoader has constructors for 0, 2, or 3
> String objects).
>
> p.s. I realize that, in this case, we can use the default
> SequenceFileLoader() without parameters (it works), but we want to use
> other converters beyond this example.
>


Thanks,

Ha

Reply via email to