jinpengSun opened a new issue, #23479:
URL: https://github.com/apache/shardingsphere/issues/23479

   ## Bug Report
   
   java.lang.NumberFormatException: For input string: ""
   at java.lang.NumberFormatException.forInputString(Unknown Source)
           at java.lang.Integer.parseInt(Unknown Source)
           at java.lang.Integer.parseInt(Unknown Source)
           at 
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
           at Script24$_run_closure1.doCall(Script24.groovy:1)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
           at groovy.lang.Closure.call(Closure.java:418)
           at groovy.lang.Closure.call(Closure.java:412)
           at 
org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineShardingAlgorithm.getTargetShardingNode(InlineShardingAlgorithm.java:92)
           at 
org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineShardingAlgorithm.doSharding(InlineShardingAlgorithm.java:74)
           at 
org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:74)
           at 
org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:63)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeDataSources(ShardingStandardRoutingEngine.java:260)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route0(ShardingStandardRoutingEngine.java:248)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditionsWithCondition(ShardingStandardRoutingEngine.java:141)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditions(ShardingStandardRoutingEngine.java:134)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.getDataNodes(ShardingStandardRoutingEngine.java:101)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route(ShardingStandardRoutingEngine.java:83)
           at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:59)
           at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:46)
           at 
org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:58)
           at 
org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:55)
           at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:59)
           at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:51)
           at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:549)
           at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.addBatch(ShardingSpherePreparedStatement.java:630)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.executeBatchInsert(DefaultImporter.java:185)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.doFlush(DefaultImporter.java:154)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.tryFlush(DefaultImporter.java:136)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.flushInternal(DefaultImporter.java:129)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.flush(DefaultImporter.java:119)
           at 
org.apache.shardingsphere.data.pipeline.core.importer.DefaultImporter.runBlocking(DefaultImporter.java:98)
           at 
org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.start(AbstractLifecycleExecutor.java:52)
           at 
org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.run(AbstractLifecycleExecutor.java:90)
           at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown 
Source)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   apache-shardingsphere-5.3.0-shardingsphere-proxy-bin
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphereProxy
   ### Expected behavior
   DATA MIGRATION success
   ### Actual behavior
   DATA MIGRATION fail
   ### Reason analyze (If you can)
   It is suspected that the program itself is wrong. The config-sharding.yaml 
configuration file can be used to partition correctly, and the data insertion 
is also correct. Only an exception occurred during data migration.
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   1. config-sharding.yaml
   databaseName: sharding_db
   
   dataSources:
    ds_0:
      url: 
jdbc:mysql://xxx:3306/db1?useUnicode=true&autoReconnect=true&characterEncoding=utf8
      username: root
      password: xxx
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
    ds_1:
      url: 
jdbc:mysql://xxx:3306/db2?useUnicode=true&autoReconnect=true&characterEncoding=utf8
      username: root
      password: xxx
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
    ds_2:
      url: 
jdbc:mysql://xxx:3306/db3?useUnicode=true&autoReconnect=true&characterEncoding=utf8
      username: root
      password: xxx
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
   rules:
   - !SHARDING
    tables:
      table1:
        actualDataNodes: ds_${0..2}.table1_${1..20}
        databaseStrategy: 
           standard: 
             shardingColumn: id 
             shardingAlgorithmName: database_table1_inline # 分片算法名称
        tableStrategy:
          standard:
            shardingColumn: id
            shardingAlgorithmName: table1_inline
        keyGenerateStrategy:
          column: id
          keyGeneratorName: snowflake
    shardingAlgorithms:
      database_table1_inline:
        type: INLINE
        props:
          algorithm-expression: ds_${id % 3}
      table1_inline:
        type: INLINE
        props:
          algorithm-expression: table1_${id % 20+1}
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
   
   2. Configure the source storage units in proxy.
   REGISTER MIGRATION SOURCE STORAGE UNIT source1 (
       URL="jdbc:mysql://xxx:3306/db5?serverTimezone=UTC&useSSL=false",
       USER="root",
       PASSWORD="xxx",
       PROPERTIES("minPoolSize"="1","maxPoolSize"="20","idleTimeout"="60000")
   );
   
   
   3. Start data migration.
   MIGRATE TABLE source1 .table1 INTO table1;
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.

To unsubscribe, e-mail: 
[email protected]

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

Reply via email to