How can I create a parameter with today date of the format :
yyyy-mm-dd
in oozie. I am passing this variable to hive script which is adding the partition for that date, I found the function to create timestamp using :
<param>DATE=${wf:timestamp()}</param>
which should return output in the form :
(YYYY-MM-DDThh:mm:ss.sZ). I.e.: 1997-07-16T19:20:30.45Z
but I am getting error :
No function is mapped to the name "wf:timestamp"
Also I only want YYYY-MM-DD
from the timestamp and there is no substring function also which can give me first 10 chars of the string.
<configuration> <property> <name>DATE</name> <value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), "yyyy-MM-dd")}</value> </property> </configuration>
I am using this date to add a parition in hive table, it adds the partition value as :dt=$%7BDATE}
this is my hive command :ALTER TABLE oozietest ADD IF NOT EXISTS PARTITION (dt="${DATE}") LOCATION "/user/hello/${DATE}"
– Postboy