Skip to content

fix: count data overlay bytes in calculate_data_stats - #10885

Merged
Xuanwo merged 4 commits into
lance-format:mainfrom
zhangyue19921010:fix/data-stats-count-overlay-bytes
Nov 15, 2026
Merged

Xuanwo merged 4 commits into
lance-format:mainfrom
zhangyue19921010:fix/data-stats-count-overlay-bytes

Conversation

@zhangyue19921010

@zhangyue19921010 zhangyue19921010 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

FileFragment::storage_stats only opened the fragment's base data files, so the bytes a field's values occupy in data overlay files were left out of bytes_on_disk.

Open each overlay's data file as well and add its column sizes to the fields it holds.

Integration verification

Integrated with main 580690261d180090bb06b010f5d11600fe09b66a, which carries the #11095 cleanup fixture repair; merge commit 6fa22cbb9a4bcc91f2ee74d2202729a57182d2a7. The feature diff is still the same two files (+187/-6).

The regression writes two fragments with max_rows_per_file = 2, overlays rows only in fragment 0, and asserts that the untouched fragment is still counted. id bytes stay exactly unchanged, and val bytes grow by exactly the overlay file's physical column page-buffer bytes measured directly from its raw FileReader metadata.

On the combined tree: the foreign-root cleanup test with the aws feature (1 passed), dataset::statistics::tests (2 passed), dataset::overlay:: (64 passed), cargo fmt --all --check, and cargo clippy --all --tests --benches -- -D warnings.

This remains a per-fragment sum of base and overlay page-buffer bytes for current fields. It is not logical live size or object-store accounting, and excludes footer, manifest, deletion-file, and Blob-sidecar bytes. Unknown and dropped fields remain excluded.

FileFragment::storage_stats only opened the fragment's base data files, so
the bytes a field's values occupy in data overlay files were left out of
bytes_on_disk. Open each overlay's data file as well and add its column
sizes to the fields it holds.

@claude claude Bot 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the bug Something isn't working label Nov 10, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 10, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 15, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 15, 2026

@lance-gatekeeper lance-gatekeeper Bot 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.

✅ Gate recommendation: approve.

The overlay byte accounting fix and regression are unchanged after integrating current main. Both targeted statistics tests pass locally on the combined tree. No blocking findings.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 15, 2026
@Xuanwo
Xuanwo merged commit c029d99 into lance-format:main Nov 15, 2026
42 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants