jinpengSun commented on issue #23479:
URL:
https://github.com/apache/shardingsphere/issues/23479#issuecomment-1378148819
Hi @sandynz,I don't know what the problem is. If there is a problem with the
groovy inline expression, it should be a problem when performing data
fragmentation, but it is normal when I insert data. This exception only occurs
during data migration.
This is the content of my config-sharding.yaml configuration file. Thank you
for your investigation. Please feel free to contact me if you need anything
else. Thank you.
`databaseName: sharding_db
dataSources:
ds_0:
url:
jdbc:mysql://127.0.0.1:3306/db1?useUnicode=true&autoReconnect=true&characterEncoding=utf8
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url:
jdbc:mysql://127.0.0.1:3306/db2?useUnicode=true&autoReconnect=true&characterEncoding=utf8
username: root
password: rootŐ
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_2:
url:
jdbc:mysql://127.0.0.1:3306/db3?useUnicode=true&autoReconnect=true&characterEncoding=utf8
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !SHARDING
tables:
table1:
actualDataNodes: ds_${0..2}.table1_${1..20}
databaseStrategy: # 分库策略,缺省表示使用默认分库策略,以下的分片策略只能选其一
standard: # 用于单分片键的标准分片场景
shardingColumn: id # 分片列名称
shardingAlgorithmName: database_table1_inline # 分片算法名称
tableStrategy:
standard:
shardingColumn: id
shardingAlgorithmName: table1_inline
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
shardingAlgorithms:
database_table1_inline:
type: INLINE
props:
algorithm-expression: ds_${id % 3}
table1_inline:
type: INLINE
props:
algorithm-expression: table1_${id % 20+1}
keyGenerators:
snowflake:
type: SNOWFLAKE`
--
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]