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 2019/05/23 05:26:08 UTC

[GitHub] [incubator-shardingsphere] luochao-hz opened a new issue #2433: 复合分片不支持范围查询问题

luochao-hz opened a new issue #2433: 复合分片不支持范围查询问题
URL: https://github.com/apache/incubator-shardingsphere/issues/2433
 
 
   @SuppressWarnings("unchecked")
       @Override
       public Collection<String> doSharding(final Collection<String> availableTargetNames, final Collection<RouteValue> shardingValues) {
           Map<String, Collection<Comparable<?>>> columnShardingValues = new HashMap<>(shardingValues.size(), 1);
           String logicTableName = "";
           for (RouteValue each : shardingValues) {
   //强制转换为ListRouteValue,不适合范围查询
               columnShardingValues.put(each.getColumnName(), ((ListRouteValue) each).getValues());
               logicTableName = each.getTableName();
           }
           Collection<String> shardingResult = shardingAlgorithm.doSharding(availableTargetNames, new ComplexKeysShardingValue(logicTableName, columnShardingValues));
           Collection<String> result = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
           result.addAll(shardingResult);
           return result;
       }

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services