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

Switch to Threaded View
Pig >> mail # user >> Difficulty extending EvalFunc


Copy link to this message
-
Difficulty extending EvalFunc
Hi,

I'm trying to write a UDF to take a bag of http get arguments (e.g.
{(s=556477989), (ts=1265964662)} ) and turn them into a map (e.g.
[s#556477989, ts#1265964662] ), and have written a class extending
EvalFunc, but am having no end of trouble declaring/defining the exec
method. My first shot at compiling it had code like this:

    public InternalMap exec(DataBag input) throws IOException {

and produced the compile-time error:

httpArgParse.java:11: myudfs.httpArgParse is not abstract and does not
override abstract method exec(org.apache.pig.data.DataBag)

clumsily trying at sticking an @Override before it (as I noticed was
done in TOKENIZE), instead produced:

httpArgParse.java:12: method does not override or implement a method
from a supertype

I have a hunch that this isn't too awful a problem for someone who's
done much Java coding in the past decade, but I've been away from the
language for about 12 years now, and it seems to have changed
significantly in that time.

Cheers,
Kris

--
Kris Coward http://unripe.melon.org/
GPG Fingerprint: 2BF3 957D 310A FEEC 4733  830E 21A4 05C7 1FEB 12B3