Skip to content

feat(RTAS): add TableMetadataBuilder::build_replacement - #3057

Draft
xanderbailey wants to merge 3 commits into
apache:mainfrom
xanderbailey:xb/build_replacement
Draft

feat(RTAS): add TableMetadataBuilder::build_replacement#3057
xanderbailey wants to merge 3 commits into
apache:mainfrom
xanderbailey:xb/build_replacement

Conversation

@xanderbailey

@xanderbailey xanderbailey commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

Replaces a table's schema, partition spec and sort order in place, leaving it with no current snapshot but keeping its uuid, properties and snapshots. This is the metadata side of REPLACE TABLE, where the caller writes the new contents and commits them together with the replacement.

Are these changes tested?

AI Disclosure

Used to review and write tests

Replaces a table's schema, partition spec and sort order in place, leaving
it with no current snapshot but keeping its uuid, properties and snapshots.
This is the metadata side of `REPLACE TABLE`, where the caller writes the new
contents and commits them together with the replacement.

A column whose name the table already has keeps its field id, so data files
written before the replacement stay readable through the columns the two
schemas share. New columns are assigned above the table's last_column_id and
never reuse the id of a dropped column. `ReassignFieldIds` grows a mode for
this, matching ids by full field name so that nested fields are covered too.

The existing `reassign_ids` gains nothing but a factored-out
`rebind_to_schema`, which both paths use to rebuild the partition spec and
sort order against the reassigned schema.
@xanderbailey xanderbailey changed the title feat: add TableMetadataBuilder::build_replacement feat(RTAS): add TableMetadataBuilder::build_replacement Aug 23, 2026
@xanderbailey
xanderbailey marked this pull request as draft August 25, 2026 14:20
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.

1 participant