diff --git a/tests/perf/query_cases/sst_float_bss/case.toml b/tests/perf/query_cases/sst_float_bss/case.toml index cc2e5fa96ec..272e0eb4bc4 100644 --- a/tests/perf/query_cases/sst_float_bss/case.toml +++ b/tests/perf/query_cases/sst_float_bss/case.toml @@ -21,10 +21,10 @@ chunk_series_count = 128 timeout_seconds = 600 visibility_timeout_seconds = 300 -# Keep the physical-table definition identical except for float encoding. The -# high shared TWCS trigger avoids compaction changing the three-flush layout. +# Omit the default encoding from base setup because older binaries do not recognize it. +# The high shared TWCS trigger avoids compaction changing the three-flush layout. base_setup_sql = [ - "CREATE TABLE sst_float_bss_physical (greptime_timestamp TIMESTAMP TIME INDEX, greptime_value DOUBLE) ENGINE=metric WITH ('physical_metric_table'='', 'experimental_sst_float_field_encoding'='default', 'compaction.twcs.trigger_file_num'='100')", + "CREATE TABLE sst_float_bss_physical (greptime_timestamp TIMESTAMP TIME INDEX, greptime_value DOUBLE) ENGINE=metric WITH ('physical_metric_table'='', 'compaction.twcs.trigger_file_num'='100')", ] candidate_setup_sql = [ "CREATE TABLE sst_float_bss_physical (greptime_timestamp TIMESTAMP TIME INDEX, greptime_value DOUBLE) ENGINE=metric WITH ('physical_metric_table'='', 'experimental_sst_float_field_encoding'='byte_stream_split', 'compaction.twcs.trigger_file_num'='100')", diff --git a/tests/perf/test_query_regression_case_selection.py b/tests/perf/test_query_regression_case_selection.py index 58cefa4395b..4000a5da141 100644 --- a/tests/perf/test_query_regression_case_selection.py +++ b/tests/perf/test_query_regression_case_selection.py @@ -16,6 +16,7 @@ """Coverage for query-regression case group selection.""" import importlib.util +import re import sys import unittest from pathlib import Path @@ -54,6 +55,23 @@ class QueryRegressionCaseSelectionTest(unittest.TestCase): case = "tests/perf/query_cases/sql_topk_order_by/case.toml" self.assertEqual(runner.split_cases([case]), [case]) + def test_sst_float_bss_omits_base_encoding_for_older_binaries(self) -> None: + case_path = Path(__file__).parent / "query_cases/sst_float_bss/case.toml" + setup_sql = dict(re.findall( + r'(base|candidate)_setup_sql = \[\s*"([^"\n]+)"', + case_path.read_text(), + )) + base_setup = setup_sql["base"] + candidate_setup = setup_sql["candidate"] + candidate_option = "'experimental_sst_float_field_encoding'='byte_stream_split'" + + self.assertNotIn("experimental_sst_float_field_encoding", base_setup) + self.assertIn(candidate_option, candidate_setup) + self.assertEqual( + base_setup, + candidate_setup.replace(f", {candidate_option}", ""), + ) + if __name__ == "__main__": unittest.main()