CREATE TABLE test_table
(
label_id
int(11) NOT NULL COMMENT “标签标识”,
update_time
datetime NOT NULL COMMENT “更新时间”,
label_value
varchar(128) NULL COMMENT “标签值”,
seq_id_bitmap
bitmap BITMAP_UNION NOT NULL COMMENT “SeqID集合”
) ENGINE=OLAP
AGGREGATE KEY(label_id
, update_time
, label_value
)
COMMENT “测试”
PARTITION BY RANGE(update_time
)
(PARTITION p20230113 VALUES [(‘0000-01-01 00:00:00’), (‘2023-01-14 00:00:00’)),
PARTITION p20230114 VALUES [(‘2023-01-14 00:00:00’), (‘2023-01-15 00:00:00’)),
PARTITION p20230115 VALUES [(‘2023-01-15 00:00:00’), (‘2023-01-16 00:00:00’)),
PARTITION p20230116 VALUES [(‘2023-01-16 00:00:00’), (‘2023-01-17 00:00:00’)),
PARTITION p20230117 VALUES [(‘2023-01-17 00:00:00’), (‘2023-01-18 00:00:00’)),
PARTITION p20230118 VALUES [(‘2023-01-18 00:00:00’), (‘2023-01-19 00:00:00’)),
PARTITION p20230119 VALUES [(‘2023-01-19 00:00:00’), (‘2023-01-20 00:00:00’)),
PARTITION p20230120 VALUES [(‘2023-01-20 00:00:00’), (‘2023-01-21 00:00:00’)),
PARTITION p20230121 VALUES [(‘2023-01-21 00:00:00’), (‘2023-01-22 00:00:00’)),
PARTITION p20230122 VALUES [(‘2023-01-22 00:00:00’), (‘2023-01-23 00:00:00’)),
PARTITION p20230123 VALUES [(‘2023-01-23 00:00:00’), (‘2023-01-24 00:00:00’)),
PARTITION p20230124 VALUES [(‘2023-01-24 00:00:00’), (‘2023-01-25 00:00:00’)),
PARTITION p20230125 VALUES [(‘2023-01-25 00:00:00’), (‘2023-01-26 00:00:00’)),
PARTITION p20230126 VALUES [(‘2023-01-26 00:00:00’), (‘2023-01-27 00:00:00’)),
PARTITION p20230127 VALUES [(‘2023-01-27 00:00:00’), (‘2023-01-28 00:00:00’)),
PARTITION p20230128 VALUES [(‘2023-01-28 00:00:00’), (‘2023-01-29 00:00:00’)),
PARTITION p20230129 VALUES [(‘2023-01-29 00:00:00’), (‘2023-01-30 00:00:00’)),
PARTITION p20230130 VALUES [(‘2023-01-30 00:00:00’), (‘2023-01-31 00:00:00’)),
PARTITION p20230131 VALUES [(‘2023-01-31 00:00:00’), (‘2023-02-01 00:00:00’)),
PARTITION p20230201 VALUES [(‘2023-02-01 00:00:00’), (‘2023-02-02 00:00:00’)),
PARTITION p20230202 VALUES [(‘2023-02-02 00:00:00’), (‘2023-02-03 00:00:00’)),
PARTITION p20230203 VALUES [(‘2023-02-03 00:00:00’), (‘2023-02-04 00:00:00’)),
PARTITION p20230204 VALUES [(‘2023-02-04 00:00:00’), (‘2023-02-05 00:00:00’)),
PARTITION p20230205 VALUES [(‘2023-02-05 00:00:00’), (‘2023-02-06 00:00:00’)),
PARTITION p20230206 VALUES [(‘2023-02-06 00:00:00’), (‘2023-02-07 00:00:00’)),
PARTITION p20230207 VALUES [(‘2023-02-07 00:00:00’), (‘2023-02-08 00:00:00’)),
PARTITION p20230208 VALUES [(‘2023-02-08 00:00:00’), (‘2023-02-09 00:00:00’)),
PARTITION p20230209 VALUES [(‘2023-02-09 00:00:00’), (‘2023-02-10 00:00:00’)),
PARTITION p20230210 VALUES [(‘2023-02-10 00:00:00’), (‘2023-02-11 00:00:00’)),
PARTITION p20230211 VALUES [(‘2023-02-11 00:00:00’), (‘2023-02-12 00:00:00’)),
PARTITION p20230212 VALUES [(‘2023-02-12 00:00:00’), (‘2023-02-13 00:00:00’)),
PARTITION p20230213 VALUES [(‘2023-02-13 00:00:00’), (‘2023-02-14 00:00:00’)),
PARTITION p20230214 VALUES [(‘2023-02-14 00:00:00’), (‘2023-02-15 00:00:00’)),
PARTITION p20230215 VALUES [(‘2023-02-15 00:00:00’), (‘2023-02-16 00:00:00’)),
PARTITION p20230216 VALUES [(‘2023-02-16 00:00:00’), (‘2023-02-17 00:00:00’)),
PARTITION p20230217 VALUES [(‘2023-02-17 00:00:00’), (‘2023-02-18 00:00:00’)),
PARTITION p20230218 VALUES [(‘2023-02-18 00:00:00’), (‘2023-02-19 00:00:00’)),
PARTITION p20230219 VALUES [(‘2023-02-19 00:00:00’), (‘2023-02-20 00:00:00’)),
PARTITION p20230220 VALUES [(‘2023-02-20 00:00:00’), (‘2023-02-21 00:00:00’)),
PARTITION p20230221 VALUES [(‘2023-02-21 00:00:00’), (‘2023-02-22 00:00:00’)),
PARTITION p20230222 VALUES [(‘2023-02-22 00:00:00’), (‘2023-02-23 00:00:00’)))
DISTRIBUTED BY HASH(label_id
, label_value
) BUCKETS 3
PROPERTIES (
“replication_num” = “3”,
“dynamic_partition.enable” = “true”,
“dynamic_partition.time_unit” = “DAY”,
“dynamic_partition.time_zone” = “Asia/Shanghai”,
“dynamic_partition.start” = “-2147483648”,
“dynamic_partition.end” = “2”,
“dynamic_partition.prefix” = “p”,
“dynamic_partition.buckets” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”
);