Skip to content

feat: add BatchCommitTables API for atomic multi-table commit operations#315

Merged
jackye1995 merged 5 commits intolance-format:mainfrom
XuQianJin-Stars:feat/delete-table-versions-multi-table
Mar 16, 2026
Merged

feat: add BatchCommitTables API for atomic multi-table commit operations#315
jackye1995 merged 5 commits intolance-format:mainfrom
XuQianJin-Stars:feat/delete-table-versions-multi-table

Conversation

@XuQianJin-Stars
Copy link
Copy Markdown
Contributor

@XuQianJin-Stars XuQianJin-Stars commented Mar 12, 2026

Summary

Add BatchCommitTables API (POST /v1/table/batch-commit) for atomic multi-table commit operations,
and add DeleteTableVersionsEntry model with entries field to BatchDeleteTableVersionsRequest for multi-table version deletion.

New API: BatchCommitTables

Endpoint: POST /v1/table/batch-commit

Atomically commit a batch of mixed table operations within a single transaction at the metadata layer.
This is a generalized version of BatchCreateTableVersions that supports mixed operation types.

All operations are committed atomically: either all succeed or none are applied.
Physical file operations are best-effort — metadata is the source of truth.

New Models

Request:

  • BatchCommitTablesRequest — contains a list of CommitTableOperation
  • CommitTableOperation — discriminated union (via type field) supporting 4 operation types:
    • CommitTableOperationDeclareTable (type: declare_table) — declare/reserve a new table
    • CommitTableOperationCreateTableVersion (type: create_table_version) — create a new version entry for a table
    • CommitTableOperationDeleteTableVersions (type: delete_table_versions) — delete version ranges from a table
    • CommitTableOperationDeregisterTable (type: deregister_table) — soft-delete a table

Response:

  • BatchCommitTablesResponse — contains a list of CommitTableResult (same order as request)
  • CommitTableResult — discriminated union (via type field) with result types:
    • CommitTableResultDeclareTable
    • CommitTableResultCreateTableVersion
    • CommitTableResultDeleteTableVersions
    • CommitTableResultDeregisterTable

Modified: BatchDeleteTableVersionsRequest

Added multi-table support with optional entries field:

  • entries: Optional<List<DeleteTableVersionsEntry>> — multi-table transactional delete entries
  • New model DeleteTableVersionsEntry with required fields: id (table identifier) and ranges (version ranges)
  • When entries is provided, legacy single-table id + ranges fields are ignored

Files Changed

Category Files
Spec docs/src/rest.yaml
BatchCommitTables — New Files
Rust batch_commit_tables_request.rs, batch_commit_tables_response.rs, commit_table_operation.rs, commit_table_operation_*.rs (4), commit_table_result.rs, commit_table_result_*.rs (4), metadata_api.rs, table_api.rs, transaction_api.rs
Java (apache-client) BatchCommitTablesRequest.java, BatchCommitTablesResponse.java, CommitTableOperation.java, CommitTableOperation*.java (4), CommitTableResult.java, CommitTableResult*.java (4), MetadataApi.java, TableApi.java, TransactionApi.java
Java (springboot-server) BatchCommitTablesRequest.java, BatchCommitTablesResponse.java, CommitTableOperation*.java (5), CommitTableResult*.java (5), TableApi.java
Python (urllib3-client) batch_commit_tables_request.py, batch_commit_tables_response.py, commit_table_operation*.py (5), commit_table_result*.py (5)
DeleteTableVersionsEntry — New Files
Rust delete_table_versions_entry.rs
Java (apache-client) DeleteTableVersionsEntry.java
Java (springboot-server) DeleteTableVersionsEntry.java
Python (urllib3-client) delete_table_versions_entry.py
Modified Files
All languages mod.rs, __init__.py, README.md, openapi.yaml, BatchDeleteTableVersionsRequest.* files updated

Total: 141 files changed, 14015 insertions(+), 190 deletions(-)

All generated code produced via make gen from the updated rest.yaml spec.

