pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Ding (JIRA)" <j...@apache.org>
Subject [jira] Updated: (PIG-1479) Embed Pig in scripting languages
Date Tue, 14 Sep 2010 23:03:34 GMT

     [ 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_2.patch

In the previous patch, the executeScript method on ScriptPigServer returns a list of ExecJobs
(one for each store statement in the script). Unfortunately, the order of ExecJobs in the
list is indeterminate.  

This patch fixes this problem by making the executeScript method return a PigStats object.
One then can retrieves the output result by the alias corresponding to store statement.

Here is a example:

{code}
P = pig.executeScript("""
        A = load '${input}';
        ... ...
        store G into '${output}'; """)

output = P.result("G")  # an OutputStats object
iter = output.iterator()
if iter.hasNext():
        # do something
else:
        # do something else
{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
>         Attachments: PIG-1479.patch, PIG-1479_2.patch, 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.


Mime
View raw message