You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "robben009 (via GitHub)" <gi...@apache.org> on 2024/07/10 10:31:56 UTC

[I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   5.5version
   
   `
   dataSources:
     ds_0:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.jdbc.Driver
       jdbcUrl: *
       username: *
       password: *
   
   rules:
     - !SINGLE
       tables:
         - "*.*"
       defaultDataSource: ds_0
     - !SHARDING
       tables:
         test_order:
           actualDataNodes: ds_0.test_order_${0..1}
           tableStrategy:
             standard:
               shardingColumn: id
               shardingAlgorithmName: OrderShardingRules
       bindingTables:
         - test_order
       shardingAlgorithms:
         OrderShardingRules:
           type: CLASS_BASED
           props:
             strategy: STANDARD
             algorithmClassName: *
   `
   
   Then I use the following code
   `
       @Operation(summary = "查询订单")
       @PostMapping("/order")
       public TestOrder order() {
           HintManager hintManager = HintManager.getInstance();
           hintManager.addTableShardingValue("test_order", 1);
   
           TestOrder t = testOrderService.getOne(new LambdaQueryWrapper<TestOrder>()
                   .eq(TestOrder::getUserId, "100")
                   .eq(TestOrder::getOrderStatus, 40), false);
           hintManager.clear();
   
           return t;
       }
   `
   
   I found that no matter how " hintManager.addTableShardingValue("test_order", 1);"   is written, data can be found,It's like a full table scan
   
   Why is this?


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   Please try to use JDBC to reproduce your issue first.


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #32056: hintManager.addTableShardingValue ,No effect
URL: https://github.com/apache/shardingsphere/issues/32056


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   <img width="2946" height="876" alt="Image" src="https://github.com/user-attachments/assets/6ec3a45b-c793-48bc-bce5-bb027f633916" />
   why getTableShardingValuesFromHint() or similar hint-based methods aren't typically used as a "fallback" in the traditional sense.


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   @terrymanu 


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   The issue involves other third-party dependencies, but our focus is solely on ShardingSphere itself. Since ShardingSphere implements the JDBC interface, standard applications should be functional. We wish to allocate more effort towards enhancing the current version, and therefore will no longer handle such issues. Please read the documentation or provide more effective information when submitting an issue.


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   > The issue involves other third-party dependencies, but our focus is solely on ShardingSphere itself. Since ShardingSphere implements the JDBC interface, standard applications should be functional. We wish to allocate more effort towards enhancing the current version, and therefore will no longer handle such issues. Please read the documentation or provide more effective information when submitting an issue.
   
   
   Hi @terrymanu,
   
   Thanks for the reply. I want to clarify that this is not a third-party bug.
   
   The issue here is a common usage scenario:
   
   For a table configured with standard sharding, we expect HintManager.addTableShardingValue to allow routing to a specific shard.
   
   Currently, it has no effect and seems like a full table scan is performed.
   
   This is not caused by other dependencies, but a limitation in ShardingSphere itself.
   Standard sharding should support using HintManager to specify the target table for special tasks like batch processing.
   
   Could this be considered a feature enhancement for future versions?
   
   Thanks!
   


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   +1


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   https://github.com/Dr-wgy/shardingsphere/commit/ffcab022f9813031ffd68f47840157c4ec9b4182


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


Re: [I] hintManager.addTableShardingValue ,No effect [shardingsphere]

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

   <img width="2876" height="1724" alt="Image" src="https://github.com/user-attachments/assets/c6f90f74-606e-49cb-82a5-003f6ec06cd3" />
    i guess you can use simple project can reproduce this issue  JPA + sharding-jdbc 


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