[ https://issues.apache.org/jira/browse/PIG-1824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017762#comment-13017762 ]
Alan Gates commented on PIG-1824: --------------------------------- On the issue of the static block, I dislike static initialization blocks because you're never sure when they are going to be called. Someone adding "import o.a.p.s.j.JythonScriptingEngine" somewhere in the code will result in changing when this is executed, including possibly when it does not need to be executed. Just moving it into the Interpreter class as a static block won't change that I don't think. It can't be in Interpreter's constructor? On the second point, what I meant was, should there be a separate method ScriptEngine.includeResources()? This would make clear to developers of future scripting engines that this is something they need to do. The contract would then be that before Pig called ScriptingEngine.registerFunction it would call includeResources(). I agree with you that, when possible, all scripting engine implementations should include their resources. I was not suggesting a supportsFeature() method. For situations where it cannot be supported includeResources would be a NOP. > 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 > > > 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