@github-actions github-actions bot added enhancement New feature or request python Python features java Java features rust Rust features labels Mar 12, 2026
@jackye1995
Copy link
Copy Markdown
Collaborator

you should edit the model in rest.yaml and then do make gen to generate all these files

@XuQianJin-Stars XuQianJin-Stars force-pushed the feat/delete-table-versions-multi-table branch from c63ab77 to 48a71e8 Compare March 13, 2026 01:44
@XuQianJin-Stars XuQianJin-Stars changed the title feat: add multi-table support for BatchDeleteTableVersionsRequest feat: add BatchCommitTables API for atomic multi-table commit operations Mar 13, 2026
Supported operation types:
- `declare_table`: Declare (reserve) a new table
- `create_table_version`: Create a new version entry for a table
- `delete_table_versions`: Delete version ranges from a table
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

BatchDeleteTableVersions

single atomic transaction at the metadata layer.

Supported operation types:
- `declare_table`: Declare (reserve) a new table
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: these should be PascalCase, like DeclareTable

- `deregister_table`: Deregister (soft-delete) a table

All operations are committed atomically: either all succeed or none are applied.
Physical file operations (e.g., writing manifest files, deleting version files)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is not true, we still want files to be the eventual source of truth. Let's just remove this line.

Supports deleting ranges of versions for efficient bulk cleanup.
required:
- ranges
This request supports two modes:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these changes seem wrong? Looks like they come from the last PR for BatchDeleteTableVersions

description: |
A single operation within a batch commit.
Uses a discriminator on the `type` field to determine the operation kind.
oneOf:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we try to avoid the use of oneOf, because it causes a ton of issues in codegen. Prefer just simple case that lists all operations directly, see for example: https://github.com/lance-format/lance-namespace/blob/main/docs/src/rest.yaml#L2811

        vector:
          type: object
          nullable: true
          description: Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both.
          properties:
            single_vector:
              type: array
              items:
                type: number
                format: float
              description: Single query vector
            multi_vector:
              type: array
              items:
                type: array
                items:
                  type: number
                  format: float
              description: Multiple query vectors for batch search

vector can only be one of single_vector or multi_vector, but we still list them all as just optional properties, and we just check at client side that only one of them is set.

A single operation within a batch commit.
Uses a discriminator on the `type` field to determine the operation kind.
oneOf:
- $ref: "#/components/schemas/CommitTableOperationDeclareTable"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why not directly reference DeclareTableRequest? (similar question to the next few lines)

Copy link
Copy Markdown
Collaborator

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

looks good to me! Can you also update the Java and Python LanceNamespace interfaces? Also we just added LanceNamespaceAsync in Java as well. All these high level interfaces need to be updated manually. Once that is done we should be good!

Edit rest.yaml to add DeleteTableVersionsEntry schema and entries field
to BatchDeleteTableVersionsRequest. All language clients (Rust, Java,
Python) are regenerated using make gen.

This enables transactional deletion of table versions across multiple
tables in a single operation. When entries is provided, the legacy
single-table id + ranges fields are ignored.
Add BatchCommitTables endpoint (POST /v1/table/batch-commit) to support
atomic multi-table transactions with discriminated union types:

- CommitTableOperation: declare_table, create_table_version,
  delete_table_versions, deregister_table
- CommitTableResult: corresponding result types for each operation

Generated Rust, Python, and Java client code via make gen.
- Add batchCommitTables to Java sync LanceNamespace interface
- Add batchCommitTables to Java async LanceNamespaceAsync interface
- Add batch_commit_tables to Python LanceNamespace ABC
- Regenerate async-client to include BatchCommitTables models
@XuQianJin-Stars XuQianJin-Stars force-pushed the feat/delete-table-versions-multi-table branch from e61c7a0 to 7cd14d3 Compare March 16, 2026 04:53
Copy link
Copy Markdown
Collaborator

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

looks good to me!

@jackye1995 jackye1995 merged commit 9e71e6a into lance-format:main Mar 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Java features python Python features rust Rust features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants