Table
Metadata
Transaction

Atomically commit a batch of mixed table operations

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

Supported operation types:

  • DeclareTable: Declare (reserve) a new table
  • CreateTableVersion: Create a new version entry for a table
  • DeleteTableVersions: Delete version ranges from a table
  • DeregisterTable: Deregister (soft-delete) a table

All operations are committed atomically: either all succeed or none are applied.

post/v1/table/batch-commit

Query parameters

delimiterstring

An optional delimiter of the string identifier, following the Lance Namespace spec. When not specified, the $ delimiter must be used.

Request body

{"stackTrail":"components:schemas:BatchCommitTablesRequest:properties:context","oasType":"schema","type":"unknown","description":"Arbitrary context for a request as key-value pairs.\nHow to use the context is custom to the specific implementation.\n\nREST NAMESPACE ONLY\nContext entries are passed via HTTP headers using the naming convention\n`x-lance-ctx-<key>: <value>`. For example, a context entry\n`{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`.\n"}

Example request

{
  "operations": [
    {
      "deregister_table": {
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ]
      },
      "create_table_version": {
        "naming_scheme": "V2",
        "metadata": {
          "key": "metadata"
        },
        "manifest_path": "manifest_path",
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "manifest_size": 0,
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ],
        "e_tag": "e_tag",
        "version": 0,
        "branch": "branch"
      },
      "delete_table_versions": {
        "ranges": [
          {
            "start_version": 0,
            "end_version": 6
          },
          {
            "start_version": 0,
            "end_version": 6
          }
        ],
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ],
        "branch": "branch"
      },
      "declare_table": {
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "location": "location",
        "id": [
          "id",
          "id"
        ],
        "properties": {
          "key": "properties"
        },
        "vend_credentials": true
      }
    },
    {
      "deregister_table": {
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ]
      },
      "create_table_version": {
        "naming_scheme": "V2",
        "metadata": {
          "key": "metadata"
        },
        "manifest_path": "manifest_path",
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "manifest_size": 0,
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ],
        "e_tag": "e_tag",
        "version": 0,
        "branch": "branch"
      },
      "delete_table_versions": {
        "ranges": [
          {
            "start_version": 0,
            "end_version": 6
          },
          {
            "start_version": 0,
            "end_version": 6
          }
        ],
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "id": [
          "id",
          "id"
        ],
        "branch": "branch"
      },
      "declare_table": {
        "identity": {
          "api_key": "api_key",
          "auth_token": "auth_token"
        },
        "context": {
          "key": "context"
        },
        "location": "location",
        "id": [
          "id",
          "id"
        ],
        "properties": {
          "key": "properties"
        },
        "vend_credentials": true
      }
    }
  ],
  "identity": {
    "api_key": "api_key",
    "auth_token": "auth_token"
  },
  "context": {
    "key": "context"
  }
}

Response

Result of atomically committing a batch of mixed table operations

transaction_idstring

Optional transaction identifier for the batch commit

Example response

{
  "transaction_id": "transaction_id",
  "results": [
    {
      "deregister_table": {
        "transaction_id": "transaction_id",
        "location": "location",
        "id": [
          "id",
          "id"
        ],
        "properties": {
          "owner": "Ralph",
          "created_at": "1452120468"
        }
      },
      "create_table_version": {
        "transaction_id": "transaction_id",
        "version": {
          "metadata": {
            "key": "metadata"
          },
          "manifest_path": "manifest_path",
          "timestamp_millis": 1,
          "manifest_size": 0,
          "e_tag": "e_tag",
          "version": 0
        }
      },
      "delete_table_versions": {
        "transaction_id": "transaction_id",
        "deleted_count": 0
      },
      "declare_table": {
        "transaction_id": "transaction_id",
        "location": "location",
        "properties": {
          "owner": "Ralph",
          "created_at": "1452120468"
        },
        "managed_versioning": true,
        "storage_options": {
          "key": "storage_options"
        }
      }
    },
    {
      "deregister_table": {
        "transaction_id": "transaction_id",
        "location": "location",
        "id": [
          "id",
          "id"
        ],
        "properties": {
          "owner": "Ralph",
          "created_at": "1452120468"
        }
      },
      "create_table_version": {
        "transaction_id": "transaction_id",
        "version": {
          "metadata": {
            "key": "metadata"
          },
          "manifest_path": "manifest_path",
          "timestamp_millis": 1,
          "manifest_size": 0,
          "e_tag": "e_tag",
          "version": 0
        }
      },
      "delete_table_versions": {
        "transaction_id": "transaction_id",
        "deleted_count": 0
      },
      "declare_table": {
        "transaction_id": "transaction_id",
        "location": "location",
        "properties": {
          "owner": "Ralph",
          "created_at": "1452120468"
        },
        "managed_versioning": true,
        "storage_options": {
          "key": "storage_options"
        }
      }
    }
  ]
}

Changes