简体   繁体   English

如果是oozie工作流程作业,则直接在workflow.xml中访问日期

[英]Accessing date directly in workflow.xml in case of oozie workflow jobs

Input data path contains current date( INPUT/YYYY/MM/DD/HH/ ) and the oozie job is simply workflow job. 输入数据路径包含当前日期(INPUT / YYYY / MM / DD / HH /),而oozie作业只是工作流程作业。

I tried the following, but didn't work. 我尝试了以下操作,但没有成功。

<java>
    <job-tracker>${jobTracker}</job-tracker>
    <name-node>${nameNode}</name-node>
    <prepare>
        <delete path="${nameNode}/user/510600/output" />
    </prepare>
    <main-class>${parse_mainClass}</main-class>
    <arg>${inputDir}/${YEAR}/${MONTH}/${DAY}</arg>
    <arg>${parse_Output}</arg>
</java>

By including the follwing in coordinator.xml. 通过在coordinator.xml中包含以下内容。 I can use the variable "prevDaystart" in workflow.xml. 我可以在工作流.xml中使用变量“ prevDaystart”。

<workflow>
    <app-path>${workflowAppUri}</app-path>
    <configuration>
    <property>
       <name>prevDaystart</name>
       <value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'),'yyyy-MM-dd')}</value>
    </property>
 </configuration>

My question is "Is there any direct way available to access the current date(YYYY/MM/DD/HH/) in workflow.xml (workflow jobs)? " 我的问题是“在workflow.xml(工作流作业)中,是否有任何直接方法可以访问当前日期(YYYY / MM / DD / HH /)?”

AFAIK, no there is no way to access these variables in the workflow itself. AFAIK,没有办法在工作流本身中访问这些变量。 I've always worked around this by adding in some additional dummy data outputs and properties that mirror the coordinator variables for year / month / day and then you can reference them in the workflow. 我一直通过添加一些其他虚拟数据输出和属性来解决此问题,这些输出和属性反映了年/月/日的协调变量,然后您可以在工作流中引用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM