在Kettle中使用时间戳时,未声明名为getTime的方法

时间:2015-07-23 15:29:09

标签: pentaho kettle

如果我在Kettle中声明用户定义的java表达式(使用janino),就像这样:

new java.util.Date(agent_start_time.getTime())

(其中agent_start_time被定义为时间戳)

我收到此错误:

2015/07/23 16:25:10 - [test-timestamp].User Defined Java Expression.0 - Caused by: org.codehaus.janino.CompileException: Line 1, Column 44: A method named "getTime" is not declared in any enclosing class nor any supertype, nor through a static import

这很奇怪,因为doco明确表示时间戳支持getTime就像java.util.Dates一样(虽然粒度不同)

1 个答案:

答案 0 :(得分:0)

看起来用户定义的Java表达式步骤不支持时间戳参数(bug PDI-14347)。

您可以通过选择值步骤将其投射到日期,这似乎可以解决我测试中的问题。