fix(scan): preserve snapshot id for empty data evolution index plans - #258
Open
wangyong9999 wants to merge 1 commit into
Open
fix(scan): preserve snapshot id for empty data evolution index plans#258wangyong9999 wants to merge 1 commit into
wangyong9999 wants to merge 1 commit into
Conversation
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.
Purpose
Linked issue: none.
A global-index miss on a non-empty DataEvolution table currently returns
PlanImpl::EmptyPlan(). The query result is correctly empty, but the plan loses the snapshot used by the index scan; a null snapshot is otherwise reserved for a table with no snapshot.This change resolves the explicit or latest snapshot once before creating
GlobalIndexScan, passes that same ID to the scan, and returns a zero-split plan carrying the resolved ID on a miss. The fast-miss path still does not invoke the data batch scan or read data manifests. A truly empty table continues to return an empty plan with no snapshot.For a pre-supplied empty
GlobalIndexResult, the existingScanContextremains the snapshot source: an explicit scan snapshot is preserved, otherwise the current latest snapshot is resolved when the plan is created.Tests
GlobalIndexTest.TestDataEvolutionBatchScanandGlobalIndexTest.TestDataEvolutionGlobalIndexMissPreservesResolvedSnapshot: 8/8 parameterized cases passed.DataEvolutionBatchScanTest.*andTableScanTest.TestNoSnapshot: 4/4 cases passed.git diff --checkpassed.The new test covers internally evaluated and pre-supplied empty index results with both latest and explicit snapshots.
TableScanTest.TestNoSnapshotkeeps the empty-table boundary covered.API and Format
No public API, ABI, storage-format, or protocol change. The modified scan helpers are private implementation details and no class data member is added.
Documentation
No new feature or user-facing configuration; no documentation change is required.
Generative AI tooling
Generated-by: OpenAI Codex (GPT-5)