You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Filix Suo <sy...@gmail.com> on 2014/10/15 09:17:09 UTC
how to get date in workflow.xml?
Hi all,
I want to create output file according to date(in fact, yesterday)
workflow.xml
<property>
<name>mapred.output.dir</name>
<value>x/y/z/${year}-${month}-${day}</value>
</property>
but can’t find a EL function can do this.
anyone help?
Re: how to get date in workflow.xml?
Posted by Laurent H <la...@gmail.com>.
Hi, you can get the date by coordinator with :
${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1,
'DAY'),'yyyy-MM-dd')}</value>
(http://stackoverflow.com/questions/17405867/accessing-date-directly-in-workflow-xml-in-case-of-oozie-workflow-jobs)
and then pass it to the workflow.
You can also get the current timestamp in a workflow ${wf:timestamp()}
and change it to a yyyy-MM-dd format
--
Laurent HATIER - Consultant Big Data & Business Intelligence chez CapGemini
fr.linkedin.com/pub/laurent-hatier/25/36b/a86/
<http://fr.linkedin.com/pub/laurent-h/25/36b/a86/>
2014-10-15 9:17 GMT+02:00 Filix Suo <sy...@gmail.com>:
> Hi all,
>
> I want to create output file according to date(in fact, yesterday)
>
> workflow.xml
>
> <property>
> <name>mapred.output.dir</name>
> <value>x/y/z/${year}-${month}-${day}</value>
> </property>
>
> but can’t find a EL function can do this.
>
> anyone help?
>
>
>
>