Skip to content

add table template manager for hbase#164

Merged
WeiXinChan merged 3 commits into
secondary_partfrom
secondary_part_test
Mar 10, 2025
Merged

add table template manager for hbase#164
WeiXinChan merged 3 commits into
secondary_partfrom
secondary_part_test

Conversation

@maochongxin

@maochongxin maochongxin commented Mar 8, 2025

Copy link
Copy Markdown
Contributor

Usage effect

============= create table: test_group_non_partitioned_regular$cf  table_group: test_group_non_partitioned_regular =============
CREATE TABLE `test_group_non_partitioned_regular$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_non_partitioned_regular 
============= done =============

============= create table: test_group_non_partitioned_time_series$cf  table_group: test_group_non_partitioned_time_series =============
CREATE TABLE `test_group_non_partitioned_time_series$cf` (
  `K` varbinary(1024) NOT NULL,
  `T` bigint(20) NOT NULL,
  `S` bigint(20) NOT NULL,
  `V` json NOT NULL,
  PRIMARY KEY (`K`, `T`, `S`)
) TABLEGROUP = test_group_non_partitioned_time_series 
============= done =============

============= create table: test_group_single_partitioned_regular$cf  table_group: test_group_single_partitioned_regular =============
CREATE TABLE `test_group_single_partitioned_regular$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_single_partitioned_regular PARTITION BY KEY(`K`) PARTITIONS 97  
============= done =============

============= create table: test_group_single_partitioned_time_series$cf  table_group: test_group_single_partitioned_time_series =============
CREATE TABLE `test_group_single_partitioned_time_series$cf` (
  `K` varbinary(1024) NOT NULL,
  `T` bigint(20) NOT NULL,
  `S` bigint(20) NOT NULL,
  `V` json NOT NULL,
  PRIMARY KEY (`K`, `T`, `S`)
) TABLEGROUP = test_group_single_partitioned_time_series PARTITION BY KEY(`K`) PARTITIONS 97  
============= done =============

============= create table: test_group_double_partitioned_range_key$cf  table_group: test_group_double_partitioned_range_key =============
CREATE TABLE `test_group_double_partitioned_range_key$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_double_partitioned_range_key PARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION BY KEY(`K`) SUBPARTITIONS 97 
(PARTITION `p0` VALUES LESS THAN (1741341426201),
 PARTITION `p1` VALUES LESS THAN (1741427826201),
 PARTITION `p2` VALUES LESS THAN (1741514226201),
 PARTITION `p3` VALUES LESS THAN MAXVALUE) 
============= done =============

============= create table: test_group_double_partitioned_range_key_gen$cf  table_group: test_group_double_partitioned_range_key_gen =============
CREATE TABLE `test_group_double_partitioned_range_key_gen$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  K_PREFIX varbinary(1024) GENERATED ALWAYS AS (substring(`K`, 1, 4)),
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_double_partitioned_range_key_gen PARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION BY KEY(`K_PREFIX`) SUBPARTITIONS 97 
(PARTITION `p0` VALUES LESS THAN (1741341431437),
 PARTITION `p1` VALUES LESS THAN (1741427831437),
 PARTITION `p2` VALUES LESS THAN (1741514231437),
 PARTITION `p3` VALUES LESS THAN MAXVALUE)  
============= done =============

