[
https://issues.apache.org/jira/browse/PIG-2904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456878#comment-13456878
]
Cheolsoo Park commented on PIG-2904:
------------------------------------
Now I understand what this jira is about after reading old jiras (e.g. PIG-928).
For Java UDFs (including EvalFunc), it is possible to define a non-default
constructor that takes parameters and pass args to it via DEFINE statements.
For example,
{code}
REGISTER MyUDF.jar;
DEFINE func MyUDF.MyFunc('param');
...
foo = FOREACH bar GENERATE func($0); // The arg 'param' is available inside the
func().
...
{code}
However, this is not possible with scripting UDFs because:
# Script UDF classes such as JythonFunction only define the default
constructors with no parameters.
# There is currently no mechanism via which we can pass args from Java to
scripting languages.
While #1 seems trivial, #2 seems more involved (e.g. passing args via function
closures, etc). I am wondering whether anyone is working on this; if not, I'd
like to give it a try.
Thanks!
> Scripting UDFs should allow DEFINE statements to pass parameters to the UDF's
> constructor
> -----------------------------------------------------------------------------------------
>
> Key: PIG-2904
> URL: https://issues.apache.org/jira/browse/PIG-2904
> Project: Pig
> Issue Type: New Feature
> Reporter: Julien Le Dem
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira