Skip to content

Core: Fix branch snapshot scans when main is empty - #17735

Open
smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:sm/null-current-snapshot-specs
Open

Core: Fix branch snapshot scans when main is empty#17735
smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:sm/null-current-snapshot-specs

Conversation

@smaheshwar-pltr

Copy link
Copy Markdown
Contributor

Closes #17734.

This PR removes the currentSnapshot() == null shortcut introduced in #13301, so that a snapshot rebinds partition specs to its own schema even when main is empty.

See the PR for a test that fails on main, demonstrating the filed issue.

@github-actions github-actions Bot added the core label Aug 19, 2026
}

@TestTemplate
void plansBranchSnapshotWhenMainIsEmptyAfterSchemaEvolution() throws IOException {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on main with:

Cannot find field 'data' in struct: struct<1: id: required long, 3: part: required string>

@smaheshwar-pltr

Copy link
Copy Markdown
Contributor Author

Tagging in folks from #14438 and #13301 for potential reviews here, cc @ebyhr @chenjian2664 @singhpk234 @nastra

Table table = TestTables.create(temp, "test", SCHEMA, SPEC, formatVersion);

table.newAppend().appendFile(createDataFile("one")).toBranch("branch").commit();
long snapshotId = table.snapshot("branch").snapshotId();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We could rename the variable to branchSnapshotId to make its usage clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tables with no current snapshot throws on time travel filter with different schema

2 participants