Wei
07/18/2025, 7:42 PMCREATE TABLE IF NOT EXISTS eth_counters(
cluster STRING NULL,
hostname STRING NULL,
rx_bytes_phy BIGINT NULL,
tx_bytes_phy BIGINT NULL,
ts TIMESTAMP NOT NULL,
TIME INDEX (ts),
PRIMARY KEY (cluster, hostname)
)Ning
07/19/2025, 1:35 AMhostname > 'a' in partition rules. Note that the partition rules should cover all possible values of hostnameWei
07/19/2025, 4:46 AMNing
07/19/2025, 5:54 AMhostname >= 'a' means starts with a . Note that the partition rule is range based, so you will use it like compare stringWei
07/20/2025, 9:32 PMCREATE TABLE ti (id INT, amount DECIMAL(7,2), tr_date DATE)
ENGINE=INNODB
PARTITION BY HASH( MONTH(tr_date) )
PARTITIONS 6;Wei
07/20/2025, 9:33 PMWei
07/20/2025, 10:12 PMsdn=> CREATE TABLE IF NOT EXISTS ethtool_counters(
clusters STRING NULL,
hostname STRING NULL,
pf STRING NULL,
rx_bytes_phy BIGINT NULL,
tx_bytes_phy BIGINT NULL,
ts TIMESTAMP(9) NOT NULL,
TIME INDEX (ts),
PRIMARY KEY (clusters, hostname, pf)
)
PARTITION ON COLUMNS (clusters, pf) (
clusters >= 'zone2' and pf == 'p0',
clusters >= 'zone2' and pf == 'p1',
clusters >= 'zone7' and pf == 'p0',
clusters >= 'zone7' and pf == 'p1'
)
with(
append_mode='true'
);
ERROR: Checkpoint `clusters<zone2, pf<p0` is not covered
sdn=>Wei
07/20/2025, 10:12 PMNing
07/21/2025, 2:07 AMWei
07/21/2025, 1:32 PMNing
07/21/2025, 2:15 PMpf , you can use pf <= 'p0' and pf > 'p0' to cover them.Wei
07/21/2025, 5:35 PMWei
07/21/2025, 9:14 PMCREATE TABLE IF NOT EXISTS test(
hostname STRING NULL,
location STRING NULL,
iface STRING NULL,
rx_bytes_phy BIGINT NULL,
tx_bytes_phy BIGINT NULL,
ts TIMESTAMP(9) NOT NULL,
TIME INDEX (ts),
PRIMARY KEY (agent_tag_cluster, hostname, pf)
)
PARTITION ON COLUMNS (location ) (
)
with(
append_mode='true'
);Wei
07/21/2025, 9:19 PMRuihang
07/22/2025, 3:55 AMlocation <= 'beijing',
location > 'beijing' and location <= 'dalian',
location > 'dalian' and location <= 'shanghai',
location > 'shanghai' and location <= 'tianjin',
location > 'tianjin',Ruihang
07/22/2025, 3:56 AMRuihang
07/22/2025, 3:57 AMselect count(*), location from t group by location order by locationWei
07/22/2025, 4:38 PMRuihang
07/22/2025, 5:20 PMany changes, will be a big reorderingthat’s the problem of modulus, not ranges
Wei
07/22/2025, 9:08 PM