add "register /path/to/piggybank.jar" to the top of your script

2012/4/11 Ayman Farahat <[email protected]>

>
>
> Hello;
> I am using pig 0.9.2
> It compiles fine and runs. I can also build my own UDFs.
> When i try using Piggybank i get an error :
>
> Any help much appreciated
>
>
> Pig Stack Trace
> ---------------
> ERROR 1070: Could not resolve
> org.apache.pig.piggybank.evaluation.string.LOWER using imports: [,
> org.apache.pig.builtin., org.apache.pig.impl.builtin.]
>
> Failed to parse: Pig script failed to parse:
> <line 2, column 26> Failed to generate logical plan. Nested exception:
> java.lang.RuntimeException: Cannot instantiate:
> org.apache.pig.piggybank.evaluation.string.LOWER
>         at
> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:178)
>         at
> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1609)
>         at
> org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1582)
>         at org.apache.pig.PigServer.registerQuery(PigServer.java:584)
>         at
> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:942)
>         at
> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386)
>         at
> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:188)
>         at
> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:164)
>         at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69)
>         at org.apache.pig.Main.run(Main.java:495)
>         at org.apache.pig.Main.main(Main.java:111)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> Caused by:
> <line 2, column 26> Failed to generate logical plan. Nested exception:
> java.lang.RuntimeException: Cannot instantiate:
> org.apache.pig.piggybank.evaluation.string.LOWER
>         at
> org.apache.pig.parser.LogicalPlanBuilder.buildUDF(LogicalPlanBuilder.java:912)
>
>
>
> ________________________________
>  From: James Newhaven <[email protected]>
> To: [email protected]
> Sent: Wednesday, April 11, 2012 8:15 AM
> Subject: Re: Strange behaviour when using FLATTEN
>
> Thanks Pablo,
>
> That link was really useful. The reason the fieldnames contain NULL, is
> that I used FLATTEN with TOP, which currently discards the bagname. This is
> going to be fixed in 0.11 as per
> https://issues.apache.org/jira/browse/PIG-2365
>
>
>
> On Wed, Apr 11, 2012 at 2:55 PM, pablomar
> <[email protected]>wrote:
>
> > this is a very good explanation of flatten:
> >
> >
> >
> http://ofps.oreilly.com/titles/9781449302641/advanced_pig_latin.html#foreach_flatten
> >
> >
> >
> > On Wed, Apr 11, 2012 at 9:46 AM, James Newhaven <
> [email protected]
> > >wrote:
> >
> > > Hi,
> > >
> > > Sorry, this is a PIG newbie question...
> > >
> > > When I use FLATTEN, I don't understand the structure of the relation
> that
> > > is returned.
> > >
> > > For example, the following relation A is the result of using flatten:
> > >
> > > DESCRIBE A;
> > >
> > > A {null::group: chararray,null::tagcount: long}
> > >
> > > I'm not really sure why there is "null" prefixing group and tagcount.
> Can
> > > anyone help explain what this means?
> > >
> > > Thanks,
> > > James
> > >
> >

Reply via email to