I built a workflow that has two hive2 actions and I am running it using Hue. I need to get the current time from the system when the workflow starts and pass it to both actions. This is the structure of the workflow:
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="workflow.xml">
<global>
<job-tracker>host1:1234</job-tracker>
<name-node>hdfs://myhost:4312</name-node>
<configuration>
<property>
<name>execution_start</name>
<value>${timestamp()}</value>
</property>
</configuration>
</global>
<start to="script1" />
<action name="script1">
<hive2 xmlns="uri:oozie:hive2-action:0.2">
<jdbc-url>jdbc:hive2://myhost:10/default</jdbc-url>
<script>script1.hql</script>
<param>execution_start=${execution_start}</param>
</hive2>
<ok to="script2" />
<error to="fail" />
</action>
<action name="script2">
<hive2 xmlns="uri:oozie:hive2-action:0.2">
<jdbc-url>jdbc:hive2://myhost:10/default</jdbc-url>
<script>script2.hql</script>
<param>execution_start=${execution_start}</param>
</hive2>
<ok to="end" />
<error to="fail" />
</action>
<kill name="fail">
<message>Sub workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end" />
</workflow-app>
I need to have the same timestamp in both hive actions. So far Hue asks to input the parameter with name execution_start
.
I also tried: <param>execution_start=${wf:conf('execution_start')}>
. I'm not prompted to input the parameter with this but I get a NULL value inside the script.
Notice that <param>execution_start=${timestamp()}>
works, but it doesn't do the job for me as the timestamps would be different in each action.