You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/07/28 09:10:44 UTC
[GitHub] [shardingsphere] zjcnb edited a comment on issue #11522: java.lang.NullPointerException: Inline sharding algorithm expression cannot be null.
zjcnb edited a comment on issue #11522:
URL: https://github.com/apache/shardingsphere/issues/11522#issuecomment-888146840
@18435753200 Hi,Can you try use this config:
`spring:
shardingsphere:
datasource:
names: ds0
ds0:
username: root
password: 123456
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
rules:
sharding:
tables:
t_user:
actual-data-nodes: ds0.t_user$->{0..1}
table-strategy:
standard:
sharding-column: id
sharding-algorithm-name: table-inline
sharding-algorithms:
table-inline:
type: INLINE
props:
algorithm-expression: t_user$->{id % 2}
props:
sql.show: true
`
By the way,If you have not solved your problem, you can provide more information!
--
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