Files
greptimedb/tests/compatibility/cases/exemplar_legacy_keys/verify.sql
T
shuiyisong ec240ad7e6 feat(mito): preserve ordinary sparse keys across writes and schema changes (#9920)
* feat(mito): support ordinary sparse append tables

Ordinary append tables need sparse keys for optional series tags, including JSON2 values written through row and bulk paths. This change validates sparse tag schemas and defaults, keeps key identity stable when nullable tags are added, selects flat SST storage, and preserves append-mode semantics when reopening regions.

Includes storage, bulk-write, schema-evolution and repartition tests, plus SQL and mixed-version fixtures. Existing metric-engine sparse key handling remains supported. This is the storage prerequisite for exemplar ingestion; it introduces no exemplar protocol endpoint.

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix(mito): preserve reserved sparse key semantics

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix(mito): clarify sparse errors and avoid panics

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* perf(mito): reduce sparse key validation overhead

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: sqlness

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* perf(mito-codec): reduce sparse validation cost

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* refactor(mito): remove ordinary sparse support

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-10-29 05:45:07 +00:00

14 lines
697 B
SQL

SELECT ts, host, val FROM dense_keys ORDER BY ts;
SELECT ts, host, val FROM logical_keys ORDER BY ts;
INSERT INTO dense_keys (ts, host, val) VALUES (3, 'new', 5.5);
INSERT INTO logical_keys (ts, host, val) VALUES (3, 'new', 6.5);
ADMIN FLUSH_TABLE('dense_keys');
ADMIN FLUSH_TABLE('metric_keys');
SELECT COUNT(*) FROM dense_keys;
SELECT COUNT(*) FROM logical_keys;
-- New OTLP writes retain the historical infinity label across upgrade.
INSERT INTO otlp_upgrade_bucket VALUES (30000, 'inf', 3), (40000, 'inf', 4);
SELECT greptime_timestamp, le, greptime_value FROM otlp_upgrade_bucket ORDER BY greptime_timestamp;
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (10, 40, '10s') otlp_upgrade_bucket{le="inf"};