1、日志:

java.sql.BatchUpdateException: Data truncation: Data too long for column 'scriptInfoMap' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at com.xs.fun.processor.base.AbstractEventProcessor.baseDefaultJdbcExecuteBatchInsert(AbstractEventProcessor.java:166)
at com.xs.fun.processor.defaults.DefaultInsertEventProcessor.eventProcess(DefaultInsertEventProcessor.java:75)
at com.xs.fun.processor.base.AbstractEventProcessor.baseEventProcessor(AbstractEventProcessor.java:209)
at com.xs.fun.sink.BaseAdminMysqlSink$1.run(BaseAdminMysqlSink.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'scriptInfoMap' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3601)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1976)
... 14 more

2、解决方法:

1)使用了mybatis的逆向工程,插入数据;

2)这里报错,是因为插入的数据长度过大,mysql的字段设置小于真实长度;

3)临时表的字段设置长度更大即可,因为数据会马上被清理掉。