You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Soora33 (via GitHub)" <gi...@apache.org> on 2023/05/01 03:42:52 UTC
[GitHub] [shardingsphere] Soora33 opened a new issue, #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
Soora33 opened a new issue, #25425:
URL: https://github.com/apache/shardingsphere/issues/25425
Why can't we query by id when using id as the sharding column? Similarly, when I switch to age as the sharding column, age cannot be used as the query condition either. Here is my configuration.
`
shardingsphere:
datasource:
names: ds0
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/sora33?serverTimezone=UTC
username: root
password: root
rules:
sharding:
tables:
user:
actual-data-nodes: ds0.sora_user0$->{1..2}
table-strategy:
standard:
sharding-column: id
sharding-algorithm-name: user-inline
sharding-algorithms:
user-inline:
type: INLINE
props:
algorithm-expression: sora_user0${id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
sql-show: true`
--
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] Soora33 commented on issue #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
Posted by "Soora33 (via GitHub)" <gi...@apache.org>.
Soora33 commented on issue #25425:
URL: https://github.com/apache/shardingsphere/issues/25425#issuecomment-1529313462
<img width="1132" alt="image" src="https://user-images.githubusercontent.com/99789477/235403547-e8298b41-5c32-412b-bea5-df56f4d5331e.png">
This is the error message. So far, there is no problem with sharding storage based on the id column, and full queries also return all data from two tables. However, once querying based on the sharding column as a condition, an error occurs.
--
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] RaigorJiang closed issue #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
URL: https://github.com/apache/shardingsphere/issues/25425
--
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] Soora33 commented on issue #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
Posted by "Soora33 (via GitHub)" <gi...@apache.org>.
Soora33 commented on issue #25425:
URL: https://github.com/apache/shardingsphere/issues/25425#issuecomment-1529336180
The problem has been solved. I set the accepted parameter type to String, but it should be Long. String cannot use the % operator for operations, so an error occurred.
--
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 #25425: Inline sharding algorithms expression `%s` and sharding column `%s` do not match.
Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25425:
URL: https://github.com/apache/shardingsphere/issues/25425#issuecomment-1531401180
> The problem has been solved. I set the accepted parameter type to String, but it should be Long. String cannot use the % operator for operations, so an error occurred.
You can close this issue if this problem are solved.
--
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