fix: [branch-1.2] key the Parquet metadata cache by object store (#7856) - #7867
Draft
sshpuntoff wants to merge 2 commits into
Draft
sshpuntoff wants to merge 2 commits into
sshpuntoff wants to merge 2 commits into
Conversation
One runtime serves every scan of a native plan, and its Parquet metadata cache is keyed by a file's path within its store. An entry is valid while the file's size and modification time are unchanged, and every file a scan lists carries the same modification time. Two scans of one plan that read files of the same path and size from different stores therefore shared an entry: the second file was read with the first one's footer, whose statistics could prune its rows. Read and write the cache through a view that puts the store's URL in the key. The scan and the deletion-vector prefetch of a Delta scan use the same view, so the prefetch still serves the scan. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 27ace25)
…ntainers Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit c32a696)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Backport of #7856 to
branch-1.2. Part of #7855.Rationale for this change
branch-1.2has the bug of #7855: two scans in one native plan share a cached Parquet footer when their files have the same path and size in different object stores, and the second scan silently drops rows.What changes are included in this PR?
The two commits of #7856, cherry-picked with
-x. #7856 has not merged yet, so I will pick its squash commit again once it does, and this stays a draft until then.Adaptations:
native/core/src/parquet/mod.rsandnative/core/src/parquet/parquet_exec.rs: the cherry-pick conflicted on a neighbouring line forfile_error_context, whichbranch-1.2does not have. I kept only themetadata_cachelines.Other release branches:
branch-1.2is the newest, so no newer branch needs the fix.branch-1.1andbranch-1.0also key the shared cache by path. They have no Delta scan and the cherry-pick needs more adaptation there, so I have not opened backports for them. I can if the maintainers want those lines covered.How are these changes tested?
cargo check --all-targetsandcargo clippy --all-targets -- -D warningsinnative/pass.cargo test -p datafusion-comet --libpasses, including the three tests the fix added.same_path_and_size_in_two_stores_do_not_share_cached_metadataandsame_path_and_size_in_two_abfs_containers_do_not_share_cached_metadatafail on this branch, which shows the branch has the bug../mvnw test-compilewas not run. The change is Rust only.🤖 Generated with Claude Code