You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/20 10:03:45 UTC

[GitHub] [shardingsphere] pedesdestiny opened a new issue, #18458: multiple datasource route table error ?

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

   springboot:1.5.4.RELEASE
   sharding.sphere:3.0.0.M2
   mysql:5.7.24-log
   
   config:
   `sharding:
     jdbc:
       db:
         schema: crm_was
       datasource:
          names: crm_was,main_data,crm_was_0,crm_was_1,crm_was_2,crm_was_3,crm_was_4,crm_was_5,crm_was_6,crm_was_7,crm_was_8,crm_was_9
          main_data:
   		type: com.zaxxer.hikari.HikariDataSource
   		.......
          crm_was:
   		.......
          crm_was_0:
           .......
          crm_was_1:
   		.......
          crm_was_2:
   		.......
       config:
         sharding:
           tables:
             waybill_analysis_base:
                actual-data-nodes: crm_was_$->{0..9}.waybill_analysis_base_$->{0..99}
                table-strategy:
                  inline:
                    sharding-column: waybill_id
                    algorithm-expression: waybill_analysis_base_$->{waybill_id%100}
                database-strategy:
                   inline:
                     sharding-column: waybill_id
                     algorithm-expression: crm_was_$->{(waybill_id/100).longValue()%10}
                key-generator-column-name: waybill_id
             employee:
                actual-data-nodes: main_data.employee
                table-strategy:
                  inline:
                    sharding-column: id
                    algorithm-expression: employee
                database-strategy:
                   inline:
                     sharding-column: id
                     algorithm-expression: main_data
                key-generator-column-name: id
             department:
                actual-data-nodes: main_data.department
                table-strategy:
                  inline:
                    sharding-column: id
                    algorithm-expression: department
                database-strategy:
                   inline:
                     sharding-column: id
                     algorithm-expression: main_data
                key-generator-column-name: id             
           default-data-source-name: crm_was`
   
   There is multiple dataNodes. crm_was_0~9 are sub database and sub table, crm_was and main_data are single dataNode. 'default-data-source-name' is configed with 'crm_was', so i config 'main_data' in sharding rules. 
   
   problems:
   query single table of crm_was is ok.  but when i use sub or join to query table of crm_was, then routing to main_data error occurs.  like this: 
   
   ![image](https://user-images.githubusercontent.com/4444055/174577053-2441d93e-6994-424a-a9b1-2cd851c34f78.png)
   
   
   thanks for your answer!!!
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #18458: multiple datasources route table error ?

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18458:
URL: https://github.com/apache/shardingsphere/issues/18458#issuecomment-1164395933

   This version is out of service, please try version 5.x


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] pedesdestiny commented on issue #18458: multiple datasources route table error ?

Posted by GitBox <gi...@apache.org>.
pedesdestiny commented on issue #18458:
URL: https://github.com/apache/shardingsphere/issues/18458#issuecomment-1165175183

   > This version is out of service, please try version 5.x
   
   Thank you for your remind. Any version can support this way applying table in sharding rules directly?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu closed issue #18458: multiple datasources route table error ?

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #18458: multiple datasources route table error ?
URL: https://github.com/apache/shardingsphere/issues/18458


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org