如何在oozie中将pig选项作为参数传递?

时间:2015-09-30 13:55:56

标签: hadoop apache-pig oozie oozie-coordinator

为了执行我的猪脚本,我需要关闭优化器。在命令行和脚本中使用以下命令可以正常工作。

 pig -t ColumnMapKeyPrune population.pig

如何在oozie中传递此选项?

我试过传递作为参数。

<action>
<pig>
    <job-tracker>${jobTracker}</job-tracker>
    <name-node>${nameNode}</name-node>                      
    <script>Population.pig</script> 
    <argument>-t</argument>
    <argument>ColumnMapKeyPrune</argument>
    <param>piggybankJar=${piggybankJar}</param>
    <param>datafuJar=${datafuJar}</param>
    <param>inputPath=${inputPath}</param>
    <param>outputPath=${outputPath}</param>
</pig>
</action>

收到以下错误:

E0701: XML schema error, cvc-complex-type.2.4.a: Invalid content was found starting with element 'param'. One of '{"uri:oozie:workflow:0.4":argument, "uri:oozie:workflow:0.4":file, "uri:oozie:workflow:0.4":archive}' is expected.

尝试使用param,但它没有用

 <action>
 <pig>
    <job-tracker>${jobTracker}</job-tracker>
    <name-node>${nameNode}</name-node>                      
    <script>Population.pig</script> 
    <param>-t</param>
    <param>ColumnMapKeyPrune</param>
    <param>piggybankJar=${piggybankJar}</param>
    <param>datafuJar=${datafuJar}</param>
    <param>inputPath=${inputPath}</param>
    <param>outputPath=${outputPath}</param>
</pig>
</action>

对于pig oozie action,只允许param,archive,file和argument标签。如何传递此optimizer_off选项?

1 个答案:

答案 0 :(得分:1)

在您的猪脚本中设置下面提到的属性并尝试一次。

设置pig.optimizer.rules.disabled'LealMapKeyPrune';

供参考,请通过以下提及的链接

[http://pig.apache.org/docs/r0.14.0/perf.html#optimization-rules]