rp346
rp346

Reputation: 7028

pig script param with ERROR 2999

Hi i am trying to run pig script with param.

cat unbz2.pig 
a = load '$source' using PigStorage();
store a into '$target' using PigStorage();

Then I run following command from CMD :

$ pig -f /home/user/unbz2.pig –param source=/part-m-* -param target=/unzip2
2014-08-22 11:51:33,015 [main] INFO  org.apache.pig.Main - Apache Pig version 0.11.0-cdh4.6.0 (rexported) compiled Feb 26 2014, 03:01:22
2014-08-22 11:51:33,016 [main] INFO  org.apache.pig.Main - Logging error messages to: /home/user/pig_1408722693009.log
2014-08-22 11:51:34,041 [main] INFO  org.apache.pig.impl.util.Utils - Default bootup file /home/user/.pigbootup not found
2014-08-22 11:51:34,151 [main] ERROR org.apache.pig.Main - ERROR 2999: Unexpected internal error. Undefined parameter : source
Details at logfile: /home/user/pig_1408722693009.log

I dont know what I am doing wrong. Please help.

Upvotes: 1

Views: 1868

Answers (2)

user3387616
user3387616

Reputation: 81

you could delete the $ and put just the parameter 'source'

a = load 'source' using PigStorage();
store a into 'target' using PigStorage();

Upvotes: 0

user3922840
user3922840

Reputation:

you just need to pass parameter before executing your pig script because right now you are passing parameter after your pig execute command. you can pass your parameter like -

pig -param parameter=<parameter value> /home/user/unbz2.pig

Upvotes: 2

Related Questions