嗨,我想用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
我不知道我做错了什么。请帮忙。
2条答案
按热度按时间j0pj023g1#
您只需要在执行pig脚本之前传递参数,因为现在您正在pig execute命令之后传递参数。你可以像这样传递你的参数-
taor4pac2#
您可以删除$并只放置参数'source'