fix(arrow,maintenance): keep dict columns in batch reader; opt-in expire_snapshots file GC#15
Open
abnobdoss wants to merge 3 commits into
Open
fix(arrow,maintenance): keep dict columns in batch reader; opt-in expire_snapshots file GC#15abnobdoss wants to merge 3 commits into
abnobdoss wants to merge 3 commits into
Conversation
added 3 commits
June 23, 2026 21:27
Fixes apache#3540. to_arrow_batch_reader(dictionary_columns=...) cast each batch to a target schema built from schema_to_pyarrow(projection()), which has no dictionary types, silently decoding dictionary-encoded columns back to plain arrays (to_arrow does not, because it concatenates with permissive promotion). Derive the reader's target schema from the first scan batch so requested columns that ArrowScan actually dictionary-encodes (strings) stay dictionary typed, while columns it leaves plain (ints, ORC, etc.) stay plain - matching to_arrow. The trailing cast still conforms later batches. Adds regression tests covering string, non-string, and mixed dictionary_columns.
Fixes apache#2604. ExpireSnapshots was metadata-only and leaked the data, delete, manifest, manifest-list, and statistics files of expired snapshots forever. Add opt-in ExpireSnapshots.clean_expired_files(). On the autocommit path, collect files reachable from the expiring snapshots before the metadata commit, then after the commit collect files still reachable from every surviving snapshot (which covers all branches and tags), and best-effort delete the difference. Surviving-file resolution runs strict: if it cannot be fully resolved the cleanup aborts rather than risk deleting a live file. Statistics and partition-statistics puffin files are cleaned the same way. Cleanup is off by default and skipped for non-autocommit transactions.
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.
No description provided.