Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop PIG-将多个单词作为参数传递_Hadoop_Apache Pig - Fatal编程技术网

Hadoop PIG-将多个单词作为参数传递

Hadoop PIG-将多个单词作为参数传递,hadoop,apache-pig,Hadoop,Apache Pig,在我的猪脚本中,我有以下内容: REL = FILTER OLD_REL BY COL == '$filter'; 如果我将$filter作为一个多字字符串word1-word2传递,则PIG只针对word1进行过滤。就好像单词2被砍掉了 当我从命令行或从oozie调用它时,就会发生这种情况 我正在使用PIG 0.11.0-cdh4.3.0在字符串中添加额外的单引号: -p filter="'word1 word2'" 如果您再次遇到此类问题,请使用-dryrun选项,该选项可生成带有替换参

在我的猪脚本中,我有以下内容:

REL = FILTER OLD_REL BY COL == '$filter';
如果我将$filter作为一个多字字符串
word1-word2
传递,则PIG只针对word1进行过滤。就好像单词2被砍掉了

当我从命令行或从oozie调用它时,就会发生这种情况


我正在使用PIG 0.11.0-cdh4.3.0在字符串中添加额外的单引号:

-p filter="'word1 word2'"

如果您再次遇到此类问题,请使用
-dryrun
选项,该选项可生成带有替换参数的脚本(文本文件),而无需执行脚本。

谢谢@卡巴德,我如何处理字符串中的单个引号?就像我的弦是“c'est bon”;我试过“c'est bon”,结果只得到了“c”。。。