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

Aniket Mokashi commented on PIG-928:
------------------------------------

I support above comment.
Also, in favor of not breaking old code. I think, we should avoid introducing 
new keywords.

In the above proposal, by adding python as a lang-keyword I meant to hide 
extensibility of ScriptEngine interface by natively supporting python. If we 
have to allow users add support for other languages. we need to allow "using 
org.apache.pig.scripting.jython.JythonScriptEngine". But this will need us to 
document the scriptengine interface.

Following seems to be more suitable choice. Comments?
{code}
-- register all UDFs inside test.py using custom (or builtin) ScriptEngine
register 'test.py' using org.apache.pig.scripting.jython.JythonScriptEngine 
ship ('1.py', '2.py');
-- namespace? test.helloworld?
b = foreach a generate helloworld(a.$0), complex(a.$1);

-- register helloworld UDF as hello using JythonScriptEngine
define hello using org.apache.pig.scripting.jython.JythonScriptEngine from 
'test.py'#helloworld ship ('1.py', '2.py');
b = foreach a generate helloworld(a.$0); 
{code}

Also, register scalascript.jar would not be necessary if 
getStandardScriptJarPath() returns the path of the jar.

> UDFs in scripting languages
> ---------------------------
>
>                 Key: PIG-928
>                 URL: https://issues.apache.org/jira/browse/PIG-928
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Alan Gates
>            Assignee: Aniket Mokashi
>             Fix For: 0.8.0
>
>         Attachments: calltrace.png, package.zip, pig-greek.tgz, 
> pig.scripting.patch.arnab, pyg.tgz, RegisterPythonUDF2.patch, 
> RegisterScriptUDFDefineParse.patch, scripting.tgz, scripting.tgz, test.zip
>
>
> It should be possible to write UDFs in scripting languages such as python, 
> ruby, etc.  This frees users from needing to compile Java, generate a jar, 
> etc.  It also opens Pig to programmers who prefer scripting languages over 
> Java.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to