Bash 无法解析Oozie变量

Bash 无法解析Oozie变量,bash,bigdata,oozie,oozie-workflow,Bash,Bigdata,Oozie,Oozie Workflow,在决策节点中传递变量有问题。该参数在全局配置下声明 <global> <configuration> <property> <name>mapred.job.queue.name</name> <value>${yarnQueueName}</value> </property&

在决策节点中传递变量有问题。该参数在全局配置下声明

 <global>
        <configuration>
            <property>
                <name>mapred.job.queue.name</name>
                <value>${yarnQueueName}</value>
            </property>
             <property>
                <name>currentDate</name>
                <value>${replaceAll(timestamp(), "T(\\d{2}):(\\d{2})Z", "")}</value>
            </property>
        </configuration>
    </global>

mapred.job.queue.name
${yarnQueueName}
当前日期
${replaceAll(timestamp(),“T(\\d{2}):(\\d{2})Z”,“”)
但当在决策节点下使用“currentDate”时,它无法解析

<decision name="checkFile">
         <switch>
            <case to="an-email">
              ${fs:exists('/user/svc-pmdi/tmp/delta_Combination_'+currentDate+'.csv')}
            </case>
            <default to="end"/>
         </switch>
    </decision>

${fs:exists('/user/svc pmdi/tmp/delta_composition.'+currentDate+'.csv'))
我得到的错误 错误代码:EL_错误 错误消息:无法解析变量[currentDate]

我的第一个oozie worflow…可能是犯了愚蠢的错误。
请帮助我。

您不应该在全局配置块中声明workflow.xml的参数。 在您的情况下,您可以使用内联,而且您必须将“+”更改为concat()


${fs:exists(concat(concat('/user/svc pmdi/tmp/delta_组合),replaceAll(timestamp(),“T(\\d{2}):(\\d{2})Z',“),”),'.csv'))

您可以创建自定义参数,以便在workflow.xml开头的workflow.xml in块中使用它们。但是那里只能存储静态字符串。链接到文档:https://oozie.apache.org/docs/4.3.1/WorkflowFunctionalSpec.html#a4_Parameterization_of_Workflows

这对我很有效。谢谢你,罗斯兰。
<decision name="checkFile">
     <switch>
        <case to="an-email">
          ${fs:exists(concat(concat('/user/svc-pmdi/tmp/delta_Combination_', replaceAll(timestamp(), "T(\\d{2}):(\\d{2})Z", "")), '.csv'))}
        </case>
        <default to="end"/>
     </switch>
</decision>