You don't need to add anything to the piggybank -- just create a class that extends EvalFunc (you will need pig.jar on the classpath), do your thing, build a jar , then call "register mything.jar" in the script.
I think you are not sending me your whole script. When I try just the first two lines, I get the following error: grunt> file1 = LOAD '/user/dmitriy/tmp/numbers.txt' USING PigStorage(','); grunt> f1filter = filter file1 by status matches '"0"'; 2011-07-01 15:06:37,987 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025: <line 2, column 27> Invalid field projection. Projected field [status] does not exist. Details at logfile: /var/log/pig/pig_1309532746023.log (which is of course correct -- there is no schema that would tell us what "status" is). On Fri, Jul 1, 2011 at 7:51 AM, Marian Condurache <m.condura...@bigpoint.net > wrote: > I don't think so ...the script works on the prebuilt pig versions. > When I try to add a class in the piggybank of the prebuilt sources and then > run ant in there I still get errors..so I thought that maybe if I get a > fresh pig checkout I won't have that problem. > > I don't think it is the double quotes....i removed the filter...he > complains about the load..plus all the scripts tried work on the prebuilt > versions. > > > Regards, Marian > > > -----Ursprüngliche Nachricht----- > Von: Dmitriy Ryaboy [mailto:dvrya...@gmail.com] > Gesendet: Freitag, 1. Juli 2011 16:29 > An: user@pig.apache.org > Betreff: Re: Error after build > > Hi Marian. > > So, for UDFs, you don't need to build your own pig -- you can just register > a jar that has your UDF implementations. No recompilation of Pig necessary. > > As for the script, I wonder if the problem is in single-quoting double > quotes. Does Pig still complain if you get rid of the double quotes? > > D > > On Fri, Jul 1, 2011 at 6:06 AM, Marian Condurache < > m.condura...@bigpoint.net > > wrote: > > > I am just learning it and I want to try to make a custom function..so the > > script is really easy > > > > file1 = LOAD '/user/mojo/input/testData' USING PigStorage(','); > > > > f1filter = filter file1 by status matches '"0"'; > > > > STORE f1filter INTO '/user/mojo/output/testData' using PigStorage(','); > > > > > > And still I get > > > > ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <file > ./testmypig.pig, > > line 1, column 58> mismatched input '(' expecting SEMI_COLON > > > > > > I think there is problem with the parser in the trunk. > > > > > > > > Regards, Marian > > > > > > > > -----Ursprüngliche Nachricht----- > > Von: Dmitriy Ryaboy [mailto:dvrya...@gmail.com] > > Gesendet: Freitag, 1. Juli 2011 14:39 > > An: user@pig.apache.org > > Betreff: Re: Error after build > > > > Having your script would help us debug it and/or pig :). > > The parser changed in 0.9, it's possible there's an inconsistency. > > > > btw, not sure why you need to build your own pig for udfs -- that's > > generally not required. What error did you get building 0.8? > > > > D > > > > On Thu, Jun 30, 2011 at 6:39 AM, Marian Condurache < > > m.condura...@bigpoint.net> wrote: > > > > > Hi > > > So I checked out the pig version from > > > http://svn.apache.org/repos/asf/pig/trunk/, because the 0.8 from the > > > website wouldn't build on my machine and I needed to build the project > > for > > > my UDFs. > > > So now the weird thing is that I am running the same script that worked > > on > > > the already the already built versions 0.7, 0.8 from the pig website on > > the > > > freshly checked out one ...that I built on my machine and I get a super > > cool > > > error message > > > > > > Pig Stack Trace > > > --------------- > > > ERROR 1200: <file /home/mojo/Documents/test.pig, line 9, column 72> > > > mismatched input '(' expecting SEMI_COLON > > > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error > > > during parsing. <file /home/mojo/Documents/test.pig, line 9, column 72> > > > mismatched input '(' expecting SEMI_COLON > > > at > org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1640) > > > at > > org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1583) > > > at org.apache.pig.PigServer.registerQuery(PigServer.java:583) > > > 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.exec(Grunt.java:81) > > > at org.apache.pig.Main.run(Main.java:553) > > > at org.apache.pig.Main.main(Main.java:108) > > > Caused by: Failed to parse: <file /home/mojo/Documents/test.pig, line > 9, > > > column 72> mismatched input '(' expecting SEMI_COLON > > > at > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:222) > > > at > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:164) > > > at > org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1632) > > > ... 9 more > > > > > > > > > ================================================================================ > > > > > > > > > Kind Regards, Marian > > > > > >