You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Abhijit Chanda <ab...@mara-ison.com> on 2013/04/24 13:25:18 UTC
How can I pass command-line parameters with whitespace to an apache
pig script?
Hi,
I want to pass a filter statement with in my pig script using parameter
substitution.
For that I have tried
exec -param flt='a1==1 AND a2=2' filterscript.pig
But sadly it is throwing an exception message
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: Local file
'AND' does not exist.
Pig version - 0.9.2
Any help will be appreciated
-Abhijit
Re: How can I pass command-line parameters with whitespace to an
apache pig script?
Posted by Abhijit Chanda <ab...@mara-ison.com>.
Basically i want to know how can i add white space character in a
param_value in case of parameter substitution?
Any help will be highly appreciated
-Abhijit
On Thu, Apr 25, 2013 at 11:11 AM, Abhijit Chanda <
abhijit.chanda@mara-ison.com> wrote:
> Thanks for the responses. But it still not working. Any other thoughts
>
> -Abhijit
>
>
> On Wed, Apr 24, 2013 at 10:00 PM, centerqi hu <ce...@gmail.com> wrote:
>
>> You should pass -param flt="a1==1 AND a2==2"
>>
>>
>> 2013/4/24 David LaBarbera <da...@localresponse.com>
>>
>> > My first though is to try
>> >
>> > flt='\'a1==1 AND a2=2\''
>> >
>> > but mostly want to recommend running pig with the dry run (-r or
>> -dryrun)
>> > flag so you can see how the substitution is being made.
>> >
>> > David
>> >
>> > On Apr 24, 2013, at 7:25 AM, Abhijit Chanda <
>> abhijit.chanda@mara-ison.com>
>> > wrote:
>> >
>> > > Hi,
>> > >
>> > > I want to pass a filter statement with in my pig script using
>> parameter
>> > > substitution.
>> > >
>> > > For that I have tried
>> > > exec -param flt='a1==1 AND a2=2'filterscript.pig
>> > >
>> > > But sadly it is throwing an exception message
>> > > ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: Local
>> file
>> > > 'AND' does not exist.
>> > >
>> > > Pig version - 0.9.2
>> > >
>> > > Any help will be appreciated
>> > >
>> > > -Abhijit
>> >
>> >
>>
>>
>> --
>> centerqi@gmail.com|齐忠
>>
>
>
Re: How can I pass command-line parameters with whitespace to an
apache pig script?
Posted by Abhijit Chanda <ab...@mara-ison.com>.
Thanks for the responses. But it still not working. Any other thoughts
-Abhijit
On Wed, Apr 24, 2013 at 10:00 PM, centerqi hu <ce...@gmail.com> wrote:
> You should pass -param flt="a1==1 AND a2==2"
>
>
> 2013/4/24 David LaBarbera <da...@localresponse.com>
>
> > My first though is to try
> >
> > flt='\'a1==1 AND a2=2\''
> >
> > but mostly want to recommend running pig with the dry run (-r or -dryrun)
> > flag so you can see how the substitution is being made.
> >
> > David
> >
> > On Apr 24, 2013, at 7:25 AM, Abhijit Chanda <
> abhijit.chanda@mara-ison.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I want to pass a filter statement with in my pig script using parameter
> > > substitution.
> > >
> > > For that I have tried
> > > exec -param flt='a1==1 AND a2=2'filterscript.pig
> > >
> > > But sadly it is throwing an exception message
> > > ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: Local
> file
> > > 'AND' does not exist.
> > >
> > > Pig version - 0.9.2
> > >
> > > Any help will be appreciated
> > >
> > > -Abhijit
> >
> >
>
>
> --
> centerqi@gmail.com|齐忠
>
Re: How can I pass command-line parameters with whitespace to an
apache pig script?
Posted by centerqi hu <ce...@gmail.com>.
You should pass -param flt="a1==1 AND a2==2"
2013/4/24 David LaBarbera <da...@localresponse.com>
> My first though is to try
>
> flt='\'a1==1 AND a2=2\''
>
> but mostly want to recommend running pig with the dry run (-r or -dryrun)
> flag so you can see how the substitution is being made.
>
> David
>
> On Apr 24, 2013, at 7:25 AM, Abhijit Chanda <ab...@mara-ison.com>
> wrote:
>
> > Hi,
> >
> > I want to pass a filter statement with in my pig script using parameter
> > substitution.
> >
> > For that I have tried
> > exec -param flt='a1==1 AND a2=2'filterscript.pig
> >
> > But sadly it is throwing an exception message
> > ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: Local file
> > 'AND' does not exist.
> >
> > Pig version - 0.9.2
> >
> > Any help will be appreciated
> >
> > -Abhijit
>
>
--
centerqi@gmail.com|齐忠
Re: How can I pass command-line parameters with whitespace to an apache pig script?
Posted by David LaBarbera <da...@localresponse.com>.
My first though is to try
flt='\'a1==1 AND a2=2\''
but mostly want to recommend running pig with the dry run (-r or -dryrun) flag so you can see how the substitution is being made.
David
On Apr 24, 2013, at 7:25 AM, Abhijit Chanda <ab...@mara-ison.com> wrote:
> Hi,
>
> I want to pass a filter statement with in my pig script using parameter
> substitution.
>
> For that I have tried
> exec -param flt='a1==1 AND a2=2'filterscript.pig
>
> But sadly it is throwing an exception message
> ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: Local file
> 'AND' does not exist.
>
> Pig version - 0.9.2
>
> Any help will be appreciated
>
> -Abhijit