Skip to content

fix(scan): don't project a stale schema after a schema update with no write - #2904

Open
NoahKusaba wants to merge 3 commits into
apache:mainfrom
NoahKusaba:fix/scan-project-current-schema
Open

fix(scan): don't project a stale schema after a schema update with no write#2904
NoahKusaba wants to merge 3 commits into
apache:mainfrom
NoahKusaba:fix/scan-project-current-schema

Conversation

@NoahKusaba

@NoahKusaba NoahKusaba commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

changes

    let schema = snapshot.schema(self.table.metadata())?;

to:
let schema = match self.snapshot_id {
Some(_) => snapshot.schema(self.table.metadata())?,
None => self.table.metadata().current_schema().clone(),
};

If this doesn't remain a 3-4 line change, and becomes more complicated I will close the PR (Everything else is tests).
This is a minor bug not worth wasting too much reviewer time, hoping this can just be a simple fix.

Are these changes tested?

test_scan_of_current_state_reads_column_added_after_last_write: unpinned scan reads back the new column as null over pre-existing data files. Fails without the fix.

test_time_travel_scan_excludes_column_added_after_last_write: pinned scan still rejects that column. Guards the time-travel arm; passes either way by design.

@NoahKusaba
NoahKusaba marked this pull request as draft July 26, 2026 18:24
@NoahKusaba NoahKusaba changed the title Fix/scan project current schema fix(scan): project current schema Jul 26, 2026
@NoahKusaba
NoahKusaba force-pushed the fix/scan-project-current-schema branch from f57bc82 to d8a703d Compare July 26, 2026 19:12
@NoahKusaba
NoahKusaba marked this pull request as ready for review July 26, 2026 19:36
@NoahKusaba NoahKusaba changed the title fix(scan): project current schema fix(scan): don't project a stale schema after a schema update with no write Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scan projects a stale schema after a schema update with no write

1 participant