PDI 时间戳:无法从索引 5 处的结果集中获取时间戳

PDI Timestamp : Unable to get timestamp from resultset at index 5

我在 PDI 中有一个转换,它基本上从亚马逊 S3 存储桶读取数据并将数据推送到 mysql database.But 今天,我在转换执行时遇到以下 PDI 错误。

org.pentaho.di.core.exception.KettleDatabaseException: 
Couldn't get row from result set

Timestamp : Unable to get timestamp from resultset at index 5
Value '37467412015-04-18 13:58:472015-04-18 13:58:4700000-00-00 00:00:001:138' can not be represented as java.sql.Timestamp


at org.pentaho.di.core.database.Database.getRow(Database.java:2397)
at org.pentaho.di.core.database.Database.getRow(Database.java:2368)
at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:145)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:

我已经在 PDI 中使用了 zeroDateTimeBehavior = convertToNull 选项

转到数据库连接 window 然后 select Option 然后输入下面的值

Parameter=zeroDateTimeBehavior
Value= convertToNull 

然后重启spoon

问题是由于 Java 时间戳不接受“0000-00-00”日期。

您可以将此参数添加到 JNDI 中的 jdbc 连接字符串 jdbc.properties:

jdbc:mysql://localhost:3306/......&zeroDateTimeBehavior=CONVERT_TO_NULL

有效值为“EXCEPTION”、“ROUND”和“CONVERT_TO_NULL”