zhangzhen108 commented on issue #8516:
URL: https://github.com/apache/shardingsphere/issues/8516#issuecomment-739694181


   I have already implement ComplexKeysShardingAlgorithm interface.
   my sharding fields is card_id、order_id、user_id,if card_id is null,i can use 
orderId to sharding the table.
   
   Below is the error log:
   
   
   Caused by: java.lang.IllegalArgumentException: Sharding value must 
implements Comparable.
   at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
   at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.getRouteValue(InsertClauseShardingConditionEngine.java:112)
   at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingCondition(InsertClauseShardingConditionEngine.java:94)
   at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingConditions(InsertClauseShardingConditionEngine.java:65)
   at 
org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.getShardingConditions(ShardingRouteDecorator.java:80)
   at 
org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:62)
   at 
org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:53)
   at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:91)
   at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
   at 
org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54)
   at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
   at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
   at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.prepare(ShardingPreparedStatement.java:183)
   at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:143)
   at 
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
   at 
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   at 
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to