* test(compat): downgrade to v1.2.1 instead of v1.1.4 SSTs written since #10528 can have inverted-index segments that cross row group boundaries. Readers older than v1.2.0 do not split such segments and return fewer rows, so v1.1.x is no longer a supported downgrade target. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(cmd): record the decoded row group size of a replacement SST sst_replace set max_row_group_decoded_size to 0 for the replacement file. Compute it from the replacement footer with the helper writers use, which is now public in mito2. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(mito2): derive decoded value bytes from size statistics for old SSTs SSTs written before #10528 have no greptime:max_row_group_value_bytes or greptime:max_row_value_width footer keys, so a row group of repeated large dictionary-encoded values was sized by its encoded bytes on the first compaction and read after upgrade. When the keys are absent, sum the unencoded_byte_array_data_bytes size statistic of each row group's byte array column chunks instead, skipping columns that readers decode as Arrow dictionaries like the writer does. Parquet writers record the statistic whenever column statistics are enabled, which mito did by default with parquet >= 53 (v0.12.0). Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(mito2): count only top-level var-len columns in the size statistics fallback The fallback summed every non-dictionary byte array leaf, including leaves nested in structs such as JSON2 columns, which the footer keys do not count. New files without var-len values write no keys, so they took the fallback and got a larger decoded size than before. Count only leaves that are top-level string or binary columns, which matches var_len_value_bytes and leaves key-less new files unchanged. Drop the early exit, which dictionary primary keys defeated anyway. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * perf(mito2): index the Arrow schema by root column in the size statistics fallback Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(compat): look up an inverted index segment that crosses a row group boundary after downgrade Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(compat): also downgrade to v1.2.0, the oldest reader that splits index segments Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(mito2): treat unparseable footer size keys as absent Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * docs(compat): state the v1.2.0 downgrade floor Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Sqlness Test
Sqlness manual
Case file
Sqlness has two types of file:
.sql: test input, SQL only.result: expected test output, SQL and its results
.result is the output (execution result) file. If you see .result files is changed,
it means this test gets a different result and indicates it fails. You should
check change logs to solve the problem.
You only need to write test SQL in .sql file, and run the test.
Case organization
The root dir of input cases is tests/cases. It contains several subdirectories stand for different test
modes. E.g., standalone/ contains all the tests to run under greptimedb standalone start mode.
Under the first level of subdirectory (e.g. the cases/standalone), you can organize your cases as you like.
Sqlness walks through every file recursively and runs them.
Kafka WAL
Sqlness supports Kafka WAL. You can either provide a Kafka cluster or let sqlness to start one for you.
To run test with kafka, you need to pass the option -w kafka. If no other options are provided, sqlness will use conf/kafka-cluster.yml to start a Kafka cluster. This requires docker and docker-compose commands in your environment.
Otherwise, you can additionally pass the your existing kafka environment to sqlness with -k option. E.g.:
cargo sqlness bare -w kafka -k localhost:9092
In this case, sqlness will not start its own kafka cluster and the one you provided instead.
Run the test
Unlike other tests, this harness is in a binary target form. You can run it with:
cargo sqlness bare
It automatically finishes the following procedures: compile GreptimeDB, start it, grab tests and feed it to
the server, then collect and compare the results. You only need to check if the .result files are changed.
If not, congratulations, the test is passed 🥳!