ym0506 commented on issue #37282: URL: https://github.com/apache/shardingsphere/issues/37282#issuecomment-3984512418
I reproduced this issue on current master, and the behavior matches the report: HASH_MOD uses shardingValue.hashCode(), so the same numeric value can route differently by Java type (for example Integer(-1) vs Long(-1)). I’d like to take this issue and open a PR. Planned changes: Normalize Number sharding values to a canonical numeric form before hashing, so equal numeric values route consistently across Integer/Long/BigInteger, while keeping non-Number behavior unchanged. Add regression tests in HashModShardingAlgorithmTest for mixed numeric types with the same value. Update ShardingSphereDriverTest#assertHashModSetLongOnIntColumnWorks to use -1 (remove the current TODO) as an end-to-end verification. I will start implementing 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
