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

Julien Le Dem commented on PIG-1824:
------------------------------------

Hi Woody,
This is a great feature. 
I agree with the static block comments, but I don't see how you could do it 
differently without a major refactoring of the existing code.
Here are comments/questions about some details of the implementation.

in JythonScriptEngine.Interpreter static block:
* If _PYTHON_CACHEDIR_ is provided, we will delete it on exit. Shouldn't we 
delete it only if it has been created by Pig? it is dangerous to delete 
something that we have not created. The user could shoot himself in the foot by 
providing something he cares about as the _PYTHON_CACHEDIR_.
* Also, if we can't write to the provided _PYTHON_CACHEDIR_ we create another 
one. Can the user pre-populate the cache dir? If yes we should throw an 
exception here.

in JythonScriptEngine.Interpreter.init():
* Something should fail if _is_ is null.
{code}
InputStream is = getScriptAsStream(path);
 if (is != null) {
{code}

> 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.9.0
>
>         Attachments: 1824.patch, 1824a.patch, 1824b.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

Reply via email to