feat: add table branch operations and branch parameter#350
Merged
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.
Summary
Adds first-class table branch support to the namespace spec: three branch lifecycle operations plus an optional
branchparameter on the branch-scoped table operations. Branches are already a first-class ref in the Lance table format (alongside tags and versions), and this brings the namespace API in line with that model. An absentbranchalways means the main branch, so the change is fully backward compatible.New operations
CreateTableBranch(POST /v1/table/{id}/branches/create):nameis required; optionalfrom_branchandfrom_versioncreate the branch from a specific point (defaulting to the latest version of main).ListTableBranches(POST /v1/table/{id}/branches/list): returns a map of branch name toBranchContents.DeleteTableBranch(POST /v1/table/{id}/branches/delete):nameis required.New
BranchContentsschema (modeled onTagContents):parentBranch(absent when the branch came from main),parentVersion,createAt,manifestSize, and optionalmetadata.The
branchparameterA branch selects which ref a branch-scoped operation targets, so it is the natural sibling of the existing
versionparameter and is carried wherever each operation already passes its parameters:branchfield in the body, placed alongsideversionwhere the operation already has one (describe, count, query, stats, update, delete, the alter and backfill-column operations, the index operations, the version operations, and the tag operations).branchas a query parameter, the same waydelimiteris already passed:InsertIntoTable,MergeInsertIntoTableListTableVersions,UpdateTableSchemaMetadata,DropTableIndex