Pentaho:从DATE到TIMESTAMP的无效转换

时间:2019-06-14 14:00:34

标签: date pentaho

我将DATE值从 Informix 数据库传输到了 Redbrick 数据库,没有进行任何处理。但是“插入/更新”步骤失败,并显示以下错误:

Invalid conversion from DATE to TIMESTAMP

源数据库和目标数据库中的两列均为DATE类型。 我认为这可能是格式问题,因此我使用“选择值”步骤来明确设置日期格式。但这没有帮助。

下面是完整的堆栈:

2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : Error in step, asking everyone to stop because of:
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - Couldn't get row from result set
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - Unable to get value 'Date' from database resultset, index 3
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - ** Error ** (11002) [Red Brick Warehouse JDBC Driver] : Column 4 : Invalid conversion from DATE to TIMESTAMP.
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getRow(Database.java:2764)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getRow(Database.java:2734)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getLookup(Database.java:3103)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getLookup(Database.java:3093)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getLookup(Database.java:3089)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.lookupValues(InsertUpdate.java:89)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.processRow(InsertUpdate.java:299)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at java.lang.Thread.run(Thread.java:748)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - Unable to get value 'Date' from database resultset, index 3
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - ** Error ** (11002) [Red Brick Warehouse JDBC Driver] : Column 4 : Invalid conversion from DATE to TIMESTAMP.
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - 
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.row.value.ValueMetaBase.getValueFromResultSet(ValueMetaBase.java:5310)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.BaseDatabaseMeta.getValueFromResultSet(BaseDatabaseMeta.java:2107)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.DatabaseMeta.getValueFromResultSet(DatabaseMeta.java:2982)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.database.Database.getRow(Database.java:2756)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    ... 8 more
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 - Caused by: java.sql.SQLException: ** Error ** (11002) [Red Brick Warehouse JDBC Driver] : Column 4 : Invalid conversion from DATE to TIMESTAMP.
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at redbrick.utils.ErrorHandlers.errorHandler(ErrorHandlers.java:44)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at redbrick.utils.ErrorHandlers.errorHandler(ErrorHandlers.java:29)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at redbrick.jdbc.RBWResultSet.errorHandler(RBWResultSet.java:3952)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at redbrick.jdbc.RBWResultSet.getTimestamp(RBWResultSet.java:2993)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    at org.pentaho.di.core.row.value.ValueMetaBase.getValueFromResultSet(ValueMetaBase.java:5292)
2019/06/14 16:48:39 - Insert / update LOAD_CONTR.0 -    ... 11 more

可能是什么问题?日期格式错误?如果是这样,我必须运行什么查询才能获取两个数据库的日期格式?

我看过DDL。列类型为DATE:

create table ... (
...
DATE_FIRST DATE,
DATE_LAST DATE,
...

0 个答案:

没有答案