我们可以在oozie决策节点中使用参数吗?

时间:2014-02-12 14:07:12

标签: java hadoop oozie

我正在尝试在oozie 3.3.2中执行决策控制节点但是获取javax.servlet.jsp.el.E​​LException

遇到“{”

<decision name="decision-wf">
 <switch>
           <case to="another_wf">
                ${fs:fileSize(${OutputDir}/000000_0) gt 100 }
           </case>

           <default to="fail-wf"/>
</switch>

如何以String格式传递参数,因为上面提到的FS方法需要String输入?

2 个答案:

答案 0 :(得分:3)

从显示的document开始,

您需要传递硬编码,即'

中的${fs:fileSize('/usr/foo/myinputdir'/1000) gt 10 }

只是参数名称${fs:fileSize(OutputDir/1000) gt 10 }

可能会在工作流程的OutputDir部分或<config>文件中指定此.properties或使用-D

提交作业时传递的{{1}}文件

答案 1 :(得分:0)

是的,你可以。事实上,您可以将多个参数与concat函数组合在一起(我认为这有助于解决原始海报的问题)。

例如,如果$ {location}和$ {date}是配置文件中定义的两个参数:

DT[DT2,{print(as.matrix(.SD) %*% diag(c(i.B,i.C)))},by=.EACHI]
          [,1]         [,2]
[1,] 1.1157764 -0.033349750
[2,] 0.8069216  0.003020009
            [,1]      [,2]
[1,] -0.09445960 0.2145397
[2,] -0.08039401 2.0253136
            [,1]       [,2]
[1,]  0.02890673  0.1984297
[2,] -0.77121518 -0.1734435

如果位置和日期之间需要'/',则必须执行此操作:

<decision name="check-directory-exists">
     <switch>
        <case to="load-directory">
          <!-- check if the directory at this location for this date exists -->
          ${fs:exists(concat(location, date))}
        </case>
        <!-- The directory doesn't exist, there is nothing to do -->
        <default to="end" />
     </switch>
 </decision>
相关问题