Conversation
manuzhang
force-pushed
the
agent/changelog-dv
branch
from
September 23, 2026 03:16
29f4600 to
745e0e2
Compare
IncrementalChangelogScan rejected every snapshot that carried a delete manifest, so tables using row-level deletes could not be scanned for changes. Format version 3 stores row-level deletes as deletion vectors, where each data file has at most one live vector and a new vector replaces the previous one. That makes the rows a snapshot deleted the difference between the vector it added and the vector it removed. Add DeletionVectorChangelogPlanner, which reads the deletion vectors added and removed by each changelog snapshot and plans the delete side: a vector committed with its data file joins the AddedRowsScanTask, a vector removed with its data file becomes the existing delete of the DeletedDataFileScanTask, and a vector for a data file that already existed produces the new DeletedRowsScanTask with the added vector and the replaced vector. IncrementalChangelogScan uses the planner only for format version 3 tables. Delete files on format version 1 and 2 tables, position delete files and equality delete files remain unsupported and are rejected with NotSupported. The planner reads every delete manifest of the changelog snapshots, not only those written in the range, so a position or equality delete file carried in an older manifest is rejected as well unless it was removed before the range and can no longer apply to any row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
manuzhang
force-pushed
the
agent/changelog-dv
branch
from
September 23, 2026 03:51
745e0e2 to
ab1e688
Compare
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.
What
Plan changelog tasks for format version 3 tables that use deletion vectors:
DeletedRowsScanTask, aChangelogScanTaskwithadded_deletes()andexisting_deletes(), for rows deleted by a deletion vector committed against adata file that already existed.
DeletionVectorChangelogPlanner(changelog_dv_planner_internal.{h,cc}),which reads the delete manifests of the changelog snapshots, indexes the
deletion vectors each snapshot added and removed, and plans the delete side: a
vector committed together with its data file is attached to that file's
AddedRowsScanTask; a vector removed together with its data file becomes theexisting delete of the
DeletedDataFileScanTask; a vector for an existing datafile locates the file in the committing snapshot's data manifests and produces a
DeletedRowsScanTaskcarrying the added vector and the vector it replaced.IncrementalChangelogScanuses the planner only when the table format versionis 3 or higher. Format version 1 and 2 tables keep rejecting delete manifests
with
NotSupported.the manifests written in the range, and rejects position delete files and
equality delete files with
NotSupported. A delete file removed before therange no longer applies to any row, so it is the one case that is ignored.
This is planning only, matching the existing changelog tasks: a consumer of
DeletedRowsScanTaskreads the data file and emits the positions set in the addedvector that are not set in the existing vector.
Why
IncrementalChangelogScanfailed on any snapshot that carried a delete manifest,so a table with row-level deletes could not produce a changelog at all. Format
version 3 makes this tractable: each data file has at most one live deletion
vector and a new vector replaces the previous one, so the rows a snapshot deleted
are exactly the difference between the vector it added and the vector it removed,
without reading any earlier delete files.
Position and equality delete files accumulate instead, so their rows cannot be
attributed to a snapshot without reading every earlier delete file. A format
version 3 table can still carry them, for example after an upgrade from version
2, in manifests that no snapshot in the range rewrote. Checking every delete
manifest makes that case an explicit error instead of a changelog that silently
omits the rows those files delete.
Behavior change
may return
DeletedRowsScanTask, which callers that switch on task type musthandle.
"Delete files are only supported in changelog scans of format version 3 tables".
planning reads that snapshot's data manifests to find the referenced files.
once, and fails with
NotSupportedwhen one holds a position delete file or anequality delete file that is live or that a changelog snapshot removed. Delete
files removed before the range are ignored.
Testing
New cases in
incremental_changelog_scan_test.cccover a deletion vector added toan existing file, a vector replacing an earlier one (single snapshot and across
two snapshots), a vector committed with its data file, a vector removed with its
data file, partition pruning of vectors by the data filter, vectors outside the
scan range, the
NotSupportederrors for format version 2 delete files, positiondelete files and equality delete files written in the range or carried in a
manifest untouched during the range, and a position delete file removed before
the range being ignored.
scan_testpasses locally.🤖 Generated with Claude Code