Skip to content

Core: Add dv_count column to PartitionsTable - #17851

Open
hemanthboyina wants to merge 1 commit into
apache:mainfrom
hemanthboyina:dv_count_non_breaking
Open

Core: Add dv_count column to PartitionsTable#17851
hemanthboyina wants to merge 1 commit into
apache:mainfrom
hemanthboyina:dv_count_non_breaking

Conversation

@hemanthboyina

@hemanthboyina hemanthboyina commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This adds a new dv_count column to the partitions metadata table that reports the number of deletion vectors (DVs) per partition.

Background

This is a follow-up to #16125 (adding dv_count), which was reverted in #17825.

The original change reused the existing position_delete_file_count field to exclude
DVs, which was a behavioral change: position_delete_file_count had previously
counted all position deletes, including DVs. Changing that semantic could break users
relying on the existing behavior, so the PR was reverted.

Per the discussion on the revert, this takes a non-breaking approach:

  • position_delete_file_count is left unchanged — it continues to count all
    position-delete files, including DVs.
  • A new dv_count field is added on top, which counts only DVs

so dv_count counts DVs rather than physical Puffin files, even when multiple DVs are
packed into a single Puffin file.

Comment on lines +365 to +367
if (file.format() == FileFormat.PUFFIN) {
this.dvCount += 1;
}

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.

1 Puffin files can multiple DVs right ?

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.

The intent is to sum up the number of DVs and not the number of Puffin files containing DVs. I believe the current implementation does that.

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.

i see, that make sense, we should add a test for this scenario to make sure we never double count !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

have written the test and pushed the changes

@gaborkaszab

Copy link
Copy Markdown
Contributor

Hey @hemanthboyina ,

Thanks for the PR! Would you mind, for the record, linking the previous PR and the revert and give some context?

@hemanthboyina

Copy link
Copy Markdown
Contributor Author

thanks @gaborkaszab , updated the PR description with the context.

Comment thread core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java Outdated

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

cc @pvary

@pvary

pvary commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

I broke this PR, because the Flink version upgrade (to support 1.20, 2.1, 2.2, 2.3 in 1.12.0) takes priority and I have merged it. Please rebase, and sorry for the extra work.
Also, I would like to see if @singhpk234 has any more comments before merging

@singhpk234 singhpk234 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 @pvary, the change mostly LGTM, thanks @hemanthboyina , added a test suggestion

Recommend updating the doc too once this

Comment on lines +365 to +367
if (file.format() == FileFormat.PUFFIN) {
this.dvCount += 1;
}

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.

i see, that make sense, we should add a test for this scenario to make sure we never double count !

@hemanthboyina
hemanthboyina force-pushed the dv_count_non_breaking branch from cfe6e25 to a69b214 Compare August 31, 2026 12:04
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