开发者社区> 问答> 正文

数据同步如何关闭on duplicate key update语法

pid:2 nid:1 exception:setl:com.alibaba.otter.node.etl.load.exception.LoadException: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)]; SQL state [HY000]; error code [4506]; [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506]; nested exception is java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:621) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:613) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:458) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 21 more • PairId: 2 , TableId: 3 , EventType : I , Time : 1472632693000 - Consistency : , Mode : ---Pks EventColumn[index=0,columnType=3,columnName=id,columnValue=3828772307,isNull=false,isKey=true,isUpdate=true] ---oldPks ---Columns EventColumn[index=1,columnType=3,columnName=channelId,columnValue=154980065,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=3,columnName=userId,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] EventColumn[index=3,columnType=4,columnName=icon,columnValue=6,isNull=false,isKey=false,isUpdate=true] EventColumn[index=4,columnType=93,columnName=lastModify,columnValue=2016-08-31 16:38:13,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=5,columnName=c_status,columnValue=1,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=3,columnName=owner,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] ---Sql insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id) Caused by: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)]; SQL state [HY000]; error code [4506]; [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506]; nested exception is java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:621) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:613) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:458) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 21 more • PairId: 2 , TableId: 3 , EventType : I , Time : 1472632693000 - Consistency : , Mode : ---Pks EventColumn[index=0,columnType=3,columnName=id,columnValue=3828772307,isNull=false,isKey=true,isUpdate=true] ---oldPks ---Columns EventColumn[index=1,columnType=3,columnName=channelId,columnValue=154980065,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=3,columnName=userId,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] EventColumn[index=3,columnType=4,columnName=icon,columnValue=6,isNull=false,isKey=false,isUpdate=true] EventColumn[index=4,columnType=93,columnName=lastModify,columnValue=2016-08-31 16:38:13,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=5,columnName=c_status,columnValue=1,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=3,columnName=owner,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] ---Sql insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id) at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader.load(DataBatchLoader.java:107) at com.alibaba.otter.node.etl.load.loader.OtterLoaderFactory.load(OtterLoaderFactory.java:50) at com.alibaba.otter.node.etl.load.LoadTask$1.run(LoadTask.java:85) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)]; SQL state [HY000]; error code [4506]; [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506]; nested exception is java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:621) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:613) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:458) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 21 more • PairId: 2 , TableId: 3 , EventType : I , Time : 1472632693000 - Consistency : , Mode : ---Pks EventColumn[index=0,columnType=3,columnName=id,columnValue=3828772307,isNull=false,isKey=true,isUpdate=true] ---oldPks ---Columns EventColumn[index=1,columnType=3,columnName=channelId,columnValue=154980065,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=3,columnName=userId,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] EventColumn[index=3,columnType=4,columnName=icon,columnValue=6,isNull=false,isKey=false,isUpdate=true] EventColumn[index=4,columnType=93,columnName=lastModify,columnValue=2016-08-31 16:38:13,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=5,columnName=c_status,columnValue=1,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=3,columnName=owner,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] ---Sql insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id) Caused by: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)]; SQL state [HY000]; error code [4506]; [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506]; nested exception is java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:621) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:613) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:458) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 21 more • PairId: 2 , TableId: 3 , EventType : I , Time : 1472632693000 - Consistency : , Mode : ---Pks EventColumn[index=0,columnType=3,columnName=id,columnValue=3828772307,isNull=false,isKey=true,isUpdate=true] ---oldPks ---Columns EventColumn[index=1,columnType=3,columnName=channelId,columnValue=154980065,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=3,columnName=userId,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] EventColumn[index=3,columnType=4,columnName=icon,columnValue=6,isNull=false,isKey=false,isUpdate=true] EventColumn[index=4,columnType=93,columnName=lastModify,columnValue=2016-08-31 16:38:13,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=5,columnName=c_status,columnValue=1,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=3,columnName=owner,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] ---Sql insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id) Caused by: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)]; SQL state [HY000]; error code [4506]; [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506]; nested exception is java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:621) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:613) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:458) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: [9d2bc5a7a401000-2][10.44.182.20:3306][mark]ERR-CODE: [TDDL-4506][ERR_MODIFY_SHARD_COLUMN] Column 'userId' is a sharding key of table 'mark_user', which is forbidden to be modified. More: [http://middleware.alibaba-inc.com/faq/faqByFaqCode.html?faqCode=TDDL-4506] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 21 more • PairId: 2 , TableId: 3 , EventType : I , Time : 1472632693000 - Consistency : , Mode : ---Pks EventColumn[index=0,columnType=3,columnName=id,columnValue=3828772307,isNull=false,isKey=true,isUpdate=true] ---oldPks ---Columns EventColumn[index=1,columnType=3,columnName=channelId,columnValue=154980065,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=3,columnName=userId,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] EventColumn[index=3,columnType=4,columnName=icon,columnValue=6,isNull=false,isKey=false,isUpdate=true] EventColumn[index=4,columnType=93,columnName=lastModify,columnValue=2016-08-31 16:38:13,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=5,columnName=c_status,columnValue=1,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=3,columnName=owner,columnValue=141255216,isNull=false,isKey=false,isUpdate=true] ---Sql insert into mark.mark_user(channelId , userId , icon , lastModify , c_status , owner , id) values (? , ? , ? , ? , ? , ? , ?) on duplicate key update channelId=values(channelId) , userId=values(userId) , icon=values(icon) , lastModify=values(lastModify) , c_status=values(c_status) , owner=values(owner) , id=values(id)

image.png

原提问者GitHub用户 zjunbao

展开
收起
大圣东游 2023-06-21 16:52:08 43 0
1 条回答
写回答
取消 提交回答
  • otter目前对DRDS支持不够好,主要两点:

    1、DRDS的update更新需要带上拆分条件 2、DRDS的insert on dup key不能带上拆分条件

    原回答者GitHub用户agapple

    2023-06-21 17:58:43
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
MaxCompute技术公开课第四季 之 如何将Kafka数据同步至MaxCompute 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载