【问题标题】:error inserting/Updating row in pentaho?在 pentaho 中插入/更新行时出错?
【发布时间】:2015-04-30 20:13:06
【问题描述】:

我正在尝试将数据从 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 中检查了表定义,数据类型是字符变化而没有大小

【问题讨论】:

  • Text file input 步骤的“字段”选项卡上设置的数据类型是什么?如果它有一个数字(如 21),请尝试删除它。
  • PostgreSQL 日志应该有关于值和列的更多信息。
  • @Brian.D.Myers 谢谢
  • ERROR: value too long for type character varying(21)

标签: postgresql pentaho pentaho-cde


【解决方案1】:

错误是

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

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-14
    • 2014-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多