sharding-proxy 5.1.2 如何使用distSQL 多分片键支持写入策略? #20961
Unanswered
atylbv9191
asked this question in
Q&A
Replies: 2 comments
-
sharding_columns = c1,c2 解决 |
Beta Was this translation helpful? Give feedback.
0 replies
-
remember, next time, use English. :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
5.1.2 文档中:strategyDefinition 中属性 TYPE 用于指定分片算法的类型,目前仅支持 STANDARD 、
COMPLEX。使用 COMPLEX 时需要用 SHARDING_COLUMNS 指定多个分片键。
问题描述:通过自定义策略插件创建了多分片键策略,yml如下:
在 distSQL 使用 SHARDING_COLUMNS 参数添加多分片键时候,出现语法错误 ;
错误语法1:
CREATE sharding TABLE rule tableName (
database_strategy (
type = complex,
sharding_columns (
"create_time ,sys_code"
),
sharding_algorithm (
type (NAME = time_sys_code_alg)
)
)
);
错误语法2:
CREATE sharding TABLE rule tableName (
database_strategy (
type = complex,
sharding_columns = "create_time ,sys_code",
sharding_algorithm (
type (NAME = time_sys_code_alg)
)
)
);
请问如何定义sharding_columns 多分片键的参数?
Beta Was this translation helpful? Give feedback.
All reactions