Skip to content

fead: add Parquet content-defined chunking writer support#3608

Draft
kszucs wants to merge 2 commits into
apache:mainfrom
kszucs:feat/parquet-cdc-writer-support
Draft

fead: add Parquet content-defined chunking writer support#3608
kszucs wants to merge 2 commits into
apache:mainfrom
kszucs:feat/parquet-cdc-writer-support

Conversation

@kszucs

@kszucs kszucs commented Jul 6, 2026

Copy link
Copy Markdown
Member

Rationale for this change

PyArrow's ParquetWriter has natively supported content-defined chunking (CDC) since 21.0.0, producing stable page boundaries across appends (useful for content-addressable storage / dedup). PyIceberg's write path already funnels through a single kwargs builder (_get_parquet_writer_kwargs), so this wires CDC through as write.parquet.content-defined-chunking.* table properties, mirroring the property names and defaults iceberg-rust already uses for cross-engine consistency. A pyarrow>=21.0.0 version guard raises a clear ImportError if CDC is requested on an older PyArrow (extracted into a shared _require_pyarrow_version helper, reused by the existing Azure-filesystem version guard).

Are these changes tested?

Yes: unit tests for _get_parquet_writer_kwargs (disabled by default, enabled with defaults, enabled with custom values, unsupported PyArrow version) and an integration-style test that writes a table with CDC enabled end-to-end and reads it back.

Are there any user-facing changes?

Yes: four new table properties (write.parquet.content-defined-chunking.enabled, .min-chunk-size, .max-chunk-size, .norm-level), documented in configuration.md.

PyArrow's ParquetWriter has supported content-defined chunking natively
since 21.0.0, producing stable page boundaries across appends for
content-addressable storage. Wire this through as
write.parquet.content-defined-chunking.* table properties, mirroring
the property names and defaults already used by iceberg-rust.
@kszucs kszucs changed the title Add Parquet content-defined chunking (CDC) writer support fead: add Parquet content-defined chunking writer support Jul 6, 2026
Raise a clear ValueError for invalid content-defined-chunking config
(min-chunk-size <= 0, max-chunk-size <= min-chunk-size, negative
norm-level) instead of letting PyArrow's opaque internal error surface.
Also parametrize the near-duplicate kwargs tests, add coverage for the
new validation, and make the write-path test assert
use_content_defined_chunking actually reaches pq.ParquetWriter instead
of only checking a round-trip that would pass even if the kwarg were
silently dropped.
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