============= create table: test_group_double_partitioned_key_range$cf  table_group: test_group_double_partitioned_key_range =============
CREATE TABLE `test_group_double_partitioned_key_range$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_double_partitioned_key_range PARTITION BY KEY(`K`) PARTITIONS 97 
SUBPARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION TEMPLATE (
  SUBPARTITION `p0` VALUES LESS THAN (1741341435578),
  SUBPARTITION `p1` VALUES LESS THAN (1741427835578),
  SUBPARTITION `p2` VALUES LESS THAN (1741514235578),
  SUBPARTITION `p3` VALUES LESS THAN MAXVALUE)  
============= done =============

============= create table: test_group_double_partitioned_key_range_gen$cf  table_group: test_group_double_partitioned_key_range_gen =============
CREATE TABLE `test_group_double_partitioned_key_range_gen$cf` (
  `K` varbinary(1024) NOT NULL,
  `Q` varbinary(256) NOT NULL,
  `T` bigint(20) NOT NULL,
  `V` varbinary(1024) DEFAULT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  K_PREFIX varbinary(1024) GENERATED ALWAYS AS (substring(`K`, 1, 4)),
  PRIMARY KEY (`K`, `Q`, `T`)
) TABLEGROUP = test_group_double_partitioned_key_range_gen PARTITION BY KEY(`K_PREFIX`) PARTITIONS 97 
SUBPARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION TEMPLATE (
  SUBPARTITION `p0` VALUES LESS THAN (1741341441067),
  SUBPARTITION `p1` VALUES LESS THAN (1741427841067),
  SUBPARTITION `p2` VALUES LESS THAN (1741514241067),
  SUBPARTITION `p3` VALUES LESS THAN MAXVALUE)  
============= done =============

============= create table: test_group_double_partitioned_time_range_key$cf  table_group: test_group_double_partitioned_time_range_key =============
CREATE TABLE `test_group_double_partitioned_time_range_key$cf` (
  `K` varbinary(1024) NOT NULL,
  `T` bigint(20) NOT NULL,
  `S` bigint(20) NOT NULL,
  `V` json NOT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  PRIMARY KEY (`K`, `T`, `S`)
) TABLEGROUP = test_group_double_partitioned_time_range_key PARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION BY KEY(`K`) SUBPARTITIONS 97 
(PARTITION `p0` VALUES LESS THAN (1741341448509),
 PARTITION `p1` VALUES LESS THAN (1741427848509),
 PARTITION `p2` VALUES LESS THAN (1741514248509),
 PARTITION `p3` VALUES LESS THAN MAXVALUE)  
============= done =============

============= create table: test_group_double_partitioned_time_key_range$cf  table_group: test_group_double_partitioned_time_key_range =============
CREATE TABLE `test_group_double_partitioned_time_key_range$cf` (
  `K` varbinary(1024) NOT NULL,
  `T` bigint(20) NOT NULL,
  `S` bigint(20) NOT NULL,
  `V` json NOT NULL,
  `G` bigint(20) GENERATED ALWAYS AS (-T),
  PRIMARY KEY (`K`, `T`, `S`)
) TABLEGROUP = test_group_double_partitioned_time_key_range PARTITION BY KEY(`K`) PARTITIONS 97 
SUBPARTITION BY RANGE COLUMNS(`G`) 
SUBPARTITION TEMPLATE (
  SUBPARTITION `p0` VALUES LESS THAN (1741341470870),
  SUBPARTITION `p1` VALUES LESS THAN (1741427870870),
  SUBPARTITION `p2` VALUES LESS THAN (1741514270870),
  SUBPARTITION `p3` VALUES LESS THAN MAXVALUE) 
============= done =============

@maochongxin maochongxin force-pushed the secondary_part_test branch from d02bb5e to 6e6d0f7 Compare March 9, 2025 11:00
Comment thread src/test/java/com/alipay/oceanbase/hbase/util/TimeGenerator.java
Comment thread src/test/java/com/alipay/oceanbase/hbase/util/TableTemplateManager.java Outdated
Comment thread src/test/java/com/alipay/oceanbase/hbase/util/TimeGenerator.java Outdated
Comment thread src/test/java/com/alipay/oceanbase/hbase/OHTableSecondaryPartMcfTest.java Outdated
Comment thread src/test/java/com/alipay/oceanbase/hbase/OHTableSecondaryPartMcfTest.java Outdated
@WeiXinChan

Copy link
Copy Markdown
Contributor

LGTM

@WeiXinChan WeiXinChan merged commit 3822d55 into secondary_part Mar 10, 2025
stuBirdFly pushed a commit that referenced this pull request Apr 10, 2025
* refactor secondart test

* fix

* refactor

(cherry picked from commit 3822d55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants