[
https://issues.apache.org/jira/browse/PIG-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Ding updated PIG-1479:
------------------------------
Attachment: PIG-1479_5.patch
Based on the feedback, the new patch contains the following changes:
* Support the main program and the UDFs in the same script. However, when
mixing jython functions with top level control flow code, the script must use
the idiomatic "conditional script" stanza:
{code}
def udf1()
...
def udf2()
...
if __name__ == '__main__':
# control flow code
{code}
* Support explicit registering scripting UDFs:
{code}
Pig.registerUDF("udfs.py", "")
# control flow code
{code}
* Confirm Pig scripting API to the specification:
http://wiki.apache.org/pig/TuringCompletePig. The main change is that the
scripts now need explicitly import the Pig class:
{code}
from org.apache.pig.scripting import Pig
... ...
results = Pig.compile("<Pig Latin>").bind().run()
{code}
> Embed Pig in scripting languages
> --------------------------------
>
> Key: PIG-1479
> URL: https://issues.apache.org/jira/browse/PIG-1479
> Project: Pig
> Issue Type: New Feature
> Reporter: Julien Le Dem
> Assignee: Richard Ding
> Fix For: 0.9.0
>
> Attachments: PIG-1479.patch, PIG-1479_2.patch, PIG-1479_3.patch,
> PIG-1479_4.patch, PIG-1479_5.patch, pig-greek-test.tar, pig-greek-test.tar,
> pig-greek.tgz
>
>
> It should be possible to embed Pig calls in a scripting language and let
> functions defined in the same script available as UDFs.
> This is a spin off of https://issues.apache.org/jira/browse/PIG-928 which
> lets users define UDFs in scripting languages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.