You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "vikiuvb (via GitHub)" <gi...@apache.org> on 2023/02/05 12:06:40 UTC

[GitHub] [shardingsphere] vikiuvb opened a new issue, #24010: Create sharding algorithm is missing

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

   ### Which version of ShardingSphere did you use?
   
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   946080bc60610bec379b52b07de6a25842977fc2
   
   ### Expected behavior
   
   ```
   CREATE SHARDING ALGORITHM database_inline (
     TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="ds_${user_id % 2}"))
   );
   ```
   
   Sharding algorithm to be created successfully. 
   
   ### Actual behavior
   
   Throws error
   ### Reason analyze (If you can)
   
   It looks like the `CREATE SHARDING ALGORITHM` support is removed from version 5.3.0. Only the `DROP SHARDING ALGORITHM` exists.
   
   I would like to understand whether this was an intentional change or removed by mistake during refactoring. 
   


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


[GitHub] [shardingsphere] RaigorJiang commented on issue #24010: Create sharding algorithm is missing

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24010:
URL: https://github.com/apache/shardingsphere/issues/24010#issuecomment-1421919367

   @vikiuvb @Pace2Car 
   Yes, my original intention was to reduce the number of APIs and reduce the cost of understanding for users. Now this does bring some problems. 
   We can continue the discussion.


-- 
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] vikiuvb commented on issue #24010: Create sharding algorithm is missing

Posted by "vikiuvb (via GitHub)" <gi...@apache.org>.
vikiuvb commented on issue #24010:
URL: https://github.com/apache/shardingsphere/issues/24010#issuecomment-1418948700

   @Pace2Car Thanks for the details. 
   
   My 1cents on this change. Rather than removing the functionality, we could have extracted the ShardingAlgorithm as a separate resource and introduced INLINE/EXTERNAL concept.
   ```
   -> DROP SHARDING TABLE RULE <rule_name>
   if (sharding algorithm used in rule is INLINE): 
         remove the sharding algorithm
   ```
   Repeating the same configurations across the tables violates the DRY principle. It is same as asking the developer to define the data source/storage unit every time per sharding rule.
   


-- 
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] vikiuvb commented on issue #24010: Create sharding algorithm is missing

Posted by "vikiuvb (via GitHub)" <gi...@apache.org>.
vikiuvb commented on issue #24010:
URL: https://github.com/apache/shardingsphere/issues/24010#issuecomment-1418027892

   @zhaojinchao95 I would love to understand the reason behind this decision. The `CREATE SHARDING ALGORITHM` DistSQL helped achieve DRY configurations - Capturing the commonly used algorithmic properties across multiple tables. 


-- 
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] zhaojinchao95 commented on issue #24010: Create sharding algorithm is missing

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #24010:
URL: https://github.com/apache/shardingsphere/issues/24010#issuecomment-1417779515

   @vikiuvb Hi, it's intentional changed.


-- 
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] Pace2Car commented on issue #24010: Create sharding algorithm is missing

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on issue #24010:
URL: https://github.com/apache/shardingsphere/issues/24010#issuecomment-1418449576

   Hi @vikiuvb, we refactored these DistSQL in #21659 to provide a more unified API. Now creating a rule only retains the cohesive mode. Deleting a rule will automatically clean up unused algorithms and retaining `DROP SHARDING ALGORITHM` is used to delete the algorithm registered from the configuration, such as YAML files.


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