CREATE TABLE IF NOT EXISTS test_db.example_tbl_range_more_123
(
user_id
LARGEINT NOT NULL COMMENT "用户id",
date
DATE NOT NULL COMMENT "数据灌入日期时间",
city
VARCHAR(20) COMMENT "用户所在城市",
age
SMALLINT COMMENT "用户年龄",
sex
TINYINT COMMENT "用户性别"
)
ENGINE=OLAP
PARTITION BY RANGE(date
, user_id
)
(
PARTITION p201701_1000
VALUES LESS THAN ("2017-02-01", "1000"),
PARTITION p201702_2000
VALUES LESS THAN ("2017-03-01", "2000"),
PARTITION p201703_all
VALUES LESS THAN ("2017-04-01")
)
DISTRIBUTED BY HASH(user_id
) BUCKETS 5
PROPERTIES
(
"replication_num" = "3",
"storage_medium" = "SSD",
"storage_cooldown_time" = "2024-09-30 12:00:00"
);
使用上述语句建表时,出现SQL 错误 [1105] [HY000]: errCode = 2, detailMessage = Failed to create partition[p201702_2000]. Error: 18749: [(192.168.147.110)[E-300]fail to create tablet. tablet_id=582565];
但是如果把分桶数设置为1,则成功执行! doris版本为2.1.1 三个be 一个fe环境。