Skip to content

feat(spec): support the Avro deflate codec - #982

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:feat/avro-deflate-codec
Open

jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:feat/avro-deflate-codec

Conversation

@jackylee-ch

@jackylee-ch jackylee-ch commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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 — Java-readable — failed to read here with avro ocf: unsupported codec: deflate, and could not be written at all. (Paimon's manifest.compression default is zstd, 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 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.

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
jackylee-ch force-pushed the feat/avro-deflate-codec branch from b187ff4 to f599828 Compare September 30, 2026 13:52
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