You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Mathias Fryde <ma...@mimesis-republic.com> on 2009/02/26 14:49:30 UTC

How to use multiple parameters in Pig

Hello,
I would like to do smth like this in a pig script but its not working (i
guess the syntax is not right) :

thie pig script :
*%default period 'day'
%default dataname 'session'*
LOAD 'mysource' USING PigStorage();
A = -- some code
STORE A INTO* 'myfolder/$period_sometext_$dataname.result'* ;

so the onput will be : *myfolder/day_sometext_session.result
*
does anyone has a clue how to do this ??
thanks,
mathias*


*

Re: How to use multiple parameters in Pig

Posted by Mathias Fryde <ma...@mimesis-republic.com>.
Hello,
Thanks for your answer. I manage to make my code working depending on which
character I was using right after the parameters names.
For Example, dots working but not underscore.
Mathias.

%default period 'day'
%default dataname 'session'
A =  STORE whatever INTO 'myfolder/$period_sometext_$dataname.result' ; NOT
WORKING
B =  STORE whatever INTO 'myfolder/$period.sometext_$dataname.result' ;
WORKING





2009/2/28 Vadim Zaliva <kr...@gmail.com>

> If you are using trunk code from SVN, I see some traces of
> implementation of the following proposal in the code:
>
> http://wiki.apache.org/pig/ParameterSubstitution
>
> However I have not tried to use it myself and do not know it it is working.
> pig --help does not list -p command line option, so I found it by pure
> accident.
>
> I am also interested in something like this...
>
> Vadim
>
> On Thu, Feb 26, 2009 at 05:49, Mathias Fryde
> <ma...@mimesis-republic.com> wrote:
> > Hello,
> > I would like to do smth like this in a pig script but its not working (i
> > guess the syntax is not right) :
> >
> > thie pig script :
> > *%default period 'day'
> > %default dataname 'session'*
> > LOAD 'mysource' USING PigStorage();
> > A = -- some code
> > STORE A INTO* 'myfolder/$period_sometext_$dataname.result'* ;
> >
> > so the onput will be : *myfolder/day_sometext_session.result
> > *
> > does anyone has a clue how to do this ??
> > thanks,
> > mathias*
> >
> >
> > *
> >
>

Re: How to use multiple parameters in Pig

Posted by Vadim Zaliva <kr...@gmail.com>.
If you are using trunk code from SVN, I see some traces of
implementation of the following proposal in the code:

http://wiki.apache.org/pig/ParameterSubstitution

However I have not tried to use it myself and do not know it it is working.
pig --help does not list -p command line option, so I found it by pure accident.

I am also interested in something like this...

Vadim

On Thu, Feb 26, 2009 at 05:49, Mathias Fryde
<ma...@mimesis-republic.com> wrote:
> Hello,
> I would like to do smth like this in a pig script but its not working (i
> guess the syntax is not right) :
>
> thie pig script :
> *%default period 'day'
> %default dataname 'session'*
> LOAD 'mysource' USING PigStorage();
> A = -- some code
> STORE A INTO* 'myfolder/$period_sometext_$dataname.result'* ;
>
> so the onput will be : *myfolder/day_sometext_session.result
> *
> does anyone has a clue how to do this ??
> thanks,
> mathias*
>
>
> *
>