mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-15 09:42:58 +00:00
* fix: don't prune fields in last non null mode * test: add sqlness test for field pruning * test: add flush * refine implementation Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
25 lines
552 B
SQL
25 lines
552 B
SQL
CREATE TABLE IF NOT EXISTS prune_field (
|
|
ts TIMESTAMP TIME INDEX,
|
|
tag UInt16,
|
|
a UInt8,
|
|
b UInt8,
|
|
PRIMARY KEY (tag)) ENGINE = mito WITH('merge_mode'='last_non_null');
|
|
|
|
insert into prune_field(ts, tag, a, b) values(0, 1, 1, null);
|
|
|
|
admin flush_table('prune_field');
|
|
|
|
insert into prune_field(ts, tag, a, b) values(0, 1, null, 1);
|
|
|
|
admin flush_table('prune_field');
|
|
|
|
select * from prune_field where a = 1;
|
|
|
|
select * from prune_field where b = 1;
|
|
|
|
select * from prune_field;
|
|
|
|
select * from prune_field where a = 1 and b = 1;
|
|
|
|
drop table prune_field;
|