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

   ## Question
   `
   java.lang.NullPointerException: null
           at 
org.apache.shardingsphere.infra.rewrite.engine.RouteSQLRewriteEngine.translate(RouteSQLRewriteEngine.java:160)
           at 
org.apache.shardingsphere.infra.rewrite.engine.RouteSQLRewriteEngine.rewrite(RouteSQLRewriteEngine.java:76)
           at 
org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry.rewrite(SQLRewriteEntry.java:83)
           at 
org.apache.shardingsphere.infra.connection.kernel.KernelProcessor.rewrite(KernelProcessor.java:66)
           at 
org.apache.shardingsphere.infra.connection.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:52)
           at 
org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.generateExecutionContexts(DatabaseConnector.java:175)
           at 
org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:168)
           at 
org.apache.shardingsphere.proxy.backend.handler.data.impl.UnicastDatabaseBackendHandler.execute(UnicastDatabaseBackendHandler.java:62)
           at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal.bind(Portal.java:106)
           at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:55)
           at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.PostgreSQLAggregatedCommandExecutor.execute(PostgreSQLAggregatedCommandExecutor.java:41)
        
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
           at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:750)
   `
   
   下面是分片配置
   `
   databaseName: zw-business
   #
   dataSources:
    ds_0:
      url: 
jdbc:postgresql://192.168.209.128:5432/zw-business?characterEncoding=utf-8
      username: dbuser_dba
      password: DBUser.DBA
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
    ds_1:
      url: 
jdbc:postgresql://192.168.209.137:5432/zw-business?characterEncoding=utf-8
      username: dbuser_dba
      password: DBUser.DBA
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
   rules:
   - !SHARDING
    tables:
      user:
        actualDataNodes: ds$->{0..1}.user_$->{0..2}
        tableStrategy:
          standard:
            shardingColumn: id
            shardingAlgorithmName: user_inline
        keyGenerateStrategy:
          column: id
          keyGeneratorName: snowflake
        auditStrategy:
          auditorNames:
            - sharding_key_required_auditor
          allowHintDisable: true
    bindingTables:
      - user
    defaultDatabaseStrategy:
      standard:
        shardingColumn: id
        shardingAlgorithmName: database_inline
    defaultTableStrategy:
      none:
    defaultAuditStrategy:
      auditorNames:
        - sharding_key_required_auditor
      allowHintDisable: true
   
    shardingAlgorithms:
      database_inline:
        type: INLINE
        props:
          algorithm-expression: ds_${id % 2}
      user_inline:
        type: INLINE
        props:
          algorithm-expression: user_${id % 3}
   
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
   
    auditors:
      sharding_key_required_auditor:
        type: DML_SHARDING_CONDITIONS
   
   - !BROADCAST
    tables:
      - loudong
   `
   


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