You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "dasonXu (via GitHub)" <gi...@apache.org> on 2023/02/16 09:29:39 UTC

[GitHub] [shardingsphere] dasonXu opened a new issue, #24197: Why do I have to configure the table rule when I use the hint algorithm?

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

   Why do I have to configure the table rule when I use the hint algorithm?
   
   the version of sharding-jdbc: 5.2.1
   
   the config:
   
   `spring.shardingsphere.rules.sharding.default-database-strategy.hint.sharding-algorithm-name=myHint
   spring.shardingsphere.rules.sharding.default-table-strategy.none
   spring.shardingsphere.rules.sharding.sharding-algorithms.myHint.type=CLASS_BASED
   spring.shardingsphere.rules.sharding.sharding-algorithms.myHint.props.strategy=HINT
   spring.shardingsphere.rules.sharding.sharding-algorithms.myHint.props.algorithmClassName=xxxxx`
   
   **i only want to sharding database without sharding tables, but the configure is not works, it must config the table what u want to sharding**
   
   because of the source code, it will new ShardingIgnoreRoutingEngine ?
   
   <img width="1240" alt="image" src="https://user-images.githubusercontent.com/34209278/219324122-c7c6de1c-8a1d-483d-b371-c4019b584334.png">
   
   so when i want to sharding database without sharding tables. also need me add all tables config to the file?
   
   
   


-- 
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] dasonXu commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "dasonXu (via GitHub)" <gi...@apache.org>.
dasonXu commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1432946928

   > i think u should config at least 1 sharding table rule to make the default strategy effective
   
   <img width="1043" alt="image" src="https://user-images.githubusercontent.com/34209278/219353349-4f46acd2-3989-466a-8819-260c506614cc.png">
   
   it will compare sql tables and config tables, if u have not config, the sql will not rote to the database.


-- 
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] Qianyi951015 commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "Qianyi951015 (via GitHub)" <gi...@apache.org>.
Qianyi951015 commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1432973736

   > > i think u should config at least 1 sharding table rule to make the default strategy effective
   > 
   > so, when i config a fake table, then all table will use my default-database-strategy?
   
   no, I don't think ShardingSphere currently support sharding the whole database


-- 
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] RaigorJiang commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1433004049

   ShardingSphere needs to explicitly declare which tables need to be sharded and how the tables are distributed.
   Otherwise, if user do not specify a hint value when execute query, how does ShardingSphere choose a route?


-- 
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] Qianyi951015 commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "Qianyi951015 (via GitHub)" <gi...@apache.org>.
Qianyi951015 commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1432874517

   i think u should config at least 1 sharding table rule to make the default strategy effective


-- 
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] dasonXu commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "dasonXu (via GitHub)" <gi...@apache.org>.
dasonXu commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1433990680

   > ShardingSphere needs to explicitly declare which tables need to be sharded and how the tables are distributed. Otherwise, if user do not specify a hint value when execute query, how does ShardingSphere choose a route?
   
   sure i have specified a hint value(a tenantId in the code),  now i only want to sharding database with all tables.


-- 
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] RaigorJiang commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1433997425

   @dasonXu  OK, we can use `defaultDatabaseStrategy` to simplify some configurations, but still need to declare the name and `dataNodes` of each sharding table in the sharding rule.
   
   ShardingSphere needs to adapt to the usage scenarios of most users. If your needs are not met, are you willing to submit a PR to realize it?


-- 
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] dasonXu commented on issue #24197: Why do I have to configure the table rule when I use the hint algorithm?

Posted by "dasonXu (via GitHub)" <gi...@apache.org>.
dasonXu commented on issue #24197:
URL: https://github.com/apache/shardingsphere/issues/24197#issuecomment-1432930801

   > i think u should config at least 1 sharding table rule to make the default strategy effective
   
   so, when i config a fake table, then all table will use my default-database-strategy?


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