Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # user - Python with embbeded pig access to params


Copy link to this message
-
Re: Python with embbeded pig access to params
Jakub Glapa 2013-01-23, 14:07
Ok, I was a bit to quick. I'm able to answer to my own question now.
from org.apache.pig.scripting import ScriptPigContext

ctx  = ScriptPigContext.get()

params = ctx.getPigContext().getParams()

paramFiles = ctx.getPigContext().getParamFiles()
getParamFiles() will give me the path to the file, do I have to read the
properties by myself or is there a better way?

--
regards,
pozdrawiam,
Jakub Glapa
On Wed, Jan 23, 2013 at 1:57 PM, Jakub Glapa <[EMAIL PROTECTED]> wrote:

> Hi, is there a way to get access to the params passed with the pig command
> in the python code?
>
> pig -p param1=val1 -param_file=filepath script.py
>
>
> Based on this: https://issues.apache.org/jira/browse/PIG-2165 I know that
> those params will be automatically bound.
> Is there a way access those parameters from within the python code?
>
> --
> regards,
> pozdrawiam,
> Jakub Glapa
>