kettle报错couldn't convert string [1970-01-01 00:00:00] to a date using format [yyyy/MM/dd HH:mm:ss.SS

kettle报错couldn't convert string [1970-01-01 00:00:00] to a date using format [yyyy/MM/dd HH:mm:ss.SSS]

1.报错如下
2019/01/08 12:04:18 - 替换NULL值.0 - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : Error in step : 
2019/01/08 12:04:18 - 替换NULL值.0 - effect_date String : couldn't convert string [1970-01-01 00:00:00] to a date using format [yyyy/MM/dd HH:mm:ss.SSS] on offset location 4
2019/01/08 12:04:18 - 替换NULL值.0 - 1970-01-01 00:00:00
org.pentaho.di.core.exception.KettleValueException: 
effect_date String : couldn't convert string [1970-01-01 00:00:00] to a date using format [yyyy/MM/dd HH:mm:ss.SSS] on offset location 4
1970-01-01 00:00:00
	at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToDate(ValueMetaBase.java:925)
	at org.pentaho.di.core.row.value.ValueMetaBase.getDate(ValueMetaBase.java:2271)
	at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3813)
	at org.pentaho.di.trans.steps.ifnull.IfNull.replaceNull(IfNull.java:235)
	at org.pentaho.di.trans.steps.ifnull.IfNull.updateFields(IfNull.java:203)
	at org.pentaho.di.trans.steps.ifnull.IfNull.processRow(IfNull.java:167)
	at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.text.ParseException: 1970-01-01 00:00:00
	at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToDate(ValueMetaBase.java:916)
	... 7 more
2.报错原因

这个报错原因很好理解:couldn't convert string [1970-01-01 00:00:00] to a date using format [yyyy/MM/dd HH:mm:ss.SSS。这句话说得就是:不能使用格式[yyyy/MM/dd HH:mm:ss.SSS]字符串[1970-01-01 00:00:00] 转换成一个date。即转换格式不对。

3.修改办法
3.1 替换NULL值组件

在这里插入图片描述

3.2 转换掩码

默认转换 dateTimestamp 的转换掩码没有填写,根据自己的需要填写一个模式即可。
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

说文科技

看书人不妨赏个酒钱?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值