pig-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pallavi Palleti <pallavi.pall...@corp.aol.com>
Subject Re: issue with space in command line arguments for pig script
Date Tue, 02 Jun 2009 04:22:31 GMT
Hi Alan, 

I am using it in Group BY. Also, I tried with empty pig script by just touching a file called
test.pig and tried to run. I got same error. The error is pasted below: 

java.lang.RuntimeException: You can only run one pig script at a time from the command line.

at org.apache.pig.Main.main(Main.java:289) 

Please find below script and the way I am firing it at command line: 

test.pig: 

raw = LOAD '/user/ppallavi/' USING PigStorage('\t') ; 
clickAggr = GROUP raw by ($0, '$date') PARALLEL 10; 
clickCounts = FOREACH clickAggr GENERATE FLATTEN(group), COUNT($1); 
distinctclickCounts = DISTINCT clickCounts; 
STORE distinctclickCounts INTO '/somelocation/ClickCounts/' using PigStorage('\t'); 

Here is how I am calling this script from command line: 
bin/pig -param date="2009-06-01 01" test.pig 

If I don't use space, it is working perfectly fine. I am using hadoop-18.2 and the pig checked
out from types branch. 

Thanks 
Pallavi 



----- Original Message ----- 
From: "Alan Gates" <gates@yahoo-inc.com> 
To: pig-user@hadoop.apache.org 
Sent: Tuesday, June 2, 2009 6:05:08 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi 
Subject: Re: issue with space in command line arguments for pig script 

Can you give an example of your script. I tried passing a space to 
PigStorage for the column separator and it worked fine. Are you 
passing this to an EvalFunc or a LoadFunc? 

Alan. 

On Jun 1, 2009, at 3:00 AM, Palleti, Pallavi wrote: 

> Hi all, 
> 
> 
> 
> I have a requirement where I need to pass an argument to pig script 
> which has space in it. I found that pig script is failing to parse 
> such 
> kind of parameters as it is breaking at the space. This is happening 
> even after I surround each parameter value using quotes. So, the 
> other 
> option that I am thinking is to use a special character while 
> passing as 
> input parameter and replace it with space in pig script. So, can 
> anyone 
> please let me know if there is a simpler way of doing it? 
> 
> 
> 
> Thanks 
> 
> Pallavi 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message