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

Switch to Threaded View
Pig >> mail # user >> Multi line parameter value?


Copy link to this message
-
Re: Multi line parameter value?
Hi, Sajid:
Can you try -param_file <file> and the content of the file looks like
(basically multiple lines of parameters)
foo = ....
bazz = .....

so in your Pig script, it substitution value of foo and bazz in
set my_param = 'SUM(foo) as bar, \
                             SUM (bazz) as boo';

is this what you expect?

Johnny
On Tue, Jun 25, 2013 at 1:02 PM, Sajid Raza <[EMAIL PROTECTED]> wrote:

> Based on the spec, the parameter file only works with one line values.
>
> On Jun 25, 2013, at 11:49 AM, Johnny Zhang <[EMAIL PROTECTED]> wrote:
>
> > http://wiki.apache.org/pig/ParameterSubstitution
> >
> >
> > On Tue, Jun 25, 2013 at 10:03 AM, Shahab Yunus <[EMAIL PROTECTED]
> >wrote:
> >
> >> Have you tried using params file? I have not used it personalty but it
> >> might work that way.
> >>
> >> Regards,
> >> Shahab
> >>
> >>
> >> On Tue, Jun 25, 2013 at 12:44 PM, Sajid Raza <[EMAIL PROTECTED]>
> wrote:
> >>
> >>> I don't suppose it's possible to specify a parameter with a multi line
> >>> value.
> >>>
> >>> My use case is that I have a macro that groups over an alias, and I
> would
> >>> like to not hard-code what aggregate values I compute.
> >>>
> >>> If I could pass in a multi line parameter value, I would be able to do
> >>> something like:
> >>>
> >>> set my_param = 'SUM(foo) as bar, \
> >>>                             SUM (bazz) as boo';
> >>>
> >>> my_alias = compute_aggreate(some_alias, my_param);
> >>
>