Skip to content

feat(java): add read-only ALP v1 decoding - #1145

Open
CRZbulabula wants to merge 2 commits into
apache:developfrom
CRZbulabula:feat/java-alp-decoder
Open

CRZbulabula wants to merge 2 commits into
apache:developfrom
CRZbulabula:feat/java-alp-decoder

Conversation

@CRZbulabula

Copy link
Copy Markdown
Contributor

Motivation

Java readers currently reject ALP (encoding ID 15), so they cannot query FLOAT and DOUBLE series written with the C++ ALP v1 encoder.

Changes

  • Add a read-only Java ALP v1 decoder for FLOAT and DOUBLE, including plain fallback blocks and validation of page and block boundaries.
  • Route encoding ID 15 through the Java FLOAT and DOUBLE decoder factories while leaving Java encoding unsupported.
  • Add a small C++-generated synthetic TsFile fixture and Java tests covering multiple pages and ALP blocks, nulls, plain blocks, and special floating-point values.
  • Declare read-only ALP support in the compatibility matrix across FLOAT/DOUBLE scales and compressions, and add tree-model rows. Extend the C++ parser and completeness sweep through ALP, and update compatibility documentation.

For example, DeviceTableModelReader can query a FLOAT column from a table written by the C++ ALP encoder and recover the original values, including values at page boundaries.

Tests

  • AlpCppInteropTest and MessagesTest pass against C++-generated fixtures.
  • ./mvnw -B -P with-java clean test: 1,401 tests, 0 failures, 0 errors, 11 skipped.
  • ./mvnw -B spotless:check -P with-java,with-cpp and ./mvnw -B apache-rat:check -P with-java,with-cpp pass; RAT reports 0 unapproved files.
  • Compatibility subset: C++-written fixtures (48 expanded ALP cases plus 44 regression cases) all pass Java validation; Java-written regression fixtures (44 cases) all pass C++ validation. The C++ completeness sweep passes against the full matrix.
  • Also validated one real 5 MB ALP file (1,518,750 points) against independent C++ and Python readers; timestamps and FLOAT32 values matched.

Compatibility

This adds Java read support for existing ALP v1 FLOAT and DOUBLE files. It does not add ALP encoding to Java writers or change the on-disk format.

This change was developed with AI assistance and validated with the tests listed above.

🤖 Generated with Claude Code

Generated-by: OpenAI Codex
Declare C++ write support and Java and C++ read support for ALP FLOAT
and DOUBLE across the table and tree models. Extend the C++ coverage
scan to include ALP so the matrix exercises Java's decoder without
implying Java encoding support. Group the ALP messages and document
how to regenerate the fixtures using a portable path.

Verified 1,401 Java tests, 92 C++ fixtures read by Java, and 44 Java
fixtures read by C++. The full C++ and AddressSanitizer suites passed
(1,859 and 1,886 tests), as did Spotless and Apache RAT.

Generated-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant