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

[GitHub] [shardingsphere] zhong2312 opened a new issue, #26742: About ComplexKeysShardingAlgorithm

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

   In the doSharding method of ComplexKeysShardingAlgorithm, the inability to obtain columnName and dataNodeInfo prevents the automatic sharding and the application of the sharding algorithm for the automatic sharding strategy in DISTSQL.
   
   To address this issue, PreciseShardingValue and RangeShardingValue should be included in ComplexKeysShardingValue, as shown below:
   
   java
   Copy code
   public final class ComplexKeysShardingValue<T extends Comparable<?>> implements ShardingValue {
       
       private final String logicTableName;
       
       private final Map<String, PreciseShardingValue<T>> columnNameAndShardingValuesMap;
       
       private final Map<String, RangeShardingValue<T>> columnNameAndRangeValuesMap;
   }
   
   My requirements are as follows:
   /**
   Composite Field Sharding Algorithm
   Ensure that the last N digits of the participating fields are consistent.
   Support multiple fields for sharding.
   Since multiple fields have the same last N digits, routing to the target table can be done with any of the fields.
   Use case:
   For example, when sharding orders by user ID, querying by order ID alone cannot route to the target table.
   In this case, if the last N digits of the order ID are consistent with the user ID, it is possible to query by either the user ID or the order ID.
   */
   public class CombineHashMod implements ComplexKeysShardingAlgorithm<Comparable<?>>, ShardingAutoTableAlgorithm {
    @Override
    public Collection<String> doSharding(Collection<String> availableTargetNames, ComplexKeysShardingValue<Comparable<?>> shardingValue);
   }


-- 
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] About ComplexKeysShardingAlgorithm [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #26742: About ComplexKeysShardingAlgorithm
URL: https://github.com/apache/shardingsphere/issues/26742


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


[GitHub] [shardingsphere] github-actions[bot] commented on issue #26742: About ComplexKeysShardingAlgorithm

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #26742:
URL: https://github.com/apache/shardingsphere/issues/26742#issuecomment-1662897730

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


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