Skip to content

version 5.5.2 can not sharding #35425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zt9788 opened this issue May 15, 2025 · 0 comments
Open

version 5.5.2 can not sharding #35425

zt9788 opened this issue May 15, 2025 · 0 comments

Comments

@zt9788
Copy link

zt9788 commented May 15, 2025

When Use the 5.5.1(ShardingSpere-JDBC) it is ok

#Mysql
2025-05-15 11:49:15.846 [] [main] [] DEBUG c.h.e.e.i.r.m.A.selectList.debug(135): - ==>  Preparing: SELECT id,uid,first_msg,ai_agent_id,ai_base_session_id,param_config,tenant_id,del_flag,create_time,update_time,create_by,update_by FROM ai_agent_session WHERE (uid = ?)
2025-05-15 11:49:17.581 [] [main] [] DEBUG c.h.e.e.i.r.m.A.selectList.debug(135): - ==> Parameters: jqkj(String)

but when use the 5.5.2, this sql can not sharding( will use then union ) select ... from ai_agent_session_0 union all select ... from ai_agent_session_1 .....

Sharding Config:

              tables:
                ai_agent_session:
                  actual-data-nodes: shardingmaster.ai_agent_session_${0..15}
                  table-strategy:
                    standard:
                      sharding-column: uid
                      sharding-algorithm-name: ai_agent_session_hash_mod
                  keyGenerateStrategy:
                    column: id
                    keyGeneratorName: snowflake
                    worker:
                      id: 1
              sharding-algorithms:
                ai_agent_session_hash_mod:
                  type: INLINE
                  props:
                    algorithm-expression: ai_agent_session_${Math.abs(uid.hashCode()) % 16}

i fllow the code createShardingConditions return list(0) in shardingspere 5.5.2, but 5.5.1 return list(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant