Files
greptimedb/tests/compatibility/cases/partition_iceberg_hash/setup.sql
T
dennis zhuang 2e84833ac8 feat(partition): support iceberg_hash in partition rules (#9693)
* feat(partition): support iceberg_hash in partition rules

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(partition): reject partition column type changes and quote rule identifiers

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(table): keep time index widening for partition columns

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(partition): replace PartitionFunction with IcebergHash

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* docs(partition): describe iceberg_hash in the function module

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(meta): validate iceberg_hash partition bounds on ALTER and trim comments

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test: quote partition rule identifiers in SHOW CREATE TABLE expectations

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test(partition): check hash rules in information_schema and repartition target columns

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(partition): coerce hash partition rules against the evaluation schema

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(partition): keep quotes in partition column names when building filters

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-27 09:23:00 +00:00

23 lines
591 B
SQL

CREATE TABLE iceberg_hash_routes (
host STRING,
tenant BIGINT UNSIGNED,
ts TIMESTAMP TIME INDEX,
v INT,
PRIMARY KEY (host, tenant)
)
PARTITION ON COLUMNS (host, tenant) (
iceberg_hash(host) < 0 AND tenant < 100,
iceberg_hash(host) < 0 AND tenant >= 100,
iceberg_hash(host) >= 0 AND iceberg_hash(tenant) < 0,
iceberg_hash(host) >= 0 AND iceberg_hash(tenant) >= 0
);
INSERT INTO iceberg_hash_routes VALUES
('a', 1, 1, 1),
('b', 100, 2, 2),
('server42', 18446744073709551615, 3, 3),
('中🙂', 0, 4, 4),
(NULL, 7, 5, 5);
ADMIN FLUSH_TABLE('iceberg_hash_routes');