业务场景如下:
使用大数据平台Hadoop执行存储过程获取数据,然后将大数据平台表中的数据导出到本地Mysql数据库中,
为了数据安全,先将数据导出到一个专用用户中,再由专用用户通过触发器插入到实际业务用户中。
在由大数据平台导出时报如下错误:
- ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseBatchException:
- Error updating batch
- Column count doesn't match value count at row 1
-
- at org.pentaho.di.core.database.Database.createKettleDatabaseBatchException(Database.java:1379)
- at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1368)
- at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:575)
- at org.pentaho.di.trans.step.RunThread.run(RunThread.java:96)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.sql.BatchUpdateException: Column count doesn't match value count at row 1
- at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007)
- at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)
- at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1355)
- ... 3 more
看错误应该是大数据平台中的表字段个数和本地数据库表字段不匹配造成的,但是反复核对字段个数都是一致的。而且之前导出都是成功的。
多次测试任务终于发现问题所在,原来是update触发器缺少了一个字段导致的,加上之后导出成功,触发器也是之后才写的,所以之前导出没有报错。
比较奇怪的是大数据平台导数据到专用用户中,为什么触发器报错会带到大数据平台,导致导出也出错,怀疑是导出数据时触发器就执行,报错,导致导出失败的。
使用大数据平台Hadoop执行存储过程获取数据,然后将大数据平台表中的数据导出到本地Mysql数据库中,
为了数据安全,先将数据导出到一个专用用户中,再由专用用户通过触发器插入到实际业务用户中。
在由大数据平台导出时报如下错误:
- ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseBatchException:
- Error updating batch
- Column count doesn't match value count at row 1
-
- at org.pentaho.di.core.database.Database.createKettleDatabaseBatchException(Database.java:1379)
- at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1368)
- at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:575)
- at org.pentaho.di.trans.step.RunThread.run(RunThread.java:96)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.sql.BatchUpdateException: Column count doesn't match value count at row 1
- at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007)
- at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)
- at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1355)
- ... 3 more
看错误应该是大数据平台中的表字段个数和本地数据库表字段不匹配造成的,但是反复核对字段个数都是一致的。而且之前导出都是成功的。
多次测试任务终于发现问题所在,原来是update触发器缺少了一个字段导致的,加上之后导出成功,触发器也是之后才写的,所以之前导出没有报错。
比较奇怪的是大数据平台导数据到专用用户中,为什么触发器报错会带到大数据平台,导致导出也出错,怀疑是导出数据时触发器就执行,报错,导致导出失败的。