Description
Hive UDFs support taking in the argument, while Pig always has Tuple as argument. And we do unnecessary creation of wrapping into Tuple to pass the input.
class HelloUDF extends UDF { public Text evaluate(Text input) { return new Text("Hello " + input.toString()); } }
public String exec(Tuple input) { return new String("Hello " + input.get(0)); }
Similar to Hive, will need a UDFMethodResolver to match the most appropriate method or fallback to exec(Tuple). With bytecode generation, instead of doing Method.invoke() we can just make direct calls to the method which will improve performance. Will create a separate jira to do Method.invoke() when pig.opt.bytecode.gen=false.