Files
greptimedb/tests/compatibility/cases/downgrade_compatibility/setup.sql
T
dennis zhuang 672e94f61d feat: add column encoding option and use it for trace span ids (#9629)
* feat: add column encoding option and set it for trace span ids

COMPRESSION WITH accepts encoding = 'plain' | 'delta_binary_packed'.
Either disables the dictionary for the column; delta_binary_packed is
limited to integer and timestamp columns.

OTLP trace v1/v2 tables now create span_id and parent_span_id with plain
encoding and 64KiB pages, and timestamp_end with delta_binary_packed.

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

* test: add compatibility cases for column encoding options

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

* test: move column encoding downgrade checks into downgrade_compatibility

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

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-16 09:40:54 +00:00

71 lines
2.1 KiB
SQL

CREATE TABLE t_downgrade_compatibility(
ts TIMESTAMP TIME INDEX,
host STRING PRIMARY KEY,
val INT
);
INSERT INTO t_downgrade_compatibility VALUES
('2024-02-09 00:00:00+0000', 'host_a', 1),
('2024-02-09 00:01:00+0000', 'host_b', 2);
ADMIN FLUSH_TABLE('t_downgrade_compatibility');
CREATE TABLE t_preserve_sequence_downgrade(
ts TIMESTAMP TIME INDEX,
host STRING,
val INT,
PRIMARY KEY(host)
)
ENGINE=mito
WITH(append_mode='true', preserve_row_sequence='true');
INSERT INTO t_preserve_sequence_downgrade VALUES
('2024-02-09 00:00:00+0000', 'host_a', 1),
('2024-02-09 00:01:00+0000', 'host_b', 2);
ADMIN FLUSH_TABLE('t_preserve_sequence_downgrade');
INSERT INTO t_preserve_sequence_downgrade VALUES
('2024-02-09 00:02:00+0000', 'host_a', 3),
('2024-02-09 00:03:00+0000', 'host_c', 4);
ADMIN FLUSH_TABLE('t_preserve_sequence_downgrade');
ADMIN COMPACT_TABLE('t_preserve_sequence_downgrade');
CREATE TABLE t_sst_float_field_encoding_downgrade(
ts TIMESTAMP TIME INDEX,
host STRING PRIMARY KEY,
f FLOAT,
d DOUBLE
) ENGINE=mito
WITH('experimental_sst_float_field_encoding'='byte_stream_split');
INSERT INTO t_sst_float_field_encoding_downgrade VALUES
('2024-02-10 00:00:00+0000', 'host_a', 1.25, 10.5),
('2024-02-10 00:01:00+0000', 'host_b', -2.5, 20.25),
('2024-02-10 00:02:00+0000', 'host_c', NULL, NULL);
ADMIN FLUSH_TABLE('t_sst_float_field_encoding_downgrade');
CREATE TABLE t_fulltext_bloom_v2_downgrade (
ts TIMESTAMP TIME INDEX,
msg STRING FULLTEXT INDEX WITH(analyzer = 'English', backend = 'bloom', case_sensitive = 'false')
);
INSERT INTO t_fulltext_bloom_v2_downgrade VALUES
(1, 'hello_world'),
(2, '错误error日志');
ADMIN FLUSH_TABLE('t_fulltext_bloom_v2_downgrade');
CREATE TABLE t_column_encoding_downgrade (
ts TIMESTAMP TIME INDEX,
span_id STRING COMPRESSION WITH (encoding = 'plain', page_size = '64KiB'),
ts_end TIMESTAMP(9) COMPRESSION WITH (encoding = 'delta_binary_packed')
);
INSERT INTO t_column_encoding_downgrade VALUES (1, 'a1', 1000), (2, 'a2', 2000), (3, NULL, NULL);
ADMIN FLUSH_TABLE('t_column_encoding_downgrade');