Skip to content

Flink: reject delete files in dynamic sink overwrite mode - #18330

Open
mithun-sudo wants to merge 2 commits into
apache:mainfrom
mithun-sudo:flink-dynamic-committer-reject-deletes-on-overwrite
Open

mithun-sudo wants to merge 2 commits into
apache:mainfrom
mithun-sudo:flink-dynamic-committer-reject-deletes-on-overwrite

Conversation

@mithun-sudo

Copy link
Copy Markdown
Contributor

Summary

  • Add the same Preconditions.checkState guard in DynamicCommitter.replacePartitions() that already exists in IcebergCommitter and IcebergFilesCommitter.
  • Add TestDynamicCommitter.testReplacePartitionsRejectsDeleteFiles to verify overwrite mode fails when delete files are present.

Existing state

DynamicCommitter silently ignored delete files on the replace-partitions path while static sink committers reject that combination.

Test plan

  • ./gradlew :iceberg-flink:iceberg-flink-2.3:test --tests "org.apache.iceberg.flink.sink.dynamic.TestDynamicCommitter.testReplacePartitionsRejectsDeleteFiles"
  • ./gradlew :iceberg-flink:iceberg-flink-2.3:test --tests "org.apache.iceberg.flink.sink.dynamic.TestDynamicCommitter.testReplacePartitions"

Align DynamicCommitter with IcebergCommitter by failing when replace
partitions is requested but pending WriteResults contain delete files.
@github-actions github-actions Bot added the flink label Sep 30, 2026
…rsions

Port the DynamicCommitter guard and test to 2.2 and 1.20, and rename the
test method per review feedback.

@developer-rpai developer-rpai 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.

Parity fix I was glad to see — the dynamic committer silently dropping deletes on the overwrite path while the static committers reject them is exactly the kind of divergence that bites later. Two checks: is the error string byte-identical to the one in IcebergCommitter (one message for one condition)? And a layer question — the guard fires at commit time, after the delete files are already written, so a rejected commit leaves orphans for cleanup. If the static sink rejects at the same point, parity is the right call for now; worth noting if there's an earlier natural rejection point in the dynamic writer.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants