Doris入门篇-分区分桶实验

news2024/11/25 4:59:19

简介

测试分区分桶效果。

分区的基本操作

添加分区

ALTER TABLE v2x_olap_database.government_car
ADD PARTITION p20221203 VALUES LESS THAN ("2022-12-04");

动态分区表不能添加分区,需要转为手动分区表。

查看分区 

show partitions from <表名>

删除分区 

alter table <表名>
drop partition <分区名>

手动分区表与动态分区表切换
手动转自动

alter table <表名> set ("dynamic_partition.enable" = "true")

注意: 如果设置了 dynamic_partition.start ,则分区范围在偏移量之前的历史分区将被删除

自动转手动

alter table <表名> set ("dynamic_partition.enable" = "false")

分区和分桶

Doris 支持两层的数据划分。第一层是 Partition,支持 Range 和 List 的划分方式。第二层是 Bucket(Tablet),仅支持 Hash 的划分方式。

也可以仅使用一层分区。使用一层分区时,只支持 Bucket 划分。下面我们来分别介绍下分区以及分桶:

  1. Partition

    • Partition 列可以指定一列或多列,分区列必须为 KEY 列。多列分区的使用方式在后面 多列分区 小结介绍。
    • 不论分区列是什么类型,在写分区值时,都需要加双引号。
    • 分区数量理论上没有上限。
    • 当不使用 Partition 建表时,系统会自动生成一个和表名同名的,全值范围的 Partition。该 Partition 对用户不可见,并且不可删改。
    • 创建分区时不可添加范围重叠的分区。

    Range 分区

    • 分区列通常为时间列,以方便的管理新旧数据。

    • Partition 支持通过 VALUES LESS THAN (...) 仅指定上界,系统会将前一个分区的上界作为该分区的下界,生成一个左闭右开的区间。也支持通过 VALUES [...) 指定上下界,生成一个左闭右开的区间。

分区

Range Partition

静态 Range Partition

