Received exception from server (version 20.8.7):
Code: 42. DB::Exception: Received from localhost:9000. DB::Exception: Storage ReplicatedMergeTree requires 5 to 6 parameters:
path in ZooKeeper,
replica name,
name of column with date,
[sampling element of primary key],
primary key expression,
index granularity
Syntax for the MergeTree table engine:
CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
(
name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1] [TTL expr1],
name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2] [TTL expr2],
...
INDEX index_name1 expr1 TYPE type1(...) GRANULARITY value1,
INDEX index_name2 expr2 TYPE type2(...) GRANULARITY value2
) ENGINE = MergeTree()
ORDER BY expr
[PARTITION BY expr]
[PRIMARY KEY expr]
[SAMPLE BY expr]
[TTL expr [DELETE|TO DISK 'xxx'|TO VOLUME 'xxx'], ...]
[SETTINGS name=value, ...]
See details in documentation: https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/mergetree/. Other engines of the family support different syntax, see details in the corresponding documentation topics.
If you use the Replicated version of engines, see https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/replication/.
.
7条答案
按热度按时间clj7thdc1#
支持的,遇到什么不支持的语法了?
owfi6suc2#
支持的,遇到什么不支持的语法了?
比如如下的建表语句在clickhouse上执行会由于没有指定主键会报错:
报错信息如下:
使用1.2.6版本能正常解析出statement却没有报错产生。
brccelvz3#
补充下:其中on cluster xxx 不支持, primary key xxx 不支持,partition by 不支持,TTL语法不支持。
nbysray54#
+1
qrjkbowd5#
+1
de90aj5v6#
+1
noj0wjuj7#
支持的,遇到什么不支持的语法了?
on cluster xxx 不支持, primary key xxx 不支持,partition by 不支持,TTL语法不支持,这几种语法有计划支持吗