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

Mathias Herberts commented on PIG-3226:
---------------------------------------

My initial code incorrectly read the script as a normal file. This worked 
correctly in the unit tests as they were run locally and the path did indeed 
exist.

When ran in MR mode, access to the normal file fails.

The included patch uses getScriptAsStream to retrieve an InputStream to the 
script and copies data from this to a temporary file that can be fed to the 
Groovy Script Engine.

v2 of the patch uses commons-io FileUtils.copyInputStreamToFile
                
> Groovy UDF support may fail to load script under some circumstances
> -------------------------------------------------------------------
>
>                 Key: PIG-3226
>                 URL: https://issues.apache.org/jira/browse/PIG-3226
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.11, 0.11.1
>            Reporter: Mathias Herberts
>            Assignee: Mathias Herberts
>         Attachments: PIG-3226.patch, PIG-3226.patch-2
>
>
> When running in M/R mode, scripts may fail to load, this is due to the 
> GroovyScriptEngine looking for the script under the attempt's current working 
> dir which does not contain the script.
> The attached patch fixes that by copying the script to a place where 
> GroovyScriptEngine will be able to find it.

--
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

Reply via email to