创建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(
    PARTITION `p201701` VALUES LESS THAN ("2017-02-01"),
    PARTITION `p201702` VALUES LESS THAN ("2017-03-01"),
    PARTITION `p201703` VALUES LESS THAN ("2017-04-01")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
(
    "replication_num" = "1"
);

容易理解。这里举例说明,当使用 `VALUES LESS THAN (...)` 语句进行分区的增删操作时,分区范围的变化情况:

 - 如上 `example_range_tbl` 示例,当建表完成后,会自动生成如下3个分区:

   ```text

   p201701: [MIN_VALUE,  2017-02-01)

   p201702: [2017-02-01, 2017-03-01)

   p201703: [2017-03-01, 2017-04-01)

   ```

测试插入数据(下面分别插入对应的分区)

insert into example_range_tbl values(10001,'2017-01-05','北京',30,1,'2017-10-01 17:05:45',2,22,22); 
insert into example_range_tbl values(10000,'2017-02-01','北京',20,0,'2017-10-01 06:00:00',20,10,10);
insert into example_range_tbl values(10000,'2017-03-03','北京',20,0,'2017-10-01 07:00:00',15,2,2);

查询创建的分区

SHOW PARTITIONS FROM example_range_tbl;

动态 Range Partition

创建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES (
	"replication_allocation" = "tag.location.default: 1", 
	"dynamic_partition.enable" = "true",
    "dynamic_partition.time_unit" = "DAY",
    "dynamic_partition.end" = "3",
    "dynamic_partition.prefix" = "p",  
    "dynamic_partition.buckets" = "10"	
);

dynamic_partition.enable: 是否开启动态分区特性,可指定为 true 或 false。默认为 true。
dynamic_partition.time_unit: 动态分区调度的单位,可指定为 DAY WEEK MONTH,当指定为 DAY时,动态创建的分区名后缀格式为yyyyMMdd,例如- - 20200325。当指定为 WEEK 时,动态创建的分区名后缀格式为yyyy_ww即当前日期属于这一年的第几周。当指定为 MONTH 时,动态创建的分区名后缀格式为 yyyyMM,例如 202003。
dynamic_partition.start: 动态分区的开始时间, 以当天为基准,超过该时间范围的分区将会被删除。如果不填写,则默认为Integer.MIN_VALUE 即 -2147483648。
dynamic_partition.end: 动态分区的结束时间, 以当天为基准,会提前创建N个单位的分区范围。
dynamic_partition.prefix: 动态创建的分区名前缀。
dynamic_partition.buckets: 动态创建的分区所对应的分桶数量。

查看分区

show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 12985       | p20230302     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13006       | p20230303     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13027       | p20230304     | 1              | 2023-03-02 16:47:18 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13048       | p20230305     | 1              | 2023-03-02 16:47:19 | NORMAL | date         | [types: [DATE]; keys: [2023-03-05]; ..types: [DATE]; keys: [2023-03-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
4 rows in set (0.00 sec)

可以看到上面的创建了从今天开始后面的3个分区。

插入历史数据看看 

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22);

上面的操作以后会报错(说明如果没有对应的历史分区,默认是插入不成功的)

[root@doris1 ~]# cat _load_error_log\?file\=__shard_3%2Ferror_log_insert_stmt_75a4a5394a0a4c4a-a813211947164ecc_75a4a5394a0a4c4a_a813211947164ecc 
Reason: no partition for this tuple. tuple=+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
|(Int128)       |(Date)         |(Nullable(String))|(Nullable(Int16))|(Nullable(Int8))|(Nullable(DateTime))|(Nullable(Int64))|(Nullable(Int32))|(Nullable(Int32))|
+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
|          10001|     2017-01-05|           beijing|               30|               1| 2017-10-01 17:05:45|                2|               22|               22|
+---------------+---------------+------------------+-----------------+----------------+--------------------+-----------------+-----------------+-----------------+
. src line []; 

开启历史分区 

create_history_partition = true
1)dynamic_partition.history_partition_num 未设置,即 -1;expect_create_partition_num = end - start;
2)dynamic_partition.history_partition_num 已设置 expect_create_partition_num = end - max(start, -histoty_partition_num);
create_history_partition = false 不会创建历史分区,expect_create_partition_num = end - 0;
当 expect_create_partition_num 大于 max_dynamic_partition_num(默认500)时,禁止创建过多分区。
注意:dynamic_partition.start 与 `expect_create_partition_num``如果未设置,则无法创建历史分区

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbl
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES (
	"replication_allocation" = "tag.location.default: 1", 
	"dynamic_partition.enable" = "true",
    "dynamic_partition.time_unit" = "DAY",
    "dynamic_partition.end" = "5",
    "dynamic_partition.prefix" = "p",  
    "dynamic_partition.buckets" = "10",
    "dynamic_partition.create_history_partition" = "true",
    "dynamic_partition.start" = "-10"
);

 查看分区

show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 13071       | p20230220     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-20]; ..types: [DATE]; keys: [2023-02-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13092       | p20230221     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-21]; ..types: [DATE]; keys: [2023-02-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13113       | p20230222     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-22]; ..types: [DATE]; keys: [2023-02-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13134       | p20230223     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-23]; ..types: [DATE]; keys: [2023-02-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13155       | p20230224     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-24]; ..types: [DATE]; keys: [2023-02-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13176       | p20230225     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-25]; ..types: [DATE]; keys: [2023-02-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13197       | p20230226     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-26]; ..types: [DATE]; keys: [2023-02-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13218       | p20230227     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-27]; ..types: [DATE]; keys: [2023-02-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13239       | p20230228     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-02-28]; ..types: [DATE]; keys: [2023-03-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13260       | p20230301     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-01]; ..types: [DATE]; keys: [2023-03-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13281       | p20230302     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13302       | p20230303     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13323       | p20230304     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13344       | p20230305     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-05]; ..types: [DATE]; keys: [2023-03-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13365       | p20230306     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-06]; ..types: [DATE]; keys: [2023-03-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13386       | p20230307     | 1              | 2023-03-02 17:05:30 | NORMAL | date         | [types: [DATE]; keys: [2023-03-07]; ..types: [DATE]; keys: [2023-03-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+

 (注意今天的时间是3月2日,上面创建了未来3天的分区和历史10天的分区)

插入数据测试(如果没有分区还是不能自己创建,历史分区也就是自动的创建之前分区的功能)

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 

 下面的数据就能够创建成功

insert into example_range_tbl values(10001,'2023-02-27','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 

批量创建分区 

批量创建分区功能在前期充分调研了用户的需求,本着简洁、强大、易用的设计目标,将设计核心锁定在几个要素中:

  • 时间区间范围(会考虑开闭问题)

  • 时间跨度(即每个分区的时间维度的大小)

  • 时间单位(年、月、日、时、周等)

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbl1
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(
    FROM ("2000-01-01") TO ("2021-01-01") INTERVAL 1 YEAR,
    FROM ("2021-01-01") TO ("2022-01-01") INTERVAL 1 MONTH,
    FROM ("2022-01-01") TO ("2023-01-01") INTERVAL 1 WEEK,
    FROM ("2023-01-01") TO ("2023-02-01") INTERVAL 1 DAY
)
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES (
	"replication_allocation" = "tag.location.default: 1"
);

查看分区数据

mysql> show partitions from example_range_tbl1;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 13408       | p_2000        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2000-01-01]; ..types: [DATE]; keys: [2001-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13409       | p_2001        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2001-01-01]; ..types: [DATE]; keys: [2002-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13410       | p_2002        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2002-01-01]; ..types: [DATE]; keys: [2003-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13411       | p_2003        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2003-01-01]; ..types: [DATE]; keys: [2004-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13412       | p_2004        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2004-01-01]; ..types: [DATE]; keys: [2005-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13413       | p_2005        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2005-01-01]; ..types: [DATE]; keys: [2006-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13414       | p_2006        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2006-01-01]; ..types: [DATE]; keys: [2007-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13415       | p_2007        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2007-01-01]; ..types: [DATE]; keys: [2008-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13416       | p_2008        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2008-01-01]; ..types: [DATE]; keys: [2009-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13417       | p_2009        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2009-01-01]; ..types: [DATE]; keys: [2010-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13418       | p_2010        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2010-01-01]; ..types: [DATE]; keys: [2011-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13419       | p_2011        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2011-01-01]; ..types: [DATE]; keys: [2012-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13420       | p_2012        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2012-01-01]; ..types: [DATE]; keys: [2013-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13421       | p_2013        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2013-01-01]; ..types: [DATE]; keys: [2014-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13422       | p_2014        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2014-01-01]; ..types: [DATE]; keys: [2015-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13423       | p_2015        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2015-01-01]; ..types: [DATE]; keys: [2016-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13424       | p_2016        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2016-01-01]; ..types: [DATE]; keys: [2017-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13425       | p_2017        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2017-01-01]; ..types: [DATE]; keys: [2018-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13426       | p_2018        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2018-01-01]; ..types: [DATE]; keys: [2019-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13427       | p_2019        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2019-01-01]; ..types: [DATE]; keys: [2020-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13428       | p_2020        | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2020-01-01]; ..types: [DATE]; keys: [2021-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13429       | p_202101      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-01-01]; ..types: [DATE]; keys: [2021-02-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13430       | p_202102      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-02-01]; ..types: [DATE]; keys: [2021-03-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13431       | p_202103      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-03-01]; ..types: [DATE]; keys: [2021-04-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13432       | p_202104      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-04-01]; ..types: [DATE]; keys: [2021-05-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13433       | p_202105      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-05-01]; ..types: [DATE]; keys: [2021-06-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13434       | p_202106      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-06-01]; ..types: [DATE]; keys: [2021-07-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13435       | p_202107      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-07-01]; ..types: [DATE]; keys: [2021-08-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13436       | p_202108      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-08-01]; ..types: [DATE]; keys: [2021-09-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13437       | p_202109      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-09-01]; ..types: [DATE]; keys: [2021-10-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13438       | p_202110      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-10-01]; ..types: [DATE]; keys: [2021-11-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13439       | p_202111      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-11-01]; ..types: [DATE]; keys: [2021-12-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13440       | p_202112      | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2021-12-01]; ..types: [DATE]; keys: [2022-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13441       | p_2022_01     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-01]; ..types: [DATE]; keys: [2022-01-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13442       | p_2022_02     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-03]; ..types: [DATE]; keys: [2022-01-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13443       | p_2022_03     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-10]; ..types: [DATE]; keys: [2022-01-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13444       | p_2022_04     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-17]; ..types: [DATE]; keys: [2022-01-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13445       | p_2022_05     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-24]; ..types: [DATE]; keys: [2022-01-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13446       | p_2022_06     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-01-31]; ..types: [DATE]; keys: [2022-02-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13447       | p_2022_07     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-07]; ..types: [DATE]; keys: [2022-02-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13448       | p_2022_08     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-14]; ..types: [DATE]; keys: [2022-02-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13449       | p_2022_09     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-21]; ..types: [DATE]; keys: [2022-02-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13450       | p_2022_10     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-02-28]; ..types: [DATE]; keys: [2022-03-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13451       | p_2022_11     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-07]; ..types: [DATE]; keys: [2022-03-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13452       | p_2022_12     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-14]; ..types: [DATE]; keys: [2022-03-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13453       | p_2022_13     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-21]; ..types: [DATE]; keys: [2022-03-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13454       | p_2022_14     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-03-28]; ..types: [DATE]; keys: [2022-04-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13455       | p_2022_15     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-04]; ..types: [DATE]; keys: [2022-04-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13456       | p_2022_16     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-11]; ..types: [DATE]; keys: [2022-04-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13457       | p_2022_17     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-18]; ..types: [DATE]; keys: [2022-04-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13458       | p_2022_18     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-04-25]; ..types: [DATE]; keys: [2022-05-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13459       | p_2022_19     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-02]; ..types: [DATE]; keys: [2022-05-09]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13460       | p_2022_20     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-09]; ..types: [DATE]; keys: [2022-05-16]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13461       | p_2022_21     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-16]; ..types: [DATE]; keys: [2022-05-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13462       | p_2022_22     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-23]; ..types: [DATE]; keys: [2022-05-30]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13463       | p_2022_23     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-05-30]; ..types: [DATE]; keys: [2022-06-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13464       | p_2022_24     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-06]; ..types: [DATE]; keys: [2022-06-13]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13465       | p_2022_25     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-13]; ..types: [DATE]; keys: [2022-06-20]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13466       | p_2022_26     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-20]; ..types: [DATE]; keys: [2022-06-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13467       | p_2022_27     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-06-27]; ..types: [DATE]; keys: [2022-07-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13468       | p_2022_28     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-04]; ..types: [DATE]; keys: [2022-07-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13469       | p_2022_29     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-11]; ..types: [DATE]; keys: [2022-07-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13470       | p_2022_30     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-18]; ..types: [DATE]; keys: [2022-07-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13471       | p_2022_31     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-07-25]; ..types: [DATE]; keys: [2022-08-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13472       | p_2022_32     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-01]; ..types: [DATE]; keys: [2022-08-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13473       | p_2022_33     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-08]; ..types: [DATE]; keys: [2022-08-15]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13474       | p_2022_34     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-15]; ..types: [DATE]; keys: [2022-08-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13475       | p_2022_35     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-22]; ..types: [DATE]; keys: [2022-08-29]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13476       | p_2022_36     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-08-29]; ..types: [DATE]; keys: [2022-09-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13477       | p_2022_37     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-05]; ..types: [DATE]; keys: [2022-09-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13478       | p_2022_38     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-12]; ..types: [DATE]; keys: [2022-09-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13479       | p_2022_39     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-19]; ..types: [DATE]; keys: [2022-09-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13480       | p_2022_40     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-09-26]; ..types: [DATE]; keys: [2022-10-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13481       | p_2022_41     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-03]; ..types: [DATE]; keys: [2022-10-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13482       | p_2022_42     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-10]; ..types: [DATE]; keys: [2022-10-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13483       | p_2022_43     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-17]; ..types: [DATE]; keys: [2022-10-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13484       | p_2022_44     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-24]; ..types: [DATE]; keys: [2022-10-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13485       | p_2022_45     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-10-31]; ..types: [DATE]; keys: [2022-11-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13486       | p_2022_46     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-07]; ..types: [DATE]; keys: [2022-11-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13487       | p_2022_47     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-14]; ..types: [DATE]; keys: [2022-11-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13488       | p_2022_48     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-21]; ..types: [DATE]; keys: [2022-11-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13489       | p_2022_49     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-11-28]; ..types: [DATE]; keys: [2022-12-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13490       | p_2022_50     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-05]; ..types: [DATE]; keys: [2022-12-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13491       | p_2022_51     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-12]; ..types: [DATE]; keys: [2022-12-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13492       | p_2022_52     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-19]; ..types: [DATE]; keys: [2022-12-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13493       | p_2022_53     | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2022-12-26]; ..types: [DATE]; keys: [2023-01-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13494       | p_20230101    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-01]; ..types: [DATE]; keys: [2023-01-02]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13495       | p_20230102    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-02]; ..types: [DATE]; keys: [2023-01-03]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13496       | p_20230103    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-03]; ..types: [DATE]; keys: [2023-01-04]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13497       | p_20230104    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-04]; ..types: [DATE]; keys: [2023-01-05]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13498       | p_20230105    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-05]; ..types: [DATE]; keys: [2023-01-06]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13499       | p_20230106    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-06]; ..types: [DATE]; keys: [2023-01-07]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13500       | p_20230107    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-07]; ..types: [DATE]; keys: [2023-01-08]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13501       | p_20230108    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-08]; ..types: [DATE]; keys: [2023-01-09]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13502       | p_20230109    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-09]; ..types: [DATE]; keys: [2023-01-10]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13503       | p_20230110    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-10]; ..types: [DATE]; keys: [2023-01-11]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13504       | p_20230111    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-11]; ..types: [DATE]; keys: [2023-01-12]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13505       | p_20230112    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-12]; ..types: [DATE]; keys: [2023-01-13]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13506       | p_20230113    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-13]; ..types: [DATE]; keys: [2023-01-14]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13507       | p_20230114    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-14]; ..types: [DATE]; keys: [2023-01-15]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13508       | p_20230115    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-15]; ..types: [DATE]; keys: [2023-01-16]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13509       | p_20230116    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-16]; ..types: [DATE]; keys: [2023-01-17]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13510       | p_20230117    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-17]; ..types: [DATE]; keys: [2023-01-18]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13511       | p_20230118    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-18]; ..types: [DATE]; keys: [2023-01-19]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13512       | p_20230119    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-19]; ..types: [DATE]; keys: [2023-01-20]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13513       | p_20230120    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-20]; ..types: [DATE]; keys: [2023-01-21]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13514       | p_20230121    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-21]; ..types: [DATE]; keys: [2023-01-22]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13515       | p_20230122    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-22]; ..types: [DATE]; keys: [2023-01-23]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13516       | p_20230123    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-23]; ..types: [DATE]; keys: [2023-01-24]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13517       | p_20230124    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-24]; ..types: [DATE]; keys: [2023-01-25]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13518       | p_20230125    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-25]; ..types: [DATE]; keys: [2023-01-26]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13519       | p_20230126    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-26]; ..types: [DATE]; keys: [2023-01-27]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13520       | p_20230127    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-27]; ..types: [DATE]; keys: [2023-01-28]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13521       | p_20230128    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-28]; ..types: [DATE]; keys: [2023-01-29]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13522       | p_20230129    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-29]; ..types: [DATE]; keys: [2023-01-30]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13523       | p_20230130    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-30]; ..types: [DATE]; keys: [2023-01-31]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 13524       | p_20230131    | 1              | 2023-03-02 17:22:31 | NORMAL | date         | [types: [DATE]; keys: [2023-01-31]; ..types: [DATE]; keys: [2023-02-01]; ) | user_id         | 10      | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
117 rows in set (0.02 sec)

 List 分区

  • 分区列支持 BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, LARGEINT, DATE, DATETIME, CHAR, VARCHAR 数据类型,分区值为枚举值。只有当数据为目标分区枚举值其中之一时,才可以命中分区。

  • Partition 支持通过 VALUES IN (...) 来指定每个分区包含的枚举值。

  • 下面通过示例说明,进行分区的增删操作时,分区的变化。

测试建表

CREATE TABLE IF NOT EXISTS example_range_tbl
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) not NULL COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY LIST(city)
(
    PARTITION `p_huabei` VALUES IN ("beijing", "tianjin", "shijiazhuang"),
    PARTITION `p_dongbei` VALUES IN ("shenyang", "dalian"),
    PARTITION `p_huazhong` VALUES IN ("wuhan", "changsha"),
    PARTITION `p_xinan` VALUES IN ("chengdu", "chongqing")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
(
    "replication_num" = "1"
);

LIST(city) 里面的city字段不能为空

测试数据

insert into example_range_tbl values(10001,'2017-01-05','beijing',30,1,'2017-10-01 17:05:45',2,22,22); 
insert into example_range_tbl values(10000,'2017-02-01','tianjin',20,0,'2017-10-01 06:00:00',20,10,10);
insert into example_range_tbl values(10000,'2017-03-03','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);

效果

当我们有了合适的分区分桶时,导入数据导到 Doris 后,数据会依照建表语句中的分区分桶列进行存储。上述网站站点数据的存储示例如图示:

图2:Doris 分区分桶后的数据存储

此时如果执行 SQL 查询:

select * from test_tbl where date = "2020-03-23"  and site = 1

根据谓词 date = "2020-03-23" 可以定位到分区 p20200323,谓词 site = 1 能定位到该分区下的 bucket_1。假设有 30 天数据,自动分桶推算得到的分桶个数为 20 个。则经过明确的分区分桶谓词下推,则可以将数据全表扫描量变为原来的 1/600(30 天*20 个桶 = 600),极大减少了数据的扫描范围、提高了查询的效率。

实验

动态分区

创建一个动态分区(现在是3月2日)

CREATE TABLE IF NOT EXISTS example_range_tbl
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`user_id`)
PROPERTIES (
	"replication_allocation" = "tag.location.default: 1", 
	"dynamic_partition.enable" = "true",
    "dynamic_partition.time_unit" = "DAY",
    "dynamic_partition.prefix" = "p",  
    "dynamic_partition.buckets" = "3",
    "dynamic_partition.create_history_partition" = "true",
    "dynamic_partition.end" = "2",
    "dynamic_partition.start" = "-3"
);

查看现在的分区(可以看到创建了历史3天和未来2天的数据)

mysql> show partitions from example_range_tbl;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15869       | p20230227     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-02-27]; ..types: [DATE]; keys: [2023-02-28]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15876       | p20230228     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-02-28]; ..types: [DATE]; keys: [2023-03-01]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15883       | p20230301     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-01]; ..types: [DATE]; keys: [2023-03-02]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15890       | p20230302     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-02]; ..types: [DATE]; keys: [2023-03-03]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15897       | p20230303     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-03]; ..types: [DATE]; keys: [2023-03-04]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15904       | p20230304     | 1              | 2023-03-02 17:44:48 | NORMAL | date         | [types: [DATE]; keys: [2023-03-04]; ..types: [DATE]; keys: [2023-03-05]; ) | user_id         | 3       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
6 rows in set (0.00 sec)

查看第二天的情况 (现在是3月3日)

手动分区实验

建表语句

CREATE TABLE IF NOT EXISTS example_range_tbltest
(
    `user_id` LARGEINT NOT NULL COMMENT "用户id",
    `date` DATE NOT NULL COMMENT "数据灌入日期时间",
    `city` VARCHAR(20) COMMENT "用户所在城市",
    `age` SMALLINT COMMENT "用户年龄",
    `sex` TINYINT COMMENT "用户性别",
    `last_visit_date` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00" COMMENT "用户最后一次访问时间",
    `cost` BIGINT SUM DEFAULT "0" COMMENT "用户总消费",
    `max_dwell_time` INT MAX DEFAULT "0" COMMENT "用户最大停留时间",
    `min_dwell_time` INT MIN DEFAULT "99999" COMMENT "用户最小停留时间"
)
ENGINE=OLAP
AGGREGATE KEY(`user_id`, `date`, `city`, `age`, `sex`)
PARTITION BY RANGE(`date`)
(
    PARTITION `p201701` VALUES LESS THAN ("2017-02-01"),
    PARTITION `p201702` VALUES LESS THAN ("2017-03-01"),
    PARTITION `p201703` VALUES LESS THAN ("2017-04-01")
)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 5
PROPERTIES
(
    "replication_num" = "1"
);

查看分区

mysql> show partitions from example_range_tbltest;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15911       | p201701       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [0000-01-01]; ..types: [DATE]; keys: [2017-02-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15912       | p201702       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-02-01]; ..types: [DATE]; keys: [2017-03-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15913       | p201703       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-03-01]; ..types: [DATE]; keys: [2017-04-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
3 rows in set (0.01 sec)

插入数据

insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);

下面报错因为没有对应的分区 

mysql> insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);
ERROR 5025 (HY000): Insert has filtered data in strict mode, tracking_url=http://10.240.0.51:8040/api/_load_error_log?file=__shard_235/error_log_insert_stmt_749a91311755470e-8b2b8b059bce5df2_749a91311755470e_8b2b8b059bce5df2

手动添加一个分区

ALTER TABLE example_range_tbltest ADD PARTITION p201704 VALUES LESS THAN ("2017-05-01");
mysql> show partitions from example_range_tbltest;
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range                                                                      | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
| 15911       | p201701       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [0000-01-01]; ..types: [DATE]; keys: [2017-02-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15912       | p201702       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-02-01]; ..types: [DATE]; keys: [2017-03-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15913       | p201703       | 1              | 2023-03-02 17:52:52 | NORMAL | date         | [types: [DATE]; keys: [2017-03-01]; ..types: [DATE]; keys: [2017-04-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
| 15946       | p201704       | 1              | 2023-03-02 17:57:34 | NORMAL | date         | [types: [DATE]; keys: [2017-04-01]; ..types: [DATE]; keys: [2017-05-01]; ) | user_id         | 5       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+
4 rows in set (0.00 sec)

 然后插入数据(可以看到新的分区插入数据成功)

mysql> insert into example_range_tbltest values(10000,'2017-04-02','shenyang',20,0,'2017-10-01 07:00:00',15,2,2);
Query OK, 1 row affected (0.03 sec)
{'label':'insert_9ef4039c342c494c_aa49e0c045fbcf55', 'status':'VISIBLE', 'txnId':'1030'}

 参考资料

一文教你玩转 Apache Doris 分区分桶新功能

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/383748.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【深度估计】单目深度估计

文章目录什么是深度估计&#xff1f;什么是视差深度估计与三维重建单目深度估计研究历程单目深度估计方法传统方法基于线索线性透视聚焦/散焦度天气散射阴影纹理遮挡高度运动线索基于物体自身运动基于摄像机的运动基于机器学习参数学习方法开创性工作改进加入语义信息条件随机场…

《工业机器视觉检测123》(1.1) 目标检测样本类别不平衡的问题(持续更新...)

部分内容转载自&#xff1a;https://www.cnblogs.com/inchbyinch/p/12642760.html 参考分类任务中解决类别不平衡的办法&#xff1a; 1 什么是类别不平衡问题&#xff1f; 类别不平衡&#xff08;class-imbalance&#xff09;&#xff0c;也叫数据倾斜&#xff0c;数据不平衡…

Tomcat面试问题总结

1.Tomcat是什么&#xff1f;Tomcat 服务器Apache软件基金会项目中的一个核心项目&#xff0c;是一个免费的开放源代码的Web 应用服务器&#xff0c;属于轻量级应用服务器&#xff0c;在中小型系统和并发访问用户不是很多的场合下被普遍使用&#xff0c;是开发和调试JSP 程序的首…

EasyCVR视频融合平台的视频处理与AI智能分析流程实操案例介绍

EasyCVR基于云边端一体化架构&#xff0c;能支持海量视频的轻量化接入与汇聚管理。在视频能力上&#xff0c;可提供视频监控直播、视频轮播、视频录像、云存储、回放与检索、智能告警、服务器集群、语音对讲、云台控制、电子地图、平台级联等。 除了视频能力之外&#xff0c;将…

浅谈设备防漏扫

场景描述 随着社会的信息化&#xff0c;互联网安全被国家越来越重视&#xff0c;漏洞扫描&#xff08;简称漏扫&#xff09;业务也在被规范列入企事业单位的信息安全的标准中。 从安全角度来看&#xff0c;漏扫本身是为用户的用网安全做保障&#xff0c;避免木马、病毒等通过…

vue中点击空白处改变dom状态实现显隐,监听dom(addEventListener)

需求来源&#xff1a;点击铃铛之后弹出右侧抽屉&#xff0c;实现文件下载 现在是点击小铃铛出现弹框没问题&#xff0c;点击关闭图标关闭弹框也没问题&#xff0c;但是点击空白区域消失不了&#xff0c;这个时候需要dom监听属性document.addEventListener来实现需求了 主要是用…

c++学习笔记之基础

目录前言零碎知识点C核心内存分区引用函数类和对象对象的初始化和清理构造函数和析构函数构造函数的分类和调用拷贝构造函数的调用时机深拷贝与浅拷贝初始化列表类对象作为类的成员静态成员C对象模型和this指针成员变量和成员函数分开存储this指针空指针访问成员函数const修饰成…

IDEA2022 配置spark开发环境

本人强烈建议在 linux环境下 学习 spark&#xff01;&#xff01;&#xff01; Introduction Apache Spark是一个快速且通用的分布式计算引擎&#xff0c;可以在大规模数据集上进行高效的数据处理&#xff0c;包括数据转换、数据清洗、机器学习等。在本文中&#xff0c;我们将…

NDK C++ map容器

map容器// TODO map容器 #include <iostream> #include <map>using namespace std;int main() {// TODO map<int, string>按key值排序&#xff0c;同一个key不可以重复插入map<int, string> map1;map1.insert(pair<int, string>(1, "111&qu…

ChatGPT没有API?OpenAI官方API带你起飞

目录ChatGPT没有API&#xff1f;OpenAI官方API带你起飞安装 OpenAI 的 API 库包装个函数包装个UIChatGPT没有API&#xff1f;OpenAI官方API带你起飞 前段时间ChatGPT爆火&#xff0c;OpenAI 的 GPT API也被大家疯狂调用&#xff0c; 但其实这个API是基于GPT3的&#xff0c;和基…

【RabbitMQ】Producer之mandatory、alternative exchange、TTL - 基于AMQP 0-9-1(一)

RabbitMQ系列文章&#xff0c;前几篇介绍了基础概念&#xff0c;AMQP 0-9-1 协议&#xff0c;和服务端安装&#xff0c;准备工作都完成后&#xff0c;就开始着手开发了。这篇文章主要介绍RabbitMQ生产者的开发&#xff0c;包括Producer、Message常见的参数&#xff0c;读完这篇…

20.hadoop系列之Yarn资源调度器

Yarn是一个资源调度平台&#xff0c;负责为运算程序提供服务器运算资源&#xff0c;相当于一个分布式的操作系统&#xff0c;而MapReduce等运算程序则相当于运行于操作系统之上的应用程序 1.Yarn基础架构 Yarn主要由ResourceManager、NodeManager、ApplicationMaster和Contai…

【MySQL】基础操作

数据库的操作 查看所有数据库&#xff1a; SHOW DATABASES;&#xff08;注意这里是 databases&#xff0c;多了个 s&#xff09; mysql 不区分大小写&#xff0c;所以 show databases; 是一样的。 另外&#xff0c;在命令行窗口操作时&#xff0c;可以使用上下方向键调用前面已…

CentOS编译安装Apache

1、下载Apache、apr和apr-util源码包&#xff1a; 2、解压文件&#xff1a; tar -zxvf httpd-2.4.55.tar.gz tar -zxvf apr-util-1.6.3.tar.gz tar -zxvf apr-util-1.6.3.tar.gz mv apr-1.7.2 httpd-2.4.55/srclib/apr mv apr-util-1.6.3 httpd-2.4.55/srclib/apr-util 说明&…

计讯物联5G数采仪助力打造化工园区企业工况监测系统

项目背景 随着我国化工行业的快速发展&#xff0c;化工园区已成为化工行业发展的重要阵地&#xff0c;化工企业聚集&#xff0c;危险化学品安全风险集中&#xff0c;安全规范问题逐渐成为行业关注的焦点。然而&#xff0c;我国化工园区发展水平发展参差不齐&#xff0c;尤其是…

Redis过期删除策略和内存淘汰策略

目录一、面试题二、Redis内存满了怎么办2.1 结论三、redis里写的数据如何删除的&#xff1f;3.1 三种不同的删除策略3.1.1 立即删除3.1.2 惰性删除3.1.3 定期删除3.3.4 总结四、redis缓存淘汰策略4.1 有哪些4.2 你平时用哪一种五、总结一、面试题 生产上你们你们的redis内存设…

第三章-OpenCV基础-8-绘图函数

前置内容 这篇内容不是本书内容,但后续用的到&#xff0c;特做记录。 使用OpenCV中不可避免需要用到各种绘图功能,比如绘制人脸库、显示人脸识别信息,那就需要用到OpenCV的绘图函数&#xff0c;这些函数包括cv2.line()&#xff0c; cv2.circle()&#xff0c;cv2.rectangle()…

Lazada如何做好店铺运营?产品定价是关键

1.东南亚各国状况一览&#xff08;对比中国&#xff09; 2.东南亚消费水平真的很低&#xff1f; 精准定价的意义&#xff1a;定价过高&#xff0c;失去核心竞争力&#xff1b;定价过低&#xff0c;亏本对市场失去信心&#xff1b;价格改动&#xff0c;流量下降 定价公式&#…

MySQL实战解析底层---日志系统:一条SQL更新语句是如何执行的

目录 前言 重要的日志模块&#xff1a;redo log 重要的日志模块&#xff1a;binlog 两阶段提交 前言 MySQL 可以恢复到半个月内任意一秒的状态&#xff0c;这是怎样做到的呢&#xff1f;从一个表的一条更新语句说起&#xff0c;下面是这个表的创建语句&#xff0c;这个表有…

【个人总结】Mongodb安装下载

【个人总结】MongDB安装下载1、下载2、安装3、创建数据库文件的存放位置4、配置5、创建文件6、安装mongodb服务7、测试1、下载 官网下载地址&#xff1a;https://www.mongodb.com/try/download/community-kubernetes-operator&#xff0c;选择对应版本&#xff0c;我这里是3.6…