hongbofan commented on issue #32832:
URL:
https://github.com/apache/shardingsphere/issues/32832#issuecomment-2347988674
> @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 way i create sharding algorithm,
CREATE SHARDING ALGORITHM source_date_complex (
TYPE(NAME=CLASS_BASED,PROPERTIES("defTable"="o2pcm_multimedia","sources"="mall,customer","strategy"="COMPLEX","algorithmClassName"="com.qx.agg.client.sharding.SourceDateComplexShardingAlgorithm"))
);
get a error message
You have an error in your SQL syntax: no viable alternative at input
‘CREATESHARDING’ near ‘[@2,47:54=‘SHARDING’,<864>,1:47]’ at line 1
--
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]