Repository navigation
Conversation
Bind scan planning and Arrow filters to the same full schema as projection. Keep current-schema binding for deletes and unpinned partition inspection.
Use the transaction schema for both filtering and projection so schema changes do not bind upsert joins to an older branch snapshot. Share this scan behavior with deletes and cover added or replaced join columns, branch writes, staged writes, and updates after a staged schema change.
This branch has not been deployed
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.
Closes #4138
Rationale for this change
Time-travel scans project the snapshot's schema but bind row filters to the current schema. Dropping and re-adding a same-named column therefore makes historical filters use the wrong field ID and silently return no rows.
Use the scan's full schema for file planning and Arrow filtering, including filter columns excluded from the output. Transaction scans use the transaction's current schema for both filtering and projection, including staged schema changes. Partition inspection without an explicit snapshot continues to use the current schema.
Are these changes tested?
On Python 3.12,
make test PYTEST_ARGS='-q --tb=short'passes with 4,413 passed, 5 skipped and 126 deselected. Applying the complete patch to upstream042165agives 4,444 passed, 5 skipped and 127 deselected.make lintpasses on both trees.Nine historical-read regression cases fail without the original fix. Removing the transaction schema override makes five upsert/delete cases fail; restoring it makes all five pass. The issue's standalone repro returns 50 rows from both
to_arrow()andcount(), instead of zero. Spark/Docker integration suites were not run.Are there any user-facing changes?
Historical filters resolve names and field IDs using the snapshot's schema, matching projection. Names introduced after that snapshot raise a field lookup error. Ordinary and incremental scans retain their current-schema behavior. Upserts can also update matching rows after a non-key column is added in the same transaction.