mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-16 18:22:55 +00:00
* feat: don't allow creating logical table with partitions Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
44 lines
839 B
SQL
44 lines
839 B
SQL
create table metric_engine_partition (
|
|
ts timestamp time index,
|
|
host string primary key,
|
|
cpu double,
|
|
)
|
|
partition on columns (host) (
|
|
host <= 'host1',
|
|
host > 'host1' and host <= 'host2',
|
|
host > 'host2'
|
|
)
|
|
engine = metric
|
|
with (
|
|
physical_metric_table = "true",
|
|
);
|
|
|
|
select count(*) from metric_engine_partition;
|
|
|
|
create table logical_table_1 (
|
|
ts timestamp time index,
|
|
host string primary key,
|
|
cpu double,
|
|
)
|
|
partition on columns (host) ()
|
|
engine = metric
|
|
with (
|
|
on_physical_table = "metric_engine_partition",
|
|
);
|
|
|
|
create table logical_table_2 (
|
|
ts timestamp time index,
|
|
host string primary key,
|
|
cpu double,
|
|
)
|
|
engine = metric
|
|
with (
|
|
on_physical_table = "metric_engine_partition",
|
|
);
|
|
|
|
show create table logical_table_2;
|
|
|
|
drop table logical_table_2;
|
|
|
|
drop table metric_engine_partition;
|