插入/更新pentaho中的行错误?

时间:2015-04-27 19:59:44

标签: postgresql pentaho pentaho-cde

我正在尝试将CS​​V文件中的数据插入pentaho中的表输出。

我收到了以下错误

 2015/04/28 01:07:14 - Table output.0 - Connected to database [vps] (commit=5000)
2015/04/28 01:08:05 - Table output.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : Because of an error, this step can't continue: 
2015/04/28 01:08:05 - Table output.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : org.pentaho.di.core.exception.KettleException: 
2015/04/28 01:08:05 - Table output.0 - Error inserting row into table [fk_test] with values: [NFT-140721054GN00079XXXXXXX], [postpaid], [NON-FA], [L23-APRICOT/PINK-115(40)], [null], [OD40709024274], [82662472], [9-Jul-14], [10-Jul-14], [null], [null], [21-Jul-14], [return_completed], [1], [1379], [0], [0], [0], [0], [0], [39.5], [0], [0], [0], [0], [0], [0.3], [0], [0], [NATIONAL], [0], [0], [0], [0], [FKST-00151], [10-Jul-14], [1379], [sandal], [0], [0], [0]
2015/04/28 01:08:05 - Table output.0 - 
2015/04/28 01:08:05 - Table output.0 - Error inserting/updating row
2015/04/28 01:08:05 - Table output.0 - ERROR: value too long for type character varying(21)
2015/04/28 01:08:05 - Table output.0 - 
2015/04/28 01:08:05 - Table output.0 - 
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:377)
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:118)
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2015/04/28 01:08:05 - Table output.0 -  at java.lang.Thread.run(Thread.java:745)
2015/04/28 01:08:05 - Table output.0 - Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
2015/04/28 01:08:05 - Table output.0 - Error inserting/updating row
2015/04/28 01:08:05 - Table output.0 - ERROR: value too long for type character varying(21)
2015/04/28 01:08:05 - Table output.0 - 
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.core.database.Database.insertRow(Database.java:1268)
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:255)
2015/04/28 01:08:05 - Table output.0 -  ... 3 more
2015/04/28 01:08:05 - Table output.0 - Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(21)
2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)


2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
2015/04/28 01:08:05 - Table output.0 -  at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
2015/04/28 01:08:05 - Table output.0 -  at org.pentaho.di.core.database.Database.insertRow(Database.java:1235)
2015/04/28 01:08:05 - Table output.0 -  ... 4 more
2015/04/28 01:08:05 - Table output.0 - Finished processing (I=0, O=186, R=187, W=186, U=0, E=1)

2015/04/28 01:08:05 - 表输出0 - 插入/更新行时出错

2015/04/28 01:08:05 - 表格输出0 - 错误:类型字符变化的值太长(21)

我如何解决这个错误。

我检查了postgresql中的表定义,数据类型是不变大小的字符

1 个答案:

答案 0 :(得分:0)

错误是

ERROR: value too long for type character varying(21)

并且有两个超过21个字符的值。

NFT-140721054GN00079XXXXXXX
L23-APRICOT/PINK-115(40)

您需要缩短值或更改表fk_test

中列的字符大小