Skip to content

feat(parquet): omit unknown fields from writes - #3072

Open
manuzhang wants to merge 3 commits into
apache:mainfrom
manuzhang:add-unknown-datatype-parquet-write
Open

manuzhang wants to merge 3 commits into
apache:mainfrom
manuzhang:add-unknown-datatype-parquet-write

Conversation

@manuzhang

@manuzhang manuzhang commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

No issue is currently linked. This is the Parquet-write follow-up to #2773, which added the Unknown logical type.

What changes are included in this PR?

  • Derive the physical Parquet Arrow schema from the Iceberg table schema, omitting Unknown fields. Reject schemas and container values with no writable physical fields, as well as unsupported Variant fields.
  • Validate incoming Arrow batches against the full logical table schema before projection. Reject unexpected fields and mismatched list element IDs in ID mode; allow Arrow's item list-element name in name mode.
  • Project nested structs, lists, and maps to the writable schema while preserving row counts. Cache the projection for repeated batch schemas.
  • Remove the precomputed _partition routing column before partitioned batches reach the file writer.
  • Count NaN values from the projected physical batch using its Arrow schema.

Are these changes tested?

  • Added regressions for top-level and nested Unknown fields, empty physical schemas and containers, unsupported Variant fields, unexpected source fields, invalid field-ID metadata, list element identity, name matching, and _partition removal.
  • cargo test -p iceberg --lib parquet (57 passed)
  • cargo test -p iceberg --lib record_batch_partition_splitter (2 passed)
  • Focused Parquet writer tests after the final field rename (30 passed)
  • make check-fmt
  • make check-clippy
  • git diff --check

AI Disclosure

This PR was prepared with assistance from Codex.

@dannycjones

dannycjones commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Is this ready for review, after a rebase @manuzhang?

@manuzhang
manuzhang force-pushed the add-unknown-datatype-parquet-write branch 4 times, most recently from 768f277 to 087b635 Compare September 18, 2026 03:27
@manuzhang
manuzhang marked this pull request as ready for review September 18, 2026 16:26
Copilot AI lite review requested due to automatic review settings September 18, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@manuzhang

Copy link
Copy Markdown
Member Author

@dannycjones This is ready for review now, thanks!

@dannycjones dannycjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, @manuzhang! I have quite a few comments, I've been working on similar code myself when trying to implement both geo and write-default so I've been stumbling around here a bunch. I'm also still finding my feet around Arrow and how its used in iceberg-rust.

Comment thread crates/iceberg/src/arrow/schema.rs Resolved
Comment thread crates/iceberg/src/arrow/schema.rs Resolved
Comment thread crates/iceberg/src/arrow/schema.rs Resolved
Comment thread crates/iceberg/src/arrow/schema.rs Resolved
Comment thread crates/iceberg/src/arrow/schema.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Oct 30, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions Bot closed this Nov 7, 2026
@blackmwk blackmwk reopened this Nov 13, 2026
@github-actions github-actions Bot removed the stale label Nov 14, 2026
manuzhang and others added 3 commits November 15, 2026 00:33
Cache validated batch projections, keep partition routing metadata out of writes, and tighten schema conversion and NaN counting.

Co-authored-by: Codex <[email protected]>
@manuzhang
manuzhang force-pushed the add-unknown-datatype-parquet-write branch from 80cfbdc to 7a9d990 Compare November 14, 2026 16:43
@manuzhang

Copy link
Copy Markdown
Member Author

@dannycjones Could you please take another look? Previous comments have been addressed.

This branch has not been deployed

No deployments
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.

4 participants