RaigorJiang commented on issue #32832:
URL: 
https://github.com/apache/shardingsphere/issues/32832#issuecomment-2347971260

   @hongbofan 
   If you do not want to add the SPI Services file, you can also specify the 
full path of the custom algorithm with `CLASS BASED` type. The following is an 
example
   
   ```sql
   CREATE SHARDING TABLE RULE t_order (
   DATANODES("ds_${0..2}.t_order_${0..3}"),
   DATABASE_STRATEGY(TYPE="standard",
   SHARDING_COLUMN=order_id,
   SHARDING_ALGORITHM(TYPE(NAME="CLASS_BASED",
   PROPERTIES(
   "strategy"="standard", 
"algorithmClassName"="com.sphereex.example.fixture.CustomShardingAlgorithm",
   "mod-value-length"=5,"mod-count"=3)
   ))),
   TABLE_STRATEGY(TYPE="standard",
   SHARDING_COLUMN=order_id,
   SHARDING_ALGORITHM(TYPE(NAME="CLASS_BASED",
   PROPERTIES(
   "strategy"="standard", 
"algorithmClassName"="com.sphereex.example.fixture.CustomShardingAlgorithm",
   "mod-value-length"=5,"mod-count"=4)
   )))
   );
   ```


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

Reply via email to