shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

During the incremental migration of PostgreSQL, if the update statement is executed, the `Sharding value must implements Comparable` exception will occur

Open ReyYang opened this issue 4 years ago • 0 comments

Bug Report

Which version of ShardingSphere did you use?

Master f2151421374e3e5a856f82a7283de4d3bb0ad154

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

PostgreSQL successfully migrated during data migration of multiple data sources

Actual behavior

During the incremental migration of PostgreSQL, if the update statement is executed, the Sharding value must implements Comparable exception will occur

Reason analyze (If you can)

oldValue in org.apache.shardingsphere.data.pipeline.api.ingest.record.Column cause

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

  1. Use shardingsphere-proxy to add resources
  2. Create migration task
  3. Use update statement during incremental migration
Caused by: java.lang.IllegalArgumentException: Sharding value must implements Comparable.
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142)
    at org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:53)
    at org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:41)
    at org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.<init>(ConditionValue.java:36)
    at org.apache.shardingsphere.sharding.route.engine.condition.generator.impl.ConditionValueCompareOperatorGenerator.generate(ConditionValueCompareOperatorGenerator.java:64)
    at org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValueGeneratorFactory.generate(ConditionValueGeneratorFactory.java:51)
    at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditionValueMap(WhereClauseShardingConditionEngine.java:142)
    at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:84)
    at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:74)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createShardingConditions(ShardingSQLRouter.java:66)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:50)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:44)
    at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:73)
    at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:53)
    at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
    at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
    at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:381)
    at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:290)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.executeUpdate(AbstractImporter.java:201)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.executeUpdate(AbstractImporter.java:185)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.doFlush(AbstractImporter.java:157)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.tryFlush(AbstractImporter.java:139)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.flushInternal(AbstractImporter.java:130)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.lambda$flush$2(AbstractImporter.java:124)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.flush(AbstractImporter.java:116)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.write(AbstractImporter.java:97)
    at org.apache.shardingsphere.data.pipeline.core.importer.AbstractImporter.start(AbstractImporter.java:86)
    ... 8 common frames omitted

Example codes for reproduce this issue (such as a github link).

ReyYang avatar Dec 27 '21 11:12 ReyYang