关于Kettle更新Greenplum&Postgresql出错问题
程序员文章站
2022-06-04 15:51:44
...
今天遇到一个比较奇葩的事,在Kettle更新Greenplum&Postgresql时会出以下错误:
2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Unexpected error 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : org.pentaho.di.core.exception.KettleStepException: 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Error in step, asking everyone to stop because of: 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Error looking up row in database 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : ERROR: Unexpected internal error (cdbdisp.c:466) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.processRow(InsertUpdate.java:307) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at java.lang.Thread.run(Thread.java:662) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Error looking up row in database 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : ERROR: Unexpected internal error (cdbdisp.c:466) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.core.database.Database.getLookup(Database.java:3120) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.core.database.Database.getLookup(Database.java:3093) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.lookupValues(InsertUpdate.java:80) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.processRow(InsertUpdate.java:290) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : ... 2 more 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : Caused by: org.postgresql.util.PSQLException: ERROR: Unexpected internal error (cdbdisp.c:466) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2077) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1810) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:386) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : at org.pentaho.di.core.database.Database.getLookup(Database.java:3101) 2014/08/08 11:08:15 - Insert / Update.0 - ERROR (version 4.2.1, build 1 from 2012-11-22 19.15.47 by Administrator) : ... 5 more 2014/08/08 11:08:15 - Table input.0 - Stopped while putting a row on the buffer
网上基本找不到跟“Unexpected internal error (cdbdisp.c:466)”相关的问题,但是在Pentaho论坛找到一个bug http://wiki.pentaho.com/display/EAI/Insert+-+Update
解决方法是在数据库连接的高级选项中,勾选“Supports boolean data type”即可。
想了下,问题的原因应该是GP和PG中不会对boolean向int自动转换;问题出在建表时有字段类型是类似smallint(1)这种的情况,jdbc遇到长度为1的整形字段时(定义字段)会自动转为布尔值,所以产生了该问题。最好的解决方法,是在select时对这种类型的字段应该乘以1或者加0,利用隐式转换使字段结果为整型字段(显式转换应该也可以),这样有个好处,在遇到2~9时,不会因为前边提到的布尔类型转换都成为1
上一篇: Android根据包名获取程序基本信息
下一篇: Kettle5.0.1配置CDH4
推荐阅读
-
关于多对多关系表无法更新与插入的问题
-
关于多对多关系表无法更新与插入的问题
-
关于代码阅读问题的小技巧 脚本之家原创(适合所有网站)不定时更新
-
安装SQL Server 2016出错提示:需要安装oracle JRE7 更新 51(64位)或更高版本问题的解决方法
-
出错: bad operand types for binary operator ”^“,关于java中运算符优先级问题
-
spring整合mybatis,关于注入Dao对象出错问题
-
关于Mybatis-Plus字段策略与数据库自动更新时间的一些问题
-
关于npm警告fsevents和vue-cli项目中的一些问题,持续更新
-
《php和mysql web开发(原书第三版)》中创建CMS系统例子关于mysql的出错问题?
-
请高手指导关于Mysqli的prepare出错问题