Skip to content

feat: add file-scoped position delete index loader - #3291

Closed
unikdahal wants to merge 2 commits into
apache:mainfrom
unikdahal:feat/file-scoped-position-delete-loader
Closed

unikdahal wants to merge 2 commits into
apache:mainfrom
unikdahal:feat/file-scoped-position-delete-loader

Conversation

@unikdahal

Copy link
Copy Markdown

Part of #3287.

Adds a loader for file-scoped V2 position delete files.

It reads and validates the "file_path" / "pos" fields, checks that the delete file targets the expected data file, and returns the positions in a canonical sorted form.

Also covers malformed schemas, mismatched paths, negative positions, duplicate/out-of-order positions, encrypted files, and record-count validation.

Keeping this PR limited to the loader. The rewrite/sorting writer will come separately.

Copilot AI lite review requested due to automatic review settings September 28, 2026 18:54

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Adds a dedicated loader/index for file-scoped V2 Parquet position-delete files, validating schema/metadata and returning canonical sorted/de-duplicated positions.

Changes:

  • Introduces PositionDeleteIndex + PositionDeleteIndexLoader to read/validate Parquet position-delete files and build an in-memory index.
  • Adds extensive tests for schema validation, target verification, record_count checks, and ordering/dedup behavior.
  • Updates public API surface listing to expose the new loader/index types.
File Description
crates/​iceberg/​src/​arrow/​delete_file_loader.rs Adds position-delete index/loader implementation and related tests.
crates/​iceberg/​public-api.txt Exposes the new public structs and methods in the API listing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@unikdahal

Copy link
Copy Markdown
Author

Just a note for anyone reviewing this: I went through all four Copilot comments as well. I added the small guard in the test helper. The encrypted delete-file path is already covered by the existing encrypted positional-delete test, and I kept the projected field-id lookup as-is since Arrow/Parquet preserves those IDs in the projected schema today. I also kept the loader/metrics wiring scoped for now rather than widening this PR.

@JeonDaehong JeonDaehong 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.

Question on the public type: PositionDeleteIndex wraps a DeleteVector but only exposes iter() as i64. Since #3287 is about rewriting file-scoped position deletes, and #3232 adds DeleteVector::serialize for the deletion-vector-v1 blob, the rewrite path would probably want the DeleteVector itself. With only iter(), it would have to rebuild one position by position.

Would it be simpler to return DeleteVector directly, or add something like into_delete_vector()? That would also avoid having a second public type for a set of deleted positions (u64 in DeleteVector, i64 here).

@unikdahal

Copy link
Copy Markdown
Author

Would it be simpler to return DeleteVector directly, or add something like into_delete_vector()? That would also avoid having a second public type for a set of deleted positions (u64 in DeleteVector, i64 here).

Yeah, avoiding a position-by-position rebuild for the rewrite path is a fair point.

I’m less sure that exposing "DeleteVector" is the right API though, especially with the DV work still in progress in #3232 / #2580. I’d keep this PR scoped to the loader and decide the bulk transfer/merge API alongside that work or the rewrite integration, once the right shape is clearer.

@JeonDaehong

Copy link
Copy Markdown
Contributor

@unikdahal

Agreed. Deciding that together with #3232 or #2580 sounds like the right approach. If you need a hand or open a related discussion later, feel free to ping me and I would be happy to think it through with you. Thanks for considering it.

@github-actions

github-actions Bot commented Nov 6, 2026

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 Nov 6, 2026
@github-actions

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 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants