1

我正在尝试将数据从 CSV 文件插入到 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 - 表 output.0 - 插入/更新行时出错

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

我该如何解决这个错误。

我在 postgresql 中检查了表定义,数据类型是字符变化而没有大小

4

1 回答 1

1

错误是

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

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

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

您需要缩短值或更改表中列的字符大小fk_test

于 2015-04-30T12:13:06.647 回答