Skip to content

Conversation

@mxm
Copy link
Contributor

@mxm mxm commented Nov 13, 2025

When RowDelta only adds data files without adding delete files or deleting data files, the snapshot should be classified as an APPEND operation instead of OVERWRITE. The resulting operation is quite important because readers which read only append snapshots won't process overwrite snapshots.

The patch here is similar to the existing logic in OverwriteFiles: https://github.com/apache/iceberg/blame/main/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java#L56

Merging this would avoid patches like #14559, where separate code paths are required for the overwrite and the append path.

When RowDelta only adds data files without adding delete files or
deleting data files, it should be classified as an APPEND operation
instead of OVERWRITE.

This is similiar to the existing logic in OverwriteFiles:
https://github.com/apache/iceberg/blame/main/core/src/main/java/org/apache/iceberg/BaseOverwriteFiles.java#L56
@github-actions github-actions bot added the core label Nov 13, 2025

@TestTemplate
public void addOnlyDataFilesProducesAppendOperation() {
SnapshotUpdate<?> rowDelta = table.newRowDelta().addRows(FILE_A).addRows(FILE_B);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point!

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on adding this test case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added. Please see dcd7e73.

Copy link
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

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

LGTM

@pvary pvary merged commit c02d467 into apache:main Nov 18, 2025
44 checks passed
@pvary
Copy link
Contributor

pvary commented Nov 18, 2025

Merged to main.
Thanks @mxm for the PR, and @nastra, @huaxingao, @stevenzwu, @stevenzwu for the review!

@mxm mxm deleted the overwrite-to-append branch November 18, 2025 09:37
@mxm
Copy link
Contributor Author

mxm commented Nov 18, 2025

Thank you everyone for the reviews! And thanks for merging @pvary.

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.

6 participants