Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions .github/workflows/compatibility-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ env:

jobs:
generate-fixtures:
name: Generate ${{ matrix.language }} fixtures
name: Generate ${{ matrix.language }} ${{ matrix.compression }} fixtures
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
language: [ java, cpp ]
compression: [ UNCOMPRESSED, SNAPPY, GZIP, LZ4, ZSTD, LZMA2 ]
steps:
- name: Checkout repository
uses: actions/checkout@v7
Expand Down Expand Up @@ -102,8 +103,9 @@ jobs:
./mvnw -P with-java \
-Dtest=TableModelEncodingCompressionCompatibilityTest#generateFixtures \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtsfile.compat.compression="${{ matrix.compression }}" \
-Dtsfile.compat.generate.dir="$PWD/compat-fixtures/java" \
test
test-compile surefire:test

- name: Build C++ tests
if: matrix.language == 'cpp'
Expand All @@ -115,10 +117,10 @@ jobs:
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Denable.antlr4=OFF \
-Denable.snappy=OFF \
-Denable.snappy=ON \
-Denable.lz4=ON \
-Denable.lzokay=OFF \
-Denable.zlib=OFF \
-Denable.zlib=ON \
-Denable.zstd=ON \
-Denable.lzma2=ON \
-Denable.simd=OFF \
Expand All @@ -129,27 +131,29 @@ jobs:
shell: bash
run: |
mkdir -p compat-fixtures/cpp
TSFILE_COMPAT_COMPRESSION="${{ matrix.compression }}" \
TSFILE_COMPAT_GENERATE_DIR="$PWD/compat-fixtures/cpp" \
./cpp/target/build/test/lib/TsFile_Test \
--gtest_filter=TableModelEncodingCompressionCompatibilityTest.GenerateFixtures

- name: Upload ${{ matrix.language }} fixtures
uses: actions/upload-artifact@v7
with:
name: tsfile-${{ matrix.language }}-compat-fixtures
name: tsfile-${{ matrix.language }}-${{ matrix.compression }}-compat-fixtures
path: compat-fixtures/${{ matrix.language }}/
if-no-files-found: error
retention-days: 1

validate-fixtures:
name: Validate ${{ matrix.writer }} fixtures with ${{ matrix.reader }}
name: Validate ${{ matrix.pair.writer }} ${{ matrix.compression }} with ${{ matrix.pair.reader }}
needs: generate-fixtures
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
compression: [ UNCOMPRESSED, SNAPPY, GZIP, LZ4, ZSTD, LZMA2 ]
pair:
- writer: java
reader: cpp
- writer: cpp
Expand All @@ -172,30 +176,31 @@ jobs:
restore-keys: ${{ runner.os }}-m2-

- name: Cache verified C++ dependency archives
if: matrix.reader == 'cpp'
if: matrix.pair.reader == 'cpp'
uses: actions/cache@v6
with:
path: cpp/target/dependency-cache
key: ${{ runner.os }}-tsfile-cpp-deps-${{ hashFiles('cpp/CMakeLists.txt', 'cpp/cmake/*Source.cmake', 'cpp/third_party/CMakeLists.txt') }}

- name: Download ${{ matrix.writer }} fixtures
- name: Download ${{ matrix.pair.writer }} fixtures
uses: actions/download-artifact@v8
with:
name: tsfile-${{ matrix.writer }}-compat-fixtures
path: compat-fixtures/${{ matrix.writer }}
name: tsfile-${{ matrix.pair.writer }}-${{ matrix.compression }}-compat-fixtures
path: compat-fixtures/${{ matrix.pair.writer }}

- name: Validate ${{ matrix.writer }} fixtures with Java
if: matrix.reader == 'java'
- name: Validate ${{ matrix.pair.writer }} fixtures with Java
if: matrix.pair.reader == 'java'
shell: bash
run: |
./mvnw -P with-java \
-Dtest=TableModelEncodingCompressionCompatibilityTest#validateFixtures \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtsfile.compat.validate.dir="$PWD/compat-fixtures/${{ matrix.writer }}" \
test
-Dtsfile.compat.compression="${{ matrix.compression }}" \
-Dtsfile.compat.validate.dir="$PWD/compat-fixtures/${{ matrix.pair.writer }}" \
test-compile surefire:test

- name: Build C++ tests
if: matrix.reader == 'cpp'
if: matrix.pair.reader == 'cpp'
shell: bash
run: |
./mvnw -P with-cpp \
Expand All @@ -204,19 +209,20 @@ jobs:
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Denable.antlr4=OFF \
-Denable.snappy=OFF \
-Denable.snappy=ON \
-Denable.lz4=ON \
-Denable.lzokay=OFF \
-Denable.zlib=OFF \
-Denable.zlib=ON \
-Denable.zstd=ON \
-Denable.lzma2=ON \
-Denable.simd=OFF \
package

- name: Validate ${{ matrix.writer }} fixtures with C++
if: matrix.reader == 'cpp'
- name: Validate ${{ matrix.pair.writer }} fixtures with C++
if: matrix.pair.reader == 'cpp'
shell: bash
run: |
TSFILE_COMPAT_VALIDATE_DIR="$PWD/compat-fixtures/${{ matrix.writer }}" \
TSFILE_COMPAT_COMPRESSION="${{ matrix.compression }}" \
TSFILE_COMPAT_VALIDATE_DIR="$PWD/compat-fixtures/${{ matrix.pair.writer }}" \
./cpp/target/build/test/lib/TsFile_Test \
--gtest_filter=TableModelEncodingCompressionCompatibilityTest.ValidateFixtures
1 change: 1 addition & 0 deletions cpp/src/encoding/decoder_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class DecoderFactory {

case RLE:
switch (data_type) {
case BOOLEAN:
case INT32:
case DATE:
ALLOC_AND_RETURN_DECODER(Int32RleDecoder);
Expand Down
8 changes: 8 additions & 0 deletions cpp/test/encoding/encoding_coverage_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <vector>

#include "common/allocator/byte_stream.h"
#include "encoding/decoder_factory.h"
#include "encoding/dictionary_decoder.h"
#include "encoding/dictionary_encoder.h"
#include "encoding/gorilla_decoder.h"
Expand All @@ -45,6 +46,13 @@

namespace storage {

TEST(EncodingCoverage, BooleanRleDecoderFactory) {
Decoder* decoder =
DecoderFactory::alloc_value_decoder(common::RLE, common::BOOLEAN);
ASSERT_NE(nullptr, decoder);
DecoderFactory::free(decoder);
}

// ── Type-mismatch returns ────────────────────────────────────────────────
//
// Every codec exposes read_boolean / read_int32 / read_int64 / read_float /
Expand Down
Loading
Loading