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/05/10 07:52:29 UTC
[GitHub] [shardingsphere] grapeqin commented on issue #4622: ComplexKeysShardingAlgorithm support different types of columns?
grapeqin commented on issue #4622:
URL: https://github.com/apache/shardingsphere/issues/4622#issuecomment-1122050227
in 5.1.1 version ,please take the following steps:
1. implement ComplexKeysShardingAlgorithm<Comparable<?>> create my own ClassBasedShardingAlgorithm
2. override doSharding(Collection<String> availableTargetNames, ComplexKeysShardingValue<Comparable<?>> shardingValue) method
3. get each ColumnNameAndShardingValue from shardingValue
`Map<String, Collection<Comparable<?>>> shardingMap = shardingValue.getColumnNameAndShardingValuesMap();
Collection<Comparable<?>> uidCollection = shardingMap.get("no");
Collection<Comparable<?>> orderNoCollection = shardingMap.get("id");
`
--
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