feat(spec): support the Avro deflate codec - #982
Open
jackylee-ch wants to merge 1 commit into
Open
jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
The fast OCF reader (`spec/avro/ocf.rs`) only accepted the null, snappy and zstandard codecs, and the object-file writer (`spec/avro/objects_file.rs`) only produced those three. `deflate` is a standard Avro codec that Paimon accepts through `CodecFactory.fromString` (e.g. `manifest.compression=deflate` or `avro.output.codec=deflate`), so a manifest or object file written that way failed to read with `avro ocf: unsupported codec: deflate`, and could not be written at all. Decode deflate blocks with `flate2` (the Avro deflate codec is raw DEFLATE, matching the `miniz_oxide` output apache-avro produces on the write path) and map the `deflate` compression name to `Codec::Deflate`. Round-trip tests cover the reader (write with apache-avro, read back and decode the record) and a write-then-read of a manifest entry through the fast decoder.
jackylee-ch
force-pushed
the
feat/avro-deflate-codec
branch
from
September 30, 2026 13:52
b187ff4 to
f599828
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fast OCF reader (
spec/avro/ocf.rs) only accepted the null, snappy and zstandard codecs, and the object-file writer (spec/avro/objects_file.rs) only produced those three.deflateis a standard Avro codec that Paimon accepts throughCodecFactory.fromString(e.g.manifest.compression=deflate, oravro.output.codec=deflate), so a manifest or object file written that way — Java-readable — failed to read here withavro ocf: unsupported codec: deflate, and could not be written at all. (Paimon'smanifest.compressiondefault iszstd, so this affects tables explicitly configured for deflate, not the default path.)Decode deflate blocks with
flate2(the Avro deflate codec is raw DEFLATE, matching theminiz_oxideoutput apache-avro produces on the write path) and map thedeflatecompression name toCodec::Deflate.Round-trip tests cover the reader (write with apache-avro, read back and decode the record) and a write-then-read of a manifest entry through the fast decoder.