No function is mapped to the name “coord:formatTime”

旧时模样 提交于 2019-12-08 08:06:06

问题


I am trying to get the current timestamp using the below in oozie:

<property>
 <name>date</name>
 <value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1,
                         'DAY'), "yyyy-MM-dd")}
  </value>
 </property>

My hive action is:

<script>/abc/test.hql</script>
 <param>DATE=${date}</param>

My Hive action fails saying:

EL_ERROR

No function is mapped to the name "coord:formatTime"

Any idea why it says so?I want my date as YYYY-MM-DD HH-MM-SS


回答1:


${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), 'yyyyMMdd')}

This works for me. Which version of oozie do you use ?




回答2:


Use the documentation for coord:formatTime

6.8.2. coord:formatTime(String ts, String format) EL Function (since Oozie 2.3.2)

So probably your Oozie version is lower than 2.3.2 Also it's important to pay attention for the xmlns version inside your coordinator xml

xmlns:coordinator="uri:oozie:coordinator:

Hope this help



来源:https://stackoverflow.com/questions/38704255/no-function-is-mapped-to-the-name-coordformattime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!