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

Switch to Threaded View
Pig, mail # user - RE: reading input parameters in a pig script


Copy link to this message
-
Re: reading input parameters in a pig script
Jonathan Coveney 2013-02-20, 09:08
Reiterating Prashant's comments.

In the script though you can have a %default statement which will define
the default value for a parameter, which can also be overriden. My guess is
this might let you do what you want?
2013/2/20 Prashant Kommireddi <[EMAIL PROTECTED]>

> Hi Siddhi,
>
> "Is there any way to access these params in the script without referring to
> the param name?" -- how would you associate a param value to pig statement?
>
> I am guessing in this case your pig script is also dynamically generated?
> You could use PigServer API
> http://pig.apache.org/docs/r0.10.0/api/org/apache/pig/PigServer.html to
> generate params in a Java program and embed them into a script.
>
> -Prashant
>
>
> On Tue, Feb 19, 2013 at 3:44 PM, Siddhi Borkar <
> [EMAIL PROTECTED]> wrote:
>
> >
> > Consider the following command
> > pig -param param1=test param2=test1 param3=test2 myscript.pig
> >
> > In my case the parameters are dynamic, as in I could either pass param1
> > only or I could pass all three params or some extra params.
> >
> > Since the parameters are dynamic, in my pig script I will not be able to
> > refrence the parameters as '$param1' . Is there any way to access these
> > params in the script without referring to the param name?
> >
> > ________________________________________
> > From: Jonathan Coveney [[EMAIL PROTECTED]]
> > Sent: Tuesday, February 19, 2013 6:42 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: reading input parameters in a pig script
> >
> > Can you give an example of what you'd like this to look like?
> >
> >
> > 2013/2/19 Siddhi Borkar <[EMAIL PROTECTED]>
> >
> > > Hi ,
> > >
> > > I need to pass parameters dynamically to a pig script. Is there any way
> > to
> > > read the parameters passed and their corresponding values without
> giving
> > > the parameter names in the pig script?
> > >
> > > Thanks,
> > > Siddhi
> > >
> > > DISCLAIMER
> > > =========> > > This e-mail may contain privileged and confidential information which
> is
> > > the property of Persistent Systems Ltd. It is intended only for the use
> > of
> > > the individual or entity to which it is addressed. If you are not the
> > > intended recipient, you are not authorized to read, retain, copy,
> print,
> > > distribute or use this message. If you have received this communication
> > in
> > > error, please notify the sender and delete all copies of this message.
> > > Persistent Systems Ltd. does not accept any liability for virus
> infected
> > > mails.
> > >
> >
> > DISCLAIMER
> > =========> > This e-mail may contain privileged and confidential information which is
> > the property of Persistent Systems Ltd. It is intended only for the use
> of
> > the individual or entity to which it is addressed. If you are not the
> > intended recipient, you are not authorized to read, retain, copy, print,
> > distribute or use this message. If you have received this communication
> in
> > error, please notify the sender and delete all copies of this message.
> > Persistent Systems Ltd. does not accept any liability for virus infected
> > mails.
> >
>