wsg96321 opened a new issue #15727:
URL: https://github.com/apache/shardingsphere/issues/15727
version: sharding proxy v5.1.0
Hi, I have many resource in a schema like test, it names ds_1,ds_2....ds_100
and other ds_500..ds_600. When I use distSQL with my own defined algorithm ,
I should use the sql like
```
CREATE SHARDING ALGORITHM hint_common (
TYPE(NAME=COMMON_SHARD)
);
CREATE SHARDING TABLE RULE hero (
DATANODES("ds_${1..100}.hero,ds_${500..600}"),
DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=id,SHARDING_ALGORITHM=hint_common)
);
```
Besides, the table `hero` is in all resource . So I want to now , how to
auto discover the datanodes ? like below, though it is wrong:
```
CREATE SHARDING TABLE RULE hero (
DATANODES("*"),
DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=id,SHARDING_ALGORITHM=hint_common)
);
or
CREATE SHARDING TABLE RULE hero (
DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=id,SHARDING_ALGORITHM=hint_common)
);
```
I think it is very useful for people when one table in all resources ,
especially when I have to delete some dataresource in my schema. Eg. I have to
delete ds_50 and ds_550 in this case , so I have to execute this sql (when I
have to delete many nodes it will be so complex , though I can also use
enumerate with many numbers ) :
```
ALTER SHARDING TABLE RULE hero(
DATANODES("ds_${1..49}.hero,ds_${51..100}.hero,ds_${500..549}.hero,ds_${551..600}.hero")
);
```
--
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]