SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

PIG Statement submission error

Reply
Occasional Contributor
Posts: 17

PIG Statement submission error

Hi,

 

I am getting the following error while submitting the Pig statements using a text file

pigcommand.txt contains

 

A = load '/user/cloudera/newdirectory1/wordcount.txt' AS (FNAME:chararray,LName:chararray);
B= store A into '/user/cloudera/newdirectory2' USING PigStorage(',');

 

/* Run pig statements from a text file */

filename test1 'C:\Users\ajain59\Desktop\abc\pigcommand.txt';

proc hadoop username='cloudera' password='cloudera' verbose;

pig code=test1;

run;

 

SAS Error log:

NOTE: 03-07 13:51:46,016 [RunPigThread][ERROR RunPigThread] -

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1002: Unable to store alias B

ERROR: The pig script has encountered errors.

ERROR: Unable to store alias B

 

I have correctly set SAS_HADOOP_JAR_PATH and SAS_HADOOP_CONFIG_PATH.

 

When i used the pig statments directly on pig command promt in CDH, it is working fine.

 

Can you please help?

 

Regards,

Ashish Jain

SAS Employee
Posts: 203

Re: PIG Statement submission error

Hi @ajain59

 

Try this:

 

A = load '/user/cloudera/newdirectory1/wordcount.txt' AS (FNAME:chararray,LName:chararray);
store A into '/user/cloudera/newdirectory2' USING PigStorage(',');

 

I don't think the STORE command needs an variable.

 

Here is an example I have used in training. 

d_dividends = LOAD '/user/myuser/duped/NYSE_dividends' as (d_exchange, d_symbol, d_date, d_dividend);
d_grouped = GROUP d_dividends BY d_symbol;
d_avg = FOREACH d_grouped GENERATE group, AVG(d_dividends.d_dividend);
STORE d_avg INTO '/user/myuser/d_average_dividend';

 

Best wishes,

Jeff

 

 

Occasional Contributor
Posts: 17

Re: PIG Statement submission error

getting the same error again !!

SAS Employee
Posts: 203

Re: PIG Statement submission error

Hi @ajain59

 

If you remove the reference to B then the error should be different because B is no longer there.

 

Running this:

A = load '/user/cloudera/newdirectory1/wordcount.txt' AS (FNAME:chararray,LName:chararray);
store A into '/user/cloudera/newdirectory2' USING PigStorage(',');

 

Results in the following error?

ERROR: The pig script has encountered errors.

ERROR: Unable to store alias B

 

I will see if I can find a working example. I think I have a wordcount example.

Occasional Contributor
Posts: 17

Re: PIG Statement submission error

ERROR: The pig script has encountered errors.
ERROR: Unable to store alias A
Ask a Question
Discussion stats
  • 4 replies
  • 211 views
  • 0 likes
  • 2 in conversation