pig脚本参数,错误为2999

q8l4jmvw  于 2021-05-30  发布在  Hadoop
关注(0)|答案(2)|浏览(335)

嗨,我想用param运行pig脚本。

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

然后我从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

我不知道我做错了什么。请帮忙。

j0pj023g

j0pj023g1#

您只需要在执行pig脚本之前传递参数,因为现在您正在pig execute命令之后传递参数。你可以像这样传递你的参数-

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

taor4pac2#

您可以删除$并只放置参数'source'

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

相关问题