Skip to content

Flink: Add equality delete conversion DV resolution and writing - #16858

Merged
huaxingao merged 2 commits into
apache:mainfrom
mxm:resolve-equality-deletes.breakdown3
Jun 19, 2026
Merged

Flink: Add equality delete conversion DV resolution and writing#16858
huaxingao merged 2 commits into
apache:mainfrom
mxm:resolve-equality-deletes.breakdown3

Conversation

@mxm

@mxm mxm commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This PR adds EqualityConvertDVWriter, a two input operator keyed by data file path for the equality delete conversion task. It consumes the DVPositions emitted by EqualityConvertPKIndex and produces a DVWriteResult for the committer. Keying by data file path collects every position for a data file on one task, so the operator can write exactly one DV per file.

Positions are buffered until the watermark reaches the cycle's plan timestamp, broadcast on the second input, at which point the operator resolves and writes the DVs.

Existing DVs, including staging DVs for newly added data files, are folded into the rewrite because V3 allows only one DV per data file. Delete manifests are first pruned by partition summary to bound reads to the cycle's affected partitions rather than the table's full DV history.

The operator fails fast if the main branch snapshot changed since planning. On an upstream abort signal or a write failure it emits DVWriteResult.ABORT to ensure the committer doesn't commit partial results.

This commit is factored out of #15996.

Adds EqualityConvertDVWriter, a two input operator keyed by data file path for
the equality delete conversion task. It consumes the DVPositions emitted by
EqualityConvertPKIndex and produces a DVWriteResult for the committer. Keying by
data file path collects every position for a data file on one task, so the
operator can write exactly one DV per file.

Positions are buffered until the watermark reaches the cycle's plan timestamp,
broadcast on the second input, at which point the operator resolves and writes
the DVs.

Existing DVs, including staging DVs for newly added data files, are folded into
the rewrite because V3 allows only one DV per data file. Delete manifests are
first pruned by partition summary to bound reads to the cycle's affected
partitions rather than the table's full DV history.

The operator fails fast if the main branch snapshot changed since planning. On
an upstream abort signal or a write failure it emits DVWriteResult.ABORT to
ensure the committer doesn't commit partial results.

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

LGTM

@huaxingao
huaxingao merged commit a3a7558 into apache:main Jun 19, 2026
29 checks passed
@huaxingao

Copy link
Copy Markdown
Contributor

Thanks @mxm for the PR! Thanks @wombatu-kun for the review!

@mxm

mxm commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing / merging @wombatu-kun @huaxingao!

@nssalian nssalian added this to the Iceberg 1.12.0 milestone Jun 23, 2026
huaxingao pushed a commit to huaxingao/iceberg that referenced this pull request Jun 27, 2026
…OSS path)

Adds a runnable proof that the ConvertEqualityDeletes Flink maintenance
task converts equality deletes on a staging branch into deletion vectors
(DVs) on main, leaving no equality deletes behind, on stock OSS Apache
Iceberg.

- flink/v2.1 PoC test (TestEqualityDeleteToDVPoc): asserts before/after
  state explicitly (staging has the eq-delete; after conversion main has
  a DV, zero eq-deletes, and reads the delete-applied rows).
- poc-eq-delete-to-dv/: README, INVOCATION.md (jar build + task
  invocation), CUSTOMER_FLINK_SETUP.md (customer consumption).

Verified passing against apache/iceberg main with all six
ConvertEqualityDeletes PRs merged (apache#16831, apache#16844, apache#16858, apache#16874,
apache#16889, apache#16948).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
huaxingao pushed a commit to huaxingao/iceberg that referenced this pull request Jun 27, 2026
…OSS path)

Adds a runnable proof that the ConvertEqualityDeletes Flink maintenance
task converts equality deletes on a staging branch into deletion vectors
(DVs) on main, leaving no equality deletes behind, on stock OSS Apache
Iceberg.

- flink/v2.1 PoC test (TestEqualityDeleteToDVPoc): asserts before/after
  state explicitly (staging has the eq-delete; after conversion main has
  a DV, zero eq-deletes, and reads the delete-applied rows).
- poc-eq-delete-to-dv/: README, INVOCATION.md (jar build + task
  invocation), CUSTOMER_FLINK_SETUP.md (customer consumption).

Verified passing against apache/iceberg main with all six
ConvertEqualityDeletes PRs merged (apache#16831, apache#16844, apache#16858, apache#16874,
apache#16889, apache#16948).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jakelong95 pushed a commit to jakelong95/iceberg that referenced this pull request Jun 29, 2026
…he#16858)

* Flink: Add equality delete conversion DV resolution and writing

Adds EqualityConvertDVWriter, a two input operator keyed by data file path for
the equality delete conversion task. It consumes the DVPositions emitted by
EqualityConvertPKIndex and produces a DVWriteResult for the committer. Keying by
data file path collects every position for a data file on one task, so the
operator can write exactly one DV per file.

Positions are buffered until the watermark reaches the cycle's plan timestamp,
broadcast on the second input, at which point the operator resolves and writes
the DVs.

Existing DVs, including staging DVs for newly added data files, are folded into
the rewrite because V3 allows only one DV per data file. Delete manifests are
first pruned by partition summary to bound reads to the cycle's affected
partitions rather than the table's full DV history.

The operator fails fast if the main branch snapshot changed since planning. On
an upstream abort signal or a write failure it emits DVWriteResult.ABORT to
ensure the committer doesn't commit partial results.

* fixup! Add test for changed main snapshot abort and staging-DV merge
jakelong95 pushed a commit to jakelong95/iceberg that referenced this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants