You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Eli Finkelshteyn <ie...@gmail.com> on 2012/03/14 07:15:52 UTC

Embedded Pig in a Python Module?

Hi Folks,
I'm currently working on a framework that's going to do some awesome 
graphing stuff grabbing data out using Pig. What I'm wondering is, is 
there any way I can put embedded pig in a module and call it that way? 
Normally, I need to run embedded pig in a Python script as something 
like "pig embedded_pig_thing.py," which I can't really do when calling 
it out of a module. Ideas? It would make the framework much cleaner if 
this were something I could do, and I imagine it would be useful to 
others as well.

Cheers,
Eli

Re: Embedded Pig in a Python Module?

Posted by Eli Finkelshteyn <ie...@gmail.com>.
Sweet! That actually works. I don't know why I didn't just try that. For 
some reason, I was convinced it would break. Thanks for the advice!

Eli

On 3/14/12 8:40 AM, Norbert Burger wrote:
> What prevents you from collecting your embedded PIg imports/calls into a
> Python module, and calling out to it from there?  As an example,
> http://techblug.wordpress.com/2011/07/29/pagerank-implementation-in-pig/has
> only a single file, but seems that it could be easily externalized if
> needed.
>
> Norbert
>
> On Wed, Mar 14, 2012 at 2:15 AM, Eli Finkelshteyn<ie...@gmail.com>wrote:
>
>> Hi Folks,
>> I'm currently working on a framework that's going to do some awesome
>> graphing stuff grabbing data out using Pig. What I'm wondering is, is there
>> any way I can put embedded pig in a module and call it that way? Normally,
>> I need to run embedded pig in a Python script as something like "pig
>> embedded_pig_thing.py," which I can't really do when calling it out of a
>> module. Ideas? It would make the framework much cleaner if this were
>> something I could do, and I imagine it would be useful to others as well.
>>
>> Cheers,
>> Eli
>>


Re: Embedded Pig in a Python Module?

Posted by Norbert Burger <no...@gmail.com>.
What prevents you from collecting your embedded PIg imports/calls into a
Python module, and calling out to it from there?  As an example,
http://techblug.wordpress.com/2011/07/29/pagerank-implementation-in-pig/has
only a single file, but seems that it could be easily externalized if
needed.

Norbert

On Wed, Mar 14, 2012 at 2:15 AM, Eli Finkelshteyn <ie...@gmail.com>wrote:

> Hi Folks,
> I'm currently working on a framework that's going to do some awesome
> graphing stuff grabbing data out using Pig. What I'm wondering is, is there
> any way I can put embedded pig in a module and call it that way? Normally,
> I need to run embedded pig in a Python script as something like "pig
> embedded_pig_thing.py," which I can't really do when calling it out of a
> module. Ideas? It would make the framework much cleaner if this were
> something I could do, and I imagine it would be useful to others as well.
>
> Cheers,
> Eli
>