You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Alan Gates (JIRA)" <ji...@apache.org> on 2011/04/06 20:23:05 UTC

[jira] [Commented] (PIG-1824) Support import modules in Jython UDF

    [ https://issues.apache.org/jira/browse/PIG-1824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016475#comment-13016475 ] 

Alan Gates commented on PIG-1824:
---------------------------------

A couple of questions:

# Based on my analysis the static init block that this patch adds to JythonScriptingEngine will only get invoked once we know we have Jython in the mix.  Is that correct?  We don't want to be invoking this when Python UDFs or a Python control flow.
# Right now the code to do this is part of the init of the JythonScriptingEngine.  Should we make this a separate method in ScriptEngine so that other languages can also add this kind of functionality?  I would not make it abstract, since some languages may not be able to do this.  But it seems like it makes for a cleaner interface.


> Support import modules in Jython UDF
> ------------------------------------
>
>                 Key: PIG-1824
>                 URL: https://issues.apache.org/jira/browse/PIG-1824
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Richard Ding
>            Assignee: Woody Anderson
>             Fix For: 0.8.0, 0.9.0, 0.10
>
>         Attachments: 1824.patch, 1824a.patch
>
>
> Currently, Jython UDF script doesn't support Jython import statement as in the following example:
> {code}
> #!/usr/bin/python
> import re
> @outputSchema("word:chararray")
> def resplit(content, regex, index):
>         return re.compile(regex).split(content)[index]
> {code}
> Can Pig automatically locate the Jython module file and ship it to the backend? Or should we add a ship clause to let user explicitly specify the module to ship? 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira